Add Java and Kotlin API for punctuation models (#818)

This commit is contained in:
Fangjun Kuang
2024-04-26 22:06:48 +08:00
committed by GitHub
parent db25986240
commit 5407f880c0
19 changed files with 515 additions and 0 deletions

View File

@@ -197,9 +197,29 @@ function testOfflineAsr() {
java -Djava.library.path=../build/lib -jar $out_filename
}
function testPunctuation() {
if [ ! -f ./sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12/model.onnx ]; then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/punctuation-models/sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12.tar.bz2
tar xvf sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12.tar.bz2
rm sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12.tar.bz2
fi
out_filename=test_punctuation.jar
kotlinc-jvm -include-runtime -d $out_filename \
./test_punctuation.kt \
./OfflinePunctuation.kt \
faked-asset-manager.kt \
faked-log.kt
ls -lh $out_filename
java -Djava.library.path=../build/lib -jar $out_filename
}
testSpeakerEmbeddingExtractor
testOnlineAsr
testTts
testAudioTagging
testSpokenLanguageIdentification
testOfflineAsr
testPunctuation