Sakshamrzt commited on
Commit
8e5266f
·
verified ·
1 Parent(s): b4507e1

Delete IndicNLP-Multilingual.py

Browse files
Files changed (1) hide show
  1. IndicNLP-Multilingual.py +0 -68
IndicNLP-Multilingual.py DELETED
@@ -1,68 +0,0 @@
1
- """TODO(IndicSentiment): Add a description here."""
2
-
3
-
4
- import json
5
-
6
- import datasets
7
-
8
-
9
- _HOMEPAGE = ""
10
-
11
- _CITATION = """\
12
- """
13
-
14
- _DESCRIPTION = """\
15
- """
16
-
17
- _LANG = ["telugu"]
18
- _URL = "https://huggingface.co/datasets/Sakshamrzt/IndicNLP-Multilingual/tree/main/{language}-{split}.jsonl"
19
- _VERSION = datasets.Version("1.0.0", "First version of IndicNLP-Multilingual")
20
-
21
-
22
- class IndicNLP-Multilingual(datasets.GeneratorBasedBuilder):
23
- BUILDER_CONFIGS = [
24
- datasets.BuilderConfig(
25
- name=f"news-{lang}",
26
- description=f"translated sentiment data for {lang}",
27
- version=_VERSION,
28
- )
29
- for lang in _LANG
30
- ]
31
-
32
- def _info(self):
33
- return datasets.DatasetInfo(
34
- description=_DESCRIPTION + self.config.description,
35
- features=datasets.Features(
36
- {
37
- "news": datasets.Value("string"),
38
- "class": datasets.Value("string"),
39
- }
40
- ),
41
- homepage=_HOMEPAGE,
42
- citation=_CITATION,
43
- )
44
-
45
- def _split_generators(self, dl_manager):
46
- """Returns SplitGenerators."""
47
- *translation_prefix, language = self.config.name.split("-")
48
- splits = {datasets.Split.TRAIN: "train", datasets.Split.TEST: "test"}
49
-
50
- data_urls = {
51
- split: _URL.format(language=language, split=splits[split]) for split in splits
52
- }
53
- dl_paths = dl_manager.download(data_urls)
54
- return [
55
- datasets.SplitGenerator(
56
- name=split,
57
- gen_kwargs={"filepath": dl_paths[split]},
58
- )
59
- for split in splits
60
- ]
61
-
62
- def _generate_examples(self, filepath):
63
- """Yields examples."""
64
-
65
- with open(filepath, encoding="utf-8") as f:
66
- for idx, row in enumerate(f):
67
- data = json.loads(row)
68
- yield idx, data