Update app.py
Browse files
app.py
CHANGED
@@ -58,17 +58,18 @@ def score_fincat(txt):
|
|
58 |
context_text = extract_context_words(x)
|
59 |
features = bert_embedding_extract(context_text, word)
|
60 |
if(features[0]=='None'):
|
61 |
-
|
62 |
-
|
|
|
63 |
prediction = lr_clf.predict(features.reshape(1, 768))
|
64 |
prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
|
65 |
highlight.append((word, ' In-claim' if prediction==1 else 'Out-of-Claim'))
|
66 |
# li.append([word,' In-claim' if prediction==1 else 'Out-of-Claim', prediction_probability])
|
67 |
else:
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
return highlight
|
73 |
|
74 |
|
|
|
58 |
context_text = extract_context_words(x)
|
59 |
features = bert_embedding_extract(context_text, word)
|
60 |
if(features[0]=='None'):
|
61 |
+
continue
|
62 |
+
#highlight.append((txt, ' '))
|
63 |
+
#return highlight
|
64 |
prediction = lr_clf.predict(features.reshape(1, 768))
|
65 |
prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
|
66 |
highlight.append((word, ' In-claim' if prediction==1 else 'Out-of-Claim'))
|
67 |
# li.append([word,' In-claim' if prediction==1 else 'Out-of-Claim', prediction_probability])
|
68 |
else:
|
69 |
+
continue
|
70 |
+
# highlight.append((word, ' '))
|
71 |
+
if(len(highlight)<1):
|
72 |
+
highlight.append((txt,' '))
|
73 |
return highlight
|
74 |
|
75 |
|