ebrigham commited on
Commit
30f98f7
·
1 Parent(s): 0ba1ac0

Update labels.py

Browse files
Files changed (1) hide show
  1. labels.py +3 -3
labels.py CHANGED
@@ -61,12 +61,12 @@ class AGNews(datasets.GeneratorBasedBuilder):
61
  features=datasets.Features(
62
  {
63
  "text": datasets.Value("string"),
64
- "label": datasets.features.ClassLabel(names=["Society & Culture", "Science & Mathematics", "Health","Education & Reference", "Computers & Internet", "Sports", "Business & Finance", "Entertainment & Music", "Family & Relationships", "Politics & Government"]),
65
  }
66
  ),
67
  homepage="http://groups.di.unipi.it/~gulli/AG_corpus_of_news_articles.html",
68
  citation=_CITATION,
69
- task_templates=[TextClassification(text_column="text", label_column="label")],
70
  )
71
 
72
  def _split_generators(self, dl_manager):
@@ -90,5 +90,5 @@ class AGNews(datasets.GeneratorBasedBuilder):
90
  # Re-map to [0, 1, 2, 3].
91
  label = int(label) - 1
92
  text = " ".join((title, description))
93
- yield id_, {"text": text, "label": label}
94
 
 
61
  features=datasets.Features(
62
  {
63
  "text": datasets.Value("string"),
64
+ "labels": datasets.features.ClassLabel(names=["Society & Culture", "Science & Mathematics", "Health","Education & Reference", "Computers & Internet", "Sports", "Business & Finance", "Entertainment & Music", "Family & Relationships", "Politics & Government"]),
65
  }
66
  ),
67
  homepage="http://groups.di.unipi.it/~gulli/AG_corpus_of_news_articles.html",
68
  citation=_CITATION,
69
+ task_templates=[TextClassification(text_column="text", label_column="labels")],
70
  )
71
 
72
  def _split_generators(self, dl_manager):
 
90
  # Re-map to [0, 1, 2, 3].
91
  label = int(label) - 1
92
  text = " ".join((title, description))
93
+ yield id_, {"text": text, "labels": label}
94