Java wrapper for SentencePiece with JNI. This module wraps
sentencepiece::SentencePieceProcessor
class with the following modifications:
- Encode and Decode methods are re-defined as EncodeAsIds, EncodeAsPieces, DecodeIds and DecodePieces respectively.
- SentencePieceText proto is not supported.
To build and install the Java wrapper from source, please try the following commands:
% mvn clean install
Because the resulting JAR is platform-dependent, resolving this dependency is managed by the os-maven-plugin. Follow the instructions there to use this platform-dependent JAR.
Please note you need to have a C++ compiler and cmake installed.
See SentencePieceProcessorTest for more.