프로젝트
GitHub에서 보기
messense/fasttext-rs
messense/fasttext-rs has 71 GitHub stars and 14 forks. Star changes are not measured yet. Last checked 2026-11-08 19:07 UTC. Last push 2026-11-05.
Rust implementation of fastText
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalfasttext-rs
Pure Rust implementation of fastText
Installation
Add it to your Cargo.toml:
[dependencies]
fasttext = "0.8"
Usage
Training a model
use fasttext::FastText;
use fasttext::args::{Args, ModelName};
let mut args = Args::default();
args.input = "data.txt".into();
args.model = ModelName::Supervised;
args.epoch = 25;
args.lr = 1.0;
let model = FastText::train(args).unwrap();
model.save_model("model.bin").unwrap();
Loading and predicting
use fasttext::FastText;
let model = FastText::load_model("model.bin").unwrap();
let predictions = model.predict("Which baking dish is best?", 3, 0.0);
for pred in &predictions {
println!("{} {}", pred.label, pred.prob);
}
Nearest neighbors
use fasttext::FastText;
let model = FastText::load_model("model.bin").unwrap();
let neighbors = model.get_nn("king", 10);
for (score, word) in &neighbors {
println!("{word}\t{score}");
}
CLI
A command-line tool compatible with the C++ fastText CLI is available behind the cli feature:
cargo install fasttext --features cli
It supports C++-style single-dash flags (e.g. -epoch 25) as well as standard double-dash flags (--epoch 25):
fasttext supervised -input data.txt -output model -epoch 25 -lr 1.0
fasttext predict model.bin test.txt
fasttext test model.bin test.txt
fasttext nn model.bin
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.