Multilingual WSD with Just a Few Lines of Code: the Babelnet API

Multilingual WSD with Just a Few Lines of Code: the Babelnet API

Multilingual WSD with Just a Few Lines of Code: the BabelNet API Roberto Navigli and Simone Paolo Ponzetto Dipartimento di Informatica Sapienza Universita` di Roma {navigli,ponzetto}@di.uniroma1.it Abstract the topic has explored the translation of sentences into many languages (Navigli and Ponzetto, 2010; In this paper we present an API for program- Lefever et al., 2011; Banea and Mihalcea, 2011), matic access to BabelNet – a wide-coverage as well as the projection of monolingual knowledge multilingual lexical knowledge base – and onto another language (Khapra et al., 2011). multilingual knowledge-rich Word Sense Dis- ambiguation (WSD). Our aim is to provide the In our research we focus on knowledge-based research community with easy-to-use tools to methods and tools for multilingual WSD, since perform multilingual lexical semantic analysis knowledge-rich WSD has been shown to achieve and foster further research in this direction. high performance across domains (Agirre et al., 2009; Navigli et al., 2011) and to compete with su- pervised methods on a variety of lexical disambigua- 1 Introduction tion tasks (Ponzetto and Navigli, 2010). Our vi- In recent years research in Natural Language Pro- sion of knowledge-rich multilingual WSD requires cessing (NLP) has been steadily moving towards two fundamental components: first, a wide-coverage multilingual processing: the availability of ever multilingual lexical knowledge base; second, tools growing amounts of text in different languages, in to effectively query, retrieve and exploit its informa- fact, has been a major driving force behind re- tion for disambiguation. Nevertheless, to date, no search on multilingual approaches, from morpho- integrated resources and tools exist that are freely syntactic (Das and Petrov, 2011) and syntactico- available to the research community on a multi- semantic (Peirsman and Pado,´ 2010) phenomena to lingual scale. Previous endeavors are either not high-end tasks like textual entailment (Mehdad et freely available (EuroWordNet (Vossen, 1998)), or al., 2011) and sentiment analysis (Lu et al., 2011). are only accessible via a Web interface (cf. the Mul- These research trends would seem to indicate the tilingual Research Repository (Atserias et al., 2004) time is ripe for developing methods capable of per- and MENTA (de Melo and Weikum, 2010)), thus forming semantic analysis of texts written in any providing no programmatic access. And this is de- language: however, this objective is still far from be- spite the fact that the availability of easy-to-use li- ing attained, as is demonstrated by research in a core braries for efficient information access is known to language understanding task such as Word Sense foster top-level research – cf. the widespread use of Disambiguation (Navigli, 2009, WSD) continuing to semantic similarity measures in NLP, thanks to the be focused primarily on English. While the lack of availability of WordNet::Similarity (Peder- resources has hampered the development of effec- sen et al., 2004). tive multilingual approaches to WSD, recently this With the present contribution we aim to fill this idea has been revamped with the organization of gap in multilingual tools, providing a multi-tiered SemEval tasks on cross-lingual WSD (Lefever and contribution consisting of (a) an Application Pro- Hoste, 2010) and cross-lingual lexical substitution gramming Interface (API) for efficiently accessing (Mihalcea et al., 2010). In addition, new research on the information available in BabelNet (Navigli and 67 Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics, pages 67–72, Jeju, Republic of Korea, 8-14 July 2012. c 2012 Association for Computational Linguistics bn:00008364n WIKIWN 08420278n 85 WN:EN:bank WIKI:EN:Bank WIKI:DE:Bank WIKI:IT:Banca WIKIRED:DE:Finanzinstitut WN:EN:banking_company WNTR:ES:banco WNTR:FR:societ´ e_bancaire´ WIKI:FR:Banque ... 35 1_7 2_3,4,9 6_8 ... 228 r bn:02945246n r bn:02854884n|FROM_IT @ bn:00034537n ... 2 Figure 1: The Babel synset for bankn, i.e. its ‘financial’ sense (excerpt, formatted for ease of readability). Ponzetto, 2010), a very large knowledge repository tion of WordNet and Wikipedia); (c) the correspond- with concept lexicalizations in 6 languages (Cata- ing (possibly empty) WordNet 3.0 synset offset; lan, English, French, German, Italian and Spanish), (d) the number of senses in all languages and at the lexicographic (i.e., word senses), encyclope- their full listing; (e) the number of translation re- dic (i.e., named entities) and conceptual (i.e., con- lations and their full listing; (f) the number of se- cepts and semantic relations) levels; (b) an API to mantic pointers (i.e., relations) to other Babel perform graph-based WSD with BabelNet, thus pro- synsets and their full listing. Senses encode in- viding, for the first time, a freely-available toolkit for formation about their source – i.e., whether they performing knowledge-based WSD in a multilingual come from WordNet (WN), Wikipedia pages (WIKI) and cross-lingual setting. or their redirections (WIKIRED), or are automatic translations (WNTR / WIKITR) – and about their 2 BabelNet language and lemma. In addition, translation rela- tions among lexical items are represented as a map- BabelNet follows the structure of a traditional lex- ping from source to target senses – e.g., 2 3,4,9 ical knowledge base and accordingly consists of a means that the second element in the list of senses labeled directed graph where nodes represent con- (the English word bank) translates into items #3 cepts and named entities and edges express semantic (German Bank), #4 (Italian banca), and #9 (French relations between them. Concepts and relations are banque). Finally, semantic relations are encoded harvested from the largest available semantic lexi- using WordNet’s pointers and an additional sym- con of English, i.e., WordNet (Fellbaum, 1998), and bol for Wikipedia relations (r), which can also a wide-coverage collaboratively-edited encyclope- specify the source of the relation (e.g., FROM IT 1 dia, i.e., Wikipedia , thus making BabelNet a mul- means that the relation was harvested from the Ital- tilingual ‘encyclopedic dictionary’ which automati- ian Wikipedia). In Figure 1, the Babel synset in- cally integrates fine-grained lexicographic informa- herits the WordNet hypernym (@) relation to finan- tion with large amounts of encyclopedic knowledge 1 cial institutionn (offset bn:00034537n), as well by means of a high-performing mapping algorithm as Wikipedia relations to the synsets of FINAN- (Navigli and Ponzetto, 2010). In addition to this CIAL INSTRUMENT (bn:02945246n) and ETH- conceptual backbone, BabelNet provides a multilin- ICAL BANKING (bn:02854884n, from Italian). gual lexical dimension. Each of its nodes, called Babel synsets, contains a set of lexicalizations of 3 An API for multilingual WSD the concept for different languages, e.g., { bankEN, BabelNet API. BankDE, bancaIT,..., bancoES }. BabelNet can be effectively ac- Similar in spirit to WordNet, BabelNet consists, cessed and automatically embedded within applica- at its lowest level, of a plain text file. An ex- tions by means of a programmatic access. In order cerpt of the entry for the Babel synset containing to achieve this, we developed a Java API, based on 2 2 Apache Lucene3, which indexes the BabelNet tex- bankn is shown in Figure 1 . The record contains (a) the synset’s id; (b) the region of BabelNet tual dump and includes a variety of methods to ac- where it lies (e.g., WIKIWN means at the intersec- cess the four main levels of information encoded in BabelNet, namely: (a) lexicographic (information 1http://www.wikipedia.org about word senses), (b) encyclopedic (i.e. named en- 2 i We denote with wp the i-th WordNet sense of a word w with part of speech p. 3http://lucene.apache.org 68 1 BabelNet bn = BabelNet.getInstance(); 2 System.out.println("SYNSETS WITH English word: \"bank\""); 3 List<BabelSynset> synsets = bn.getSynsets(Language.EN, "bank"); 4 for (BabelSynset synset : synsets) { 5 System.out.print(" =>(" + synset.getId() + ") SOURCE: " + synset.getSource() + 6 "; WN SYNSET: " + synset.getWordNetOffsets() + ";\n" + 7 " MAIN LEMMA: " + synset.getMainLemma() + ";\n SENSES (IT): { "); 8 for (BabelSense sense : synset.getSenses(Language.IT)) 9 System.out.print(sense.toString()+" "); 10 System.out.println("}\n -----"); 11 Map<IPointer, List<BabelSynset>> relatedSynsets = synset.getRelatedMap(); 12 for (IPointer relationType : relatedSynsets.keySet()) { 13 List<BabelSynset> relationSynsets = relatedSynsets.get(relationType); 14 for (BabelSynset relationSynset : relationSynsets) { 15 System.out.println(" EDGE " + relationType.getSymbol() + 16 " " + relationSynset.getId() + 17 " " + relationSynset.toString(Language.EN)); 18 } 19 } 20 System.out.println(" -----"); 21 } Figure 2: Sample BabelNet API usage. tities), (c) conceptual (the semantic network made off-line paths connecting any pair of Babel synsets, up of its concepts), (d) and multilingual level (in- which are collected by iterating through each synset formation about word translations). Figure 2 shows in turn, and performing a depth-first search up to a a usage example of the BabelNet API. In the code maximum depth – which we set to 3, on the basis of snippet we start by querying the Babel synsets for experimental evidence from a variety of knowledge the English word bank (line 3). Next, we access dif- base linking and lexical disambiguation tasks (Nav- ferent kinds of information for each synset: first, we igli and Lapata, 2010; Ponzetto and Navigli, 2010). print their id, source (WordNet, Wikipedia, or both), Next, these paths are stored within a Lucene index, the corresponding, possibly empty, WordNet offsets, which ensures efficient lookups for querying those and ‘main lemma’ – namely, a compact string rep- paths starting and ending in a specific synset. Given resentation of the Babel synset consisting of its cor- a set of words as input, a semantic graph factory responding WordNet synset in stringified form, or class searches for their meanings within BabelNet, the first non-redirection Wikipedia page found in it looks for their connecting paths, and merges such (lines 5–7).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us