# Semantic Annotation of Unstructured Documents Using Concepts Similarity

Authors: Fernando Pech; Alicia Martinez; Hugo Estrada; Yasmin Hernandez
Journal: Scientific Programming
 (2017)

---

## Abstract

There is a large amount of information in the form of unstructured documents which pose challenges in the information storage, search, and retrieval. This situation has given rise to several information search approaches. Some proposals take into account the contextual meaning of the terms specified in the query. Semantic annotation technique can help to retrieve and extract information in unstructured documents. We propose a semantic annotation strategy for unstructured documents as part of a semantic search engine. In this proposal, ontologies are used to determine the context of the entities specified in the query. Our strategy for extracting the context is focused on concepts similarity. Each relevant term of the document is associated with an instance in the ontology. The similarity between each of the explicit relationships is measured through the combination of two types of associations: the association between each pair of concepts and the calculation of the weight of the relationships.


---

## Body

## 1. Introduction

The rapid growth of the web has generated an enormous amount of information in the form of unstructured documents. Search engines have become common and basic tools for users. However, engines still have difficulties in performing searches because search methods are based on keywords, and they do not capture and do not explore the meaning and context of the need of the user. This challenge has drawn attention of several research groups which are interested in solving the issues associated with information storage and search and retrieval of information in this enormous cumulus of data.On the other hand, the continuous growth of the Semantic Web has motivated the development of knowledge structures on different domains and applications, like Wikipedia [1], Linked Open Data (LOD) [2], DBpedia [3], Freebase [4], and YAGO [5], among other applications. Additionally, some ontologies for several domains have been developed, such as Snomed CT [6] and UMLS [7] for the medical field and AGROVOC [8] for the agricultural field. An ontology is a formal representation of knowledge, which plays a very important role in the semantic web because of its capability to express meanings and relationships. Ontologies have been valuable in knowledge extraction technologies, especially in the aggregation of knowledge from unstructured documents. Ontologies are a key component of semantic association, which is the process to formalizing knowledge through the linking of words or phrases of plain text (mentions or named entities) with elements of the ontology (concepts or entities).The semantic annotation of a document consists in finding mappings between text chunks of a document and the instances or individuals in ontology. The annotation plays an important role in a variety of semantic applications, such as generation of linked data, extraction of open information, alignment of ontologies, and semantic search. Specifically, semantic search allows users to express their information needs in terms of the knowledge base concepts. Unlike traditional keyword-based search, semantic search can make use of semantic relationships in the ontology to accomplish new tasks, such as refining user queries with broader or more specific concepts.The semantic annotation has been applied in different areas of knowledge. For example, it has been applied in biological systems for the identification of biomedical entities such as genes, proteins, and their relationships; also, it has been applied in news analysis for identification of people, organizations, and places.At the present, semantic annotation strategies are carried out without regard to context [9–11]; these works do not analyze the meaning or semantics of the terms. Generally, authors assume that lexicons are enough to express the meaning of the terms in a document. However, to a large degree, the semantic of a concept depends of the context in which it occurs. Therefore, the identification of meaning could lead to problems of ambiguity. Several research works have demonstrated the complexity of word-sense disambiguation (WSD), where traditionally a term is searched in a data dictionary (e.g., WordNet) [12]. Other approaches have chosen to analyze the context of the terms to improve the annotation process [13]. The problems related to semantic annotation are still an open research topic.The annotation process could be a source of different types of problems, for example, (i) ambiguous annotations, when entities have been assigned to more than one concept in the ontology, (ii) erroneous annotations, when the meaning of a text is not found in the ontology, and, (iii) false annotations, when the annotation does not provide any value for the realization of a semantic search. In this sense, this paper presents a strategy of semantic annotation in unstructured documents. Our approach is based on ontologies and on the extraction of contextual semantic information from entities of the ontology. The semantic context of an entity is determined by their relationships in the ontology. Therefore, we propose to extract the semantic context of the entities by calculating the similarity of association between each pair of concepts and the calculation of the weights of the relationships of the entities. With this strategy, we deal with the problems of ambiguous, erroneous, and false annotations. Our method of semantic annotation is part of a semantic search system in natural language and it has been evaluated with the corpus compiled by Lee and Welsh [14] and DBpedia.This paper is organized as follows: Section2 describes the background of our proposal, Section 3 presents the related work, Section 4 presents the architecture of the system, Section 5 presents the evaluation of the proposed approach, and finally, Section 6 provides some conclusions and an outlook for future work.


## 2. Foundations

This section presents the concepts and foundations of the proposed semantic annotation approach.


### 2.1. Ontology

An ontology is composed of a schema and instances (see Figure1). A schema is defined as C,D,P where C is the set of classes/concepts C={c1,c2,…,cn}, D is the set of data types, and P is the set of properties P={p1,p2,…,pn} which are the relationships between classes. Instances represent knowledge and denote an instanced class and their relationships. Instances can be defined as a graph G=V,E, where V is the set of instances, and E is the set of relationships or predicates binding the instances.Figure 1
Two-level ontology: schema and instances.In an ontology, classes, properties, data types, and instances are explicitly identified by Uniform Resource Identifiers (URI). In addition, they represent entities within the ontology, which are characterized by their textual description declared in the propertyrdfs:label. This may have lexical variations defined asrdfs:label = "text1","text2".Figure1 shows a fragment of an ontology for the research domain. The schema level defines classes such asLaboratory andProfessor, and properties such asinterestedIn.The instance level indicates the instantiated schemas. For example,ontologies is an instance of the classResearchGroup; Methodology, andAlice Perez are related to the propertywrittenBy and belong to the classesPublication andAuthor, respectively. TheAcapulco instance contains its textual description with two lexical variationsrdfs:label = "Acapulco","Acapulco de Juárez".


### 2.2. Semantic Annotation

The semantic annotation is fundamental to obtaining better results in the semantic search because the documents are represented in a conceptual space.The semantic annotation of a documentd consists in linking the terms t in d={t1,t2,…,tn} with the entities in the ontology which describe the content of the term in its textual description best (see Figure 2). Namely, let an entity-term pair be c,t, where c is an entity in the ontology and t is a term/phrase of d, so that there is a mapping between the textual descriptions defined in the labelrdfs:label of c and t.Figure 2
Link between terms (mentions) of a document and the ontology entities.In semantic annotation techniques, a document is analyzed in order to identify its relevant terms and to define the importance of each term. There are tools to identify mentions, such as TagMe [15] and Spotlight [16].When the semantic annotations are made without regard to the context, its terms or mentions are linked with the entities in the ontology without taking into account their meaning. This causes ambiguous or erroneous annotations.Our research work proposes to analyze the context of the annotations in order to identify their meaning through the entities in the ontology, and in this way to avoid ambiguities. In the extraction of the context, the explicit relationships of each entity in the ontology are analyzed. For example, Figure2 shows the relationship between theOntologies entity andResearchGroup andAlice Perez.


## 2.1. Ontology

An ontology is composed of a schema and instances (see Figure1). A schema is defined as C,D,P where C is the set of classes/concepts C={c1,c2,…,cn}, D is the set of data types, and P is the set of properties P={p1,p2,…,pn} which are the relationships between classes. Instances represent knowledge and denote an instanced class and their relationships. Instances can be defined as a graph G=V,E, where V is the set of instances, and E is the set of relationships or predicates binding the instances.Figure 1
Two-level ontology: schema and instances.In an ontology, classes, properties, data types, and instances are explicitly identified by Uniform Resource Identifiers (URI). In addition, they represent entities within the ontology, which are characterized by their textual description declared in the propertyrdfs:label. This may have lexical variations defined asrdfs:label = "text1","text2".Figure1 shows a fragment of an ontology for the research domain. The schema level defines classes such asLaboratory andProfessor, and properties such asinterestedIn.The instance level indicates the instantiated schemas. For example,ontologies is an instance of the classResearchGroup; Methodology, andAlice Perez are related to the propertywrittenBy and belong to the classesPublication andAuthor, respectively. TheAcapulco instance contains its textual description with two lexical variationsrdfs:label = "Acapulco","Acapulco de Juárez".


## 2.2. Semantic Annotation

The semantic annotation is fundamental to obtaining better results in the semantic search because the documents are represented in a conceptual space.The semantic annotation of a documentd consists in linking the terms t in d={t1,t2,…,tn} with the entities in the ontology which describe the content of the term in its textual description best (see Figure 2). Namely, let an entity-term pair be c,t, where c is an entity in the ontology and t is a term/phrase of d, so that there is a mapping between the textual descriptions defined in the labelrdfs:label of c and t.Figure 2
Link between terms (mentions) of a document and the ontology entities.In semantic annotation techniques, a document is analyzed in order to identify its relevant terms and to define the importance of each term. There are tools to identify mentions, such as TagMe [15] and Spotlight [16].When the semantic annotations are made without regard to the context, its terms or mentions are linked with the entities in the ontology without taking into account their meaning. This causes ambiguous or erroneous annotations.Our research work proposes to analyze the context of the annotations in order to identify their meaning through the entities in the ontology, and in this way to avoid ambiguities. In the extraction of the context, the explicit relationships of each entity in the ontology are analyzed. For example, Figure2 shows the relationship between theOntologies entity andResearchGroup andAlice Perez.


## 3. Related Work

The semantic search involves different components: (i) preprocessing, (ii) semantic query translator, (iii) semantic annotation and indexing, (iv) retrieval of semantic content, and (v) semantic ranking.Currently, there are several research works with different contributions in the area of the semantic web. Several general-purpose tools have been developed to support the annotation process, and, also, specific domain ontologies and knowledge bases have been proposed by research groups.General-Purpose Tools. There are several available services for annotation of named entities in documents that could be accessed using RESTful APIs such as the case of OpenCalais [17].Let us remark that, AlchemyAPI [18] and OpenCalais [17] use context-based statistical techniques to disambiguate the candidate instances to annotate a term. These tools use proprietary vocabularies and ontologies whose instances are linked to DBpedia through theowl:sameAs relationship. However, OpenCalais provides some limited linkage to DBpedia. Also, OpenCalais is mainly focused on organizations. This approach has two disadvantages. Firstly, it only explores the surface of the graph for each DBpedia instance considering the labels, abstract, links to Wiki pages, and synonyms. Secondly, this approach annotates a term with only one instance of DBpedia. Therefore, this approach does not exploit the semantic information available in DBpedia to disambiguate the instance annotating a given term.DBpedia Spotlight [16] is a semantic annotation tool for data entities in a document and it is based on DBpedia for the annotation. Also, this tool provides interfaces for disambiguation, including a Web API which supports XML, JSON, and RFD formats.Gate [19] is a tool for text engineering to help users in the process of text annotation manually. This tool provides basic processing functionalities, such as recognition of entity named, sentence dividers, markers, and so on.Ontea [20] is a tool for semantic metadata extraction from documents. This tool uses regular expressions patterns as text analysis tool, and it detects semantically equivalent elements according to the domain ontology defined in the tool. This tool creates a new individual ontology from a defined class and it assigns the detected elements as properties in the ontology class. The patterns of regular expressions are used to annotate the text without format with elements in the ontology.These approaches have two main drawbacks. On the one hand, they just explore the surface of the graph for each DBpedia instance; they mainly consider label, abstract, links to Wiki pages, and synonyms. Therefore, these approaches do not exploit the semantic information available in DBpedia to disambiguate the instance annotating a given term. Another disadvantage of this work lies in the fact that it discards the relationship, which contains relevant information about a term. That is, they do not enrich the description of relevant terms with the semantic graphs that contain the DBpedia instances related to the context of the document. Some works do face these drawbacks by annotating their documents with graphs extracted from DBpedia.Specific Domain Tools. There are specific tools for biomedical annotations such as MetaMap [8], Whatizi [21], and Semantator [22]. Most of this approaches and tools are based on a strategy to search terms in thesaurus. These methods consist in finding occurrences of a concept chain in a text fragment using strict coincidence of terms.Semantic Annotation Approaches Based on Information Retrieval Techniques. Popov and colleagues [23] present KIM, a platform for information and knowledge management, annotation, and indexed and semantic retrieval. This tool provides a scalar infrastructure for personalized information extraction and also for documents management and its corresponding annotations. The main contribution of KIM is the recognition of the named entities according to ontology.Castells et al. [24] propose an information retrieval model using ontologies for the annotation classification. This model uses an ontology-based schema for the semiautomatic semantic annotation of documents. This research was extended by Fernández et al. [25] to provide natural language queries.Berlanga et al. [26] propose a semantic annotation/query strategy for a corpus using several knowledge bases. This method is based on a statistical framework where the concepts of the knowledge bases and the corpus documents are homogeneously represented through statistical models of language. This enables the effective semantic annotation of the corpus.Nebot and Berlanga [27] explore the use of semantic annotation in the biomedical domain. They present a scalable method to extract domain-independent relationships. They propose a probabilistic approach to measure the synonymy relationship and also a method to discover abstract semantic relationships automatically.Fuentes-Lorenzo et al. [28] propose a tool to improve the quality of results of the Web search engines, performing a better classification of the query results.In the literature we can find several approaches to optimize query results. Swoogle [29] is a raster based system to discover, index, and query RDF documents. SemSearch [30] is another search engine relying on semantic indexes and is based on Sesame [31] and Lucene. The ranking algorithm was specifically designed for the extraction of ontologies through annotation. In [32] a search engine is proposed to infer the context of Web pages and also to create links to relevant Web pages. Lopez et al. [33] developed an information retrieval system based on ontologies. This system takes as input a natural language query and converts it to semantic entities using a question-answering system. PowerAqua [33] is a system to recover and to classify documents through TF-IDF measures [34].


## 4. Semantic Annotation Architecture

This paper presents a novel semantic annotation approach based on ontologies for the improvement of information search in unstructured documents. We present an approach to annotation that enriches and semantically describes the content of a document using the similarity of entities of an ontology. Specifically calculating(1) the association between each concept pair and (2) the relationships weight.The goals of our approach are (a) to link the entities with their meaning in order to be annotated and (b) to provide a framework for semantic searches using natural language processing. The semantic annotation approach extracts the semantic context through the similarity analysis calculating the association of the explicit relationships and the weight of the relationships of the entities involved. Figure3 shows an overview of our proposed solution for the semantic annotation.Figure 3
Methodological proposal for semantic annotation process.


### 4.1. Documents Indexing

Commonly, Natural Language Processing (NLP) is used for the analysis of unstructured documents, and also for the recognition and extraction of mentions or named entities [35].In this approach, the indexing of unstructured web documents generates inverted indexes, which contain the set of terms to be compared with the entities in the ontology. We propose an algorithm for the indexing of documents using Lucene. The output of this algorithm is an inverted index containing the list of terms or keywords and a set of documents where the terms appear.Therefore, the algorithm provides a mapping from terms to documents and a mechanism for annotating search results. Also, it obtains the position of the information: the list of terms IDs, the association with the ID of the document, and its position.


### 4.2. Entity Identifications

Given a documentd and a knowledge base, the objective of this phase is to extract the textual descriptions and the semantic context of all the information about d from the knowledge base.Identification of Mentions. Documents are analyzed to detect terms. Generally, this process is known as acknowledgment of mentions or named entities [35]. A mention is a term/phrase in the text which may correspond to an entity in the knowledge base.From the ontological point of view, an entity can denote classes, relationships, or instances. Entities can represent people, organizations, locations, and so on. There are different tools to define entities, like Spotlight [16] and TagMe [15], among others. TagMe uses Wikipedia as a dictionary of terms for mentions detection. We have used this tool with the same purpose.TagMe analyzes the input text and detects mentions using a dictionary of entities/words (surface form). For each word, it registers the set of entities recognized by that name. This dictionary is constructed by extracting the words from four sources: Wikipedia papers, redirected pages, Wikipedia page titles, and other variants.Words with few occurrences and single-character words are discarded. Finally, an additional filtering to discard words with low link probability is done (e.g., less than 0.001). The link probability is defined as stated in(1)plinkm=Plink∣mlinkmfreqm,where link(m) is the number of times the mention m appears as a link and freq(m) denotes the number of times the mention m occurs in Wikipedia.The detection of mentions is carried out by comparing then-grams (until n=6) of the document.


#### 4.2.1. Extraction of Instances

Each mention detected in documentd is searched in the ontology, and if an instance matches its textual description, it is extracted from the labelrdfs:label. All the values contained inrdfs:label (lexical variations) are considered as labels that are later compared in the document index.Figure4 shows a fragment of theMéxico entity code containing URI, class, and textual description with two lexical variationsMéxico andEstados Unidos Mexicanos.Figure 4
Code fragment of an instance in the ontology.


#### 4.2.2. Extraction of the Instances Semantic Context

In this process, the semantic context of the instances is extracted to be analyzed in detail. The explicit relationships in theURI are also analyzed. Several strategies have been proposed to evaluate the proximity of entities according to their semantic characteristics [21]. The use of the semantic measure based on graphs allows us to compare concepts, terms, and instances. This measure is represented as an edge in a semantic graph in order to determine the relationship strength among the ontology concepts.Therefore, this research work uses the semantic measure as a strategy to measure the strength of the explicit relationship between entities. Two types of measures are considered:(1) the association between each concept pair and (2) the relationships weight. Each measure reflects the similarity degree or relationship between the ontology entities according to its meaning.Concept Pairwise Association. An entity is explicitly related to other concepts in the ontology. To measure the association strength between each pair of concepts c1 and c2, we compare each pairwise by calculating similarity. Figure 2 shows theAcapulco entity with four explicitly related concepts (Carlos,Guerrero,México, andRichard).The association strength between each pairwise can be measured taking into account different characteristics, such as the shortest path between concepts pairwise, the depth of their common ancestor, and information content [36].We have adopted the Resnik approach [37] to measure the similarity between two concepts c1 and c2 according to the information content, using the formula (2)Simpc1,c2=ICMSCAc1,c2ICc1+ICc2,where MSCA(c1,c2) denotes the common ancestor of c1 and c2 with the higher information content. IC is the information content calculated for each node c in the ontology, whereas the more specific the node in the ontology is, the greater its information content is. There are different metrics to calculate IC [36].Generally, these metrics are intrinsic. Namely, they are based on the topological information of the ontology and consider the instances occurrence. This approach considers the occurrence of an instancex quantified as l(x)=log2⁡pr(x), which has been reformulated as stated in(3)IC=-log2⁡IDcIC,where I(D(c)) denotes the number instances of the concept c and I(C) represents the number of instances on the ontology.From the ontology in Figure2 which contains 1000 resources including the entitiesPerson,Publication, andResearchGroup, we can see a group of 600 people interested in some research group(ResearchGroup) and 100 people(Author) who wrote some publications(Publication). The information content ininterestedIn andwrittenBy is obtained as stated in(4)ICinterestedInPerson,ResearchGroup=-log2⁡printerestedInPerson,ResearchGroup=-log2⁡6001000=-log2⁡0.6≈0.73,ICwrittenByPublication,Author=-log2⁡prwrittenByPublication,Author=-log2⁡1001000=log2⁡0.1≈3.32.The information content in a property represents the strength of the discrimination among the relationships. However, this is not enough to determine the meaning of the entity. We propose to measure the weight of each property linked to a concept c.Relationships Weight. Based on information theory, the amount of information contained in a random variable over another variable is measured by mutual information. This strategy has been proposed by Cover [38] and we have adapted it to measure the relationship strength of pairwise c1 and c2.(5)MIpc1,c2=∑∑prc1,c2·log2⁡prc1,c2prc1·prc2,where pr(c1,c2) is the probability of relationship e belonging to a set of properties of c1 and c2. pr(c1) is the probability of relationship belonging to set of properties of c1, whereas pr(c2) is the probability of relationship e belonging to set of properties of c2.Figure5 shows the relationshipswrittenBy,memberOf,hasAdvisor, andlivesIn belonging toRichard entity in the ontology. The instances of these relationships are shown in Figure 6.Figure 5
RelationshipsmemberOf,writtenBy,hasAdvisor, andlivesIn in the ontology.Figure 6
Examples ofwrittenBy,memberOf, andhasAdvisor entities andlivesIn property.As an example, let us calculate the relationship weight betweenRichard andMethodology, which iswrittenBy, and it is computed as stated in(6)MIwrittenByPublication,Author=IMethodology,Richard·log2⁡IMethodology,RichardIMethodology·IRichard+IMetodology,AlicePerez·log2⁡IMethodology,AlicePerezIMethodology·IAlicePerez+ITheSemanticWeb,AlicePerez·log2⁡ITheSemanticWeb,AlicePerezITheSemanticWeb·IAlicePerez+ITheSemanticWeb,Carlos·log2⁡ITheSemanticWeb,CarlosITheSemanticWeb·ICarlos=14·log2⁡1/41/2·1/4+14·log2⁡1/41/2·1/2+14·log2⁡1/41/2·1/2+14·log2⁡1/41/2·1/4=0.5.It should be noted that a relationship can have many instances. Consequently, calculating the relationships weight would have a high computational cost. Thus, we calculate the mutual information as stated in (7)MIe=≈log2⁡1/Ie1/Ic1·1/Ic2,where [I(e)] represents all relationships e in the relationships set, I(c1) represents all relationships in c1 (subject), and I(c2) represents all relationships in c2 (object).Combining Association and Relationship Weights. The combination of weights requires considering several methods of aggregation, such as average, addition, and multiplication. A weighted sum as combination method to adjust the influence of each factor on the total weight was selected. Finally, to combine the association between each pair of concepts (see (2)) and the weights of the relationships (see (7)), we calculate the final weight to obtain the entities context, as stated in(8)WPci,cj=α·Simc1,c2+β·MIpc1c2,where 0≤α, β≤1. Sim and MI were normalized to be in the 0,1 range by unit-based normalization [13], stated in (9)Sim-minp∈P⁡Simmaxp∈P⁡Sim-minp∈P⁡Sim,MI-minp∈P⁡MImaxp∈P⁡MI-minp∈P⁡MI.


### 4.3. Terms Extraction and Documents Annotation

The textual descriptions of instances and entities semantic context obtained in the previous stage are searched in the inverted index to extract and generate a documents’ annotation table containing the ontology entity, the belonging document, and its weight (see Table1).Table 1
Document annotation.
Entity
Document
Weight
http://ex/onto#State
D1
0.5
http://ex/onto#State
D2
0.2
http://ex/onto#State
D87
0.67
http://ex/onto#Mexico
D1
0.45
http://ex/onto#Mexico
D23
0.6The annotations weight is done by means of TF-IDF algorithm. Term frequency (TF) is the local weighting factor reflecting the importance of a term within a document. Document frequency (DF) is the global weighting factor considering the importance of a term within the document collection. Inverse document frequency (IDF) calculates the frequency of a document within the collection. TF and IDF are calculated using the formulas stated in (10) and (11).(10)TF=freqx,dmaxy⁡freqy,d,where freqx,d is the number of occurrences of term x within document d and maxy⁡freqy,d is the number of occurrences of all terms within document d.(11)IDF=log⁡Ndf,where N is the total number of documents in the collection and df represents the documents where term x appears. The weight dx for x in d is the combination of TF ∗ IDF.Finally, the annotations are represented in the form of serialized triplets in JSON-LD.


## 4.1. Documents Indexing

Commonly, Natural Language Processing (NLP) is used for the analysis of unstructured documents, and also for the recognition and extraction of mentions or named entities [35].In this approach, the indexing of unstructured web documents generates inverted indexes, which contain the set of terms to be compared with the entities in the ontology. We propose an algorithm for the indexing of documents using Lucene. The output of this algorithm is an inverted index containing the list of terms or keywords and a set of documents where the terms appear.Therefore, the algorithm provides a mapping from terms to documents and a mechanism for annotating search results. Also, it obtains the position of the information: the list of terms IDs, the association with the ID of the document, and its position.


## 4.2. Entity Identifications

Given a documentd and a knowledge base, the objective of this phase is to extract the textual descriptions and the semantic context of all the information about d from the knowledge base.Identification of Mentions. Documents are analyzed to detect terms. Generally, this process is known as acknowledgment of mentions or named entities [35]. A mention is a term/phrase in the text which may correspond to an entity in the knowledge base.From the ontological point of view, an entity can denote classes, relationships, or instances. Entities can represent people, organizations, locations, and so on. There are different tools to define entities, like Spotlight [16] and TagMe [15], among others. TagMe uses Wikipedia as a dictionary of terms for mentions detection. We have used this tool with the same purpose.TagMe analyzes the input text and detects mentions using a dictionary of entities/words (surface form). For each word, it registers the set of entities recognized by that name. This dictionary is constructed by extracting the words from four sources: Wikipedia papers, redirected pages, Wikipedia page titles, and other variants.Words with few occurrences and single-character words are discarded. Finally, an additional filtering to discard words with low link probability is done (e.g., less than 0.001). The link probability is defined as stated in(1)plinkm=Plink∣mlinkmfreqm,where link(m) is the number of times the mention m appears as a link and freq(m) denotes the number of times the mention m occurs in Wikipedia.The detection of mentions is carried out by comparing then-grams (until n=6) of the document.


### 4.2.1. Extraction of Instances

Each mention detected in documentd is searched in the ontology, and if an instance matches its textual description, it is extracted from the labelrdfs:label. All the values contained inrdfs:label (lexical variations) are considered as labels that are later compared in the document index.Figure4 shows a fragment of theMéxico entity code containing URI, class, and textual description with two lexical variationsMéxico andEstados Unidos Mexicanos.Figure 4
Code fragment of an instance in the ontology.


### 4.2.2. Extraction of the Instances Semantic Context

In this process, the semantic context of the instances is extracted to be analyzed in detail. The explicit relationships in theURI are also analyzed. Several strategies have been proposed to evaluate the proximity of entities according to their semantic characteristics [21]. The use of the semantic measure based on graphs allows us to compare concepts, terms, and instances. This measure is represented as an edge in a semantic graph in order to determine the relationship strength among the ontology concepts.Therefore, this research work uses the semantic measure as a strategy to measure the strength of the explicit relationship between entities. Two types of measures are considered:(1) the association between each concept pair and (2) the relationships weight. Each measure reflects the similarity degree or relationship between the ontology entities according to its meaning.Concept Pairwise Association. An entity is explicitly related to other concepts in the ontology. To measure the association strength between each pair of concepts c1 and c2, we compare each pairwise by calculating similarity. Figure 2 shows theAcapulco entity with four explicitly related concepts (Carlos,Guerrero,México, andRichard).The association strength between each pairwise can be measured taking into account different characteristics, such as the shortest path between concepts pairwise, the depth of their common ancestor, and information content [36].We have adopted the Resnik approach [37] to measure the similarity between two concepts c1 and c2 according to the information content, using the formula (2)Simpc1,c2=ICMSCAc1,c2ICc1+ICc2,where MSCA(c1,c2) denotes the common ancestor of c1 and c2 with the higher information content. IC is the information content calculated for each node c in the ontology, whereas the more specific the node in the ontology is, the greater its information content is. There are different metrics to calculate IC [36].Generally, these metrics are intrinsic. Namely, they are based on the topological information of the ontology and consider the instances occurrence. This approach considers the occurrence of an instancex quantified as l(x)=log2⁡pr(x), which has been reformulated as stated in(3)IC=-log2⁡IDcIC,where I(D(c)) denotes the number instances of the concept c and I(C) represents the number of instances on the ontology.From the ontology in Figure2 which contains 1000 resources including the entitiesPerson,Publication, andResearchGroup, we can see a group of 600 people interested in some research group(ResearchGroup) and 100 people(Author) who wrote some publications(Publication). The information content ininterestedIn andwrittenBy is obtained as stated in(4)ICinterestedInPerson,ResearchGroup=-log2⁡printerestedInPerson,ResearchGroup=-log2⁡6001000=-log2⁡0.6≈0.73,ICwrittenByPublication,Author=-log2⁡prwrittenByPublication,Author=-log2⁡1001000=log2⁡0.1≈3.32.The information content in a property represents the strength of the discrimination among the relationships. However, this is not enough to determine the meaning of the entity. We propose to measure the weight of each property linked to a concept c.Relationships Weight. Based on information theory, the amount of information contained in a random variable over another variable is measured by mutual information. This strategy has been proposed by Cover [38] and we have adapted it to measure the relationship strength of pairwise c1 and c2.(5)MIpc1,c2=∑∑prc1,c2·log2⁡prc1,c2prc1·prc2,where pr(c1,c2) is the probability of relationship e belonging to a set of properties of c1 and c2. pr(c1) is the probability of relationship belonging to set of properties of c1, whereas pr(c2) is the probability of relationship e belonging to set of properties of c2.Figure5 shows the relationshipswrittenBy,memberOf,hasAdvisor, andlivesIn belonging toRichard entity in the ontology. The instances of these relationships are shown in Figure 6.Figure 5
RelationshipsmemberOf,writtenBy,hasAdvisor, andlivesIn in the ontology.Figure 6
Examples ofwrittenBy,memberOf, andhasAdvisor entities andlivesIn property.As an example, let us calculate the relationship weight betweenRichard andMethodology, which iswrittenBy, and it is computed as stated in(6)MIwrittenByPublication,Author=IMethodology,Richard·log2⁡IMethodology,RichardIMethodology·IRichard+IMetodology,AlicePerez·log2⁡IMethodology,AlicePerezIMethodology·IAlicePerez+ITheSemanticWeb,AlicePerez·log2⁡ITheSemanticWeb,AlicePerezITheSemanticWeb·IAlicePerez+ITheSemanticWeb,Carlos·log2⁡ITheSemanticWeb,CarlosITheSemanticWeb·ICarlos=14·log2⁡1/41/2·1/4+14·log2⁡1/41/2·1/2+14·log2⁡1/41/2·1/2+14·log2⁡1/41/2·1/4=0.5.It should be noted that a relationship can have many instances. Consequently, calculating the relationships weight would have a high computational cost. Thus, we calculate the mutual information as stated in (7)MIe=≈log2⁡1/Ie1/Ic1·1/Ic2,where [I(e)] represents all relationships e in the relationships set, I(c1) represents all relationships in c1 (subject), and I(c2) represents all relationships in c2 (object).Combining Association and Relationship Weights. The combination of weights requires considering several methods of aggregation, such as average, addition, and multiplication. A weighted sum as combination method to adjust the influence of each factor on the total weight was selected. Finally, to combine the association between each pair of concepts (see (2)) and the weights of the relationships (see (7)), we calculate the final weight to obtain the entities context, as stated in(8)WPci,cj=α·Simc1,c2+β·MIpc1c2,where 0≤α, β≤1. Sim and MI were normalized to be in the 0,1 range by unit-based normalization [13], stated in (9)Sim-minp∈P⁡Simmaxp∈P⁡Sim-minp∈P⁡Sim,MI-minp∈P⁡MImaxp∈P⁡MI-minp∈P⁡MI.


## 4.2.1. Extraction of Instances

Each mention detected in documentd is searched in the ontology, and if an instance matches its textual description, it is extracted from the labelrdfs:label. All the values contained inrdfs:label (lexical variations) are considered as labels that are later compared in the document index.Figure4 shows a fragment of theMéxico entity code containing URI, class, and textual description with two lexical variationsMéxico andEstados Unidos Mexicanos.Figure 4
Code fragment of an instance in the ontology.


## 4.2.2. Extraction of the Instances Semantic Context

In this process, the semantic context of the instances is extracted to be analyzed in detail. The explicit relationships in theURI are also analyzed. Several strategies have been proposed to evaluate the proximity of entities according to their semantic characteristics [21]. The use of the semantic measure based on graphs allows us to compare concepts, terms, and instances. This measure is represented as an edge in a semantic graph in order to determine the relationship strength among the ontology concepts.Therefore, this research work uses the semantic measure as a strategy to measure the strength of the explicit relationship between entities. Two types of measures are considered:(1) the association between each concept pair and (2) the relationships weight. Each measure reflects the similarity degree or relationship between the ontology entities according to its meaning.Concept Pairwise Association. An entity is explicitly related to other concepts in the ontology. To measure the association strength between each pair of concepts c1 and c2, we compare each pairwise by calculating similarity. Figure 2 shows theAcapulco entity with four explicitly related concepts (Carlos,Guerrero,México, andRichard).The association strength between each pairwise can be measured taking into account different characteristics, such as the shortest path between concepts pairwise, the depth of their common ancestor, and information content [36].We have adopted the Resnik approach [37] to measure the similarity between two concepts c1 and c2 according to the information content, using the formula (2)Simpc1,c2=ICMSCAc1,c2ICc1+ICc2,where MSCA(c1,c2) denotes the common ancestor of c1 and c2 with the higher information content. IC is the information content calculated for each node c in the ontology, whereas the more specific the node in the ontology is, the greater its information content is. There are different metrics to calculate IC [36].Generally, these metrics are intrinsic. Namely, they are based on the topological information of the ontology and consider the instances occurrence. This approach considers the occurrence of an instancex quantified as l(x)=log2⁡pr(x), which has been reformulated as stated in(3)IC=-log2⁡IDcIC,where I(D(c)) denotes the number instances of the concept c and I(C) represents the number of instances on the ontology.From the ontology in Figure2 which contains 1000 resources including the entitiesPerson,Publication, andResearchGroup, we can see a group of 600 people interested in some research group(ResearchGroup) and 100 people(Author) who wrote some publications(Publication). The information content ininterestedIn andwrittenBy is obtained as stated in(4)ICinterestedInPerson,ResearchGroup=-log2⁡printerestedInPerson,ResearchGroup=-log2⁡6001000=-log2⁡0.6≈0.73,ICwrittenByPublication,Author=-log2⁡prwrittenByPublication,Author=-log2⁡1001000=log2⁡0.1≈3.32.The information content in a property represents the strength of the discrimination among the relationships. However, this is not enough to determine the meaning of the entity. We propose to measure the weight of each property linked to a concept c.Relationships Weight. Based on information theory, the amount of information contained in a random variable over another variable is measured by mutual information. This strategy has been proposed by Cover [38] and we have adapted it to measure the relationship strength of pairwise c1 and c2.(5)MIpc1,c2=∑∑prc1,c2·log2⁡prc1,c2prc1·prc2,where pr(c1,c2) is the probability of relationship e belonging to a set of properties of c1 and c2. pr(c1) is the probability of relationship belonging to set of properties of c1, whereas pr(c2) is the probability of relationship e belonging to set of properties of c2.Figure5 shows the relationshipswrittenBy,memberOf,hasAdvisor, andlivesIn belonging toRichard entity in the ontology. The instances of these relationships are shown in Figure 6.Figure 5
RelationshipsmemberOf,writtenBy,hasAdvisor, andlivesIn in the ontology.Figure 6
Examples ofwrittenBy,memberOf, andhasAdvisor entities andlivesIn property.As an example, let us calculate the relationship weight betweenRichard andMethodology, which iswrittenBy, and it is computed as stated in(6)MIwrittenByPublication,Author=IMethodology,Richard·log2⁡IMethodology,RichardIMethodology·IRichard+IMetodology,AlicePerez·log2⁡IMethodology,AlicePerezIMethodology·IAlicePerez+ITheSemanticWeb,AlicePerez·log2⁡ITheSemanticWeb,AlicePerezITheSemanticWeb·IAlicePerez+ITheSemanticWeb,Carlos·log2⁡ITheSemanticWeb,CarlosITheSemanticWeb·ICarlos=14·log2⁡1/41/2·1/4+14·log2⁡1/41/2·1/2+14·log2⁡1/41/2·1/2+14·log2⁡1/41/2·1/4=0.5.It should be noted that a relationship can have many instances. Consequently, calculating the relationships weight would have a high computational cost. Thus, we calculate the mutual information as stated in (7)MIe=≈log2⁡1/Ie1/Ic1·1/Ic2,where [I(e)] represents all relationships e in the relationships set, I(c1) represents all relationships in c1 (subject), and I(c2) represents all relationships in c2 (object).Combining Association and Relationship Weights. The combination of weights requires considering several methods of aggregation, such as average, addition, and multiplication. A weighted sum as combination method to adjust the influence of each factor on the total weight was selected. Finally, to combine the association between each pair of concepts (see (2)) and the weights of the relationships (see (7)), we calculate the final weight to obtain the entities context, as stated in(8)WPci,cj=α·Simc1,c2+β·MIpc1c2,where 0≤α, β≤1. Sim and MI were normalized to be in the 0,1 range by unit-based normalization [13], stated in (9)Sim-minp∈P⁡Simmaxp∈P⁡Sim-minp∈P⁡Sim,MI-minp∈P⁡MImaxp∈P⁡MI-minp∈P⁡MI.


## 4.3. Terms Extraction and Documents Annotation

The textual descriptions of instances and entities semantic context obtained in the previous stage are searched in the inverted index to extract and generate a documents’ annotation table containing the ontology entity, the belonging document, and its weight (see Table1).Table 1
Document annotation.
Entity
Document
Weight
http://ex/onto#State
D1
0.5
http://ex/onto#State
D2
0.2
http://ex/onto#State
D87
0.67
http://ex/onto#Mexico
D1
0.45
http://ex/onto#Mexico
D23
0.6The annotations weight is done by means of TF-IDF algorithm. Term frequency (TF) is the local weighting factor reflecting the importance of a term within a document. Document frequency (DF) is the global weighting factor considering the importance of a term within the document collection. Inverse document frequency (IDF) calculates the frequency of a document within the collection. TF and IDF are calculated using the formulas stated in (10) and (11).(10)TF=freqx,dmaxy⁡freqy,d,where freqx,d is the number of occurrences of term x within document d and maxy⁡freqy,d is the number of occurrences of all terms within document d.(11)IDF=log⁡Ndf,where N is the total number of documents in the collection and df represents the documents where term x appears. The weight dx for x in d is the combination of TF ∗ IDF.Finally, the annotations are represented in the form of serialized triplets in JSON-LD.


## 5. Evaluation

Pearson and Spearman correlation were used in order to measure the agreement with the human judgments. Pearson correlation measures the linear correlation between two variables, uses the ranges, orders numbers of each group of subjects, and compares those ranges. Spearman is a correlation measure between two continuous random variables.Experimental SetupOntology and KIM Platform Knowledge Base [23]. This ontology has 271 classes, and 120 relationships and attributes. Some declared classes are of general importance such as People, Organizations, Government, and Location. The knowledge base consists of 200,000 instances, 50,000 locations, 130,000 organizations, 6,000 people, and more.DBpedia [3]. DBpedia is general-purpose and multilingual in nature and has comprehensiveness. For this reason, it was selected for our experimentation. The English version contains 685 classes and 2795 properties; and the knowledge base is more than 4 million instances. DBpedia contains multiple classification systems, such as YAGO, Wikipedia Categories, and the hierarchical subgraph of the DBpedia Ontology. The Wikipedia Category system has the highest coverage of entities among all three options. To overcome these issues, we use the Wikipedia Category Hierarchy by Kapanipathi et al. [39].Data Sets. LP50 are data sets of documents compiled by Lee and Welsh [14], which was used for our experimentation. LP50 is composed of 50 general-purpose news documents with lengths between 50 and 126 words.Lucene. The Lucene’s documents were indexed to generate a documents index that includes the list of mentions and documents where they appear. Also, the TagMe tool was used for mentions detection in the documents. We used the Jena library for the analysis and extraction of the entities in the ontology. We use Jena TDB triple store to operate DBpedia locally.For space issues, Table2 shows only the results of the first 25 annotated documents. Column 2 shows the number of words in each document. Column 3 shows the mentions detected in each document. The columns 4 and 5 show the mentions linked in the KIM and DBpedia ontologies, respectively.Table 2
Summary of Corpus LP50 annotations with KIM and DBpedia.
#doc
Words
Mention detection
Linked KIM
Linked DBpedia
(
1
)
80
13
8
30
(
2
)
98
21
10
37
(
3
)
98
17
7
34
(
4
)
106
24
4
42
(
5
)
80
13
9
47
(
6
)
97
15
14
43
(
7
)
97
27
8
39
(
8
)
82
24
10
35
(
9
)
126
12
7
28
(
10
)
76
23
11
41
(
11
)
83
17
7
31
(
12
)
67
15
8
38
(
13
)
103
4
10
21
(
14
)
105
16
9
24
(
15
)
90
17
12
45
(
16
)
75
18
11
41
(
17
)
73
15
8
29
(
18
)
62
16
7
25
(
19
)
103
27
13
33
(
20
)
122
19
11
25
(
21
)
94
18
6
31
(
22
)
61
12
6
22
(
23
)
72
13
7
23
(
24
)
54
13
5
16
(
25
)
57
13
5
29Table2 shows only few mentions linked with KIM knowledge base. This is mainly due to the fact that (i) ontologies and instances are limited and (ii) the entities must have a value in rdfs: label.In the first case, if an ontology and knowledge base have a limited scope, a mention in the ontology could not exist. Therefore, ontology with a larger population (as DBpedia) will cover most of the mentions obtained in the documents.In the second case, the entities must have value in rdfs: label, since this depends on links between the mentions and entities. DBpedia has more mention-entity link since it contains more than 4 million instances.Table3 shows the results of the semantic annotation evaluation DBpedia. The standard measures precision, recall, F measure, and accuracy were used for evaluating the annotations obtained. Precision is the rate between the relevant instances of the ontology and the total number of instances retrieved, and recall is the rate between the number of relevant instances retrieved and the total number of relevant instances existing in the ontology:(12)Precision=TPTP+FP,Recall=TPTP+FN,where TP (True Positives) are the set of retrieved instances that are relevant, FP (False Positives) are the set of retrieved instances that are not relevant, and FN (False Negatives) are the set of instances that are wrongly retrieved as nonrelevant.Table 3
Precision, recall,F-measure, and accuracy of semantic annotations between context-free and context-based semantic annotation.
Means
Context-free
Context-based
Precision
0.621
0.893
Recall
0.839
0.799
F-measure
0.678
0.815
Accuracy
0.644
0.835The results show that our proposed method of context-based semantic annotation improves the results of the context-free annotation method.Comparison to State of the Art. The results of our similarity calculation approach were compared with different strategies shown of the state of the art. Some approaches only take into account the weight of the edges, the association between each pairwise concept, and the ontology structure. We compared our approach with different methods in the literature that measure document similarity and use the LP50 data set. Among the methods analyzed are Latent Semantic Analysis (LSA) [40], Explicit Semantic Analysis (ESA) [41], Salient Semantic Analysis (SSA) [40], Graph Edit Distance (GED) [42], and ConceptsLearned [43].The results obtained of comparison of our approach with other methods using LP50 dataset are shown in Table4. The values of Pearson and Spearmen correlation of our approach were 0.745 and 0.65, respectively. This result was best compared to the results of other approaches. Thus, our approach significantly outperforms, to our knowledge, the most competitive related approaches, although ConceptsLearned has a better correlation of Pearson and Spearman (0.81 and 0.75). This is because ConceptsLearned uses 17 more features compared to ours, but the computational cost is high.Table 4
Comparing our approach with other methods using LP50 dataset.
Approach
Pearson correlation
Spearman correlation
LSA
0.59
0.53
ESA
0.68
0.59
SSA
0.71
0.64
GED
0.72
0.64
Our approach
0.745
0.65
ConceptsLearned
0.81
0.75Comparison with Other Metrics for Information Content (IC) Calculation. We performed tests with different metrics to calculate the information content and use the extrinsic approach. The information content with the intrinsic approach can be performed using two parameters: (1) the depth of the class and (2) the descendants of a class.Table5 shows the slight advantage of considering the ontology instances with the extrinsic information content.Table 5
Information content with extrinsic and intrinsic approaches.
Parameter
Metric
Pearson correlation
Depth
Intrinsic
0.743
Descendant
Intrinsic
0.743
Instances
Extrinsic
0.745


## 6. Conclusions

In this paper, we have presented a semantic annotation of unstructured documents approach. Which considers concepts similarity in ontology through its semantic relations.The unstructured documents are represented as graphs, the nodes represent the mentions, and the edges represent the semantics and relationships. Each semantic relationship has a weighting measure assigned. Thus, the significant relationships have a higher weight.The context extraction was done through the computation of association between pairwise concepts and the weight of entity relations. The sum of the two values is the one that measures the meaning or context of an entity. We also took advantage of instances in the knowledge base to measure the information content classes and relationships.According to the state of the art the results obtained with our approach give the best results.As future work, we are trying to reduce the knowledge base by selecting the entities whose definition is more likely to be used in the corpus. Additionally, Word2vec tool for semantic extraction of terms and documents can be used.Finally, this approach also has been compared with other proposals available in the literature.



---

*Source: 7831897-2017-12-07.xml*