Shredder commited on
Commit
e9e58e0
1 Parent(s): f3c0dcb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- highlight.append((txt, ' '))
62
- return highlight
 
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
- highlight.append((word, ' '))
69
- #headers = ['numeral', 'prediction', 'probability']
70
- #dff = pd.DataFrame(li)
71
- # dff.columns = headers
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