fix git lfs
Browse files- .gitattributes +1 -2
- UTS_Text.py +47 -3
.gitattributes
CHANGED
@@ -52,7 +52,6 @@ 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
|
55 |
-
data/** filter=lfs diff=lfs merge=lfs -text
|
56 |
*.txt filter=lfs diff=lfs merge=lfs -text
|
57 |
-
*.py filter=lfs diff=lfs merge=lfs -text
|
58 |
*.gitignore 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 |
*.txt filter=lfs diff=lfs merge=lfs -text
|
|
|
56 |
*.gitignore filter=lfs diff=lfs merge=lfs -text
|
57 |
+
data/** filter=lfs diff=lfs merge=lfs -text
|
UTS_Text.py
CHANGED
@@ -1,3 +1,47 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import re
|
3 |
+
from itertools import chain
|
4 |
+
|
5 |
+
import datasets
|
6 |
+
|
7 |
+
_DESCRIPTION = """\
|
8 |
+
UTSText
|
9 |
+
"""
|
10 |
+
|
11 |
+
_CITATION = """\
|
12 |
+
"""
|
13 |
+
|
14 |
+
_BASE_URL = "https://huggingface.co/datasets/undertheseanlp/UTS_Text_v1/resolve/main/data/"
|
15 |
+
TRAIN_FILE = "UTS_Text_v1.txt"
|
16 |
+
|
17 |
+
class UTSText(datasets.GeneratorBasedBuilder):
|
18 |
+
def _info(self):
|
19 |
+
return datasets.DatasetInfo(
|
20 |
+
description=_DESCRIPTION,
|
21 |
+
features=datasets.Features(
|
22 |
+
{
|
23 |
+
"text": datasets.Value("string"),
|
24 |
+
}
|
25 |
+
),
|
26 |
+
supervised_keys=None,
|
27 |
+
homepage=None,
|
28 |
+
citation=_CITATION
|
29 |
+
)
|
30 |
+
|
31 |
+
def _split_generators(self, dl_manager):
|
32 |
+
"""Returns SplitGenerators."""
|
33 |
+
DATA_PATH = os.path.join(_BASE_URL, self.config.name)
|
34 |
+
train_file = dl_manager.download(os.path.join(DATA_PATH, "train.txt"))
|
35 |
+
# dev_file = dl_manager.download(os.path.join(DATA_PATH, "dev.txt"))
|
36 |
+
# test_file = dl_manager.download(os.path.join(DATA_PATH, "test.txt"))
|
37 |
+
data_files = {
|
38 |
+
"train": train_file,
|
39 |
+
# "dev": dev_file,
|
40 |
+
# "test": test_file,
|
41 |
+
}
|
42 |
+
splits = [
|
43 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_files["train"]}),
|
44 |
+
# datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": data_files["dev"]}),
|
45 |
+
# datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": data_files["test"]}),
|
46 |
+
]
|
47 |
+
return splits
|