Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a good relation extractor

I'm doing a NLP project.

The purpose of the project is to extract possible relationship between two things. For example, for a pair "location" and "person" the extracted results would be "near", "lives in", "works in", etc.

Is there any existing NLP tool capable of doing this?

like image 317
Yangrui Avatar asked Dec 21 '14 10:12

Yangrui


People also ask

What is relationship extraction?

What is relationship extraction? Relationships are the grammatical and semantic connections between two entities in a piece of text. Rosette® uses a combination of deep learning and semantic rules to recognize and extract the relationship that connects the entities.

Why should you perform joint NER and relation extraction?

Performing joint NER and relation extraction will open up a whole new way of information retrieval through knowledge graphs where you can navigate across different nodes to discover hidden relationships. Therefore, performing these tasks jointly will be beneficial.

What relations does the Stanford relation extractor extract?

The Stanford Relation Extractor extracts relations Live_In, Located_In, OrgBased_In, and Work_For. If you want to use a different set of relations, you can train your own relation extractor using the code (details provided on the webpage).

Can NLP solve the problem of extracting relations among named entity?

In this post, we introduce the problem of extracting relations among named entities using NLP. We illustrate this problem with examples of progressively increasing sophistication, and muse, along the way, on ideas towards solving them. Let’s get started. Consider these sentences. John Doe works at Google. Apple is located in Cupertino.


2 Answers

There are a few different tools you might want to look at:

MITIE

MIT's new MITIE tool supports basic relationship extraction. Included in the distribution are 21 English binary relation extraction models trained on a combination of Wikipedia and Freebase data. You can also train your own custom relation detectors. Here's a listing of the MITIE/MITIE-models/english/binary_relations/ directory, which is downloaded when you run the make MITIE-models target during the build process (the names should be relatively self-explanatory):

  • rel_classifier_book.written_work.author.svm
  • rel_classifier_film.film.directed_by.svm
  • rel_classifier_influence.influence_node.influenced_by.svm
  • rel_classifier_law.inventor.inventions.svm
  • rel_classifier_location.location.contains.svm
  • rel_classifier_location.location.nearby_airports.svm
  • rel_classifier_location.location.partially_contains.svm
  • rel_classifier_organization.organization.place_founded.svm
  • rel_classifier_organization.organization_founder.organizations_founded.svm
  • rel_classifier_organization.organization_scope.organizations_with_this_scope.svm
  • rel_classifier_people.deceased_person.place_of_death.svm
  • rel_classifier_people.ethnicity.geographic_distribution.svm
  • rel_classifier_people.person.ethnicity.svm
  • rel_classifier_people.person.nationality.svm
  • rel_classifier_people.person.parents.svm
  • rel_classifier_people.person.place_of_birth.svm
  • rel_classifier_people.person.religion.svm
  • rel_classifier_people.place_of_interment.interred_here.svm
  • rel_classifier_time.event.includes_event.svm
  • rel_classifier_time.event.locations.svm
  • rel_classifier_time.event.people_involved.svm

OpenIE

OpenIE from the Univ of Washington will extract relationships from text, representing the output as triples in the form of (Arg1, Arg2, Relation). For example, given the input sentence:

The U.S. president Barack Obama gave his speech on Tuesday to thousands of people.

OpenIE will extract these binary relations:

  • (Barack Obama, is the president of, the U.S.)
  • (Barack Obama, gave, his speech)
  • (Barack Obama, gave his speech, on Tuesday)
  • (Barack Obama, gave his speech, to thousands of people)

Note: OpenIE uses a non-standard open source license that expressly prohibits commercial use.

Stanford Relation Extractor

The Stanford Relation Extractor extracts relations Live_In, Located_In, OrgBased_In, and Work_For. If you want to use a different set of relations, you can train your own relation extractor using the code (details provided on the webpage).

If you want basic dependencies, you can also use the Stanford Dependency Parser:

The Stanford Dependency Parser (part of the Stanford Parser) will extract grammatical relations between words in a sentence. For example, given this input:

Bills on ports and immigration were submitted by Senator Brownback, Republican of Kansas

The Stanford Parser will extract these grammatical dependencies:

  • nsubjpass(submitted, Bills)
  • auxpass(submitted, were)
  • agent(submitted, Brownback)
  • nn(Brownback, Senator)
  • appos(Brownback, Republican)
  • prep_of(Republican, Kansas)
  • prep_on(Bills, ports)
  • conj_and(ports, immigration)
  • prep_on(Bills, immigration)

GATE

GATE from the Univ of Sheffield also includes a relation extraction capability, though I've never used it myself. This presentation provides an overview of how it works: https://gate.ac.uk/sale/talks/gate-course-may10/track-3/module-11-ml-adv/module-11-relations.pdf

like image 52
Charlie Greenbacker Avatar answered Oct 12 '22 12:10

Charlie Greenbacker


The MIML-RE relation extractor (http://nlp.stanford.edu/software/mimlre.shtml) could also be useful, if you're looking for one of the relations in the KBP relation set (see http://surdeanu.info/kbp2014/TAC_KBP_2014_Slot_Descriptions_V1.1.pdf). Admittedly, this is a much bigger system that's more of a pain to set up than the "relation" annotator in CoreNLP.

Probably the easiest way to get started with this option, is to download http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22stanford-kbp%22 (make sure to also download the models, as well as all of the dependencies). From there, there are a bunch of relatively low-barrier entry methods in SlotfillingTasks (e.g., getSlotsInSentence() gets all relations for a given entity, or classifyRelation() classifies the relation between two entities in a sentence).

like image 35
Gabor Angeli Avatar answered Oct 12 '22 13:10

Gabor Angeli