Comments (11)
https://github.com/hankcs/HanLP/releases 最新的都会发布在这里。
from hanlp.
目前运行CRFModelTest时会报找不到CRFSegmentModel.txt的error。可能我没表述清楚,有没有可以下载CRFSegmentModel.txt这个模型的链接?
from hanlp.
代码库中好像没有CRFModelTest这个类,请给出完整路径。
CRFSegmentModel.txt是CRF++训练出来的文本模型,转成bin之后就删掉了。
from hanlp.
是没有这个类,只是想表达测试CRF模型这个意思,让你受干扰了,我把错误给你贴一下吧哈
八月 17, 2015 10:06:52 上午 com.hankcs.hanlp.model.CRFSegmentModel
严重: CRF分词模型加载 D:/JavaProjects/HanLP/data/model/segment/CRFSegmentModel.txt 失败,耗时 941 ms
from hanlp.
哦,明白了。
你想自己加载CRF分词模型,于是用了 new CRFSegmentModel 。但是在设计上CRFSegmentModel 是个静态包装类,默认加载data/model/segment/CRFSegmentModel.txt,如果存在data/model/segment/CRFSegmentModel.txt.bin则优先加载bin,否则加载txt,连txt都没有则终止加载。
正确的加载方式是
String path = HanLP.Config.CRFSegmentModelPath + Predefine.BIN_EXT;
CRFModel model = new CRFModel(new BinTrie<FeatureFunction>());
model.load(ByteArray.createByteArray(path));
Table table = new Table();
String text = "人民生活进一步改善了";
table.v = new String[text.length()][2];
for (int i = 0; i < text.length(); i++)
{
table.v[i][0] = String.valueOf(text.charAt(i));
}
model.tag(table);
System.out.println(table);
from hanlp.
哦,谢谢了。git上给的例子就是直接new CRFSegmentModel,我也没太仔细看哈。
from hanlp.
不客气,不过至少在当前版本,没有创建过CRFSegmentModel的实例。
from hanlp.
我用v1.2.4发布的jar包,用你给的加载方式还是会有错误。
at com.hankcs.hanlp.model.crf.CRFModel.tag(CRFModel.java:185)
at com.hankcs.demo.DemoCRFSegment.main(DemoCRFSegment.java:75)
75行是model.tag(table);
同时也没看到data/model/segment/CRFSegmentModel.txt.bin这个文件。
from hanlp.
请自己下载data,解压配置路径。
from hanlp.
请问这个警告: 读取data/model/segment/CRFSegmentModel.txt.bin时发生异常java.io.FileNotFoundException: data\model\segment\CRFSegmentModel.txt.bin (系统找不到指定的路径。)这个模型是要自己去跑,还是单独要在vs上跑完集成过来
from hanlp.
已废弃CRFSegment,请使用功能更丰富、设计更优雅的CRFLexicalAnalyzer
from hanlp.
Related Issues (20)
- Failed to load https://file.hankcs.com/hanlp/dep/pmt_dep_electra_small_20220218_134518.zip HOT 2
- TransformerNamedEntityRecognizerTF 无法识别data的max_seq_length HOT 3
- pip install hanlp failed HOT 4
- " unpack (expected 4, got 3)" from HanLP(['XXXXX']) 运行错误 HOT 1
- 索引与查找使用相同的analyzer,结果无法命中 HOT 4
- 无法下载CTB9_POS_ELECTRA_SMALL_TF HOT 2
- 解析失败,提示升级hanlp HOT 1
- 依存分析的模型要么下载不了,要么刚开始下载非常慢,然后就下不了了(dep的四个模型都是) HOT 1
- No module named 'hanlp.datasets.parsing.ctb'
- 中文名包含多音字时生成的拼音只有一个,例如 ‘李娜’ 生成拼音为 ‘Li Nuo’ HOT 1
- 执行open_small.py时报'utf-8' codec can't decode byte 0xb4 in position 0: invalid start byte HOT 1
- ================================ERROR LOG BEGINS================================ HOT 1
- When I runing the example occurred error HOT 1
- Add a custom dictionary type that supports spaces HOT 3
- Smatch provide wrong and random scores HOT 2
- portable 1.8.4的更新 请尽快推到portable分支 现在分支上还是1.8.3
- 中文分词(粗分)错误:New in version 3.3. HOT 1
- 中文分词错误:左右捕盜廳以『邪學罪人安敦伊、吳伯多祿、閔유아욱가、黃錫斗、張周基,押付公忠水營,梟警』啓。 HOT 5
- NER模型加载问题 HOT 1
- cpu docker部署安装依赖cuda环境 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hanlp.