NP VP [0.9] S -> VP [0.1] VP -> V NP [0.5] VP -> V [0.1] VP -> V VP_V [0.3] VP -> V PP [0.1] NP -> NP NP [0.1] NP -> NP PP [0.2] NP -&g_nltk c++">
当前位置:   article > 正文

统计句法分析——用C++实现nltk.ViterbiParser_nltk c++

nltk c++

先上python使用封装好的包的代码和运行结果:

grammar3 = PCFG.fromstring("""
    S -> NP VP [0.9]
    S -> VP [0.1]
    VP -> V NP [0.5]
    VP -> V [0.1]
    VP -> V VP_V [0.3]
    VP -> V PP [0.1]
    NP -> NP NP [0.1]
    NP -> NP PP [0.2]
    NP -> N [0.7]
    PP -> P NP [1.0]

    N -> 'people' [0.5]
    N -> 'fish' [0.2]
    N -> 'tanks' 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/382094
推荐阅读
相关标签
  

闽ICP备14008679号