Shredder commited on
Commit
9b4cc04
1 Parent(s): a826f4e

Update score_fincat.py

Browse files
Files changed (1) hide show
  1. score_fincat.py +4 -3
score_fincat.py CHANGED
@@ -23,11 +23,12 @@ def score_fincat(txt):
23
  context_text = extract_context_words(x)
24
  features = bert_embedding_extract(context_text, word)
25
  if(features[0]=='None'):
26
- highlight.append((txt, ' '))
27
- return highlight
28
  prediction = lr_clf.predict(features.reshape(1, 768))
29
  prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
30
  highlight.append((word, ' In-claim' if prediction==1 else 'Out-of-Claim'))
31
  else:
32
- highlight.append((word, ' '))
 
 
33
  return highlight
23
  context_text = extract_context_words(x)
24
  features = bert_embedding_extract(context_text, word)
25
  if(features[0]=='None'):
26
+ continue
 
27
  prediction = lr_clf.predict(features.reshape(1, 768))
28
  prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
29
  highlight.append((word, ' In-claim' if prediction==1 else 'Out-of-Claim'))
30
  else:
31
+ continue
32
+ if(len(highlight)<1):
33
+ highlight.append((txt,'None'))
34
  return highlight