Stanford Relation Extractor is a Java implementation to find relations between two entities. The current relation extraction model is trained on the relation types (except the 'kill' relation) and data from the paper Roth and Yih, Global inference for entity and relation identification via a linear programming formulation, 2007, except instead of using the gold NER tags, we used the NER tags predicted by Stanford NER classifier to improve generalization.
The algorithm and features are described in the paper below. The code was mostly written by Mihai Surdeanu, David McClosky, Mason R. Smith, Andrey Gusev, and modified by Sonal Gupta. The performance of the model using the NER tags predicted by our NER classifier is here.
Mihai Surdeanu, David McClosky, Mason R. Smith, Andrey Gusev, and Christopher D. Manning. 2011. Customizing an Information Extraction System to a New Domain. In Proceedings of the ACL 2011 Workshop on Relational Models of Semantics.
Stanford Relation Extractor is available for download via Stanford CoreNLP.
Included with Stanford relation extractor is a classifier to predict relations Live_In, Located_In, OrgBased_In, Work_For, and None.
Use annotator "relation" in the Stanford CoreNLP pipeline and the results are saved in annotations
MachineReadingAnnotations.RelationMentionsAnnotation.class, which returns a list of
If you want to train your own model, see this properties file for an example. The description of the flags is in the file. You can run the code as:
java -cp classpath edu.stanford.nlp.ie.machinereading.MachineReading --arguments roth.properties
The easiest way to train your own model on a different dataset is to have the data formatted in the same way as Roth and Yih's data, more specifically like this. You can use this properties file after changing the
trainUsePipelineNER as true if you want to use NER tags produced by the Stanford NER toolkit.
Once you train your model, you can specify your trained model in the Stanford CoreNLP pipeline with property
sup.relation.model=[value given to the flag serializedRelationExtractorPath]
We have 3 mailing lists, all of which are shared
with other JavaNLP tools.Each address is
java-nlp-userThis is the best list to post to in order to ask questions, make announcements, or for discussion among JavaNLP users. You have to subscribe to be able to use it. Join the list via this webpage or by emailing
firstname.lastname@example.org. (Leave the subject and message body empty.) You can also look at the list archives.
java-nlp-announceThis list will be used only to announce new versions of Stanford JavaNLP tools. So it will be very low volume (expect 1-3 messages a year). Join the list via this webpage or by emailing
email@example.com. (Leave the subject and message body empty.)
java-nlp-supportThis list goes only to the software maintainers. It's a good address for licensing questions, etc. For general use and support questions, you're better off joining and using
java-nlp-user. You cannot join
java-nlp-support, but you can mail questions to