update
Browse files
test_data.py → test_data_huggingface.py
RENAMED
@@ -14,13 +14,11 @@
|
|
14 |
# limitations under the License.
|
15 |
"""test_data dataset."""
|
16 |
|
17 |
-
|
18 |
import csv
|
19 |
|
20 |
import datasets
|
21 |
from datasets.tasks import TextClassification
|
22 |
|
23 |
-
|
24 |
_DESCRIPTION = """"""
|
25 |
|
26 |
_HOMEPAGE = "https://github.com/freeziyou/test_data"
|
@@ -28,12 +26,12 @@ _HOMEPAGE = "https://github.com/freeziyou/test_data"
|
|
28 |
_LICENSE = "Creative Commons Attribution 4.0 International"
|
29 |
|
30 |
_TRAIN_DOWNLOAD_URL = (
|
31 |
-
"https://raw.githubusercontent.com/freeziyou/test_data/main/
|
32 |
)
|
33 |
-
_TEST_DOWNLOAD_URL = "https://raw.githubusercontent.com/freeziyou/test_data/main/
|
34 |
|
35 |
|
36 |
-
class
|
37 |
"""test_data dataset."""
|
38 |
|
39 |
VERSION = datasets.Version("1.1.0")
|
@@ -44,18 +42,18 @@ class test_data(datasets.GeneratorBasedBuilder):
|
|
44 |
"text": datasets.Value("string"),
|
45 |
"label": datasets.features.ClassLabel(
|
46 |
names=[
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
}
|
60 |
)
|
61 |
return datasets.DatasetInfo(
|
@@ -84,4 +82,4 @@ class test_data(datasets.GeneratorBasedBuilder):
|
|
84 |
next(csv_reader)
|
85 |
for id_, row in enumerate(csv_reader):
|
86 |
text, label = row
|
87 |
-
yield id_, {"text": text, "label": label}
|
|
|
14 |
# limitations under the License.
|
15 |
"""test_data dataset."""
|
16 |
|
|
|
17 |
import csv
|
18 |
|
19 |
import datasets
|
20 |
from datasets.tasks import TextClassification
|
21 |
|
|
|
22 |
_DESCRIPTION = """"""
|
23 |
|
24 |
_HOMEPAGE = "https://github.com/freeziyou/test_data"
|
|
|
26 |
_LICENSE = "Creative Commons Attribution 4.0 International"
|
27 |
|
28 |
_TRAIN_DOWNLOAD_URL = (
|
29 |
+
"https://raw.githubusercontent.com/freeziyou/test_data/main/comments_only_train.csv"
|
30 |
)
|
31 |
+
_TEST_DOWNLOAD_URL = "https://raw.githubusercontent.com/freeziyou/test_data/main/comments_only_test.csv"
|
32 |
|
33 |
|
34 |
+
class test_data_huggingface(datasets.GeneratorBasedBuilder):
|
35 |
"""test_data dataset."""
|
36 |
|
37 |
VERSION = datasets.Version("1.1.0")
|
|
|
42 |
"text": datasets.Value("string"),
|
43 |
"label": datasets.features.ClassLabel(
|
44 |
names=[
|
45 |
+
"none",
|
46 |
+
"like",
|
47 |
+
"unlike",
|
48 |
+
"hope",
|
49 |
+
"questioning",
|
50 |
+
"express_surprise",
|
51 |
+
"normal_interaction",
|
52 |
+
"express_sad",
|
53 |
+
"tease",
|
54 |
+
"meme",
|
55 |
+
"express_abashed"
|
56 |
+
]),
|
57 |
}
|
58 |
)
|
59 |
return datasets.DatasetInfo(
|
|
|
82 |
next(csv_reader)
|
83 |
for id_, row in enumerate(csv_reader):
|
84 |
text, label = row
|
85 |
+
yield id_, {"text": text, "label": label}
|