Skip to main content

Installion

uv pip install fastertext

Usage

On a model such as glotlid you should expect around a 7x-10x speedup compared to regular fasttext.

! wget https://huggingface.co/cis-lmu/glotlid/resolve/main/model_v3.bin
from fastertext import load_model

model = load_model("model_v3.bin")
labels, probs = model.batch(["hello world", "bonjour le monde"], k=2)

id2label = model.get_labels()
print(id2label[int(labels[0, 0])], probs[0, 0])

Benchmark on longer Wikipedia documents

fastertext: 2.93s  34,114 texts/s
fasttext:   17.84s  5,604 texts/s
speedup:    6.1x
top-1 agreement: 100.0000%

Citations

@misc{shippole2026fastertext,
  author       = {Shippole, Enrico},
  title        = {fastertext: embarrassingly parallel fasttext batch inference in rust},
  year         = {2026},
  howpublished = {\url{https://github.com/teraflop-ai/fastertext}}
}

@article{joulin2016bag,
  title={Bag of Tricks for Efficient Text Classification},
  author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Mikolov, Tomas},
  journal={arXiv preprint arXiv:1607.01759},
  year={2016}
}

@article{bojanowski2016enriching,
  title={Enriching Word Vectors with Subword Information},
  author={Bojanowski, Piotr and Grave, Edouard and Joulin, Armand and Mikolov, Tomas},
  journal={arXiv preprint arXiv:1607.04606},
  year={2016}
}

@misc{messense_fasttext_rs,
  author       = {messense},
  title        = {fasttext-rs: fastText Rust binding},
  howpublished = {\url{https://github.com/messense/fasttext-rs}}
}

@misc{wang_fasttext_parallel,
  author       = {Congyu Wang},
  title        = {fasttext-parallel: multithreaded batch processing for fasttext},
  howpublished = {\url{https://github.com/Congyuwang/fasttext-parallel}}
}

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastertext-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (429.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

File details

Details for the file fastertext-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: fastertext-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 429.8 kB
  • Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastertext-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40bf6a78192535318385c0487cec00d457d91ae126f24685a8e826285e0b7457
MD5 e8ce1d46a2b65acdeb92d624746e98d6
BLAKE2b-256 cef3bcb1366cd9f4540898a8cdc098965a7124d27e9edf7ac1b7c9d1d0dd4c2a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

1 file

This release

0.1.1 This release

1 file

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page