TEXTA Bert Tagger
Installation
Using built package
pip install texta-bert-tagger
Using Git
pip install git+https://git.texta.ee/texta/texta-bert-tagger-python.git
Testing
python -m pytest -v tests
Documentation
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!")
print(result)
Output
[{"prediction": "bad", "probability": 0.55200404, "attributions": {}}]
Release files for texta-bert-tagger 3.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| texta-bert-tagger-3.0.2.tar.gz | 30.5 kB | Details |
Release files / texta-bert-tagger-3.0.2.tar.gz
| Download URL | texta-bert-tagger-3.0.2.tar.gz |
|---|---|
| Size | 30.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9719cea7e8288f76ed8593694836fafd0e9c8d544d767793201c39f09e11a0cb
|
|
BLAKE2b-256 checksum How to use checksums |
e0326e61503d7dfafea7f382a15eeb91d9e95cf147cc768c7010c5ef41ba157a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|