-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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语料训练 ansj加载模型报错 #436
Comments
CRFppTxtModel.loadModel |
你要是测试过了..帮加上呗..commit下代码 |
好多地方都读不懂,等我明白了:) |
六月 07, 2017 5:46:15 下午 org.ansj.library.CrfLibrary error |
你好,按照https://github.com/NLPchina/ansj_seg/wiki/%E5%AE%9A%E5%88%B6%E4%BD%A0%E8%87%AA%E5%B7%B1%E7%9A%84CRF%E6%A8%A1%E5%9E%8B 链接定制了CRF模型
1、用的是swresult.txt语料
2、模板用的是
Unigram
U01:%x[-1,0]
U02:%x[0,0]
U03:%x[1,0]
U04:%x[-1,0]/%x[0,0]
U05:%x[0,0]/%x[1,0]
U06:%x[-1,0]/%x[1,0]
Bigram
B
3、最终训练出来了model和model.txt
用的是ansj 5.1.1版本来加载定制的模型
报错:
CRFppTxtModel crfppTxtModel=new CRFppTxtModel();
String path = "src/main/resources/model.txt";
CRFppTxtModel model = crfppTxtModel.loadModel(path);
System.out.println(new SplitWord(model).cut("结婚的和尚未结婚的"));
}
Exception in thread "main" java.lang.Exception: err tag named U in model null
at org.ansj.app.crf.model.CRFppTxtModel.loadTagCoven(CRFppTxtModel.java:256)
at org.ansj.app.crf.model.CRFppTxtModel.loadModel(CRFppTxtModel.java:57)
at org.ansj.app.crf.model.CRFppTxtModel.loadModel(CRFppTxtModel.java:39)
at org.ansj.app.crf.ModelTest.main(ModelTest.java:46)
这是什么原因?
谢谢了
The text was updated successfully, but these errors were encountered: