holylovenia commited on
Commit
2f3264a
1 Parent(s): 966d88a

Upload imdb_jv.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. imdb_jv.py +12 -12
imdb_jv.py CHANGED
@@ -4,9 +4,9 @@ from typing import Dict, List, Tuple
4
 
5
  import datasets
6
 
7
- from nusacrowd.utils.configs import NusantaraConfig
8
- from nusacrowd.utils.constants import Tasks
9
- from nusacrowd.utils import schemas
10
  import pandas as pd
11
 
12
  _CITATION = """\
@@ -41,27 +41,27 @@ _SUPPORTED_TASKS = [Tasks.SENTIMENT_ANALYSIS]
41
 
42
  _SOURCE_VERSION = "1.0.0"
43
 
44
- _NUSANTARA_VERSION = "1.0.0"
45
 
46
  class IMDbJv(datasets.GeneratorBasedBuilder):
47
  """Javanese Imdb Movie Reviews Dataset is a Javanese version of the IMDb Movie Reviews dataset by translating the original English dataset to Javanese."""
48
 
49
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
50
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
51
 
52
  BUILDER_CONFIGS = [
53
- NusantaraConfig(
54
  name="imdb_jv_source",
55
  version=datasets.Version(_SOURCE_VERSION),
56
  description="imdb_jv source schema",
57
  schema="source",
58
  subset_id="imdb_jv",
59
  ),
60
- NusantaraConfig(
61
- name="imdb_jv_nusantara_text",
62
- version=datasets.Version(_NUSANTARA_VERSION),
63
  description="imdb_jv Nusantara schema",
64
- schema="nusantara_text",
65
  subset_id="imdb_jv",
66
  ),
67
  ]
@@ -77,7 +77,7 @@ class IMDbJv(datasets.GeneratorBasedBuilder):
77
  "label": datasets.Value("string")
78
  }
79
  )
80
- elif self.config.schema == "nusantara_text":
81
  features = schemas.text_features(['1', '0', '-1'])
82
 
83
  return datasets.DatasetInfo(
@@ -135,7 +135,7 @@ class IMDbJv(datasets.GeneratorBasedBuilder):
135
  }
136
  yield id, ex
137
 
138
- elif self.config.schema == "nusantara_text":
139
  data = pd.read_csv(filepath)
140
  length = len(data['label'])
141
  for id in range(length):
 
4
 
5
  import datasets
6
 
7
+ from seacrowd.utils.configs import SEACrowdConfig
8
+ from seacrowd.utils.constants import Tasks
9
+ from seacrowd.utils import schemas
10
  import pandas as pd
11
 
12
  _CITATION = """\
 
41
 
42
  _SOURCE_VERSION = "1.0.0"
43
 
44
+ _SEACROWD_VERSION = "2024.06.20"
45
 
46
  class IMDbJv(datasets.GeneratorBasedBuilder):
47
  """Javanese Imdb Movie Reviews Dataset is a Javanese version of the IMDb Movie Reviews dataset by translating the original English dataset to Javanese."""
48
 
49
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
50
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
51
 
52
  BUILDER_CONFIGS = [
53
+ SEACrowdConfig(
54
  name="imdb_jv_source",
55
  version=datasets.Version(_SOURCE_VERSION),
56
  description="imdb_jv source schema",
57
  schema="source",
58
  subset_id="imdb_jv",
59
  ),
60
+ SEACrowdConfig(
61
+ name="imdb_jv_seacrowd_text",
62
+ version=datasets.Version(_SEACROWD_VERSION),
63
  description="imdb_jv Nusantara schema",
64
+ schema="seacrowd_text",
65
  subset_id="imdb_jv",
66
  ),
67
  ]
 
77
  "label": datasets.Value("string")
78
  }
79
  )
80
+ elif self.config.schema == "seacrowd_text":
81
  features = schemas.text_features(['1', '0', '-1'])
82
 
83
  return datasets.DatasetInfo(
 
135
  }
136
  yield id, ex
137
 
138
+ elif self.config.schema == "seacrowd_text":
139
  data = pd.read_csv(filepath)
140
  length = len(data['label'])
141
  for id in range(length):