Skip to main content


Project description

TEXTA Bert Tagger

Py3.8 Py3.9


Using built package

pip install texta-bert-tagger

Using Git

pip install git+


python -m pytest -v tests


Documentation for version 1.* is available here.

Documentation for version 2.* is available here.

Documentation for version 3.* is available here.

Usage (for versions >=3..)

Fine-tune BERT model

from texta_bert_tagger.tagger import BertTagger
bert_tagger = BertTagger()

data_sample = {"good": ["It was a nice day.", "All was well."], "bad": ["It was horrible.", "What a disaster."]}

# Train a model

# pos_label - used in metrics (precision, recall, f1-score etc) calculations as true label
bert_tagger.train(data_sample, pos_label="bad", n_epochs=2)

# Predict
result = bert_tagger.tag_text("How awful!")


[{"prediction": "bad", "probability": 0.55200404, "attributions": {}}]

Project details

Download files

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

Source Distribution

texta-bert-tagger-3.0.2.tar.gz (30.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page