Clémentine
commited on
Commit
·
f7e2acf
1
Parent(s):
451041d
init
Browse files- TwitterAAE.py +50 -0
- aa/test.jsonl +0 -0
- white/test.jsonl +0 -0
TwitterAAE.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import datasets
|
| 2 |
+
import os
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
_CITATION = """
|
| 7 |
+
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
_DESCRIPTION = """
|
| 11 |
+
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
class Builder(datasets.GeneratorBasedBuilder):
|
| 15 |
+
VERSION = datasets.Version("1.0.0")
|
| 16 |
+
|
| 17 |
+
BUILDER_CONFIGS = [
|
| 18 |
+
datasets.BuilderConfig(name=name, version=datasets.Version("1.0.0"), description=_DESCRIPTION)
|
| 19 |
+
for name in ["aa", "white"]
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
def _info(self):
|
| 23 |
+
features = datasets.Features(
|
| 24 |
+
{
|
| 25 |
+
"tweet": datasets.Value("string"),
|
| 26 |
+
}
|
| 27 |
+
)
|
| 28 |
+
return datasets.DatasetInfo(
|
| 29 |
+
description=_DESCRIPTION,
|
| 30 |
+
features=features,
|
| 31 |
+
homepage="",
|
| 32 |
+
license="",
|
| 33 |
+
citation=_CITATION,
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
def _split_generators(self, dl_manager):
|
| 37 |
+
test_json = dl_manager.download(os.path.join(self.config.name, "test.jsonl"))
|
| 38 |
+
|
| 39 |
+
return [
|
| 40 |
+
datasets.SplitGenerator(
|
| 41 |
+
name=datasets.Split.TEST,
|
| 42 |
+
gen_kwargs={"path": test_json},
|
| 43 |
+
),
|
| 44 |
+
]
|
| 45 |
+
|
| 46 |
+
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 47 |
+
def _generate_examples(self, path):
|
| 48 |
+
with open(path, encoding="utf-8") as f:
|
| 49 |
+
for key, row in enumerate(f):
|
| 50 |
+
yield key, json.loads(row)
|
aa/test.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
white/test.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|