Skip to content

Commit ff98c57

Browse files
author
Gerit Wagner
committed
update evaluation: asreview
1 parent 779a747 commit ff98c57

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

notebooks/evaluation.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import evaluation
1111
import pandas as pd
12-
from asreview.data import ASReviewData
1312

1413
from bib_dedupe.bib_dedupe import block
1514
from bib_dedupe.bib_dedupe import cluster
@@ -336,14 +335,40 @@ def append_to_output(result: dict, *, package_name: str) -> None:
336335
)
337336

338337
# ASReview
338+
339+
tmp_in = Path("notebooks/asreview_input.csv")
340+
tmp_out = Path("notebooks/asreview_dedup.csv")
341+
records_df.to_csv(tmp_in, index=False)
342+
339343
timestamp = datetime.now()
340-
asdata = ASReviewData(records_df)
341-
merged_df = asdata.drop_duplicates()
344+
subprocess.run(
345+
[
346+
"asreview",
347+
"data",
348+
"dedup",
349+
str(tmp_in),
350+
"-o",
351+
str(tmp_out),
352+
"--pid",
353+
"DOI",
354+
],
355+
check=True,
356+
)
357+
merged_df = pd.read_csv(tmp_out)
358+
342359
result = dedupe_benchmark.compare_dedupe_id(
343360
records_df=records_df, merged_df=merged_df, timestamp=timestamp
344361
)
345362
evaluation.append_to_output(result, package_name="asreview")
346363

364+
# timestamp = datetime.now()
365+
# asdata = ASReviewData(records_df)
366+
# merged_df = asdata.drop_duplicates()
367+
# result = dedupe_benchmark.compare_dedupe_id(
368+
# records_df=records_df, merged_df=merged_df, timestamp=timestamp
369+
# )
370+
# evaluation.append_to_output(result, package_name="asreview")
371+
347372
# ASySD (R)
348373
# temporarily skip (need to combine part1/2)
349374
if benchmark_path == "depression":

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies = [
3636
[project.optional-dependencies]
3737
with-data = [
3838
"asreview>=1.5",
39+
"asreview-datatools",
3940
]
4041
dev = [
4142
"pylint==3.0.1",

0 commit comments

Comments
 (0)