Expand description
Rust bindings for UDPipe - Universal Dependencies Pipeline.
UDPipe is a trainable pipeline for tokenization, tagging, lemmatization, and dependency parsing of CoNLL-U files.
§Example
use udpipe_rs::Model;
// Download a model by language (one-time setup)
let model_path = udpipe_rs::download_model("english-ewt", ".")
.expect("Failed to download model");
// Load and use the model
let model = Model::load(&model_path).expect("Failed to load model");
let words = model.parse("Hello world!").expect("Failed to parse");
for word in words {
println!("{}: {} ({})", word.form, word.upostag, word.deprel);
}Structs§
- Model
- UDPipe model wrapper.
- Udpipe
Error - Error type for UDPipe operations.
- Word
- A parsed word from UDPipe with Universal Dependencies annotations.
Constants§
- AVAILABLE_
MODELS - Available pre-trained models from Universal Dependencies 2.5.
Functions§
- download_
model - Download a pre-trained model by language identifier.
- download_
model_ from_ url - Download a model from a custom URL to a local file path.
- model_
filename - Returns the expected filename for a given language model.