Update app.py
Browse files
app.py
CHANGED
|
@@ -187,37 +187,17 @@ if uploaded_file is not None:
|
|
| 187 |
t5_words = word_tokenize(x.lower())
|
| 188 |
|
| 189 |
t5_words=list(set(sent_words).difference(set(t5_words)))
|
| 190 |
-
# sent_out = re.sub("\n","|",sent)
|
| 191 |
-
# sent_out = re.sub(".","|",sent_out)
|
| 192 |
-
# sent_out = re.sub(",","|",sent_out)
|
| 193 |
-
# sent_out = re.sub(" ","|",sent_out)
|
| 194 |
-
# sent_n_q_c=sent_out.split("|")
|
| 195 |
-
# sent_n_q_c=[]
|
| 196 |
-
# sent_n = list(set(sent.lower().replace('.',' ').split("\n")))
|
| 197 |
-
# for i in sent_n:
|
| 198 |
-
# for j in i.split(" "):
|
| 199 |
-
# sent_n_q_c+=j.split(',')
|
| 200 |
-
# x_q = x.lower().replace('.',' ').split(' ')
|
| 201 |
-
# e=[]
|
| 202 |
-
# for i in x_q:
|
| 203 |
-
# e+=i.split(',')
|
| 204 |
-
# sent_out = re.sub("\n","|",x)
|
| 205 |
-
# sent_out = re.sub(".","|",sent_out)
|
| 206 |
-
# sent_out = re.sub(",","|",sent_out)
|
| 207 |
-
# sent_out = re.sub(" ","|",sent_out)
|
| 208 |
-
# e = sent_out.split("|")
|
| 209 |
-
# t5_words=list(set(sent_n_q_c).difference(set(e)))
|
| 210 |
entities,words_out = extract_entities(sent)
|
| 211 |
-
words_out
|
| 212 |
-
# print("\nwords_out:",words_out)
|
| 213 |
# print("\nT5",t5_words)
|
| 214 |
# print("X:",x,"\nsent:",sent,"\nx_q:",x_q,"\nsent_n:",sent_n,"\ne:",e,"\nsent_n_q_c:",sent_n_q_c,'\nt5_words',t5_words)
|
| 215 |
bert_words = words_red_bert(sent)
|
|
|
|
| 216 |
# print("\nbert:",bert_words)
|
| 217 |
new=[]
|
| 218 |
for w in words_out:
|
| 219 |
new+=w.split('\n')
|
| 220 |
-
#
|
| 221 |
new+=bert_words
|
| 222 |
words_out = [i for i in new if len(i)>3]
|
| 223 |
# print("\nfinal:",words_out)
|
|
|
|
| 187 |
t5_words = word_tokenize(x.lower())
|
| 188 |
|
| 189 |
t5_words=list(set(sent_words).difference(set(t5_words)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
entities,words_out = extract_entities(sent)
|
| 191 |
+
# print("\microsoft:",words_out)
|
|
|
|
| 192 |
# print("\nT5",t5_words)
|
| 193 |
# print("X:",x,"\nsent:",sent,"\nx_q:",x_q,"\nsent_n:",sent_n,"\ne:",e,"\nsent_n_q_c:",sent_n_q_c,'\nt5_words',t5_words)
|
| 194 |
bert_words = words_red_bert(sent)
|
| 195 |
+
words_out+=t5_words
|
| 196 |
# print("\nbert:",bert_words)
|
| 197 |
new=[]
|
| 198 |
for w in words_out:
|
| 199 |
new+=w.split('\n')
|
| 200 |
+
# new+=t5_words
|
| 201 |
new+=bert_words
|
| 202 |
words_out = [i for i in new if len(i)>3]
|
| 203 |
# print("\nfinal:",words_out)
|