HanLP icon indicating copy to clipboard operation
HanLP copied to clipboard

python 無法使用 HanLP.Config.ShowTermNature

Open yesseecity opened this issue 9 years ago • 1 comments

  • 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時,少動用全域設定會比較好

yesseecity avatar Mar 14 '17 03:03 yesseecity

  1. Config = JClass('com.hankcs.hanlp.HanLP$Config') print(Config.ShowTermNature)
  2. 因为分词与词性标注严格上讲是两个任务,而CRFSegment只是个字标注分词模型而已。
  3. 这样会要求每个term都具备一个配置变量或父分词器的指针,内存上有点划不来

hankcs avatar Mar 20 '17 01:03 hankcs