例如,我想将出生"转换为出生",因为使用Wordnet相似性时,该算法无法显示出生"和出生"非常相似.因此,我想将出生转变为出生,反之亦然.为了有更多相似的单词.您有什么建议?我找到了一些工具,但不确定它们是否可以这样做: -NTLK(我猜只有python) -OpenNlp -斯坦福大学 -简单的NLG 谢谢解决方案使用wordnet的快速而肮脏的解决方案如下所示.>>>from ntlk.corpus import wordnet as wn>>> wn.synsets('born')[Synset('born.n.01'), Synset('bear.v.01'), Synset('give_birth.v.01'), Synset('digest.v.03'), Synset('bear.v.04'), Synset('bear.v.05'), Synset('bear.v.06'), Synset('hold.v.11'), Synset('yield.v.10'), Synset('wear.v.02'), Synset('behave.v.02'), Synset('bear.v.11'), Synset('hold.v.14'), Synset('have_a_bun_in_the_oven.v.01'), Synset('born.a.01'), Synset('natural.s.09')]>>> wn.synsets('birth')[Synset('birth.n.01'), Synset('birth.n.02'), Synset('parturition.n.01'), Synset('parentage.n.02'), Synset('birth.n.05'), Synset('give_birth.v.01')]>>>在这里您可以看到"Synset('give_birth.v.01')]"是常见的结果集,即动词".这样,您就可以找到解决方法,看看是否有任何匹配的结果,然后将出生转换为出生,反之亦然!Is it possible to hava a Java alternative to NLTK in order to 'verbify' words as can be seen in this question?Convert words between verb/noun/adjective formsFor example I would like to convert born to birth, since when using Wordnet Similarity, the algorithm does not show that born and birth are very similar.I would like to therefore convert either born to birth or vice versa. In order to have much more similar words.What do you suggest? I found some tools but I'm not sure if they can do this: - NTLK (only python I guess) - OpenNlp - Stanford-Nlp - Simple NLGThank you 解决方案 A quick and dirty solution using wordnet can be like following.>>>from ntlk.corpus import wordnet as wn>>> wn.synsets('born')[Synset('born.n.01'), Synset('bear.v.01'), Synset('give_birth.v.01'), Synset('digest.v.03'), Synset('bear.v.04'), Synset('bear.v.05'), Synset('bear.v.06'), Synset('hold.v.11'), Synset('yield.v.10'), Synset('wear.v.02'), Synset('behave.v.02'), Synset('bear.v.11'), Synset('hold.v.14'), Synset('have_a_bun_in_the_oven.v.01'), Synset('born.a.01'), Synset('natural.s.09')]>>> wn.synsets('birth')[Synset('birth.n.01'), Synset('birth.n.02'), Synset('parturition.n.01'), Synset('parentage.n.02'), Synset('birth.n.05'), Synset('give_birth.v.01')]>>>Here you can see that " Synset('give_birth.v.01')] " is a common result set which is "verb". So in this way you can find work around and see if there is any matching result, and convert born to birth or vice versa! 这篇关于将单词转换为Java中的名词/形容词/动词形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-09 23:30