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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fasttext_rs-0.2.1.tar.gz.
File metadata
- Download URL: fasttext_rs-0.2.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
649ccd2127a8a6520caa7e8fcf7084295ab4fbbc9645ad007193e47ed10656ef
|
|
| MD5 |
8c682510ab7b8c45a824d93a5f11ed29
|
|
| BLAKE2b-256 |
f269f33f3017e5ba21dd9da6d6451ff0df306dda05f5d9e3d32fc2787da5d1f5
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1.tar.gz:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1.tar.gz -
Subject digest:
649ccd2127a8a6520caa7e8fcf7084295ab4fbbc9645ad007193e47ed10656ef - Sigstore transparency entry: 1056832802
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 375.6 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fed3e51694f03c0ea789a2c91cc663ff3485be826977d3d0a5297ec7602a23ab
|
|
| MD5 |
6cf01c36dd1128adb3054dd9296fb056
|
|
| BLAKE2b-256 |
a8af363778f9cf7395b80dcbe448b2481109755ca6783bd5231fbffac0e5d7b3
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
fed3e51694f03c0ea789a2c91cc663ff3485be826977d3d0a5297ec7602a23ab - Sigstore transparency entry: 1056832847
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 379.5 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
773be53c1c5e043d1cf7674a64a029ea9b9430e93a6c7508d061ac8f88f01815
|
|
| MD5 |
f0fef0b919d4fb0216f033b8bce4c1bf
|
|
| BLAKE2b-256 |
7dcde63d271c05a4ec61ca7f465f04ede58d797fff8a08aaa9dec459ae10fcda
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
773be53c1c5e043d1cf7674a64a029ea9b9430e93a6c7508d061ac8f88f01815 - Sigstore transparency entry: 1056832911
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 248.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d632ee8b891fa19eb927a1034d41a7aa53e8b41f073e11558ca5721f5a1d8cb3
|
|
| MD5 |
c25245f4ecde40042d043ee62430d0a0
|
|
| BLAKE2b-256 |
e39a9003393d0b75a845bc776e28c70162e1832c59417eeafd4c2879912283ed
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-cp39-abi3-win_amd64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-cp39-abi3-win_amd64.whl -
Subject digest:
d632ee8b891fa19eb927a1034d41a7aa53e8b41f073e11558ca5721f5a1d8cb3 - Sigstore transparency entry: 1056832823
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 379.3 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52a21bb604113f13a4ed62018c8f93f2e48b8bd2c8b5891862c8c0d4388de9b8
|
|
| MD5 |
35cdf31079da16aec76915d73af92c38
|
|
| BLAKE2b-256 |
0b1d25cf55b3dfca2efd09317cd3fa28ca7f14f42bfa6cab42b223e7504be93f
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
52a21bb604113f13a4ed62018c8f93f2e48b8bd2c8b5891862c8c0d4388de9b8 - Sigstore transparency entry: 1056832895
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 347.9 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b007522ac19c35fc5796329e4e78580cec280e6fac7e1219e4f6cae689b280
|
|
| MD5 |
cb1686e8c373aab41ba16180d58d0674
|
|
| BLAKE2b-256 |
8bd4dd76ed6f329e2e4f22d7104ea8ba391ed0f9937c417d848135c3c468c9ad
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
28b007522ac19c35fc5796329e4e78580cec280e6fac7e1219e4f6cae689b280 - Sigstore transparency entry: 1056832878
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 356.7 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9d6abba7b17220261898edeac89a088e54d6585a4a550c929a212d22511183d
|
|
| MD5 |
b34f695d4a7635d8be24706fc1029f66
|
|
| BLAKE2b-256 |
eb3f0d46d8fb0d5a525ce9904cd236ad1a4a243996dcf21799e0ae55d46d17f2
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
a9d6abba7b17220261898edeac89a088e54d6585a4a550c929a212d22511183d - Sigstore transparency entry: 1056832930
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fasttext_rs-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fasttext_rs-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 395.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
328a32eb45046af0bfd6061bc55b3f649d699cdc6c3ad528e9b1677c91ae1c89
|
|
| MD5 |
0b2328f1614f47bfbc420f074bdf8454
|
|
| BLAKE2b-256 |
61702bbde42b79966f8887e3abbfdfe5b1db55dd84bfa6d0a2c26eefa202ca59
|
Provenance
The following attestation bundles were made for fasttext_rs-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on duarteocarmo/fasttext.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fasttext_rs-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
328a32eb45046af0bfd6061bc55b3f649d699cdc6c3ad528e9b1677c91ae1c89 - Sigstore transparency entry: 1056832868
- Sigstore integration time:
-
Permalink:
duarteocarmo/fasttext.rs@3067f2de1aeace42797556f3613eb9749b8d21aa -
Branch / Tag:
refs/heads/master - Owner: https://github.com/duarteocarmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3067f2de1aeace42797556f3613eb9749b8d21aa -
Trigger Event:
workflow_dispatch
-
Statement type: