Skip to main content

Kindred

Kindred is a Python3 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 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_core_web_sm

Usage

Check out the tutorial that goes through a simple use case of extracting capital cities from text. More details and the full documentation can be found at readthedocs.

BioNLP Shared Task Example

import kindred

# Load the SeeDev corpus
trainCorpus = kindred.bionlpst.load('2016-SeeDev-binary-train')
devCorpus = kindred.bionlpst.load('2016-SeeDev-binary-dev')

# Create a copy of the dev corpus to make predictions on
predictionCorpus = devCorpus.clone()
predictionCorpus.removeRelations()

# Create a relation classifier, train it and make predictions
classifier = kindred.RelationClassifier()
classifier.train(trainCorpus)
classifier.predict(predictionCorpus)

# Get the F1 score of the predicted relations
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.

Citing

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

@article{lever2017painless,
   title={Painless {R}elation {E}xtraction with {K}indred},
   author={Lever, Jake and Jones, Steven},
   journal={BioNLP 2017},
   pages={176--183},
   year={2017}
}

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.

Release files for kindred 2.8.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kindred 2.8.4
File Size Uploaded Provenance
kindred-2.8.4.tar.gz 58.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kindred 2.8.4
File Interpreter ABI Platform
kindred-2.8.4-py3-none-any.whl Python 3 none any Details

Total release size: 105.1 kB

Release files / kindred-2.8.4.tar.gz

Download URL kindred-2.8.4.tar.gz
Size 58.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f05a3d1d5f62e4c9fe04172dbd75da8ae8b2081db675637d69f14734d518fa86
BLAKE2b-256 checksum
How to use checksums
ae4f17d016abeca7f30c8c4f32ff7ce4c660337ad4e65bace6285112fcec6dc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release files / kindred-2.8.4-py3-none-any.whl

Download URL kindred-2.8.4-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9918e94bb8c584d18407816ca36e3431ae4e46a3f5acea9c60473eb07f28f29
BLAKE2b-256 checksum
How to use checksums
3bd99ab7cc23e9b151aeb00528a5ae263e73a12ce6e69de0a5953487194822b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Security for kindred 2.8.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.8.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page