Sanatbek_Matlatipov commited on
Commit
4747b67
·
1 Parent(s): a0a398d

TypeError: argument of type 'Value' is not iterable is fixed

Browse files
aspect-based-sentiment-analysis-uzbek.py CHANGED
@@ -2,11 +2,14 @@ import os
2
  import xml.etree.ElementTree as ET
3
 
4
  import datasets
 
 
5
 
6
  class UZABSAConfig(datasets.BuilderConfig):
7
  def __init__(self, **kwargs):
8
  super(UZABSAConfig, self).__init__(version="1.0.0", **kwargs)
9
 
 
10
  class UzABSA(datasets.DatasetBuilder):
11
  BUILDER_CONFIG_CLASS = UZABSAConfig
12
  BUILDER_CONFIGS = [
@@ -15,25 +18,21 @@ class UzABSA(datasets.DatasetBuilder):
15
 
16
  def _info(self):
17
  # Define the data features
18
- return datasets.DatasetInfo(
19
- features={
20
- "sentence_id": datasets.Value("string"),
21
- "text": datasets.Value("string"),
22
- "aspect_terms": datasets.Sequence(
23
- {
24
- "term": datasets.Value("string"),
25
- "polarity": datasets.Value("string"),
26
- "from": datasets.Value("int32"),
27
- "to": datasets.Value("int32"),
28
- }
29
- ),
30
- "aspect_categories": datasets.Sequence(
31
- {
32
- "category": datasets.Value("string"),
33
- "polarity": datasets.Value("string"),
34
- }
35
- ),
36
- }
37
  )
38
 
39
  def _split_generators(self, dl_manager):
@@ -81,5 +80,4 @@ class UzABSA(datasets.DatasetBuilder):
81
  "text": text,
82
  "aspect_terms": aspect_terms,
83
  "aspect_categories": aspect_categories,
84
- }
85
-
 
2
  import xml.etree.ElementTree as ET
3
 
4
  import datasets
5
+ from datasets import Features, Value, Sequence, DatasetInfo
6
+
7
 
8
  class UZABSAConfig(datasets.BuilderConfig):
9
  def __init__(self, **kwargs):
10
  super(UZABSAConfig, self).__init__(version="1.0.0", **kwargs)
11
 
12
+
13
  class UzABSA(datasets.DatasetBuilder):
14
  BUILDER_CONFIG_CLASS = UZABSAConfig
15
  BUILDER_CONFIGS = [
 
18
 
19
  def _info(self):
20
  # Define the data features
21
+ return DatasetInfo(
22
+ features=Features({
23
+ "sentence_id": Value("string"),
24
+ "text": Value("string"),
25
+ "aspect_terms": Sequence({
26
+ "term": Value("string"),
27
+ "polarity": Value("string"),
28
+ "from": Value("int32"),
29
+ "to": Value("int32"),
30
+ }),
31
+ "aspect_categories": Sequence({
32
+ "category": Value("string"),
33
+ "polarity": Value("string"),
34
+ }),
35
+ })
 
 
 
 
36
  )
37
 
38
  def _split_generators(self, dl_manager):
 
80
  "text": text,
81
  "aspect_terms": aspect_terms,
82
  "aspect_categories": aspect_categories,
83
+ }
 
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- datasets
2
- xmltodict
 
1
+ datasets>=2.14.5
2
+ xmltodict>=0.13.0