你如何提取某个单词的各种含义

时间:2013-07-10 05:32:49

标签: nlp opennlp disambiguation word-sense-disambiguation

鉴于“暴力”作为输入,有可能提出一个人如何解释暴力(例如身体暴力,书籍,专辑,音乐团体......),如参考文献1中所述。

假设用户意味着相册,那么从一组推文中查找暴力作为专辑的最佳方法是什么。

有没有办法通过任何一个NLP API来说明OpenNLP。

参考#1

violence/N1 - intentional harmful physical action.
violence/N2 - the property of being wild or turbulent.
Violence/N6 - a book from Neil L. Whitehead; nonfiction
Violence/N7 - an album by The Last Resort
Violence/N8 - Violence is the third album by the Washington-based Alternative metal music group Nothingface.
Violence/N9 - a musical group which produced the albums Eternal Nightmare and Nothing to Gain
Violence/N10 - a song by Aesthetic Perfection, Angel Witch, Arsenic, Beth Torbert, Brigada Flores Magon, etc on the albums A Natural Disaster, Adult Themes for Voice, I Bificus, Retribution, S.D.E., etc
Violence/N11 - an album by Bombardier, Dark Quarterer and Invisible Limits
Violence/N12 - a song by CharlElie Couture, EsprieM, Fraebbblarnir, Ian Hunter, Implant, etc on the albums All the Young Dudes, Broke, No Regrets, Power of Limits, Repercussions, etc
Violence/N18 - Violence: The Roleplaying Game of Egregious and Repulsive Bloodshed is a short, 32-page roleplaying game written by Greg Costikyan under the pseudonym "Designer X" and published by Hogshead Publishing as part of its New Style line of games.
Violence/N42 - Violence (1947) is an American drama film noir directed by Jack Bernhard.

5 个答案:

答案 0 :(得分:2)

对于这个问题,纯自动推理通常有点难。

相反,我们可能会使用:

  • WordNet等资源或语义词典。 对于英语以外的语言,您可以查看eurowordnet(非免费)数据集。

  • 为了获得更多意义(即专辑意义),我们处理一些管理良好的资源,如维基百科。维基百科作为很多元信息,对于这种处理非常有用。

  • 只需将最大数量的数据源与正确处理的数据源与专业程序相结合,即可实现流程的可靠性。

  • 作为最后的手段,您可以尝试手工处理/注释。漫长而昂贵,但在企业环境中非常有用,您只需要一小部分语言。

这里没有免费午餐。

答案 1 :(得分:1)

如果您正在使用python中的英语NLP,那么您可以尝试使用wordnet API:

from nltk.corpus import wordnet as wn
query = 'violence'
for ss in wn.synsets(query):
  print query, str(ss.offset).zfill(8)+'-'+ss.pos, ss.definition

如果您正在使用其他人类语言,也许您可​​以查看http://casta-net.jp/~kuribayashi/multi/

中提供的开放字网

注意:str(ss.offset).zfill(8)+'-'+ss.pos的原因,因为它被用作特定单词的每个sense的唯一ID。对于每种语言,这个id在开放的wordnet中是一致的。前8个数字给出了id和破折号之后的字符是感觉的词性。

答案 2 :(得分:1)

查看此内容:来自Idilia的Twitter Filtering Demo。它通过首先分析一段文本来发现其单词的含义,然后过滤包含您正在寻找的意义的文本,从而完全符合您的要求。它可以作为API使用。

免责声明:我为Idilia工作。

答案 3 :(得分:0)

您可以提取所有上下文中出现的“暴力”(上下文可以是整个文档,或者说50个单词的窗口),然后将它们转换为要素(使用单词包),然后对这些要素进行聚类。由于群集无人监管,因此您不会拥有群集的名称,但可以使用某些典型的上下文对其进行标记。

然后,您需要查看查询中的哪个群集“暴力”属于。基于查询中充当上下文的其他单词或明确询问(您是指“......”或“......”中的暴力)

答案 4 :(得分:0)

这将是非常困难的,因为专有名词使用“暴力”一词将非常罕见地作为所有单词的一部分,并且它们的频率分布可能在某种程度上高度倾斜。我们几乎在任何时候想要做某种形式的命名实体消歧时遇到这些问题。

我所知道的工具不会为你做这件事,所以你将建立自己的分类器。使用维基百科作为K先生建议的培训资源可能是您最好的选择。