【问题标题】:Word Sense Disambiguation using WordNet.Net使用 WordNet.Net 进行词义消歧
【发布时间】:2011-10-13 23:41:45
【问题描述】:

作为一个更大项目的一部分,我需要做一些词义消歧,我遇到了WordNet.Net 我尝试使用下载的WordsMatching项目附带的wordsensedisambiguator类,这是我的代码

        string sent = "We have investigated the inductions of the IE genes in response to calcium signals in Jurkat cells (in the presence of activated p21(ras)) and their correlated consequences.";
        Tokeniser tok = new Tokeniser();
        tok.UseStemming = true;
        string[] words = tok.Partition(sent);

        if (words.Length == 0) return null;

        MyWordInfo[] wordInfos = new MyWordInfo[words.Length];

        for (int i = 0; i < words.Length; i++)
        {

            WnLexicon.WordInfo wordInfo = WnLexicon.Lexicon.FindWordInfo(words[i], true);

            if (wordInfo.partOfSpeech != Wnlib.PartsOfSpeech.Unknown && wordInfo.text != string.Empty)
            {

                words[i] = wordInfo.text;

                Wnlib.PartsOfSpeech[] posEnum = (Wnlib.PartsOfSpeech[])Enum.GetValues(typeof(Wnlib.PartsOfSpeech));

                for (int j = 0; j < posEnum.Length; j++)
                {
                    if (wordInfo.senseCounts[j] > 0) // get the first part of speech
                    {
                        wordInfos[i] = new MyWordInfo(words[i], posEnum[j]);
                        break;
                    }
                }
            }
        }

        WordSenseDisambiguator wsd = new WordSenseDisambiguator();
        wordInfos = wsd.Disambiguate(wordInfos);

当我查看结果时,每个单词的 Sense 仍然是 '0' :( 之前有人用过这个,或者任何人都知道如何使用 WordSenseDisambiguator? 感谢您期待您的快速回复:)

【问题讨论】:

    标签: nlp wordnet word-sense-disambiguation


    【解决方案1】:

    您可能想尝试 WordNet::SenseRelate::AllWords,它使用 WordNet 对所有单词进行歧义感知。

    http://senserelate.sourceforge.net

    通过网络界面尝试一下

    http://marimba.d.umn.edu

    【讨论】:

    • 网页界面显示cannot connect to server 127.0.0.1:32323 (Connection refused)。是否有其他服务器托管它?
    猜你喜欢
    • 2015-01-08
    • 2014-08-11
    • 2015-04-20
    • 2017-09-25
    • 2011-04-11
    • 2013-04-03
    • 2015-02-09
    • 2020-11-30
    • 1970-01-01
    相关资源
    最近更新 更多