Shredder commited on
Commit
e395983
1 Parent(s): 6c115d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -57,6 +57,10 @@ def score_fincat(txt):
57
  x = {'paragraph' : txt, 'offset_start':st, 'offset_end':ed}
58
  context_text = extract_context_words(x)
59
  features = bert_embedding_extract(context_text, word)
 
 
 
 
60
  prediction = lr_clf.predict(features.reshape(1, 768))
61
  prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
62
  highlight.append((word, ' In-claim' if prediction==1 else 'Out-of-Claim'))
 
57
  x = {'paragraph' : txt, 'offset_start':st, 'offset_end':ed}
58
  context_text = extract_context_words(x)
59
  features = bert_embedding_extract(context_text, word)
60
+ if(features[0]=='None'):
61
+ highlight.append(('None', ' '))
62
+ dff = pd.DataFrame(['None'])
63
+ return highlight, dff
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'))