2013-07-10 77 views
2

以「暴力」作爲輸入,可以提出一個人如何解釋暴力(如身體暴力,書籍,專輯,音樂團體等)如下面參考文獻1中所述。如何提取某個詞的各種含義

假設如果用戶意味着一個專輯,這將是尋找暴力從一組鳴叫的專輯的最好方式。

有沒有辦法通過任何的NLP API(S)說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. 

回答

2

純自動推理是有點硬,一般這個問題。

相反,我們可以使用:

  • 資源,如共發現或語義解釋。 對於英語以外的語言,您可以查看eurowordnet(非自由)數據集。

  • 爲了獲得更多的含義(即,對於這張專輯的意義上)我們處理像維基百科一些很好的管理資源。維基百科作爲大量的元信息,對於這種處理非常有用。

  • 該方法的可靠性是通過組合數據源的最大數量,並正確地處理它們,以專門方案只是實現。

  • 作爲最後的手段,您可以嘗試手動處理/註釋。長而昂貴,但對於只需要一小部分語言的企業環境非常有用。

這裏沒有免費的午餐。

0

您可以提取所有上下文「暴力」的發生(上下文可以是一個完整的文檔,或一個窗口說50個字),然後將其轉換爲功能(使用說文字包),然後聚集這些功能。由於羣集不受監督,因此您不會爲羣集指定名稱,但可以使用一些典型的上下文標記它們。

然後,您需要查看查詢中屬於哪個集羣「暴力」。無論是基於查詢換句話說充當上下文或要求明確(你指的是暴力,如「......」或在「......」)

0

這是由於非常困難事實上,專有名詞使用「暴力」這個詞將是非常罕見的,因爲所有單詞的比例及其頻率分佈可能以某種方式嚴重偏斜。幾乎每次我們想要做某種形式的命名實體消歧時,我們都會遇到這些問題。

沒有工具我知道會爲你做這個,所以你會建立你自己的分類器。 K先生建議使用維基百科作爲培訓資源可能是您最好的選擇。

1

如果你在英語NLP在python工作,那麼你可以嘗試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在每種語言的開放字網中都是一致的。前8位數字給出了id和字符之後的字符是感覺的詞性。

1

查看:Twitter Filtering Demo來自Idilia。它通過首先分析一段文字來發現其詞語的含義,然後過濾包含您正在尋找的意義的文本,從而完全實現您想要的效果。它可用作API。

聲明:我爲Idilia工作。