antypasd commited on
Commit
b26e2c1
1 Parent(s): 163ef0e

bug fix: hate

Browse files
data/tweet_hate/test.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tweet_hate/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tweet_hate/validation.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
process/tweet_hate.py CHANGED
@@ -7,7 +7,7 @@ import urllib
7
  HATE = 1
8
  NOT_HATE = 0
9
 
10
- # class mapping for the multiclass
11
  class_mapping = {
12
  'target_gender_aggregated': 0,
13
  'target_race_aggregated': 1,
@@ -38,7 +38,7 @@ def clean_text(text):
38
  for t in text.split():
39
  # MAKE SURE to check lowercase
40
  t = '@user' if t.startswith('@') and len(t) > 1 and t.replace('@','').lower() not in verified_users else t
41
- t = '\{URL\}' if t.startswith('http') else t
42
  new_text.append(t)
43
 
44
  return ' '.join(new_text)
 
7
  HATE = 1
8
  NOT_HATE = 0
9
 
10
+ # class mapping for the multi-class
11
  class_mapping = {
12
  'target_gender_aggregated': 0,
13
  'target_race_aggregated': 1,
 
38
  for t in text.split():
39
  # MAKE SURE to check lowercase
40
  t = '@user' if t.startswith('@') and len(t) > 1 and t.replace('@','').lower() not in verified_users else t
41
+ t = '{URL}' if (t.startswith('http') or t.startswith('URL')) else t
42
  new_text.append(t)
43
 
44
  return ' '.join(new_text)
super_tweet_eval.py CHANGED
@@ -2,7 +2,7 @@
2
  import json
3
  import datasets
4
 
5
- _VERSION = "0.1.35"
6
  _SUPER_TWEET_EVAL_CITATION = """TBA"""
7
  _SUPER_TWEET_EVAL_DESCRIPTION = """TBA"""
8
  _TWEET_TOPIC_DESCRIPTION = """
@@ -286,7 +286,7 @@ class SuperTweetEval(datasets.GeneratorBasedBuilder):
286
  label_classes = [
287
  'hate_gender','hate_race', 'hate_sexuality', 'hate_religion','hate_origin', 'hate_disability',
288
  'target_age', 'not_hate']
289
- features['gold_label'] = datasets.features.ClassLabel(names=self.config.label_classes)
290
  #features["gold_label"] = datasets.Value("int32")
291
  features["text"] = datasets.Value("string")
292
  if self.config.name == "tweet_nerd":
 
2
  import json
3
  import datasets
4
 
5
+ _VERSION = "0.1.37"
6
  _SUPER_TWEET_EVAL_CITATION = """TBA"""
7
  _SUPER_TWEET_EVAL_DESCRIPTION = """TBA"""
8
  _TWEET_TOPIC_DESCRIPTION = """
 
286
  label_classes = [
287
  'hate_gender','hate_race', 'hate_sexuality', 'hate_religion','hate_origin', 'hate_disability',
288
  'target_age', 'not_hate']
289
+ features['gold_label'] = datasets.features.ClassLabel(names=label_classes)
290
  #features["gold_label"] = datasets.Value("int32")
291
  features["text"] = datasets.Value("string")
292
  if self.config.name == "tweet_nerd":