Python NLTK中的形容词名词化

Python NLTK中的形容词名词化,第1张

概述有没有办法使用NLTK获得Wordnet形容词标称化?例如,对于“快乐”,期望的输出将是“快乐”.我试图四处搜寻,但找不到任何东西.谢谢!最佳答案快速而肮脏的答案是wordnet does this already: <adj.all>S: (adj) happy (enjoying or showing or marked by jo

有没有办法使用NLTK获得Wordnet形容词标称化?
例如,对于“快乐”,期望的输出将是“快乐”.

我试图四处搜寻,但找不到任何东西.

谢谢!

最佳答案快速而肮脏的答案是wordnet does this already:

“a happy smile”; “spent many happy
days on the beach”; “a happy marriage”

attribute well-being characterized by emotions
ranging from contentment to intense
joy) in a state of well-being)derivationally related form of well-being characterized by
emotions ranging from contentment to
intense joy) (emotions experIEnced when in a state
of well-being)

剩下的问题是如何以编程方式执行此 *** 作(无需网络抓取).

添加:

wordnet库包装器工具非常强大,它展示了C库接口的广度:

$wn happyNo information available for noun happyNo information available for verb happyinformation available for adj happy    -antsa      Antonyms    -synsa      Synonyms (ordered by estimated frequency)    -attra      Attributes    -deria      Derived Forms    -famla      Familiarity & polysemy Count    -grepa      List of Compound Words    -over       OvervIEw of Senses$wn happy -deria -n1Derived Forms of adj happySense 1happy (vs. unhappy)       RELATED TO->(noun) happiness#1           => happiness,felicity       RELATED TO->(noun) happiness#2           => happiness

所以,从Python的角度来说,你可以对wn命令进行子处理,这有点邋or,或者使用已经内置到NLTK中的wordnet工具.

在ubuntu(可能是debian)上,wordnet库和工具可以方便地使用:

sudo apt-get install wordnet wordnet-dev

唉:

$wn pythonicNo information available for pythonic
总结

以上是内存溢出为你收集整理的Python NLTK中的形容词名词化全部内容,希望文章能够帮你解决Python NLTK中的形容词名词化所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1205865.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存