estnltk.ner module

class estnltk.ner.NerTagger(model_dir='/home/uku/anaconda3/lib/python3.5/site-packages/estnltk/estner/models/py3_default')[source]

The class for tagging named entities.

Methods

tag_document(document)
tag_documents(documents)
class estnltk.ner.NerTrainer(nersettings)[source]

The class for training NER models. Uses crfsuite implementation.

Methods

train(jsondocs, model_dir) Train a NER model using given documents.
train(jsondocs, model_dir)[source]

Train a NER model using given documents.

Each word in the documents must have a “label” attribute, which denote the named entities in the documents.

Parameters:

jsondocs: list of JSON-style documents.

The documents used for training the CRF model.

model_dir: str

A directory where the model will be saved.

estnltk.ner.json_document_to_estner_document(jsondoc)[source]

Convert an estnltk document to an estner document.

Parameters:

jsondoc: dict

Estnltk JSON-style document.

Returns:

estnltk.estner.ner.Document

A ner document.

estnltk.ner.json_token_to_estner_token(json_token)[source]

Convert a JSON-style word token to an estner token.

Parameters:

vabamorf_token: dict

Vabamorf token representing a single word.

label: str

The label string.

Returns:

estnltk.estner.ner.Token