How to use the errant.annotator.Annotator function in errant

To help you get started, we’ve selected a few errant examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chrisjbryant / errant / errant / __init__.py View on Github external
if lang not in supported:
        raise Exception("%s is an unsupported or unknown language" % lang)

    # Load spacy
    nlp = nlp or spacy.load(lang, disable=["ner"])

    # Load language edit merger
    merger = import_module("errant.%s.merger" % lang)

    # Load language edit classifier
    classifier = import_module("errant.%s.classifier" % lang)
    # The English classifier needs spacy
    if lang == "en": classifier.nlp = nlp

    # Return a configured ERRANT annotator
    return Annotator(lang, nlp, merger, classifier)

errant

The ERRor ANnotation Toolkit (ERRANT). Automatically extract and classify edits in parallel sentences.

MIT
Latest version published 11 months ago

Package Health Score

59 / 100
Full package analysis