NAME
PDL::SentencePiece - SentencePiece C++17/XS tokenizer bindings for PDL ndarrays
SYNOPSIS
use PDL::SentencePiece;
my $sp = PDL::SentencePiece->new(model => 'tokenizer.model');
my $ids = $sp->encode('Hello, world!'); # PDL long ndarray
my $txt = $sp->decode($ids);
DESCRIPTION
PDL::SentencePiece provides C++17/XS bindings to Google's libsentencepiece library, encoding text directly into PDL long token-ID ndarrays and decoding token ndarrays back to text.
AUTHOR
C.J. Collier <cjac@google.com>
LICENSE AND COPYRIGHT
Copyright 2026 Google LLC. Apache License, Version 2.0.