Skip to main content

A relation extraction toolkit for biomedical text mining

Project description

PyPI Release Travis CI status Coverage status Documentation status MIT license

Kindred is a package for relation extraction in biomedical texts. Given some training data, it can build a model to identify relations between entities (e.g. drugs, genes, etc) in a sentence.


You can install “kindred” via pip from PyPI:

$ pip install kindred

As of v2, Kindred relies on the Spacy toolkit for parsing. After installing kindred (which also installs spacy), you will need to install a Spacy language model. For instance, the command below installs the english language model:

$ python -m spacy download en


Full documentation can be found at readthedocs.

BioNLP Shared Task Example

>>> import kindred
>>> trainCorpus = kindred.bionlpst.load('2016-BB3-event-train')
>>> devCorpus = kindred.bionlpst.load('2016-BB3-event-dev')
>>> predictionCorpus = devCorpus.clone()
>>> predictionCorpus.removeRelations()
>>> classifier = kindred.RelationClassifier()
>>> classifier.train(trainCorpus)
>>> classifier.predict(predictionCorpus)
>>> f1score = kindred.evaluate(devCorpus, predictionCorpus, metric='f1score')

PubAnnotation Example

>>> corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')

PubTator Example

>>> corpus = kindred.pubtator.load([19894120,19894121])

Input Formats

Kindred can load several formats, including BioNLP Shared Task, JSON, BioC XML and a simple tag format. Check out the file format documentation for example data and code.


It would be wonderful if you could cite the associated paper for this package if used in any academic research.

   title={Painless {R}elation {E}xtraction with {K}indred},
   author={Lever, Jake and Jones, Steven},
   journal={BioNLP 2017},


Contributions are very welcome.


Distributed under the terms of the MIT license, “kindred” is free and open source software


If you encounter any problems, please file an issue along with a detailed description.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kindred, version 2.3.0
Filename, size File type Python version Upload date Hashes
Filename, size kindred-2.3.0.tar.gz (34.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page