2010-11-01 5 views
2

Existe-t-il une API pour obtenir la catégorie d'un mot? par exemple,Obtenir une catégorie de mots

word: "joke"; caetgory (retrieved from API) : "Entertainment", 
word: "united states"; category(retrieved from API): "countries" 
word:"jay leno"; category"celebrities(retrieved from API)", 
and so on... 

Répondre

2

Catégorisation est toujours très subjective. Si vous souhaitez utiliser des appproaches courants, essayez Wordnet (http://wordnet.princeton.edu/). Il est utilisé par la plupart des travailleurs dans le traitement du langage naturel. Voici un exemple

dog, domestic dog, Canis familiaris 
    => canine, canid 
     => carnivore 
     => placental, placental mammal, eutherian, eutherian mammal 
      => mammal 
      => vertebrate, craniate 
       => chordate 
       => animal, animate being, beast, brute, creature, fauna 

Voici ce que vous obtenez pour « blague »

# S: (n) joke, gag, laugh, jest, jape (a humorous anecdote or remark intended to provoke laughter) "he told a very funny joke"; "he knows a million gags"; "thanks for the laugh"; "he laughed unpleasantly at his own jest"; "even a schoolboy's jape is supposed to have some ascertainable point" 

    * direct hyponym/full hyponym 
    * part meronym 
    * direct hypernym/inherited hypernym/sister term 
      o S: (n) wit, humor, humour, witticism, wittiness 
        (a message whose ingenuity or verbal skill or 
        incongruity has the power to evoke laughter) 

Notez que « hypernym » est un terme plus large et peut être utilisé en tant que catégorie.

Pour les gens que vous pouvez essayer Wikipedia et gratter l'infobox (pas très amusant - j'ai passé beaucoup de temps à le faire). Mieux vaut essayer DBPedia.

Voici le Infobox Wikipedia pour Jay Leno:

JayLenoJul08.jpg 
Leno in July 2008 
Birth name James Douglas Muir Leno 
Born April 28, 1950 (1950-04-28) (age 60)[1] 
New Rochelle, New York, U.S.[1] 
Medium Television 
Nationality  American 
Years active 1973–present 
Genres Observational comedy 
Subject(s) Everyday life, American culture 
Influences Johnny Carson, Robert Klein, Alan King, George Carlin, Don Rickles, Bob Newhart, Rodney Dangerfield 
Influenced Dennis Miller[2] 
Spouse Mavis Leno (1980–present) 
Notable works and roles  The Tonight Show with Jay Leno (host, 1992–2009) 
The Jay Leno Show 
(host, 2009–2010) 
The Tonight Show with Jay Leno (host, 2010–) 
Signature Jay Leno Autograph.svg 
Website  The Tonight Show with Jay Leno 
Emmy Awards 
Outstanding Variety, Music or Comedy Series 
1995 The Tonight Show with Jay Leno 

Je ne sais pas si cela a été capturé pour DBPedia. Si oui, vous obtiendrez une bonne catégorisation

+0

Merci! C'est très utile. Cependant, cela ne fonctionne que pour les mots anglais dans le dictionnaire. Pas pour des noms tels que Jay Leno bien sûr :) – Joel

+0

@Joel voir mon addition sur DBPedia –

Questions connexes