Fix dataset

#3
by lhoestq HF staff - opened
README.md CHANGED
@@ -5,4 +5,7 @@ language:
5
  - uz
6
  size_categories:
7
  - 1K<n<10K
 
 
 
8
  ---
 
5
  - uz
6
  size_categories:
7
  - 1K<n<10K
8
+ configs:
9
+ - config_name: default
10
+ data_files: aspect-based-sentiment-analysis-uzbek.parquet
11
  ---
aspect-based-sentiment-analysis-uzbek.py DELETED
@@ -1,51 +0,0 @@
1
- import json
2
- import datasets
3
- from datasets import GeneratorBasedBuilder, DatasetInfo, Split, SplitGenerator, Features, Value, Sequence
4
-
5
- _BASE_URL = "https://drive.google.com/uc?export=download&id=12J5C6knWWPebLsjdZt0zCU4GKzDO5kGa"
6
-
7
-
8
- class UzABSA(GeneratorBasedBuilder):
9
- VERSION = datasets.Version("1.0.0")
10
-
11
- BUILDER_CONFIGS = [
12
- datasets.BuilderConfig(name="uzabsa", version=VERSION,
13
- description="UZABSA dataset for sentiment analysis in Uzbek"),
14
- ]
15
-
16
- def _info(self):
17
- return DatasetInfo(
18
- features=Features({
19
- "sentence_id": Value("string"),
20
- "text": Value("string"),
21
- "aspect_terms": Sequence({
22
- "term": Value("string"),
23
- "polarity": Value("string"),
24
- "from": Value("int32"),
25
- "to": Value("int32"),
26
- }),
27
- "aspect_categories": Sequence({
28
- "category": Value("string"),
29
- "polarity": Value("string"),
30
- }),
31
- })
32
- )
33
-
34
- def _split_generators(self, dl_manager):
35
- # Use the dl_manager to download and cache the data
36
- downloaded_file = dl_manager.download_and_extract(_BASE_URL)
37
- return [
38
- SplitGenerator(name=Split.TRAIN, gen_kwargs={"filepath": downloaded_file}),
39
- ]
40
-
41
- def _generate_examples(self, filepath):
42
- # Now we'll read the jsonl format
43
- with open(filepath, 'r') as file:
44
- for line in file:
45
- record = json.loads(line.strip())
46
- yield record["sentence_id"], {
47
- "sentence_id": record["sentence_id"],
48
- "text": record["text"],
49
- "aspect_terms": record["aspect_terms"],
50
- "aspect_categories": record["aspect_categories"],
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aspect-based-sentiment-analysis-uzbek.yaml DELETED
@@ -1,51 +0,0 @@
1
- # aspect-based-sentiment-analysis-uzbek.yaml
2
-
3
- name: uzabsa
4
- description: UZABSA dataset for sentiment analysis in Uzbek
5
- homepage: https://drive.google.com/uc?export=download&id=12J5C6knWWPebLsjdZt0zCU4GKzDO5kGa
6
- license: "unknown" # Please specify an appropriate license if known
7
- version: "1.0.0"
8
- citation: "unknown" # If there's a paper or source, cite it here
9
-
10
- post_processed:
11
- features:
12
- - name: sentence_id
13
- type: string
14
- description: The unique ID of the sentence.
15
- - name: text
16
- type: string
17
- description: The actual sentence or text.
18
- - name: aspect_terms
19
- type: sequence
20
- description: List of aspect terms present in the sentence.
21
- item:
22
- type: mapping
23
- properties:
24
- - name: term
25
- type: string
26
- description: The aspect term.
27
- - name: polarity
28
- type: string
29
- description: Polarity of the aspect term.
30
- - name: from
31
- type: int32
32
- description: Start index of the aspect term in the sentence.
33
- - name: to
34
- type: int32
35
- description: End index of the aspect term in the sentence.
36
- - name: aspect_categories
37
- type: sequence
38
- description: List of aspect categories present in the sentence.
39
- item:
40
- type: mapping
41
- properties:
42
- - name: category
43
- type: string
44
- description: The aspect category.
45
- - name: polarity
46
- type: string
47
- description: Polarity of the aspect category.
48
-
49
- splits:
50
- - name: train
51
- path: aspect-based-sentiment-analysis-uzbek.jsonl