Datasets:
Tasks:
Text Classification
Sub-tasks:
sentiment-classification
Languages:
Chinese
Size:
100K - 1M
Tags:
jd
License:
wangsong commited on
Commit ·
3116335
1
Parent(s): d175c15
修正下载地址
Browse files
jd21.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
|
| 2 |
-
from datasets import Value, ClassLabel
|
| 3 |
import datasets
|
| 4 |
|
| 5 |
|
|
@@ -49,8 +49,8 @@ class JD21(datasets.GeneratorBasedBuilder):
|
|
| 49 |
label_classes=['POS','NEG'],
|
| 50 |
label_column='label',
|
| 51 |
citation="",
|
| 52 |
-
data_dir=
|
| 53 |
-
data_url = "",
|
| 54 |
url='https://github.com/ws719547997/LNB-DA')
|
| 55 |
for domain_name in domain_list
|
| 56 |
]
|
|
@@ -70,9 +70,12 @@ class JD21(datasets.GeneratorBasedBuilder):
|
|
| 70 |
)
|
| 71 |
|
| 72 |
def _split_generators(self, dl_manager):
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
| 76 |
return [datasets.SplitGenerator(name=datasets.Split.TEST,
|
| 77 |
gen_kwargs={
|
| 78 |
"data_file": test_file,
|
|
@@ -99,4 +102,4 @@ class JD21(datasets.GeneratorBasedBuilder):
|
|
| 99 |
if len(lin_sp) < 5:
|
| 100 |
continue
|
| 101 |
# id, {example}
|
| 102 |
-
yield lin_sp[0], {'sentence':lin_sp[4],'domain':lin_sp[1], 'label':lin_sp[2], 'id':lin_sp[0], 'rank':lin_sp[3]}
|
|
|
|
| 1 |
|
| 2 |
+
from datasets import Value, ClassLabel
|
| 3 |
import datasets
|
| 4 |
|
| 5 |
|
|
|
|
| 49 |
label_classes=['POS','NEG'],
|
| 50 |
label_column='label',
|
| 51 |
citation="",
|
| 52 |
+
data_dir= "",
|
| 53 |
+
data_url = r"https://huggingface.co/datasets/kuroneko3578/jd21/resolve/main/data.7z",
|
| 54 |
url='https://github.com/ws719547997/LNB-DA')
|
| 55 |
for domain_name in domain_list
|
| 56 |
]
|
|
|
|
| 70 |
)
|
| 71 |
|
| 72 |
def _split_generators(self, dl_manager):
|
| 73 |
+
downloaded_file = dl_manager.download_and_extract(self.config.data_url)
|
| 74 |
+
print(downloaded_file)
|
| 75 |
+
|
| 76 |
+
test_file = rf'{downloaded_file}\data\test\{self.config.name}.txt'
|
| 77 |
+
dev_file = rf'{downloaded_file}\data\dev\{self.config.name}.txt'
|
| 78 |
+
train_file = rf'{downloaded_file}\data\train\{self.config.name}.txt'
|
| 79 |
return [datasets.SplitGenerator(name=datasets.Split.TEST,
|
| 80 |
gen_kwargs={
|
| 81 |
"data_file": test_file,
|
|
|
|
| 102 |
if len(lin_sp) < 5:
|
| 103 |
continue
|
| 104 |
# id, {example}
|
| 105 |
+
yield lin_sp[0], {'sentence':lin_sp[4],'domain':lin_sp[1], 'label':lin_sp[2], 'id':lin_sp[0], 'rank':lin_sp[3]}
|