Commit ·
9b3cf37
0
Parent(s):
Update files from the datasets library (from 1.0.2)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.0.2
Files changed (7)
- .gitattributesAdded+27
- dataset_infos.jsonAdded+1
- dummy/age_classification/1.0.0/dummy_data.zipAdded+3
- dummy/qa/1.0.0/dummy_data.zipAdded+3
- dummy/summarization/1.0.0/dummy_data.zipAdded+3
- dummy/topic_classification/1.0.0/dummy_data.zipAdded+3
- matinf.pyAdded+183
123456789101112131415161718192021222324252627*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bin.* filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zstandard filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text1{"age_classification": {"description": "MATINF is the first jointly labeled large-scale dataset for classification, question answering and summarization.\nMATINF contains 1.07 million question-answer pairs with human-labeled categories and user-generated question \ndescriptions. Based on such rich information, MATINF is applicable for three major NLP tasks, including classification, \nquestion answering, and summarization. We benchmark existing methods and a novel multi-task baseline over MATINF to \ninspire further research. Our comprehensive comparison and experiments over MATINF and other datasets demonstrate the \nmerits held by MATINF.\n", "citation": "@inproceedings{xu-etal-2020-matinf,\n title = \"{MATINF}: A Jointly Labeled Large-Scale Dataset for Classification, Question Answering and Summarization\",\n author = \"Xu, Canwen and\n Pei, Jiaxin and\n Wu, Hongtao and\n Liu, Yiyu and\n Li, Chenliang\",\n booktitle = \"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics\",\n month = jul,\n year = \"2020\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.acl-main.330\",\n pages = \"3586--3596\",\n}\n\n", "homepage": "https://github.com/WHUIR/MATINF", "license": "", "features": {"question": {"dtype": "string", "id": null, "_type": "Value"}, "description": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["0-1\u5c81", "1-2\u5c81", "2-3\u5c81"], "names_file": null, "id": null, "_type": "ClassLabel"}, "id": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "matinf", "config_name": "age_classification", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 33901977, "num_examples": 134852, "dataset_name": "matinf"}, "test": {"name": "test", "num_bytes": 9616194, "num_examples": 38318, "dataset_name": "matinf"}, "validation": {"name": "validation", "num_bytes": 4869685, "num_examples": 19323, "dataset_name": "matinf"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 48387856, "size_in_bytes": 48387856}, "topic_classification": {"description": "MATINF is the first jointly labeled large-scale dataset for classification, question answering and summarization.\nMATINF contains 1.07 million question-answer pairs with human-labeled categories and user-generated question \ndescriptions. Based on such rich information, MATINF is applicable for three major NLP tasks, including classification, \nquestion answering, and summarization. We benchmark existing methods and a novel multi-task baseline over MATINF to \ninspire further research. Our comprehensive comparison and experiments over MATINF and other datasets demonstrate the \nmerits held by MATINF.\n", "citation": "@inproceedings{xu-etal-2020-matinf,\n title = \"{MATINF}: A Jointly Labeled Large-Scale Dataset for Classification, Question Answering and Summarization\",\n author = \"Xu, Canwen and\n Pei, Jiaxin and\n Wu, Hongtao and\n Liu, Yiyu and\n Li, Chenliang\",\n booktitle = \"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics\",\n month = jul,\n year = \"2020\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.acl-main.330\",\n pages = \"3586--3596\",\n}\n\n", "homepage": "https://github.com/WHUIR/MATINF", "license": "", "features": {"question": {"dtype": "string", "id": null, "_type": "Value"}, "description": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 18, "names": ["\u4ea7\u8925\u671f\u4fdd\u5065", "\u513f\u7ae5\u8fc7\u654f", "\u52a8\u4f5c\u53d1\u80b2", "\u5a74\u5e7c\u4fdd\u5065", "\u5a74\u5e7c\u5fc3\u7406", "\u5a74\u5e7c\u65e9\u6559", "\u5a74\u5e7c\u671f\u5582\u517b", "\u5a74\u5e7c\u8425\u517b", "\u5b55\u671f\u4fdd\u5065", "\u5bb6\u5ead\u6559\u80b2", "\u5e7c\u513f\u56ed", "\u672a\u51c6\u7236\u6bcd", "\u6d41\u4ea7\u548c\u4e0d\u5b55", "\u75ab\u82d7\u63a5\u79cd", "\u76ae\u80a4\u62a4\u7406", "\u5b9d\u5b9d\u4e0a\u706b", "\u8179\u6cfb", "\u5a74\u5e7c\u5e38\u89c1\u75c5"], "names_file": null, "id": null, "_type": "ClassLabel"}, "id": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "matinf", "config_name": "topic_classification", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 153326538, "num_examples": 613036, "dataset_name": "matinf"}, "test": {"name": "test", "num_bytes": 43877443, "num_examples": 175363, "dataset_name": "matinf"}, "validation": {"name": "validation", "num_bytes": 21834951, "num_examples": 87519, "dataset_name": "matinf"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 219038932, "size_in_bytes": 219038932}, "summarization": {"description": "MATINF is the first jointly labeled large-scale dataset for classification, question answering and summarization.\nMATINF contains 1.07 million question-answer pairs with human-labeled categories and user-generated question \ndescriptions. Based on such rich information, MATINF is applicable for three major NLP tasks, including classification, \nquestion answering, and summarization. We benchmark existing methods and a novel multi-task baseline over MATINF to \ninspire further research. Our comprehensive comparison and experiments over MATINF and other datasets demonstrate the \nmerits held by MATINF.\n", "citation": "@inproceedings{xu-etal-2020-matinf,\n title = \"{MATINF}: A Jointly Labeled Large-Scale Dataset for Classification, Question Answering and Summarization\",\n author = \"Xu, Canwen and\n Pei, Jiaxin and\n Wu, Hongtao and\n Liu, Yiyu and\n Li, Chenliang\",\n booktitle = \"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics\",\n month = jul,\n year = \"2020\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.acl-main.330\",\n pages = \"3586--3596\",\n}\n\n", "homepage": "https://github.com/WHUIR/MATINF", "license": "", "features": {"description": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "id": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "matinf", "config_name": "summarization", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 181245403, "num_examples": 747888, "dataset_name": "matinf"}, "test": {"name": "test", "num_bytes": 51784189, "num_examples": 213681, "dataset_name": "matinf"}, "validation": {"name": "validation", "num_bytes": 25849900, "num_examples": 106842, "dataset_name": "matinf"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 258879492, "size_in_bytes": 258879492}, "qa": {"description": "MATINF is the first jointly labeled large-scale dataset for classification, question answering and summarization.\nMATINF contains 1.07 million question-answer pairs with human-labeled categories and user-generated question \ndescriptions. Based on such rich information, MATINF is applicable for three major NLP tasks, including classification, \nquestion answering, and summarization. We benchmark existing methods and a novel multi-task baseline over MATINF to \ninspire further research. Our comprehensive comparison and experiments over MATINF and other datasets demonstrate the \nmerits held by MATINF.\n", "citation": "@inproceedings{xu-etal-2020-matinf,\n title = \"{MATINF}: A Jointly Labeled Large-Scale Dataset for Classification, Question Answering and Summarization\",\n author = \"Xu, Canwen and\n Pei, Jiaxin and\n Wu, Hongtao and\n Liu, Yiyu and\n Li, Chenliang\",\n booktitle = \"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics\",\n month = jul,\n year = \"2020\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.acl-main.330\",\n pages = \"3586--3596\",\n}\n\n", "homepage": "https://github.com/WHUIR/MATINF", "license": "", "features": {"question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "id": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "matinf", "config_name": "qa", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 188047511, "num_examples": 747888, "dataset_name": "matinf"}, "test": {"name": "test", "num_bytes": 53708532, "num_examples": 213681, "dataset_name": "matinf"}, "validation": {"name": "validation", "num_bytes": 26931809, "num_examples": 106842, "dataset_name": "matinf"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 268687852, "size_in_bytes": 268687852}}123version https://git-lfs.github.com/spec/v1oid sha256:3fa3c4b0a93e7baa6d6db03cbe0fe36896c9012fd32c3f84dff5ecbe733abe3dsize 6107123version https://git-lfs.github.com/spec/v1oid sha256:3fa3c4b0a93e7baa6d6db03cbe0fe36896c9012fd32c3f84dff5ecbe733abe3dsize 6107123version https://git-lfs.github.com/spec/v1oid sha256:3fa3c4b0a93e7baa6d6db03cbe0fe36896c9012fd32c3f84dff5ecbe733abe3dsize 6107123version https://git-lfs.github.com/spec/v1oid sha256:3fa3c4b0a93e7baa6d6db03cbe0fe36896c9012fd32c3f84dff5ecbe733abe3dsize 6107123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183from __future__ import absolute_import, division, print_function
import csvimport os
import six
import datasets
_CITATION = """\@inproceedings{xu-etal-2020-matinf, title = "{MATINF}: A Jointly Labeled Large-Scale Dataset for Classification, Question Answering and Summarization", author = "Xu, Canwen and Pei, Jiaxin and Wu, Hongtao and Liu, Yiyu and Li, Chenliang", booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics", month = jul, year = "2020", address = "Online", publisher = "Association for Computational Linguistics", url = "https://www.aclweb.org/anthology/2020.acl-main.330", pages = "3586--3596",}
"""
_DESCRIPTION = """\MATINF is the first jointly labeled large-scale dataset for classification, question answering and summarization. MATINF contains 1.07 million question-answer pairs with human-labeled categories and user-generated question descriptions. Based on such rich information, MATINF is applicable for three major NLP tasks, including classification, question answering, and summarization. We benchmark existing methods and a novel multi-task baseline over MATINF to inspire further research. Our comprehensive comparison and experiments over MATINF and other datasets demonstrate the merits held by MATINF."""
class MatinfConfig(datasets.BuilderConfig): """BuilderConfig for MATINF."""
def __init__( self, text_features, label_column, label_classes=None, **kwargs, ): """BuilderConfig for MATINF.
Args: text_features: `dict[string, string]`, map from the name of the feature dict for each text field to the name of the column in the tsv file label_column: `string`, name of the column in the tsv file corresponding to the label label_classes: `list[string]`, the list of classes if the label is categorical. If not provided, then the label will be of type `datasets.Value('float32')`. **kwargs: keyword arguments forwarded to super. """ super(MatinfConfig, self).__init__(version=datasets.Version("1.0.0"), **kwargs) self.text_features = text_features self.label_column = label_column self.label_classes = label_classes
class Matinf(datasets.GeneratorBasedBuilder): VERSION = datasets.Version("1.0.0")
BUILDER_CONFIGS = [ MatinfConfig( name="age_classification", text_features=["question", "description"], label_column="class", label_classes=["0-1岁", "1-2岁", "2-3岁"], ), MatinfConfig( name="topic_classification", text_features=["question", "description"], label_column="class", label_classes=[ "产褥期保健", "儿童过敏", "动作发育", "婴幼保健", "婴幼心理", "婴幼早教", "婴幼期喂养", "婴幼营养", "孕期保健", "家庭教育", "幼儿园", "未准父母", "流产和不孕", "疫苗接种", "皮肤护理", "宝宝上火", "腹泻", "婴幼常见病", ], ), MatinfConfig( name="summarization", text_features=["description", "question"], label_column=None, ), MatinfConfig( name="qa", text_features=["question", "answer"], label_column=None, ), ]
@property def manual_download_instructions(self): return ( "To use MATINF you have to download it manually. Please fill this google form (" "https://forms.gle/nkH4LVE4iNQeDzsc9). You will receive a download link and a password once you " "complete the form. Please extract all files in one folder and load the dataset with: " "`datasets.load_dataset('matinf', data_dir='path/to/folder/folder_name')`" )
def _info(self): features = {text_feature: datasets.Value("string") for text_feature in self.config.text_features} if self.config.label_classes: features["label"] = datasets.features.ClassLabel(names=self.config.label_classes) features["id"] = datasets.Value("int32") return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features(features), homepage="https://github.com/WHUIR/MATINF", citation=_CITATION, )
def _split_generators(self, dl_manager): """Returns SplitGenerators.""" data_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
if not os.path.exists(data_dir): raise FileNotFoundError( "{} does not exist. Make sure you insert a manual dir via `datasets.load_dataset('matinf', data_dir=...)` that includes files unzipped from the MATINF zip. Manual download instructions: {}".format( data_dir, self.manual_download_instructions ) ) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(data_dir, "train.csv")}, ), datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(data_dir, "test.csv")}, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(data_dir, "dev.csv")}, ), ]
def _generate_examples(self, filepath): """Yields examples.""" label_classes = self.config.label_classes
with open(filepath, encoding="utf8") as f: reader = csv.DictReader(f)
for n, row in enumerate(reader): example = {feat: row[feat] for feat in self.config.text_features} example["id"] = row["id"]
if self.config.label_column: label = row[self.config.label_column] if label_classes and label not in label_classes: continue # Split age/topic classification example["label"] = label
# Filter out corrupted rows. for value in six.itervalues(example): if value is None: break else: yield example["id"], example.gitattributesAdded+27
dataset_infos.jsonAdded+1
dummy/age_classification/1.0.0/dummy_data.zipAdded+3
dummy/qa/1.0.0/dummy_data.zipAdded+3
dummy/summarization/1.0.0/dummy_data.zipAdded+3
dummy/topic_classification/1.0.0/dummy_data.zipAdded+3
matinf.pyAdded+183