Skip to main content

A Rust-backed Python implementation of Facebook's fastText

Project description

fasttext.rs logo
PyPI CI

[!WARNING] This was completely AI-generated. Running on a ralph wiggum loop to see what was possible. I HAVE NOT checked the code.

fasttext.rs

A Rust-backed Python implementation of Facebook's fastText.

Installation

uv add fasttext-rs
# or
uv pip install fasttext-rs

Quick start

import fasttext_rs

# Train
model = fasttext_rs.train_supervised(input="cooking.train", epoch=25, lr=1.0, word_ngrams=2)

# Predict
labels, probs = model.predict("Which baking dish is best?")

# Vectors
vec = model.get_word_vector("hello")

# Save / Load
model.save_model("model.bin")
model = fasttext_rs.load_model("model.bin")

Performance

Benchmarked on the cooking.stackexchange dataset (12k training, 3k validation) with default parameters, single-threaded. Median of 5 runs, Apple M3 Pro.

Task fasttext (C++) fasttext.rs (Rust) Speedup
Training (5 epochs) 12.633s 6.406s 1.97x
Inference (3000 samples) 0.443s 0.218s 2.03x
Precision@1 0.1363 0.1543
Recall@1 0.0590 0.0703

Run make bench to reproduce.

Development

make           # Show all commands

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

fasttext_rs-0.2.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

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

fasttext_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (376.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

fasttext_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (380.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

fasttext_rs-0.2.0-cp39-abi3-win_amd64.whl (248.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

fasttext_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (380.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

fasttext_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (347.8 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

fasttext_rs-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl (356.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

fasttext_rs-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (395.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file fasttext_rs-0.2.0.tar.gz.

File metadata

  • Download URL: fasttext_rs-0.2.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fasttext_rs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d8615b6c664f6b210d77289956829ea3072ba7329f15b0b8d9fbab25f711a2ab
MD5 0fa4f0553c8654c8ee8822483c9717fb
BLAKE2b-256 f3cc759dcc36ab88ffe35f9ac64564af07a2a04ef8d5c3652738c8b773f35bd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0.tar.gz:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d7c50f65172616a928001b85516d5ecba47f78384c77fc718684979b980618e5
MD5 9d96041405881fa29bd5f9294b827243
BLAKE2b-256 9072879c7eca56218425fa2e309f58f3cba0d5e5cc592d78ba1613027ea15512

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8104bbab823e13a0e53cd588aa3a5ccea595848980db011140e95373c79c5685
MD5 a8b98187a6aa4e64771144224ac34c0e
BLAKE2b-256 080140779bd0ba3a4f0e454e54867962e1b47cf9c7c5306630bc23e19c93c767

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: fasttext_rs-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 248.6 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fasttext_rs-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 755f47be6b89a88b668be1374f0372f68f68deab8e1829dabfe7d350c77b77e1
MD5 ec306a089e2c2ad6a7750b5f04f32686
BLAKE2b-256 d0ca2ff46b5254178c4ec6fc738b3f8f33cc1eac462661ba670ef05a70239dee

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3c32889098c27c77836455fce046c1094c0a2e762120a21bc4255f6e2019dc7b
MD5 669bf045bb9e422c387a4fa023ac5f99
BLAKE2b-256 1d0a907b45b6b479ee15998ce02317561eaaac4f6a610c1e6386033958f918a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11ceb15b31b2384d0387bedbbd05d3e042c31de5ccfc9fef268486b82e830729
MD5 9b678058bab33c187cf10419cd5e77a6
BLAKE2b-256 835f7fa252fd9cca58636533bec1161705de16eeefcc0aa39051aeca460e3ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bcaee4d60313d9548456014d38748705cb639682c4ceaebf4c122e2b52afb0bb
MD5 13a33b76ef5223aeaa9638c113b5a4ce
BLAKE2b-256 a88e0fecfedbe9fcfa0950e3d4afffb82ef7e27916e30cf3845e67978f29a726

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fasttext_rs-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ddd2b50ae3c97e4b7f74b91c5d47c1ee0898db36585ac03dae7df9514108bb0a
MD5 285baa6ecf500478093cc7f50acfa30d
BLAKE2b-256 ab0c2c53565ee992bf4db802f20d9c32f41b69f1e43438823a5d87690e080546

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on duarteocarmo/fasttext.rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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