Skip to main content

Python Library for Named Entity Recognition (NER) and Linking (NEL) in the biomedical domain.

BENT can be used for:

  • Named Entity Recogniton (NER)

  • Named Entity Linking (NEL)

  • Named Entity Recognition and Linking (NER+NEL)

Access the full documentation.

Citation:

Pedro Ruas and Francisco M. Couto. `Nilinker: attention-based approach to nil entity linking.
Journal of Biomedical Informatics, 132:104137, 2022.
doi: https://doi.org/10.1016/j.jbi.2022.104137.

Installation

To use the current version of BENT it is required:

  • OS: Debian>=11/Ubuntu>=20.04

  • Python >=3.7, <=3.10.13

  • Required space between 5.5 GB - 10 GB * Dependencies: 2.5 GB * Data: between 3.0 GB (base) or 7.5 GB (if you use all available knowledge bases for Named Entity Linking)

If you have Docker installed in your system, the easiest way is to pull the BENT Docker image from DockerHub:

docker pull pedroruas18/bent

Alternatively, you can install the BENT package using pip:

pip install bent

After the pip installation, it is required a further step to install non-Python dependencies and to download the necessary data. Run in the command line:

bent_setup

Only the default knowledge bases ‘medic’ and ‘chebi’ will be available at this point.

To disable annoyng messages in the terminal run:

export TF_CPP_MIN_LOG_LEVEL='3'

You can download more knowledge bases later by specifying the desired knowledge bases among the ones that are available:

python -c "from bent.get_kbs import get_additional_kbs;get_additional_kbs([<kb1>, <kb2>])"

The following knowledge bases can be configured:

Example: to download the NCBI Taxonomy and the NCBI Gene run:

python -c "from bent.get_kbs import get_additional_kbs;get_additional_kbs(['ncbi_taxon', 'ncbi_gene'])"

Get started

To apply the complete pipeline of entity extraction (NER+NEL) set the arguments:

  • recognize: indicate that the NER module will be applied (‘True’)

  • link: indicate that the NEL module will be applied (‘True’)

  • types: entity types to recognize and the respective target knowledge bases.

  • in_dir: directory path containing the text files to be annotated (the directory must contain text files exclusively)

  • out_dir: the output directory that will contain the annotation files

Python example:

import bent.annotate as bt

bt.annotate(
        recognize=True,
        link=True,
        types={
         'disease': 'medic'
         'chemical': 'chebi',
         },
        in_dir='data/txt/',
        out_dir='data/ann/'
)

It is also possible to apply the pipeline (NER+NEL) to a string or a list or strings instantiated in the execution script.

To see more usage examples, access the documentation.

Release files for bent 0.0.80

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

Source distribution (sdist)

Source distribution for bent 0.0.80
File Size Uploaded
bent-0.0.80.tar.gz 75.9 kB Details

Built distribution (wheel)

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

Total release size: 169.3 kB

Release files / bent-0.0.80.tar.gz

Download URL bent-0.0.80.tar.gz
Size 75.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2e6c97dd50b3cb1e6a4dec96dbfab5d2526a7fcd12c78545a12e871639d0da82
BLAKE2b-256 checksum
How to use checksums
c3e113d18f6f32f46475ba2e8956a7ad4c8720ec7b487afaf1bdf106eab30335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.5

Release files / bent-0.0.80-py3-none-any.whl

Download URL bent-0.0.80-py3-none-any.whl
Size 93.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d838068997a2542c53ec2f294e38dee761c185074adeb5a2d4d6dcc327a32206
BLAKE2b-256 checksum
How to use checksums
c952962b656d944bc4bd766ca36606fafdbe0bb98463ed83bba1c9108e45f55e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.80 This release

2 release files

0.0.70

2 release files

0.0.69

2 release files

0.0.66

2 release files

0.0.65

2 release files

0.0.64

2 release files

0.0.63

2 release files

0.0.62

2 release files

0.0.61

2 release files

0.0.59

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.43

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.9

2 release files

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