Practical overview
When it fits
Use Tamnun within a Python machine-learning workflow when its documented BERT, PyTorch fitting or distillation interfaces match the task.
Who it is for
- Python developers building NLP classifiers with BERT.
- Machine-learning practitioners who want to fit PyTorch modules through an estimator interface.
- Developers exploring teacher-to-student model distillation.
Documented uses
- Fine-tune BERT for binary or multiclass classification using a scikit-learn pipeline.
- Fit a PyTorch module for classification with TorchEstimator.
- Distill a larger teacher model into a smaller student model.
Requirements & limits
The project is presented as an open-source library on GitHub. Its README gives installation instructions through PyPI or a source checkout and lists Python 3.6 and 3.7.
- The README lists Python 3.6 and 3.7; check the project instructions against the Python environment you intend to use.
- Tamnun depends on machine-learning frameworks including PyTorch and Keras, with additional dependencies.
- The BERT classifier is documented for binary and multiclass classification.
- The repository provides a fine-tuning script and notebooks, including examples for BERT fine-tuning and distillation.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Fine-tune BERT for binary classification
Fit a BERT classifier with Tamnun's scikit-learn-style pipeline and predict labels for test inputs.
Before you start
- Tamnun and its dependencies, including PyTorch-Pretrained-BERT and scikit-learn.
- Training inputs
train_Xand labelstrain_y, plus test inputstest_X.
Steps
Import
BertClassifierandBertVectorizerfromtamnun.bert, andmake_pipelinefromsklearn.pipeline.Create and fit a pipeline with
make_pipeline(BertVectorizer(), BertClassifier(num_of_classes=2)).fit(train_X, train_y).Call
clf.predict(test_X)to produce predictions.
Expected outcome
The pipeline produces predictions from a BERT classifier fitted for binary classification.
Guide limitations
- The README states support for binary and multiclass classification; this recipe covers binary classification only.
- The README points to a notebook for a full example; it does not define the training-data format here.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 18 October 2026
- Original website title
- hiredscorelabs/tamnun-ml · Official homepage title · retained in its source language

