HanLP
HanLP copied to clipboard
python 無法使用 HanLP.Config.ShowTermNature
- python 2.7 所顯示的 error 如下 AttributeError: type object 'com.hankcs.hanlp.HanLP' has no attribute 'Config'
其他問題
-
CRFSegment 在.enableCustomDictionary(False) 所有的POStag 會變成
/null在 DemoCRFSegment.java 中 把 30行的HanLP.Config.ShowTermNature = false; // 关闭词性显示註解後就會發現這個問題 -
CRFSegment 在.enablePartOfSpeechTagging(False) 無效 我認為,要停用POSTag時,各個分詞器用自己的設定會比較直覺一些,在弄成 web API時,少動用全域設定會比較好
- Config = JClass('com.hankcs.hanlp.HanLP$Config') print(Config.ShowTermNature)
- 因为分词与词性标注严格上讲是两个任务,而CRFSegment只是个字标注分词模型而已。
- 这样会要求每个term都具备一个配置变量或父分词器的指针,内存上有点划不来