mginoben commited on
Commit
bdff148
1 Parent(s): d9ea7b2

Fixed slow performance

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -38,17 +38,17 @@ contractions = read_text('contractions', 'json')
38
  lookup_words = read_text('lookup_words')
39
  obj_pronouns = read_text('obj_pronouns')
40
  profanities = read_text('profanities', 'json')
41
- eng_words = set(words.words())
 
42
 
43
  # TODO check eng words that are tagalog profanities
44
 
45
  def fuzzy_lookup(tweet):
46
 
47
  matched_profanity = dict()
48
- lookup_profanity = np.concatenate([np.hstack(list(profanities.values())), list(profanities.keys())])
49
 
50
  for word in tweet.split():
51
- if word in list(set(eng_words) - set(lookup_profanity)):
52
  continue
53
  scores = []
54
  matched_words = []
 
38
  lookup_words = read_text('lookup_words')
39
  obj_pronouns = read_text('obj_pronouns')
40
  profanities = read_text('profanities', 'json')
41
+ lookup_profanity = np.concatenate([np.hstack(list(profanities.values())), list(profanities.keys())])
42
+ eng_words = list(set(words.words()) - set(lookup_profanity))
43
 
44
  # TODO check eng words that are tagalog profanities
45
 
46
  def fuzzy_lookup(tweet):
47
 
48
  matched_profanity = dict()
 
49
 
50
  for word in tweet.split():
51
+ if word in eng_words:
52
  continue
53
  scores = []
54
  matched_words = []