Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
json
Sub-tasks:
sentiment-classification
Languages:
Russian
Size:
10K - 100K
License:
Update kinopoisk.py
Browse files- kinopoisk.py +14 -8
kinopoisk.py
CHANGED
@@ -1,6 +1,18 @@
|
|
1 |
import datasets
|
2 |
import pandas as pd
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
class KinopoiskReviewsConfig(datasets.BuilderConfig):
|
5 |
def __init__(self, features, **kwargs):
|
6 |
super(KinopoiskReviewsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
@@ -16,10 +28,6 @@ class Kinopoisk(datasets.GeneratorBasedBuilder):
|
|
16 |
]
|
17 |
|
18 |
def _info(self):
|
19 |
-
#features = {feature: datasets.Value("string") for feature in self.config.features}
|
20 |
-
#if self.config.name == "simple":
|
21 |
-
# features = {feature: datasets.Value("string") for feature in self.config.features}
|
22 |
-
#features["Idx"] = datasets.Value("int32")
|
23 |
return datasets.DatasetInfo(
|
24 |
description='Kinopoisk movie reviews dataset.',
|
25 |
features=datasets.Features(
|
@@ -38,19 +46,17 @@ class Kinopoisk(datasets.GeneratorBasedBuilder):
|
|
38 |
),
|
39 |
supervised_keys=None,
|
40 |
homepage='',
|
41 |
-
citation=
|
42 |
)
|
43 |
|
44 |
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
45 |
urls_to_download = {
|
46 |
-
"train": "kinopoisk.jsonl"
|
47 |
-
"dev": "kinopoisk.jsonl",
|
48 |
}
|
49 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
50 |
|
51 |
return [
|
52 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
53 |
-
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
54 |
]
|
55 |
|
56 |
def _generate_examples(self, filepath):
|
|
|
1 |
import datasets
|
2 |
import pandas as pd
|
3 |
|
4 |
+
_CITATION = """\
|
5 |
+
@article{blinov2013research,
|
6 |
+
title={Research of lexical approach and machine learning methods for sentiment analysis},
|
7 |
+
author={Blinov, PD and Klekovkina, Maria and Kotelnikov, Eugeny and Pestov, Oleg},
|
8 |
+
journal={Computational Linguistics and Intellectual Technologies},
|
9 |
+
volume={2},
|
10 |
+
number={12},
|
11 |
+
pages={48--58},
|
12 |
+
year={2013}
|
13 |
+
}
|
14 |
+
"""
|
15 |
+
|
16 |
class KinopoiskReviewsConfig(datasets.BuilderConfig):
|
17 |
def __init__(self, features, **kwargs):
|
18 |
super(KinopoiskReviewsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
|
|
28 |
]
|
29 |
|
30 |
def _info(self):
|
|
|
|
|
|
|
|
|
31 |
return datasets.DatasetInfo(
|
32 |
description='Kinopoisk movie reviews dataset.',
|
33 |
features=datasets.Features(
|
|
|
46 |
),
|
47 |
supervised_keys=None,
|
48 |
homepage='',
|
49 |
+
citation=_CITATION,
|
50 |
)
|
51 |
|
52 |
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
53 |
urls_to_download = {
|
54 |
+
"train": "kinopoisk.jsonl"
|
|
|
55 |
}
|
56 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
57 |
|
58 |
return [
|
59 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
|
|
60 |
]
|
61 |
|
62 |
def _generate_examples(self, filepath):
|