Expand description
SentencePiece model parser generated from the SentencePiece protobuf definition.
See SentencePieceModel
for the entry point for parsing and accessing sentencepiece models.
use sentencepiece_model::SentencePieceModel;
let model = SentencePieceModel::from_file("tests/t5-spiece.model")?;
assert_eq!(model.pieces.len(), 32000);
assert_eq!(model.trainer().unwrap().unk_id(), 2);
Structs§
- Model
Proto - ModelProto stores model parameters. SentencePieceProcessor is supposed to be self-contained. All settings/parameters which may change the behavior must be encoded in ModelProto.
- Normalizer
Spec - NormalizerSpec encodes a various parameters for string normalizaiton
- Sample
- Self-test data sample.
- Self
Test Data - Proto to store samples for self-testing.
- Sentence
Piece - SentencePiece piece.
- Sentence
Piece Model - SentencePiece model.
Provides access to the underlying
sentencepiece
model. - Trainer
Spec - TrainerSpec encodes a various parameters for SentencePiece training.