Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Natural Language Framework, for NER and RE

Project description

☝️ 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)

HOWTO Install


  • Requires Python 3 (3.5, 3.6)

Install nalaf

From PyPi

pip3 install nalaf
python3 -m nalaf.download_data

From source

git clone
cd nalaf
python3 install
python3 -m nalaf.download_data


python3 nosetests -a '!slow' # Exclude the slow ones

HOWTO Run, Examples

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


Project details

Download files

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

Files for nalaf, version 0.5.10
Filename, size File type Python version Upload date Hashes
Filename, size nalaf-0.5.10.tar.gz (8.7 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page