Download tags/train.py from anshy/classifs: direct link, hf CLI and curl.
- Browser
- Download file 580 Bytes
-
https://huggingface.co/anshy/classifs/resolve/main/tags/train.py
- Command line
-
hf download hf://anshy/classifs/tags/train.py
-
curl -L -o train.py https://huggingface.co/anshy/classifs/resolve/main/tags/train.py
580 Bytes
| """Exact training call used for this model. Run from inside this directory: | |
| python train.py | |
| Same dim64/epoch10 baseline hyperparams as quality/multilingual, plus loss="ova" | |
| (fastText's native multi-label mode): one shared model/vocabulary across all 424 tags, | |
| trained jointly, rather than 424 separate binary classifiers -- see README.md.""" | |
| import fasttext | |
| HPARAMS = dict(dim=64, epoch=10, lr=0.3, wordNgrams=2, minCount=3, bucket=2_000_000, loss="ova") | |
| model = fasttext.train_supervised(input="train.txt", **HPARAMS) | |
| model.save_model("model.bin") | |
| print("saved model.bin") | |