Extracting Lexical Semantic Knowledge from Wikipedia and Wiktionary
Total Page:16
File Type:pdf, Size:1020Kb
Extracting Lexical Semantic Knowledge from Wikipedia and Wiktionary Torsten Zesch and Christof Müller and Iryna Gurevych Ubiquitous Knowledge Processing Lab Computer Science Department Technische Universität Darmstadt, Hochschulstraße 10 D-64289 Darmstadt, Germany {zesch,mueller,gurevych} (at) tk.informatik.tu-darmstadt.de Abstract Recently, collaboratively constructed resources such as Wikipedia and Wiktionary have been discovered as valuable lexical semantic knowledge bases with a high potential in diverse Natural Language Processing (NLP) tasks. Collaborative knowledge bases however significantly differ from traditional linguistic knowledge bases in various respects, and this constitutes both an asset and an impediment for research in NLP. This paper addresses one such major impediment, namely the lack of suitable programmatic access mechanisms to the knowledge stored in these large semantic knowledge bases. We present two application programming interfaces for Wikipedia and Wiktionary which are especially designed for mining the rich lexical semantic information dispersed in the knowledge bases, and provide efficient and structured access to the available knowledge. As we believe them to be of general interest to the NLP community, we have made them freely available for research purposes. 1. Introduction with linguistic knowledge bases in Section 2. We review ex- Currently, the world wide web is undergoing a major isting mechanisms of accessing Wikipedia and Wiktionary change as more and more people are actively contributing in Section 3. In Section 4., we introduce the system archi- to the content available in the so called Web 2.0. Some of tecture that is used to provide structured access to the lexi- these rapidly growing web sites, e.g. Wikipedia (Wikime- cal semantic information contained in Wikipedia and Wik- dia Foundation, 2008a) or Wiktionary (Wikimedia Founda- tionary. In Section 5., we show how selected NLP tasks can tion, 2008b), have the potential to be used as a new kind benefit from the improved access capabilities provided by of lexical semantic resource due to their increasing size and the proposed APIs. We conclude with a summary in Sec- significant coverage of past and current developments. tion 6. In particular, the potential of Wikipedia as a lexical se- 2. Collaborative Knowledge Bases mantic knowledge base has recently started to get ex- Wikipedia and Wiktionary are instances of knowledge plored. It has been used in NLP tasks like text catego- bases that are collaboratively constructed by mainly non- rization (Gabrilovich and Markovitch, 2006), information professional volunteers on the web. We call such a knowl- extraction (Ruiz-Casado et al., 2005), information retrieval edge base Collaborative Knowledge Base (CKB), as op- (Gurevych et al., 2007), question answering (Ahn et al., posed to a Linguistic Knowledge Base (LKB) like Word- 2004), computing semantic relatedness (Zesch et al., 2007), Net (Fellbaum, 1998) or GermaNet (Kunze, 2004). In this or named entity recognition (Bunescu and Pasca, 2006). section, we briefly analyze the CKBs Wikipedia and Wik- Wiktionary has not yet been exploited for research pur- tionary as lexical semantic knowledge bases, and compare poses as extensively as Wikipedia. Interest has nonetheless them with traditionally used LKBs. already arisen, as it has recently been employed in areas like subjectivity and polarity classification (Chesley et al., 2.1. Wikipedia 2006), or diachronic phonology (Bouchard et al., 2007). Wikipedia is a multilingual, web-based, freely available en- All these tasks require reliable lexical semantic infor- cyclopedia, constructed in a collaborative effort of volun- mation which usually comes from linguistic knowledge tary contributors. It grows rapidly, and with approx 7.5 mil- bases like WordNet (Fellbaum, 1998) or GermaNet (Kunze, lion articles in more than 250 languages it has arguably be- 2004). They are usually shipped with easy-to-use appli- come the largest collection of freely available knowledge.3 1 cation programming interfaces (APIs), e.g. JWNL or Articles in Wikipedia form a heavily interlinked knowl- 2 GermaNetAPI , that allow for easy integration into applica- edge base, enriched with a category system emerging from tions. However, Wikipedia and Wiktionary have lacked this collaborative tagging, which constitutes a thesaurus (Voss, kind of support so far which constitutes a significant imped- 2006). Wikipedia thus contains a rich body of lexical iment for NLP research. Therefore, we developed general semantic information, whose aspects are thoroughly de- purpose, high performance Java-based APIs for Wikipedia scribed in (Zesch et al., 2007). This includes knowledge and Wiktionary that we made freely available to the re- about named entities, domain specific terms or domain spe- search community. cific word senses that is rarely available in LKBs. Addi- In this paper, we first describe Wikipedia and Wiktionary tionally, the redirect system of Wikipedia articles can be from a lexical semantic point of view, and compare them used as a dictionary for synonyms, spelling variations and abbreviations. 1 http://sourceforge.net/projects/jwordnet 2 3 http://projects.villa-bosch.de/nlpsoft/gn_api/index.html http://en.wikipedia.org/wiki/Wikipedia:Size_comparisons 1646 Language Rank Entries English Wiktionary German Wiktionary French 1 730,193 English German English German English 2 682,982 Entries 176,410 10,487 3,231 20,557 Vietnamese 3 225,380 Nouns 99,456 6,759 2,116 13,977 Turkish 4 185,603 Verbs 31,164 1,257 378 1,872 Russian 5 132,386 Adjectives 23,041 1,117 357 2,261 Ido 6 128,366 Examples 34,083 465 1,217 20,053 Chinese 7 115,318 Quotations 8,849 55 0 0 Greek 8 102,198 Categories 4,019 992 32 89 Arabic 9 95,020 Derived terms 43,903 944 2,319 36,259 Polish 10 85,494 Collocations 0 0 1,568 28,785 German 12 71,399 Synonyms 29,703 1,916 2,651 34,488 Spanish 20 31,652 Hyponyms 94 0 390 17,103 Hypernyms 42 0 336 17,286 Table 1: Size of Wiktionary language editions as of Febru- Antonyms 4,305 238 283 10,902 ary 29, 2008. Table 2: The number of entries and selected types of lex- ical semantic information available from the English and 2.2. Wiktionary German editions of Wiktionary as of September 2007. Wiktionary is a multilingual, web-based, freely available dictionary, thesaurus and phrase book, designed as the lex- ical companion to Wikipedia. It is also collaboratively con- mology, pronunciation, declension, examples, sample quo- structed by volunteers with no specialized qualifications tations, translations, collocations, derived terms, and usage necessary. notes. Lexically or semantically related terms of several Wiktionary targets common vocabulary and matters of lan- types like synonyms, antonyms, hypernyms and hyponyms guage and wordsmithing. It includes terms from all parts are included as well. On top of that, the English Wiktionary of speech, but excludes in-depth factual and encyclope- edition offers a remarkable amount of information not typi- dic information, as this kind of information is contained cally found in LKBs, including compounds, abbreviations, in Wikipedia.4 Thus, Wikipedia and Wiktionary are largely acronyms and initialisms, common misspellings (e.g. ba- complementary. sicly vs. basically), simplified spelling variants (e.g. thru vs. through), contractions (e.g. o’ vs. of ), proverbs (e.g. Languages and size Wiktionary consists of approx 3.5 no pain, no gain), disputed usage words (e.g. irregardless 5 million entries in 172 language editions. Unlike most vs. irrespective or regardless), protologisms (e.g. iPodian), LKBs each Wiktionary edition also contains entries for onomatopoeia (e.g. grr), or even colloquial, slang and pejo- foreign language terms. Therefore, each language edi- rative language forms. Most of these lexical semantic rela- tion comprises a multilingual dictionary with a substantial tions are explicitly encoded in the structure of a Wiktionary amount of entries in different languages (cf. Table 2). For entry. This stands in clear contrast to Wikipedia, where instance, the English Wiktionary contains the German entry links between articles usually lack clearly defined seman- Haus, which is explained in English as meaning house. tics. The size of a particular language edition of Wiktionary Different Wiktionary editions may include different types largely depends on how active the corresponding commu- of information; e.g. the German edition offers mnemonics, nity is (see Table 1). Surprisingly, the English edition while it currently does not contain quotations. The English (682,982 entries), started on December 12, 2002, is, though edition has no collocations and only very few instances of the oldest, not the largest one. The French Wiktionary hyponymy or hypernymy (see Table 2). Like in Wikipedia, (730,193 entries), which was launched over a year later, is each entry in Wiktionary is additionally connected to a list the largest. Other major languages like German (71,399 of categories. Finally, entries in Wiktionary are massively entries) or Spanish (31,652 entries) are not found among linked to other entries in different ways: they are intra- the top ten, while Ido, a constructed language, has the 6th linked, pointing to other entries in the same Wiktionary; largest edition of Wiktionary containing 128,366 entries. they are inter-linked, pointing to corresponding entries in Table 2 shows the number of English and German entries other language editions of Wiktionary; they also link to ex- in the corresponding Wiktionary editions. The English ternal knowledge bases such as Wikipedia and other web- Wiktionary edition exceeds the size of WordNet 3.0 with based dictionaries. 176,410 English entries as compared to 155,287 unique lexical units in WordNet. In contrast, the 20,557 German 2.3. Comparison with LKBs entries in the German Wiktionary edition are considerably Wikipedia and Wiktionary are instances of collabora- fewer than the 76,563 lexical units in GermaNet 5.0. tive knowledge bases (other examples are dmoz6 or Citi- Lexical semantic information Entries in Wiktionary are zendium7).