We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2279fa commit a5c78a5Copy full SHA for a5c78a5
extractnet/nn_models.py
@@ -69,7 +69,7 @@ def decode_output(self, logits, doc_blocks):
69
top_k = 10
70
scores = softmax([preds[:, idx]])[0]
71
ind = np.argpartition(preds[:, idx], -top_k)[-top_k:]
72
- 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]
73
# sort values by confidence
74
output[label] = sorted(result, key=lambda x:x[1], reverse=True)
75
else:
0 commit comments