Skip to content

Instantly share code, notes, and snippets.

@BrikerMan
Last active April 10, 2020 21:04
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save BrikerMan/efd8c95b0450fc73f387e0fc85ad7408 to your computer and use it in GitHub Desktop.
Save BrikerMan/efd8c95b0450fc73f387e0fc85ad7408 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RupertLuo
Copy link

你好,请问模型保存和载入的接口是什么啊?

@BrikerMan
Copy link
Author

你好,请问模型保存和载入的接口是什么啊?

请看这里 https://github.com/BrikerMan/Kashgari/

@ZhyiXu
Copy link

ZhyiXu commented Jul 23, 2019

请问如何指定GPU训练?

@BrikerMan
Copy link
Author

请问如何指定GPU训练?

只要安装 tensorflow-gpu 就可以,更多请看 https://github.com/BrikerMan/Kashgari/ 的文档

@weare1team
Copy link

请问训练好模型用怎么predict呢,具体的代码是什么

@BrikerMan
Copy link
Author

可以使用 predict 或者 predict_entities API, 文档路径:https://kashgari.bmio.net/api/tasks.labeling/#predict ,建议使用新版本。

@BrikerMan
Copy link
Author

出现错误:ZeroDivisionError: Weights sum to zero, can't be normalized是什么原因呢?

这个笔记本已经过期,请按照 https://kashgari.bmio.net 重新写一个测试。

@xmy7216
Copy link

xmy7216 commented Aug 13, 2019

您好 请问能不能使用自己的实体标签?

@BrikerMan
Copy link
Author

您好 请问能不能使用自己的实体标签?

可以的,请看这里 https://kashgari-zh.bmio.net/tutorial/text-labeling/#_2

@BrikerMan
Copy link
Author

谢谢,已经成功了,但是这个预测是不是很慢啊?我打印了下时间2457条数据预测时间花费了511秒,请问这正常吗?

BERT 预测就是慢,可以通过 GPU + TF-Serving 部署方式稍微提高一些。

@xmy7216
Copy link

xmy7216 commented Aug 15, 2019

您好 请问能不能使用自己的实体标签?

可以的,请看这里 https://kashgari-zh.bmio.net/tutorial/text-labeling/#_2

我想用自己的数据集,并且标注的也不是原来的PER等,也是自己定义的实体标签,数据格式一致后,不用指定实体标签有哪些,程序会自动识别有哪些实体标签是么?

@BrikerMan
Copy link
Author

对的,你可以指定自己的标签,程序会自动处理。可以参考这里

https://github.com/BrikerMan/Kashgari/blob/8831993ff32efd91ab1689b864f7037310670e84/tests/corpus.py#L61

@xmy7216
Copy link

xmy7216 commented Aug 15, 2019

对的,你可以指定自己的标签,程序会自动处理。可以参考这里

https://github.com/BrikerMan/Kashgari/blob/8831993ff32efd91ab1689b864f7037310670e84/tests/corpus.py#L61

好的,谢谢您啦,我先自己研究下,后面有问题了再请教您!再次感谢

@xmy7216
Copy link

xmy7216 commented Aug 19, 2019

对的,你可以指定自己的标签,程序会自动处理。可以参考这里

https://github.com/BrikerMan/Kashgari/blob/8831993ff32efd91ab1689b864f7037310670e84/tests/corpus.py#L61

您好,请问预测出现:(1)实体没有以‘’B-xx"开头,直接就是“I-xx”;(2)实体的多个字的“I-xxx”中间出现“O”截断;(3)实体以“B-labelA”开头,后面却出现“I-labelB”
不知道一般是由什么原因导致的呢?用的是BiLSTM_CRF_Model,为什么会出现这种情况呢?

@MaXXXXfeng
Copy link

你好,有一个简单的问题。 调动模型的fit方法,训练好模型后,如何保存模型呢?
以后做预测的时候是用 predict方法直接进行预测吗?

@BrikerMan
Copy link
Author

你好,有一个简单的问题。 调动模型的fit方法,训练好模型后,如何保存模型呢?
以后做预测的时候是用 predict方法直接进行预测吗?

是的,详细使用请参考 https://kashgari-zh.bmio.net

@hziheng
Copy link

hziheng commented Sep 25, 2019

你好,请问可以使用BMESO标注的数据吗,还是只能使用BIO标注的数据呢

@BrikerMan
Copy link
Author

BrikerMan commented Sep 25, 2019 via email

@hujukee
Copy link

hujukee commented Oct 12, 2019

请问在In [3]:中报错 timeout 可能是啥原因?谢谢

@steamfeifei
Copy link

可以选定多gpu训练吗

@steamfeifei
Copy link

tf2.0的版本bert+bilstm+crf出了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment