Spaces:
Runtime error
Runtime error
Fixed slow performance
Browse files
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 |
-
|
|
|
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
|
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 = []
|