简体   繁体   English

使用nltk和python的代码

[英]code using nltk and python

我想要一个使用NLTK和Python在给定句子或文本中标记成语的代码。

Depends what you mean by an "idiom". 取决于您所说的“成语”。 Joe's suggestion of POS tagging is probably a good start - and might be what you are really after. Joe提出的POS标记建议可能是一个不错的开始-可能正是您真正想要的。 If so, go read "Natural Language Processing with Python" by Bird et al. 如果是这样,请阅读Bird等人的“使用Python进行自然语言处理”。 It is published by O'Reilly but is also available online under a Creative Commons license. 它由O'Reilly出版,但也可以通过知识共享许可在网上获得。 This will get you started with POS tagging. 这将使您开始使用POS标记。 It also has a good review of NLTK's abilities. 它还对NLTK的能力进行了很好的评估。 For example, can some "Named Entity Recognition" techniques be adapted to do what you want? 例如,是否可以将某些“命名实体识别”技术改编成您想要的功能? Or perhaps what you want is simply too difficult. 也许您想要的只是太难了。 I suspect the latter is the case (as implied by Rafi) but you will find that out in your journey. 我怀疑是后者(如Rafi所暗示),但您会在旅途中发现这一点。 Perhaps you'll develop something new during your journey, in which case I hope you give back to the NLTK community. 也许您会在旅途中开发出一些新东西,在这种情况下,我希望您能回馈NLTK社区。

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

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