Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问,如果想输出每个标签对应的score,应该怎么修改呢 #20

Open
chentutu opened this issue Apr 8, 2020 · 2 comments

Comments

@chentutu
Copy link

chentutu commented Apr 8, 2020

No description provided.

@lc222
Copy link

lc222 commented Jul 21, 2020

我现在也遇到这个问题,请问解决了吗

@LeoWood
Copy link

LeoWood commented Jul 22, 2020

修改bert_base安装目录中的..\Lib\site-packages\bert_base\server_init_.py文件:
line 465:
return EstimatorSpec(mode=mode, predictions={ 'client_id': features['client_id'], 'encodes': tf.argmax(pred_probs[0], axis=-1), 'score': tf.reduce_max(pred_probs[0], axis=-1) })
修改为:
return EstimatorSpec(mode=mode, predictions={ 'client_id': features['client_id'], 'encodes': pred_probs[0], 'score': pred_probs[0] })
line 515:
pred_label_result = [self.id2label.get(x, -1) for x in r['encodes']]
修改为:
pred_label_result = r['encodes'].tolist()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants