holylovenia commited on
Commit
48bf006
1 Parent(s): 1a818d5

Upload casa.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. casa.py +12 -12
casa.py CHANGED
@@ -4,9 +4,9 @@ from typing import Dict, List, Tuple
4
  import datasets
5
  import pandas as pd
6
 
7
- from nusacrowd.utils import schemas
8
- from nusacrowd.utils.configs import NusantaraConfig
9
- from nusacrowd.utils.constants import Tasks
10
 
11
  _CITATION = """
12
  @INPROCEEDINGS{8629181,
@@ -47,28 +47,28 @@ _SUPPORTED_TASKS = [Tasks.ASPECT_BASED_SENTIMENT_ANALYSIS]
47
 
48
  _SOURCE_VERSION = "1.0.0"
49
 
50
- _NUSANTARA_VERSION = "1.0.0"
51
 
52
 
53
  class CASA(datasets.GeneratorBasedBuilder):
54
  """CASA is an aspect based sentiment analysis dataset"""
55
 
56
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
57
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
58
 
59
  BUILDER_CONFIGS = [
60
- NusantaraConfig(
61
  name="casa_source",
62
  version=SOURCE_VERSION,
63
  description="CASA source schema",
64
  schema="source",
65
  subset_id="casa",
66
  ),
67
- NusantaraConfig(
68
- name="casa_nusantara_text_multi",
69
- version=NUSANTARA_VERSION,
70
  description="CASA Nusantara schema",
71
- schema="nusantara_text_multi",
72
  subset_id="casa",
73
  ),
74
  ]
@@ -90,7 +90,7 @@ class CASA(datasets.GeneratorBasedBuilder):
90
  }
91
  )
92
 
93
- elif self.config.schema == "nusantara_text_multi":
94
  features = schemas.text_multi_features(["positive", "neutral", "negative"])
95
 
96
  return datasets.DatasetInfo(
@@ -144,7 +144,7 @@ class CASA(datasets.GeneratorBasedBuilder):
144
  entry = {"index": row.index, "sentence": row.sentence, "fuel": row.fuel, "machine": row.machine, "others": row.others, "part": row.part, "price": row.price, "service": row.service}
145
  yield row.index, entry
146
 
147
- elif self.config.schema == "nusantara_text_multi":
148
  for row in df.itertuples():
149
  entry = {
150
  "id": str(row.index),
 
4
  import datasets
5
  import pandas as pd
6
 
7
+ from seacrowd.utils import schemas
8
+ from seacrowd.utils.configs import SEACrowdConfig
9
+ from seacrowd.utils.constants import Tasks
10
 
11
  _CITATION = """
12
  @INPROCEEDINGS{8629181,
 
47
 
48
  _SOURCE_VERSION = "1.0.0"
49
 
50
+ _SEACROWD_VERSION = "2024.06.20"
51
 
52
 
53
  class CASA(datasets.GeneratorBasedBuilder):
54
  """CASA is an aspect based sentiment analysis dataset"""
55
 
56
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
57
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
58
 
59
  BUILDER_CONFIGS = [
60
+ SEACrowdConfig(
61
  name="casa_source",
62
  version=SOURCE_VERSION,
63
  description="CASA source schema",
64
  schema="source",
65
  subset_id="casa",
66
  ),
67
+ SEACrowdConfig(
68
+ name="casa_seacrowd_text_multi",
69
+ version=SEACROWD_VERSION,
70
  description="CASA Nusantara schema",
71
+ schema="seacrowd_text_multi",
72
  subset_id="casa",
73
  ),
74
  ]
 
90
  }
91
  )
92
 
93
+ elif self.config.schema == "seacrowd_text_multi":
94
  features = schemas.text_multi_features(["positive", "neutral", "negative"])
95
 
96
  return datasets.DatasetInfo(
 
144
  entry = {"index": row.index, "sentence": row.sentence, "fuel": row.fuel, "machine": row.machine, "others": row.others, "part": row.part, "price": row.price, "service": row.service}
145
  yield row.index, entry
146
 
147
+ elif self.config.schema == "seacrowd_text_multi":
148
  for row in df.itertuples():
149
  entry = {
150
  "id": str(row.index),