用nltk块 [英] Chunking with nltk
本文介绍了用nltk块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从给定模式的句子中获取所有块. 例子
How can I obtain all the chunk from a sentence given a pattern. Exemple
NP:{<NN><NN>}
标记为句子的
[("money", "NN"), ("market", "NN") ("fund", "NN")]
如果我解析,我会得到
(S (NP money/NN market/NN) fund/NN)
我还要另一个替代方法
(S money/NN (NP market/NN fund/NN))
推荐答案
我认为您的问题是关于获取n
最有可能的句子解析的问题.我对吗?如果是,请参见 2.0文档中的nbest_parse(sent, n=None)
函数.
I think your question is about getting the n
most likely parses of a sentence. Am I right? If yes, see the nbest_parse(sent, n=None)
function in the 2.0 documentation.
这篇关于用nltk块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文