Skip to content

Commit befeef1

Browse files
committed
Update readme and change naming in main
1 parent 54b407b commit befeef1

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ Requires Python 3.8 or later.
1212
pip install synergy-dataset
1313
```
1414

15-
For Pydantic-based work validation:
16-
17-
```sh
18-
pip install "synergy-dataset[validation]"
19-
```
20-
2115
## Dataset variants
2216

2317
| Variable | Value | Dataset |
@@ -56,7 +50,7 @@ Exports one CSV per dataset to the output folder, plus a `review_metadata.csv` t
5650
synergy get
5751
```
5852

59-
For SYNERGY+, only open-access works with a valid abstract (≥ 20 words or ≥ 100 characters) are exported. Datasets with fewer than 3 included records are skipped.
53+
For SYNERGY+, only open-access works with a valid abstract (≥ 20 words or ≥ 100 characters) are exported. Datasets with fewer than 5 included records are skipped.
6054

6155
| Flag | Default | Description |
6256
|---|---|---|
@@ -102,7 +96,7 @@ referenced_works related_works counts_by_year
10296
Each run of `synergy get` produces:
10397

10498
- **`{dataset_name}.csv`** — one file per dataset, with one row per work (filtered by the active settings).
105-
- **`review_metadata.csv`** — one row per dataset (≥ 3 inclusions), combining:
99+
- **`review_metadata.csv`** — one row per dataset (≥ 5 inclusions), combining:
106100
- `key` — dataset identifier (e.g. `Abgaz_2023`)
107101
- `split``train` or `test` (SYNERGY+ only)
108102
- `data_doi` — DOI of the dataset deposit

synergy_dataset/__main__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
3535
Would you like to convert the inverted abstract to plaintext?"""
3636

37+
MIN_INCLUSIONS = 5
38+
3739

3840
def main():
3941
if os.getenv("SYNERGY_PATH") == "development":
@@ -73,7 +75,7 @@ def info():
7375
parser.print_usage()
7476

7577

76-
def _count_filtered_records(dataset):
78+
def _count_records(dataset):
7779
n_records, n_included = 0, 0
7880
for _, label in dataset.iter(validate=False):
7981
n_records += 1
@@ -108,7 +110,7 @@ def _write_review_metadata(datasets, counts, active_vars, output_path):
108110
for dataset in datasets:
109111
n_records, n_included = counts[dataset.name]
110112

111-
if n_included < 3:
113+
if n_included < MIN_INCLUSIONS:
112114
continue
113115

114116
pub_work = WorkModel.model_validate(dataset.metadata["publication"])
@@ -207,19 +209,19 @@ def build_dataset(argv):
207209
if args.dataset is not None:
208210
datasets = [Dataset(name) for name in args.dataset]
209211
for dataset in datasets:
210-
n_records, n_included = _count_filtered_records(dataset)
212+
n_records, n_included = _count_records(dataset)
211213
counts[dataset.name] = (n_records, n_included)
212-
if n_included < 3:
214+
if n_included < MIN_INCLUSIONS:
213215
continue
214216
dataset.to_frame(args.vars).to_csv(
215217
Path(args.output, f"{dataset.name}.csv"), index=False
216218
)
217219
else:
218220
datasets = list(iter_datasets())
219221
for dataset in tqdm(datasets):
220-
n_records, n_included = _count_filtered_records(dataset)
222+
n_records, n_included = _count_records(dataset)
221223
counts[dataset.name] = (n_records, n_included)
222-
if n_included < 3:
224+
if n_included < MIN_INCLUSIONS:
223225
continue
224226
dataset.to_frame(args.vars).to_csv(
225227
Path(args.output, f"{dataset.name}.csv"), index=False

0 commit comments

Comments
 (0)