generated from asreview/template-extension-new-model
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dataset template to be compatible with version 1.0 (#8)
Co-authored-by: Jonathan de Bruin <[email protected]>
- Loading branch information
Showing
6 changed files
with
75 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
recursive-include asreviewcontrib/*/data *.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from asreviewcontrib.dataset_name.your_dataset import YourDataGroup | ||
from asreviewcontrib.dataset_name.your_dataset import ExampleDatasetGroup |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,46 @@ | ||
"""This module shows example dataset classes for creating your own dataset.""" | ||
|
||
from pathlib import Path | ||
|
||
from asreview.datasets import BaseDataSet | ||
from asreview.datasets import BaseDataGroup | ||
|
||
class YourDataGroup(BaseDataGroup): | ||
group_id = "your_data_group" | ||
description = "A new data group with my awesome datasets." | ||
|
||
class ExampleDatasetGroup(BaseDataGroup): | ||
"""This is an example dataset group.""" | ||
|
||
group_id = "example_group" | ||
description = "Example dataset group" | ||
|
||
def __init__(self): | ||
"""Initialize the dataset group.""" | ||
|
||
example_dataset_local = BaseDataSet( | ||
dataset_id="example_dataset_local", | ||
filepath=str(Path(Path(__file__).parent, 'data', 'your_dataset.csv')), # noqa | ||
title="Example dataset (local)", | ||
description="This is an example dataset that is stored locally.", | ||
authors='Teijema, J.J. (2022)', | ||
topic='example datasets', | ||
link='ASReview.ai', | ||
reference=None, | ||
img_url=None, | ||
license='MIT', | ||
year='2022' | ||
) | ||
|
||
example_dataset_remote = BaseDataSet( | ||
dataset_id="example_dataset_remote", | ||
filepath='https://raw.githubusercontent.com/asreview/systematic-review-datasets/master/datasets/van_de_Schoot_2017/output/van_de_Schoot_2017.csv', # noqa | ||
title="Example dataset (remote)", | ||
description="This is an example dataset that is stored remotely.", | ||
authors='Teijema, J.J. (2022)', | ||
topic=None, | ||
link=None, | ||
reference=None, | ||
img_url=None, | ||
license=None, | ||
year=None | ||
) | ||
|
||
dataset = BaseDataSet.from_config({ | ||
"dataset_id": "your_data_id", | ||
"url": "", | ||
"reference": "", | ||
"link": "", | ||
"license": "", | ||
"title": "Your Data", | ||
"authors": [ | ||
"Jane Doe", | ||
"John Doe" | ||
], | ||
"year": 2021, | ||
"topic": "Your topic", | ||
"final_inclusions": True, | ||
"title_abstract_inclusions": False | ||
} | ||
) | ||
|
||
super(YourDataGroup, self).__init__(dataset) | ||
# pass multiple datasets to init if there are more datasets | ||
super().__init__(example_dataset_local, example_dataset_remote) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters