Skip to main content

Python library gatenlp

PyPi version Python compatibility Downloads PyPI - Downloads License GitHub Build Status Code style: black Join the chat at https://gitter.im/GateNLP/python-gatenlp Codacy Badge Documentation Status

Python GateNLP

Python package for:

  • Representing documents, annotations, annotation and document features etc.
  • Processing documents with powerful NLP libraries like Stanza, Spacy, NLTK and represent results as gatenlp annotations and features
  • Visualize annotations and features using interactive HTML and allow those visualizations to be included in Jupyter or Colab notebooks
  • Using a powerful pattern matching library (PAMPAC) to match complex patterns based on text, annotations and features and create new annotations
  • Interact with and use Java GATE from Python
  • Allow to use Python processing from Java GATE via the GATE Python plugin
  • Provide abstractions for building complex processing pipelines

Python GateNLP is a natural language processing (NLP) and text processing framework implemented in Python.

It provides very flexible representations of documents, stand-off annotations with arbitrary types and features, grouped into arbitrary annotations sets, spans, corpora, annotators, pipelines and more. Documents, annotations and corpora can be easily and interactively visualized in notebooks. It provides the ability to use existing NLP tools for annotating documents out of the box: Spacy, Stanza as well as online services like Gate Cloud, ELG, Google NLP, IBM Watson and others. The result of these tools get represented as GateNLP annotations making it easy to write code that works with all of these tools in the same way or compares or combines the results of these tools.

In addition, GateNLP provides its own annotator tools: string-based and token based gazetteers, regular-expression-based annotators, and a very powerful and flexible rule-based annotator (PAMPAC) which allows to match complex pattern of annotations and text.

Documentation and feedback

If you find bugs, want to requrest a feature or change, please use the issue tracker

For more general discussions about the package and communication within current and future users, please use the Dicussions

Overview

Python GateNLP is an NLP and text processing framework implemented in Python.

Python GateNLP represents documents and stand-off annotations very similar to the Java GATE framework: Annotations describe arbitrary character ranges in the text and each annotation can have an arbitrary number of features. Documents can have arbitrary features and an arbitrary number of named annotation sets, where each annotation set can have an arbitrary number of annotations which can overlap in any way. Python GateNLP documents can be exchanged with Java GATE by using the bdocjs/bdocym/bdocmp formats which are supported in Java GATE via the Format Bdoc Plugin

Other than many other Python NLP tools, GateNLP does not require a specific way of how text is split up into tokens, tokens can be represented by annotations in any way, and a document can have different ways of tokenization simoultanously, if needed. Similarly, entities can be represented by annotations without restriction: they do not need to start or end at token boundaries and can overlap arbitrarily.

GateNLP provides ways to process text and create annotations using annotating pipelines, which are sequences of one or more annotators. There are annotators for matching text against gazetteer lists and annotators for complex matching of annotation and text sequences (see PAMPAC).

There is also support for creating GateNLP annotations with other NLP packages like Spacy or Stanford Stanza.

The GateNLP document representation also optionally allows to track all changes done to the document in a "change log" (a gatenlp.ChangeLog instance). Such changes can later be applied to other Python GateNLP or to Java GATE documents.

This library also implements the functionality for the interaction with a Java GATE process in two different ways:

  • The Java GATE Python plugin can invoke a python process to annotate GATE documents with python code
  • the python code can remote-control a Jave GATE instance

Versions and Roadmap

  • Versions 0.x are unpublished
  • Versions 1.0.x are public releases with feedback that may change APIs and change main parts of the software
  • Versions 1.x are public stable releases

Default branch renamed to "main"

If you have a cloned copy, you need to rename it in your local copy as well:

git branch -m master main
git fetch origin
git branch -u origin/main main

NOTE: The previous Pypi project "gatenlp" has moved to gatenlphiltlab

Release files for gatenlp 1.0.8

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

Source distribution (sdist)

Source distribution for gatenlp 1.0.8
File Size Uploaded
gatenlp-1.0.8.tar.gz 14.5 MB Details

Built distribution (wheel)

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

Total release size: 14.8 MB

Release files / gatenlp-1.0.8.tar.gz

Download URL gatenlp-1.0.8.tar.gz
Size 14.5 MB
Tags Source
SHA-256 checksum
How to use checksums
b43e8f10fc0b380f8e3b72b54433994796a090042d2b6e2e2af4db5d0445c902
BLAKE2b-256 checksum
How to use checksums
8f2de0a23eb189544995ecf89c558d2e24b7ef873e7858ffff8f8e00aa7b1adb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Release files / gatenlp-1.0.8-py3-none-any.whl

Download URL gatenlp-1.0.8-py3-none-any.whl
Size 335.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fb139252eb09dee1fd84ab41843072f231d98663fa9239d857e264b6326e7c8
BLAKE2b-256 checksum
How to use checksums
dce860ef3d40ac17646a123372aadd212c32901646b8ce63687d8d4e23eb7e3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
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