abumafrim commited on
Commit
4ca9adf
1 Parent(s): 30c065a

Update Naija-Lexicons.py

Browse files
Files changed (1) hide show
  1. Naija-Lexicons.py +9 -9
Naija-Lexicons.py CHANGED
@@ -63,8 +63,8 @@ class NaijaLexiconsConfig(datasets.BuilderConfig):
63
  def __init__(
64
  self,
65
  text_features,
66
- machine_translation,
67
- human_translation,
68
  label_column,
69
  label_classes,
70
  hau_url,
@@ -89,8 +89,8 @@ class NaijaLexiconsConfig(datasets.BuilderConfig):
89
  """
90
  super(NaijaLexiconsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
91
  self.text_features = text_features
92
- self.machine_translation = machine_translation
93
- self.human_translation = human_translation
94
  self.label_column = label_column
95
  self.label_classes = label_classes
96
  self.hau_url = hau_url
@@ -113,8 +113,8 @@ class NaijaLexicons(datasets.GeneratorBasedBuilder):
113
  f"""{_DESCRIPTION}"""
114
  ),
115
  text_features={"word": "word"},
116
- machine_translation={'machine': 'machine'},
117
- human_translation={'human': 'human'},
118
  label_classes=["POSITIVE", "NEGATIVE"],
119
  label_column="label",
120
  hau_url=f"https://raw.githubusercontent.com/hausanlp/NaijaSenti/main/data/sentiment-lexicons/{t}/hausa/mixed.csv",
@@ -133,8 +133,8 @@ class NaijaLexicons(datasets.GeneratorBasedBuilder):
133
  f"""{_DESCRIPTION}"""
134
  ),
135
  text_features={"word": "word"},
136
- machine_translation={},
137
- human_translation={},
138
  label_classes=["POSITIVE", "NEGATIVE"],
139
  label_column="label",
140
  hau_url=f"https://raw.githubusercontent.com/hausanlp/NaijaSenti/main/data/sentiment-lexicons/{t}/hausa/mixed.csv",
@@ -182,7 +182,7 @@ class NaijaLexicons(datasets.GeneratorBasedBuilder):
182
  machine = row['machine']
183
  human = row['human']
184
 
185
- yield id_, {"word": word, 'machine_translation': machine, 'human_translation': human, "label": label}
186
  else:
187
  for id_, row in df.iterrows():
188
  word = row["word"]
 
63
  def __init__(
64
  self,
65
  text_features,
66
+ machine,
67
+ human,
68
  label_column,
69
  label_classes,
70
  hau_url,
 
89
  """
90
  super(NaijaLexiconsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
91
  self.text_features = text_features
92
+ self.machine = machine
93
+ self.human = human
94
  self.label_column = label_column
95
  self.label_classes = label_classes
96
  self.hau_url = hau_url
 
113
  f"""{_DESCRIPTION}"""
114
  ),
115
  text_features={"word": "word"},
116
+ machine={'machine': 'machine'},
117
+ human={'human': 'human'},
118
  label_classes=["POSITIVE", "NEGATIVE"],
119
  label_column="label",
120
  hau_url=f"https://raw.githubusercontent.com/hausanlp/NaijaSenti/main/data/sentiment-lexicons/{t}/hausa/mixed.csv",
 
133
  f"""{_DESCRIPTION}"""
134
  ),
135
  text_features={"word": "word"},
136
+ machine={},
137
+ human={},
138
  label_classes=["POSITIVE", "NEGATIVE"],
139
  label_column="label",
140
  hau_url=f"https://raw.githubusercontent.com/hausanlp/NaijaSenti/main/data/sentiment-lexicons/{t}/hausa/mixed.csv",
 
182
  machine = row['machine']
183
  human = row['human']
184
 
185
+ yield id_, {"word": word, 'machine': machine, 'human': human, "label": label}
186
  else:
187
  for id_, row in df.iterrows():
188
  word = row["word"]