Hugo Abonizio
commited on
Commit
•
9b49309
1
Parent(s):
e575ab4
Add training set
Browse files- .gitattributes +1 -0
- ag_news_pt.py +4 -5
- test.csv +0 -0
- train.csv +3 -0
.gitattributes
CHANGED
@@ -52,3 +52,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
55 |
+
*.csv filter=lfs diff=lfs merge=lfs -text
|
ag_news_pt.py
CHANGED
@@ -49,12 +49,12 @@ _CITATION = """\
|
|
49 |
}
|
50 |
"""
|
51 |
|
52 |
-
_TRAIN_DOWNLOAD_URL = "https://huggingface.co/datasets/hugo/ag_news_pt/raw/main/
|
53 |
_TEST_DOWNLOAD_URL = "https://huggingface.co/datasets/hugo/ag_news_pt/raw/main/test.csv"
|
54 |
|
55 |
|
56 |
class AGNews(datasets.GeneratorBasedBuilder):
|
57 |
-
"""AG News topic classification dataset."""
|
58 |
|
59 |
def _info(self):
|
60 |
return datasets.DatasetInfo(
|
@@ -87,10 +87,9 @@ class AGNews(datasets.GeneratorBasedBuilder):
|
|
87 |
for id_, row in enumerate(csv_reader):
|
88 |
if id_ == 0:
|
89 |
continue
|
90 |
-
label, title,
|
91 |
# Original labels are [1, 2, 3, 4] ->
|
92 |
# ['World', 'Sports', 'Business', 'Sci/Tech']
|
93 |
# Re-map to [0, 1, 2, 3].
|
94 |
label = int(label) - 1
|
95 |
-
|
96 |
-
yield id_, {"text": text, "label": label}
|
|
|
49 |
}
|
50 |
"""
|
51 |
|
52 |
+
_TRAIN_DOWNLOAD_URL = "https://huggingface.co/datasets/hugo/ag_news_pt/raw/main/train.csv"
|
53 |
_TEST_DOWNLOAD_URL = "https://huggingface.co/datasets/hugo/ag_news_pt/raw/main/test.csv"
|
54 |
|
55 |
|
56 |
class AGNews(datasets.GeneratorBasedBuilder):
|
57 |
+
"""AG News topic classification dataset (translated to Portuguese)."""
|
58 |
|
59 |
def _info(self):
|
60 |
return datasets.DatasetInfo(
|
|
|
87 |
for id_, row in enumerate(csv_reader):
|
88 |
if id_ == 0:
|
89 |
continue
|
90 |
+
label, title, text = row
|
91 |
# Original labels are [1, 2, 3, 4] ->
|
92 |
# ['World', 'Sports', 'Business', 'Sci/Tech']
|
93 |
# Re-map to [0, 1, 2, 3].
|
94 |
label = int(label) - 1
|
95 |
+
yield id_, {"title": title, "text": text, "label": label}
|
|
test.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
train.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9aed46c3e508a4d7efd747ed36cc89297c3f65b24897ff18d3dfcfecdc265976
|
3 |
+
size 32500955
|