Enriching Keywords Database U sing W ordnets – a Case Study (2019)

Abstract: In the paper, we study the case of building a keywords database related to the Polish Classification of Activities (PKD 2007). The database enables automatic classification of the companies to the industry branches. The classification is performed based on the company’s activity description. We present the initial design of the keywords database and the ways in which wordnets were used to enrich it. Finally, we present the preliminary statistical evaluation of the produced resource.

## introduction the polish classification of activities @xcite , based on the european classification of economic activities (nace) @xcite , defines a hierarchical structure of industry branches and activities conducted by polish companies. it is divided into five levels comprising sections (industries), divisions, groups, classes, and subclasses. there are 21 sections, 88 divisions and 654 subclasses, denoted by symbols consisting of letters (sections), numbers (divisions, groups, classes) or letters and numbers @xcite . the polish classification of activities serves as a guideline for governmental institutions such as the central statistical office of poland. it acts as a source of information for services such as wskaznikibranzowe.pl foot_0 , which publishes the quarterly and yearly financial ratios for the respective industry branches distinguished in pkd 2007. furthermore, it can be used as a text corpus for different natural language processing tasks. in this paper, we follow the latter possibility. in particular, we use the descriptions of sections, divi-sions, and subclasses to build a keywords database defining each pkd 2007 section. the keywords database is then used to classify the companies to their industry branches, based on the company's activity descriptions. our motivations are as follows. firstly, we want to help company owners to better describe their activities. secondly, we want to provide an automatic tool for classifying the company to its industry. such a tool may support search engines and allow company managers to find their competition easier. finally, we would like to allow for simpler integration with services such as wskaznikibranzowe.pl, which given the company description, can provide the appropriate financial ratios. the contributions of the paper are two-fold. first, we present the designed keywords database, which adds new value to the existing lexical and semantic resources. second, we discuss the ways in which wordnet enriched the database. this way we also evaluate the wordnet in terms of data availability and completeness. we use plwordnet @xcite as the one containing more data than the other polish wordnet, polnet @xcite . the remainder of this paper is divided into four sections. in section 2 we review the literature pertaining to the applications of wordnets, e.g., for building lexical resources. in section 3 we describe the process of building and enriching the keywords database. in section 4 we present the results of the statistical evaluation of the keywords database, while in section 5 we summarize the paper and provide future research perspectives. ## related works wordnets constitute lexico-semantic resources, whose basic building blocks are usually synonym sets (synsets) @xcite or less frequently, lexical units @xcite . these blocks are interconnected by means of var-ious relations, such as hypernymy, hyponymy, meronymy, and others. wordnets support various natural language processing tasks, which we divide into the following categories: within the first category of wordnet applications, the primary source of information is the princeton wordnet @xcite , which was used to construct various national wordnets. it also plays an important role in the development of multilingual resources such as the eurowordnet or the multiwordnet projects @xcite . furthermore, thanks to the mapping of princeton wordnet to the suggested upper merged ontology (sumo) @xcite or its use in the creation of the yago ontology @xcite , the princeton word-net is used as a reliable link between these ontologies and other wordnets, e.g., plwordnet @xcite . for other projects and resources based on princeton wordnet, created with the aim of supporting research or providing entertainment, the reader is referred to (princeton university, 2010). wordnets, and in particular the princeton word-net, are often combined with other resources such as wikipedia or wiktionary to produce new or to improve existing resources. as an example of such a resource, the semantic network babelnet could be mentioned @xcite . it combines the knowledge (synsets, relations) included in the princeton wordnet with the data collected from wikipedia. a similar approach, but using additional resources, was also taken when creating the conceptnet @xcite . a key feature of the conceptnet and its relation to princeton wordnet is that it aligns the princeton wordnet concepts with other resources making it a part of the linked data movement. the idea of linking the princeton wordnet within the framework of the linguistic linked open data cloud is also mentioned in @xcite . the author focuses on the interconnection between proper nouns included in the princeton wordnet and wikipedia articles. an example of a resource that is based on the polish wordnets is the integrated wordnet discussed in @xcite . the resource combines the information included in pol-net and plwordnet by merging the common elements and extending the amount of information available in one of the wordnets with the contents of the other one and vice versa. the use of plwordnet in relation to ontologies is also mentioned in @xcite , where it is considered as a source of reusable information for building new ontologies. it is worth to mention that, although usually successful, the use of wordnets as sources of additional knowledge can also end up with a failure. an example of such a case is reported in @xcite . the authors aimed at using the existing software infrastructure and data formats of princeton wordnet to create the links between the wordnet and an open biomedical ontology. it turned out that neither the data format nor the software was suitable for biomedical data representation. it mainly suffered from the limited number of relations supported by princeton wordnet or restrictions regarding the number and format of the created concepts. finally, the authors claimed that the princeton wordnet provides a limited coverage of biomedical-specific terms. the limited coverage of required information in wordnets was also mentioned in @xcite . the authors tried to create a thesaurus for hebrew, based on the hebrew wordnet, but due to its limited coverage they had to supplement the process by manual labour. the second category of wordnet applications mentioned before is related to the support of natural language processing tasks. one of the key applications is the use of wordnets for opinion mining as well as sentiment and polarity analysis. examples of semantic resources created with this purpose in mind include the sentiwordnet @xcite , q-wordnet @xcite , and plwordnet emo @xcite . the first two resources are based on princeton wordnet, while the last one is based on plwordnet. the princeton wordnet was also used e.g., for word-sense disambiguation in text clustering @xcite as well as for the document exapansion in information retrieval systems @xcite . the use cases of polish wordnets, and especially the plwordnet, include e.g., the analysis of the amount of emotions-related information covered by plwordnet, which was investiged in @xcite . as shown in @xcite wordnets can be also used for the semantic features mapping, which in turn can support the valence schema matching. ## keywords database design the keywords database construction was based on the xml version of the pkd 2007 document (główny urz ąd statystyczny, 2007). the keywords database was constructed according to the following steps: of the above steps, the first three were performed based on the source document only, while the last step was performed with the use of wordnets. the information selection and extraction step consisted in choosing the most relevant elements of the xml document. we decided to parse the contents of the following xml elements (the translations in parentheses are added for clarity, since the original names are in polish): let us consider the following examples of the document contents. on level 1, we can find a section with symbol a and name rolnictwo, leśnictwo, łowiectwo i rybactwo ("agriculture, forestry and fishing"). on level 2, we can find a division with symbol 01 and name uprawy rolne, chów i hodowla zwierz ąt, łowiectwo, wł ączaj ąc działalność usługow ą ("crop and animal production, hunting and related service activities"). finally, on level 5, we can find a subclass with symbol 01.41.z and name chów i hodowla bydła mlecznego ("raising of dairy cattle"). the following excerpt of the description includes/excludes element for subclass 01.41.z (note the html tags) is an example of the source text used for the keywords database: "<@xmath0.41.@xmath1:</@xmath2,</@xmath3.</@xmath4.41.z this subclass includes: raising and breeding of dairy cattle, production of raw milk from cows or buffaloes.") (główny urz ąd statystyczny, 2007). since the keywords database aims to support the assignment of companies to sections only, we used the name and symbol elements to combine the descriptions of divisions and subclasses with the description of the section. this way we obtained a more detailed description of each section, which constituted the input for the second step of the database construction. note that from now on, when we speak about section description, we consider the combined descriptions mentioned above. in the information processing step we first removed from the descriptions all the elements that were not words, such as html tags, punctuation marks, and digits (we used a set of simple regular expressions to do so). then, based on the white signs (spaces, tabulations, new line characters) we divided the text into words. next, we removed those words that certainly could not become the keywords, such as conjuctions, pronouns, and prepositions. we did it semi-automatically, by removing words of length not greater than three. the process was also complemented by manual verification of the words that remained. considering the excerpt presented above, the resulting set of words would be {podklasa, obejmuje, chów, hodowlę, bydła, mlecznego, produkcję, surowego, mleka, krowiego, bawołów}. the number of words was finally reduced by creating a set of unique words describing each section. the keywords extraction step was initialized with the calculation of the edit (levenshtein) distance between the words describing each section. the aim of this process was to merge similar words together to further reduce their number e.g., the following words could be merged bawół, bawołów, bawoły, bawolę. while calculating the edit distance we temporarily ignored the polish diacritics, in the sense that characters such as e.g., 'ł' and 'l', were considered to be the same. the reason for omitting the differences resulting from the use of polish diacritics was again to limit the number of keyword candidates. based on the obtained levenshtein distances we merged together the words for which the distance was not greater than three. additionally, we performed manual verification of the outcomes, to make sure that no undesired merges were made. as a result, for each section i we obtained a set of keyword candidates k @xmath5. for each keyword candidate k, we calculated the following metric: given the sets of keywords, we performed the keywords enrichment step, which involved the use of wordnets and the apt_pl tagger @xcite used for obtaining lemmas of the keywords foot_1 . in this step we decided to include synonymy, hypernymy, hyponymy, and cohyponymy relations to expand the sets of keywords for each section. the reason for choosing these relations were as follows. the synonyms represent words which can be used interchangeably in the company's descriptions, so the more synonyms we can gather the better the classification quality should be. besides, the synonyms are available straightforwardly in the wordnets, since the basic building blocks are synsets. the hypernyms allowed us to gain some knowledge on more general terms describing the concepts represented by keywords, while hyponyms allowed us to get a more detailed view on them. the cohyponyms, although usually incompatible, were chosen to enable a broader view on the given concept. note that, before introducing the words resulting from any of the relations mentioned above, we verified whether they will not change the value of w k to become greater than the assumed threshold value. words that did not satisfy this condition were rejected. ## statistical evaluation to assess the database quantitatively we measured the sizes of the resource at the various design stages. in particular, we measured the initial size of the database, calculated at the end of information processing step, the sizes after the application of the w k and w k metrics in the keywords extraction step and the final size of the database after keywords enrichment step. the observed size changes are reflected in figure 1 . as can be observed the use of w k and w k metrics reduced the initial database size almost three times. on the other hand, using the wordnet we managed to increase the number of keywords significantly, since the number of unique synsets added was approximately equal to 50 500, which means over threefold increase in the number of keywords. figure 2: keyword candidates number distribution in sections a-u of the pkd 2007. the circles represent the number of keyword candidates after w k metric application, while the 'x' symbols denote the numbers after w k metric was used. on the other hand, the section described by the largest number of keywords was section c (manufacturing), which had over 3000 keyword candidates. we also collected the information on the contribution of plwordnet towards the extension of the keywords database ( we have observed that around 95% of initial keywords were found in plwordnet, which is a very good result. to further compare the respective sections, we have analyzed the keywords coverage percentage shown in fig. 3 . we noted that sections i, m and s were covered to the least extent. in case of sections i and s the missed keywords were usually quite specific, e.g., they were different hotel types (section i) or abbreviations (section s). in case of section m we noted the problems with the coverage of biomedical terms (see also @xcite ). on the other end we observed the full coverage of sections t and u , which had relatively small number of not-sospecific keywords. ## summary in the paper, we discussed the creation of a new resource related to the polish classification of activities. the designed keywords database has been constructed on the basis of the official documentation related to the pkd 2007 hierarchy. the database was enriched with the use of plword-net, the largest polish wordnet. we used the synonymy, hypernymy, hyponymy and cohyponymy relations available in the wordnet. the results of our preliminary evaluation show that plwordnet can be a good source of information related to the activities of polish companies. in the future we plan to use the keywords database for the classification of companies to the respective industries given by pkd sections. we want to perform an analysis of multi-word expressions and a word-sense disambiguation step to include only the most relevant terms. note however, that with the current design the database serves its purpose, because the not-related meanings will not appear in the company's description.