Accessing Germanet Data and Computing Semantic Relatedness
Total Page:16
File Type:pdf, Size:1020Kb
Accessing GermaNet Data and Computing Semantic Relatedness Iryna Gurevych and Hendrik Niederlich EML Research gGmbH Schloss-Wolfsbrunnenweg 33 69118 Heidelberg, Germany http://www.eml-research.de/ gurevych Abstract data from WordNet, e.g. WordNet::QueryData,2 jwnl.3 We present an API developed to access Research integrating semantic knowledge into GermaNet, a lexical semantic database for NLP for languages other than English is scarce. On German represented in XML. The API the one hand, there are fewer computational know- provides a set of software functions for ledge resources like dictionaries, broad enough in parsing and retrieving information from coverage to be integrated in robust NLP applica- GermaNet. Then, we present a case study tions. On the other hand, there is little off-the-shelf which builds upon the GermaNet API and software that allows to develop applications utilizing implements an application for computing semantic knowledge from scratch. While WordNet semantic relatedness according to five dif- counterparts do exist for many languages, e.g. Ger- ferent metrics. The package can, again, maNet (Kunze & Lemnitzer, 2002) and EuroWord- serve as a software library to be deployed Net (Vossen, 1999), they differ from WordNet in in natural language processing applica- certain design aspects. E.g. GermaNet features non- tions. A graphical user interface allows to lexicalized, so called artificial concepts that are non- interactively experiment with the system. existent in WordNet. Also, the adjectives are struc- tured hierarchically which is not the case in Word- 1 Motivation Net. These and other structural differences led to The knowledge encoded in WordNet (Fellbaum, divergences in the data model. Therefore, WordNet 1998) has proved valuable in many natural lan- based implementations are not applicable to Ger- guage processing (NLP) applications. One particu- maNet. Also, there is generally lack of experimental lar way to integrate semantic knowledge into appli- evidence concerning the portability of e.g. WordNet cations is to compute semantic similarity of Word- based semantic similarity metrics to other wordnets Net concepts. This can be used e.g. to perform word and their sensitivity to specific factors, such as net- sense disambiguation (Patwardhan et al., 2003), work structure, language, etc. Thus, for a researcher to find predominant word senses in untagged text who wants to build a semantic relatedness applica- (McCarthy et al., 2004), to automatically generate tion for a language other than English, it is difficult spoken dialogue summaries (Gurevych & Strube, to assess the effort and challenges involved in that. 2004), and to perform spelling correction (Hirst & Departing from that, we present an API which Budanitsky, 2005). allows to parse and retrieve data from GermaNet. Extensive research concerning the integration of Though it was developed following the guidelines semantic knowledge into NLP for the English lan- for creating WordNet, GermaNet features a cou- guage has been arguably fostered by the emergence ple of divergent design decisions, such as e.g. the of WordNet::Similarity package (Pedersen et al., use of non-lexicalized concepts, the association re- 2004).1 In its turn, the development of the WordNet lation between synsets and the small number of tex- based semantic similarity software has been facil- tual definitions of word senses. Furthermore, we itated by the availability of tools to easily retrieve 2http://search.cpan.org/dist/WordNet-QueryData 1http://www.d.umn.edu/ tpederse/similarity.html 3http://sourceforge.net/projects/jwordnet build an application accessing the knowledge in Ger- synset is a cause of; getEntailments() yields synsets maNet and computing semantic relatedness of Ger- that entail a given synset; getHolonyms(), getHy- maNet word senses according to five different met- ponyms(), getHypernyms(), getMeronyms() return a rics. Three of these metrics have been adapted from list of holonyms, hyponyms, immediate hypernyms, experiments on English with WordNet, while the re- and meronyms respectively; getPartOfSpeech() re- maining two are based on automatically generated turns the part of speech associated with word senses definitions of word senses and were developed in the of a synset; getWordSenses() returns all word senses context of work with GermaNet. constituting the synset; toString() yields a string re- presentation of a synset. 2 GermaNet API The metrics of semantic relatedness are designed to employ this API. They are implemented as classes The API for accessing GermaNet has to provide which use the API methods on an instance of the functions similar to the API developed for WordNet. GermaNet object. We evaluated the C-library distributed together with GermaNet V4.0 and the XML encoded version 3 Semantic Relatedness Software of GermaNet (Lemnitzer & Kunze, 2002). As we In GermaNet, nouns, verbs and adjectives are struc- wanted the code to be portable across platforms, we tured within hierarchies of is-a relations.4 Ger- built upon the latter. The XML version of GermaNet maNet also contains information on additional is parsed with the help of the Apache Xerces parser, lexical and semantic relations, e.g. hypernymy, http://xml.apache.org/ to create a JAVA object repre- meronymy, antonymy, etc. (Kunze & Lemnitzer, senting GermaNet. For stemming the words, we use 2002). A semantic relatedness metric specifies to the functionality provided by the Porter stemmer what degree the meanings of two words are related for the German language, freely available from to each other. E.g. the meanings of Glas (Engl. http://snowball.tartarus.org/german/stemmer.html. glass) and Becher (Engl. cup) will be typically clas- Thus, the GermaNet object exists in two versions, sified as being closely related to each other, while the original one, where the information can be the relation between Glas and Juwel (Engl. gem) accessed using words, and the stemmed one, where is more distant. RelatednessComparator is a class the information can be accessed using word stems. which takes two words as input and returns a nu- We implemented a range of JAVA based meth- meric value indicating semantic relatedness for the ods for querying the data. These methods are orga- two words. Semantic relatedness metrics have been nized around the notions of word sense and synset. implemented as descendants of this class. On the word sense (WS) level, we have the follow- Three of the metrics for computing semantic relat- ing methods: getAntonyms() retrieves all antonyms edness are information content based (Resnik, 1995; of a given WS; getArtificial() indicates whether a Jiang & Conrath, 1997; Lin, 1998) and are also im- WS is an artificial concept; getGrapheme() gets a plemented in WordNet::Similarity package. How- graphemic representation of a WS; getParticipleOf() ever, some aspects in the normalization of their retrieves the WS of the verb that the word sense is results and the task definition according to which a participle of; getPartOfSpeech() gets the part of the evaluation is conducted have been changed speech associated with a WS; getPertonym() gives (Gurevych & Niederlich, 2005). The metrics are the WS that the word sense is derived from; get- implemented as classes derived from Information- ProperName() indicates whether the WS is a proper BasedComparator, which is in its turn derived from name; getSense() yields the sense number of a WS in the class PathBasedComparator. They make use of GermaNet; getStyle() indicates if the WS is stylisti- both the GermaNet hierarchy and statistical corpus cally marked; getSynset() returns the corresponding evidence, i.e. information content. synset; toString() yields a string representing a WS. On the synset level, the following information can 4As mentioned before, GermaNet abandoned the cluster- approach taken in WordNet to group adjectives. Instead a hi- be accessed: getAssociations() returns all associa- erarchical structuring based on the work by Hundsnurscher & tions; getCausations() gets the effects that a given Splett (1982) applies, as is the case with nouns and verbs. We implemented a set of utilities for computing information content of German word senses from German corpora according to the method by Resnik (1995). The TreeTagger (Schmid, 1997) is em- ployed to compile a part-of-speech tagged word fre- quency list. The information content values of Ger- maNet synsets are saved in a text file called an in- formation content map. We experimented with dif- ferent configurations of the system, one of which in- volved stemming of corpora and the other did not involve any morphological processing. Contrary to our intuition, there was almost no difference in the information content maps arising from the both sys- Figure 1: The concept of user-system interaction. tem configurations, with and without morphological processing. Therefore, the use of stemming in com- puting information content of German synsets seems have to be included in the final definition. Exper- to be unjustified. iments carried out to determine the most effective The remaining two metrics of semantic related- parameters for generating the definitions and em- ness are based on the Lesk algorithm (Lesk, 1986). ploying those to compute semantic relatedness is de- The Lesk algorithm computes the number of over- scribed in Gurevych (2005). Gurevych & Niederlich laps in the definitions of words, which are some- (2005) present a description of the evaluation proce- times extended with the definitions of words related dure