简体   繁体   English

python在nlp中解析语法树

[英]python parsing syntax tree in nlp

I wonder whether there is a convenient module for working with parse tree in python 我想知道是否有一个方便的模块可以在python中使用解析树

for example, this is a part of the parse tree 例如,这是解析树的一部分

(ROOT
          (S
          (NP
          (NP (NN sent1534))
          (: :)
          (NP (NNP Lancaster))
          (, ,)
          (NP
          (NP (DT a) (NN farming) (NN town))
          (PP (IN of)
          (NP (CD 3))))
          (, ,)
          (NP (CD 400))

I am interested in extracting the path on the tree from one specific word to another specific word, in addition it would be great two know whether two words share the same NP, VP, etc. 我有兴趣提取树上从一个特定单词到另一个特定单词的路径,此外,最好两个知道两个单词是否共享相同的NP,VP等。

If you know any good module for parsing parse tree, please let me know. 如果您知道任何用于解析语法分析树的好模块,请告诉我。

NLTK is the most popular package for parse trees. NLTK是用于解析树的最受欢迎的软件包。 See chapter 8 in the book . 参见本书第8章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM