Delete testowy.py
Browse files- testowy.py +0 -34
testowy.py
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
import datasets
|
2 |
-
import csv
|
3 |
-
|
4 |
-
|
5 |
-
class Testowy(datasets.GeneratorBasedBuilder):
|
6 |
-
|
7 |
-
def _info(self):
|
8 |
-
features = datasets.Features(
|
9 |
-
{
|
10 |
-
'label': datasets.ClassLabel(num_classes=2),
|
11 |
-
'text': datasets.Value('string')
|
12 |
-
})
|
13 |
-
return datasets.DatasetInfo(
|
14 |
-
features=features,
|
15 |
-
supervised_keys= datasets.info.SupervisedKeysData(input='text', output='label'),
|
16 |
-
)
|
17 |
-
|
18 |
-
def _split_generators(self, dl_manager):
|
19 |
-
return [
|
20 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
21 |
-
gen_kwargs={'filepath': 'train_data.csv', 'split': 'train'}),
|
22 |
-
datasets.SplitGenerator(name=datasets.Split.TEST,
|
23 |
-
gen_kwargs={'filepath': 'test_data.csv', 'split': 'test'})]
|
24 |
-
|
25 |
-
def _generate_examples(self, filepath, split):
|
26 |
-
with open(filepath) as f:
|
27 |
-
csv_reader = csv.reader(f, delimiter=',')
|
28 |
-
for id_, row in enumerate(csv_reader):
|
29 |
-
if id_ == 0:
|
30 |
-
continue
|
31 |
-
yield id_, {
|
32 |
-
'label': row[0],
|
33 |
-
'text': row[1]
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|