Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
theblackcat102 committed Apr 12, 2022
1 parent f2279fa commit a5c78a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extractnet/nn_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def decode_output(self, logits, doc_blocks):
top_k = 10
scores = softmax([preds[:, idx]])[0]
ind = np.argpartition(preds[:, idx], -top_k)[-top_k:]
result = [ (fix_encoding(str_cast(blocks[idx].text), scores[idx])) for idx in ind if scores[idx] > self.cls_threshold]
result = [ (fix_encoding(str_cast(blocks[idx].text)), scores[idx]) for idx in ind if scores[idx] > self.cls_threshold]
# sort values by confidence
output[label] = sorted(result, key=lambda x:x[1], reverse=True)
else:
Expand Down

0 comments on commit a5c78a5

Please sign in to comment.