TextRazor Annotator

The TextRazorAnnotator is an annotator that uses the TextRazor service to annotate documents. The Service provides a number of extractors which can be chosen when creating the annotator.

import os
from gatenlp import Document
from gatenlp.processing.client.textrazor import TextRazorTextAnnotator
auth_token = os.environ["TEXTRAZOR_AUTH_TOKEN"]    # one way to pass on the token: set an env var 
doc = Document("Barack Obama visited Microsoft in New York last May.")
annt = TextRazorTextAnnotator(
    # lang="en",
    extractors=None,   # None is same as ["words", "sentences", "entities"]
    outset_name="",
    auth_token=auth_token,
)
doc = annt(doc)
doc

Notebook last updated

import gatenlp
print("NB last updated with gatenlp version", gatenlp.__version__)
NB last updated with gatenlp version 1.0.8a1