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.

Installation

You can install “kindred” via pip from PyPI:

$ pip install kindred

Kindred relies on the Stanford CoreNLP toolkit for parsing. By default it will attempt to connect to a local server (localhost:9000). If you want Kindred to download the CoreNLP files and run it as a subprocess when a server can’t be found, use the following command:

>>> import kindred
>>> kindred.downloadCoreNLP()

Usage

Full documentation can be found at readthedocs.

BioNLP Shared Task Example

>>> 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])

Contributing

Contributions are very welcome.

License

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

Issues

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.

Source Distribution

kindred-1.1.1.tar.gz (27.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page