Need a good relation extractor

Yangrui picture Yangrui · Dec 21, 2014 · Viewed 7.1k times · Source

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?

Answer

Charlie Greenbacker picture Charlie Greenbacker · Dec 21, 2014

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