Skip to main content

☝️ We moved

This library is not maintained anymore, and is only ocassionally receiving bugfixes.

We moved the functionality to train NER & Relation models to the text annotation tool, tagtog:

tagtog, The Text Annotation Tool to Train AI




PyPI version Build Status codecov

nalaf - (Na)tural (La)nguage (F)ramework

nalaf is a NLP framework written in python. The goal is to be a general-purpose module-based and easy-to-use framework for common text mining tasks. At the moment two tasks are covered: named-entity recognition (NER) and relationship extraction. These modules support both training and annotating. Associated to these, helper components such as cross-validation training or reading and conversion from different corpora formats are given. At the moment, NER is implemented with Conditional Random Fields (CRFs) and relationship extraction with Support Vector Machines (SVMs) using either linear or tree kernels.

Historically, the framework started from 2 joint theses at Rostlab at Technische Universität München with a focus on bioinformatics / BioNLP. Concretely the first goal was to do extraction of NL mutation mentions. Soon after another master's thesis used and generalized the framework to do relationship extraction of transcription factors (TF) interacting with gene or gene products. The nalaf framework is planned to be used in other BioNLP tasks at Rostlab.

As a result of the original BioNLP focus, some parts of the code are tailored to the biomedical domain. However, current efforts are underway to generalize all parts and this process is almost done. Development is not active and code maintenance is not guaranteed.

Current maintainer: Juan Miguel Cejuela (@juanmirocks).

Pipeline diagram (editable version on Lucidchart of the pipeline diagram; requires log in)

Install

Requires Python ^3.6

From PyPi

pip3 install nalaf
python3 -m nalaf.download_data

From source

git clone https://github.com/Rostlab/nalaf.git
cd nalaf
poetry shell
poetry update
python3 -m nalaf.download_data

Developing

See wiki

Test

nosetests

Run Examples

Run example_annotate.py for a simple example of annotation with a pre-trained NER model for protein names extraction:

Release files for nalaf 0.6.0

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

Source distribution (sdist)

Source distribution for nalaf 0.6.0
File Size Uploaded
nalaf-0.6.0.tar.gz 94.9 kB Details

Built distribution (wheel)

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

Total release size: 206.8 kB

Release files / nalaf-0.6.0.tar.gz

Download URL nalaf-0.6.0.tar.gz
Size 94.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9b66ccb948fe6daae0c7839ecaa04954c50aef4a33ba3ef59c8f4b9dff0ac42e
BLAKE2b-256 checksum
How to use checksums
0009c45a81fdf8934340c6276a54a7247a4824fffb700132894f2d7684e1f318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.6.12 Darwin/20.2.0

Release files / nalaf-0.6.0-py3-none-any.whl

Download URL nalaf-0.6.0-py3-none-any.whl
Size 111.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb3b4185297582e17a478cef7880bf3c8493e35f053a9d52c1c4676ea5cc8711
BLAKE2b-256 checksum
How to use checksums
7a168a21e29a8a43832f9e1a2390d88453749d4d0d168318b6b32856a38e2b6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.6.12 Darwin/20.2.0

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.10

1 release file

0.5.9

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.1

1 release file

0.3.0

1 release file

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