未验证 提交 20b8873c 编写于 作者: 王肖 提交者: GitHub

Update match.py

上级 ec4b3b89
...@@ -182,7 +182,7 @@ class Match(Head): ...@@ -182,7 +182,7 @@ class Match(Head):
label = np.argmax(np.array(self._preds[i])) label = np.argmax(np.array(self._preds[i]))
result = {'index': i, 'label': label, 'logits': self._preds_logits[i], 'probs': self._preds[i]} result = {'index': i, 'label': label, 'logits': self._preds_logits[i], 'probs': self._preds[i]}
elif self._learning_strategy == 'pairwise': elif self._learning_strategy == 'pairwise':
result = {'index': i, 'label': label, 'probs': self._preds[i][0]} result = {'index': i, 'probs': self._preds[i][0]}
result = json.dumps(result, ensure_ascii=False) result = json.dumps(result, ensure_ascii=False)
writer.write(result+'\n') writer.write(result+'\n')
print('Predictions saved at '+os.path.join(output_dir, 'predictions.json')) print('Predictions saved at '+os.path.join(output_dir, 'predictions.json'))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册