Commit ·
2080da3
1
Parent(s): 97bd0d8
Update mind.py
Browse files12345678910111213141516171819202122232425262728293031323334353637383940413 unmodified lines45464748495051525354555657585960616263646566# coding=utf-8# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# Lint as: python3"""MIND dataset."""import csvimport datasetsfrom datasets.tasks import TextClassification_DESCRIPTION = """\MIND"""_CITATION = """\@inproceedings{Zhang2015CharacterlevelCN,title={Character-level Convolutional Networks for Text Classification},author={Xiang Zhang and Junbo Jake Zhao and Yann LeCun},booktitle={NIPS},year={2015}}"""_TRAIN_DOWNLOAD_URL = "https://huggingface.co/datasets/linxinyuan/mind/resolve/main/train.csv"_TEST_DOWNLOAD_URL = "https://huggingface.co/datasets/linxinyuan/mind/resolve/main/test.csv"3 unmodified linesdef _info(self):return datasets.DatasetInfo(description=_DESCRIPTION,features=datasets.Features({"NewsID": datasets.Value("string"),"Category": datasets.features.ClassLabel(names=['foodanddrink', 'games', 'lifestyle', 'weather', 'kids', 'entertainment', 'middleeast', 'news', 'autos', 'video', 'travel', 'music', 'northamerica', 'movies', 'finance', 'health', 'sports', 'tv']),"SubCategory": datasets.Value("string"),"Title": datasets.Value("string"),"Abstract": datasets.Value("string"),"URL": datasets.Value("string"),"TitleEntities": datasets.Value("string"),"AbstractEntites": datasets.Value("string"),}),homepage="http://groups.di.unipi.it/~gulli/AG_corpus_of_news_articles.html",citation=_CITATION,task_templates=[TextClassification(text_column="Title", label_column="Category")],)def _split_generators(self, dl_manager):12345673 unmodified lines11121314151617181920212223242526import csvimport datasetsfrom datasets.tasks import TextClassification_TRAIN_DOWNLOAD_URL = "https://huggingface.co/datasets/linxinyuan/mind/resolve/main/train.csv"_TEST_DOWNLOAD_URL = "https://huggingface.co/datasets/linxinyuan/mind/resolve/main/test.csv"3 unmodified linesdef _info(self):return datasets.DatasetInfo(description="MIND",features=datasets.Features({"label": datasets.features.ClassLabel(names=['foodanddrink', 'games', 'lifestyle', 'weather', 'kids', 'entertainment', 'middleeast', 'news', 'autos', 'video', 'travel', 'music', 'northamerica', 'movies', 'finance', 'health', 'sports', 'tv']),"text": datasets.Value("string")}),homepage="http://groups.di.unipi.it/~gulli/AG_corpus_of_news_articles.html",citation="",task_templates=[TextClassification(text_column="text", label_column="label")],)def _split_generators(self, dl_manager):
mind.py+5-45