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

使用crf++训练出来的model能否在crf4j下使用 #1

Open
boluo96 opened this issue May 24, 2018 · 4 comments
Open

使用crf++训练出来的model能否在crf4j下使用 #1

boluo96 opened this issue May 24, 2018 · 4 comments

Comments

@boluo96
Copy link

boluo96 commented May 24, 2018

使用crf++训练得到的文本格式的model,能否在本个项目(crf4j)下使用?谢谢~

@xesdiny
Copy link

xesdiny commented Jun 7, 2018

不行 。Author 使用的Java序列化对象构建的模型,只能用FeatureIndex实例的转码跟解码类对象解析

@zhifac
Copy link
Owner

zhifac commented Jun 27, 2018

更新了一下Readme,请看以下内容:

Notes
The binary model generated by CrfLearn is incompatible with crfpp, but the text model is. If you somehow want to reuse a crfpp model with crf4j, please generate a text model when you train with crfpp(add -t option), and then run java -cp crf4j.jar com.github.zhifac.crf4j.EncoderFeatureIndex <crfpp_text_model> <output_crf4j_binarymodel> to convert the crfpp text model to crf4j binary model. Or if you somehow can not retrain the same text model(e.g. missing train data), you can still convert an existing crfpp binary model to text model with modified version of crfpp from here.

@zhifac
Copy link
Owner

zhifac commented Jun 27, 2018

需要将textmodel转换为crf4j binarymodel

@linkxc
Copy link

linkxc commented May 31, 2019

我试了下把crf++的文本模型,转换成了crf4j的二进制模型能跑通,但是输出结果不一样,有人遇到过这种情况吗

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

4 participants