Relationship types

There are many possible relationship types. A few categories and examples of relationships are found in the following table. An interesting site that contains a multitude of relationships is Freebase (https://www.freebase.com/). It is a database of people, places, and things organized by categories. The WordNet thesaurus (http://wordnet.princeton.edu/) contains a number of relationships:

Relationship

Example

Personal

father-of, sister-of, girlfriend-of

Organizational

subsidiary-of, subcommittee-of

Spatial

near-to, northeast-of, under

Physical

part-of, composed-of

Interactions

bonds-with, associates-with, reacts-with

Named Entity Recognition (NER) is a low-level type of NLP classification that was covered in Chapter 4, Finding People and Things. However, many applications need to go beyond this and identify different types of relationships. For example, when NER is applied to identify individuals, then knowing that we are dealing with a person can further refine the relationships that are present.

Once these entities have been identified, then links can be created to their containing documents or used as indexes. For question answering applications, named entities are often used for answers. When a sentiment of text is determined, it needs to be attributed to some entity.

For example, consider the following input:

He was the last person to see Fred. 

Using OpenNLP NER as input with the preceding sentence, as we did in Chapter 4, Finding People and Things, we get the following output:

Span: [7..9) person
Entity: Fred 

Using the OpenNLP parser, we get a lot more information about the sentence:

    (TOP (S (NP (PRP He)) (VP (VBD was) (NP (NP (DT the) (JJ last) (NN person)) (SBAR (S (VP (TO to) (VP (VB see))))))) (. Fred.)))  

Consider the following input:

The cow jumped over the moon. 

For the preceding sentence, the parser returns this:

    (TOP (S (NP (DT The) (NN cow)) (VP (VBD jumped) (PP (IN over) (NP (DT the) (NN moon))))))
  

There are two types of parsing:

  • Dependency: This focuses on the relationship between words
  • Phrase structure: This deals with phrases and their recursive structure

Dependencies can use labels such as subject, determiner, and prepositions to find relationships. Parsing techniques include shift-reduce, spanning tree, and cascaded chunking. We are not concerned about these differences here, but will focus on the use and outcome of various parsers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset