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?
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.
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.
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).
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.
There are a few different tools you might want to look at:
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):
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:
Note: OpenIE uses a non-standard open source license that expressly prohibits commercial use.
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:
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
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With