BrikerMan/Kashgari

[Question] 如何输出 top k 结果或者概率

james-robinhood opened this issue · 2 comments

You must follow the issue template and provide as much information as possible. otherwise, this issue will be closed.
请按照 issue 模板要求填写信息。如果没有按照 issue 模板填写,将会忽略并关闭这个 issue

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

You can post pictures, but if specific text or code is required to reproduce the issue, please provide the text in a plain text format for easy copy/paste.

Environment

  • OS [e.g. Mac OS, Linux]: mac
  • Python Version:
  • requirements.txt:
[Paste requirements.txt file here]

Question

[A clear and concise description of what you want to know.]

我已经搭建了一个用了bert embedding的的 cnn_model做classification。请问如何可以像老版本一样predict top k结果。我尝试了直接叫:model.tf_model.predict([['test']]), 但是结果报错:
ValueError: Layer model_1 expects 2 input(s), but it received 1 input tensors. Inputs received: [<tf.Tensor 'IteratorGetNext:0' shape=(None, 1) dtype=string>]

这个功能确实缺失了,近期会补上。

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.