Устранение неоднозначности слов в WordNet.Net
Мне нужно устранить двусмысленность слов в рамках более крупного проекта, и я наткнулся на WordNet.Net. Я попытался использовать класс wordsensedisambiguator, который поставляется вместе с проектом WordsMatching, здесь мой код
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);
Когда я просматриваю результаты, смысл каждого слова по-прежнему равен 0:(Если кто-то использовал это раньше или кто-нибудь может понять, как работает WordSenseDisambiguator? Спасибо в ожидании ваших ускоренных ответов:)
1 ответ
Решение
Возможно, вы захотите попробовать WordNet::SenseRelate::AllWords, который все слова воспринимают как разметку, используя WordNet.
http://senserelate.sourceforge.net/
Попробуйте это через веб-интерфейс на