Skip to main content

A Rust-backed Python implementation of Facebook's fastText

Project description

[!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.

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.

Installation

uv pip install -e .

Quick start

import fasttext_rs

# Train
model = fasttext_rs.train_supervised(input="data/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")

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.1.0.tar.gz (52.0 kB 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.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (376.5 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

fasttext_rs-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (380.1 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

fasttext_rs-0.1.0-cp39-abi3-win_amd64.whl (242.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

fasttext_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (380.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

fasttext_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (347.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

fasttext_rs-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (356.4 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

fasttext_rs-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (395.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fasttext_rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f20bfe1f8cfa6cf9f9a49cba69509f610e034399e0bc9fb4ec25e0a57a04662d
MD5 204d3f758125e8b79c5209689945f4c2
BLAKE2b-256 ba2701722d5c5db0bfa8acb6904e2e6c1ddae485581869a62dc53fb2e5e27551

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0d13d5ec9c966aa9f84950dd00133fd66c2d06e7a322145f5829ea5cb9c66e39
MD5 31d35e5c6307300b850f6fc5bd47c3cc
BLAKE2b-256 16b301817c8c06dad230152d362a176998dc09db5dfda9408bd09ee37f5a149c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91e7cbe7ba16cb692bb590ba7696b7feadabd6f91c6a6e500f1b8b3a77e91204
MD5 49e2afd61cda9b98eeb0624800d8eda9
BLAKE2b-256 a6cb1e8f409107789ae19d81bbb489c87c945a328ce2d4c9cf4a2d78de87ff2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: fasttext_rs-0.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 242.8 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.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 499fb1e41dc3eb05787b3674578dcde97c8f71b575159cfa886f9cfe4edb09f6
MD5 2b658f7fbcf0632f90a971e2824b4415
BLAKE2b-256 35a942da4e05250f47f9db4ef19f3b812933e16a6a0be3d526c5700c8329c91d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50f5319c966d8d6f97f7c4c6d33ce5289ca1d9de7f432bbb9390476e2a4474f6
MD5 61e0f99e797b909e9042ac29483a4d29
BLAKE2b-256 2c3808396fc198d4ee4b500f4603dac28f06ce552aff0d848e27970de77b9782

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ea2624e4059d43fae3f8704030f20e49bb6004eb4da27e1c14b2050203fe7ab0
MD5 fecf136f132b04f165f44a89377cc026
BLAKE2b-256 0c2f735d049496b6f64178578a656d13b45dd964e450955d9bc74f6afedb9c89

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4280fdf393a36767ba334d56484d003d3ac06123bb94919eafa4401482d7a2fc
MD5 3357853cda6fcae8e6026b6aaf31a485
BLAKE2b-256 90a4aa833d81b2ec83c8b15f979a325f04d992a69042c8cf79a6bbdd78b0605b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fasttext_rs-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2582a17235742cc8c5868fd3158f037d7e507d286051797dafeaf6f9ce049ccc
MD5 426f771d61f1dabd5f1ec2f49d6814ba
BLAKE2b-256 d9745851a70b0b6e56efdb9534d153022ba03b7952b9ebf2399837c06586dd47

See more details on using hashes here.

Provenance

The following attestation bundles were made for fasttext_rs-0.1.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