在斯坦福解析器中查找名词和动词 [英] finding noun and verb in stanford parser

查看:95
本文介绍了在斯坦福解析器中查找名词和动词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到一个单词是动词还是名词,或者两者都是

I need to find whether a word is verb or noun or it is both

例如,单词"search"既可以是名词,也可以是动词,但斯坦福解析器为其提供了NN标签.

For example, the word is "search" it can be both noun and a verb but stanford parser gives NN tag to it..

斯坦福解析器有没有办法使搜索"既是名词又是动词?

is there any way that stanford parser will give that "search" is both noun and verb?

我现在使用的代码

public static String Lemmatize(String word) {
    WordTag w = new WordTag(word);
    w.setTag(POSTagWord(word));
    Morphology m = new Morphology();
    WordLemmaTag wT = m.lemmatize(w);

    return wT.lemma();
}

还是我应该使用其他任何软件来做到这一点?请建议我 预先感谢

or should i use any other software to do it? please suggest me thanks in advance

推荐答案

Stanford Parser根据上下文统计信息猜测单词的词性标记.您应该真正输入完整的句子,以确定该句子中的搜索"是名词还是动词.

The Stanford Parser guesses the part-of-speech tag of a word based on context statistics. You should really pass in a complete sentence to determine whether, in that sentence, "search" is a noun or a verb.

您不需要完整的解析器即可获取词性标签. Stanford POS Tagger 就足够了;它也包含Morphology类,但它也考虑了上下文.

You don't need a full parser just to get part-of-speech tags. The Stanford POS Tagger is enough; it also includes the Morphology class, but it too takes context into account.

如果您想在不给出上下文的情况下使用英语单词使用的 all 所有词性标签,则 WordNet 可能是一个更好的选择.它具有多个Java接口,包括 JWNL JWI .

If you want all part-of-speech tags that an English word can take on, without giving context, then WordNet is probably a better choice. It has several Java interfaces, including JWNL and JWI.

这篇关于在斯坦福解析器中查找名词和动词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆