From 0102b58ee903764cf22e8e699e7dcda809a10d3e Mon Sep 17 00:00:00 2001 From: xiao Date: Wed, 18 Sep 2024 22:19:09 +0800 Subject: [PATCH] remove the *-hotwrods-* from the paraformer and ctc test filename, since it's not be used. for the keywords spotter test example, using test_keywords.txt from the test_wavs dir so that keywords can be spotted out. --- c-api-examples/CMakeLists.txt | 12 ++++++------ ...keywords-spotter-buffered-tokens-keywords-c-api.c | 8 ++++---- ...c-api.c => streaming-ctc-buffered-tokens-c-api.c} | 6 +++--- ... => streaming-paraformer-buffered-tokens-c-api.c} | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) rename c-api-examples/{streaming-ctc-buffered-tokens-hotwords-c-api.c => streaming-ctc-buffered-tokens-c-api.c} (96%) rename c-api-examples/{streaming-paraformer-buffered-tokens-hotwords-c-api.c => streaming-paraformer-buffered-tokens-c-api.c} (96%) diff --git a/c-api-examples/CMakeLists.txt b/c-api-examples/CMakeLists.txt index 6d8e22405..0bf526450 100644 --- a/c-api-examples/CMakeLists.txt +++ b/c-api-examples/CMakeLists.txt @@ -52,13 +52,13 @@ add_executable(streaming-zipformer-buffered-tokens-hotwords-c-api streaming-zipformer-buffered-tokens-hotwords-c-api.c) target_link_libraries(streaming-zipformer-buffered-tokens-hotwords-c-api sherpa-onnx-c-api) -add_executable(streaming-paraformer-buffered-tokens-hotwords-c-api - streaming-paraformer-buffered-tokens-hotwords-c-api.c) -target_link_libraries(streaming-paraformer-buffered-tokens-hotwords-c-api sherpa-onnx-c-api) +add_executable(streaming-paraformer-buffered-tokens-c-api + streaming-paraformer-buffered-tokens-c-api.c) +target_link_libraries(streaming-paraformer-buffered-tokens-c-api sherpa-onnx-c-api) -add_executable(streaming-ctc-buffered-tokens-hotwords-c-api - streaming-ctc-buffered-tokens-hotwords-c-api.c) -target_link_libraries(streaming-ctc-buffered-tokens-hotwords-c-api sherpa-onnx-c-api) +add_executable(streaming-ctc-buffered-tokens-c-api + streaming-ctc-buffered-tokens-c-api.c) +target_link_libraries(streaming-ctc-buffered-tokens-c-api sherpa-onnx-c-api) add_executable(keywords-spotter-buffered-tokens-keywords-c-api keywords-spotter-buffered-tokens-keywords-c-api.c) diff --git a/c-api-examples/keywords-spotter-buffered-tokens-keywords-c-api.c b/c-api-examples/keywords-spotter-buffered-tokens-keywords-c-api.c index 9e0861c40..ec8be3b07 100644 --- a/c-api-examples/keywords-spotter-buffered-tokens-keywords-c-api.c +++ b/c-api-examples/keywords-spotter-buffered-tokens-keywords-c-api.c @@ -65,15 +65,15 @@ int32_t main() { const char *tokens_filename = "sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile/tokens.txt"; const char *keywords_filename = - "sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile/" - "keywords.txt"; + "sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile/test_wavs/" + "test_keywords.txt"; const SherpaOnnxWave *wave = SherpaOnnxReadWave(wav_filename); if (wave == NULL) { fprintf(stderr, "Failed to read %s\n", wav_filename); return -1; } - // reading tokens and hotwords to buffers + // reading tokens and keywords to buffers const char *tokens_buf; size_t token_buf_size = ReadFile(tokens_filename, &tokens_buf); if (token_buf_size < 1) { @@ -84,7 +84,7 @@ int32_t main() { const char *keywords_buf; size_t keywords_buf_size = ReadFile(keywords_filename, &keywords_buf); if (keywords_buf_size < 1) { - fprintf(stderr, "Please check your hotwords.txt!\n"); + fprintf(stderr, "Please check your keywords.txt!\n"); free((void *)keywords_buf); return -1; } diff --git a/c-api-examples/streaming-ctc-buffered-tokens-hotwords-c-api.c b/c-api-examples/streaming-ctc-buffered-tokens-c-api.c similarity index 96% rename from c-api-examples/streaming-ctc-buffered-tokens-hotwords-c-api.c rename to c-api-examples/streaming-ctc-buffered-tokens-c-api.c index d6a90e59c..3223772a8 100644 --- a/c-api-examples/streaming-ctc-buffered-tokens-hotwords-c-api.c +++ b/c-api-examples/streaming-ctc-buffered-tokens-c-api.c @@ -1,11 +1,11 @@ -// c-api-examples/streaming-ctc-buffered-tokens-hotwords-c-api.c +// c-api-examples/streaming-ctc-buffered-tokens-c-api.c // // Copyright (c) 2024 Xiaomi Corporation // Copyright (c) 2024 Luo Xiao // // This file demonstrates how to use streaming Zipformer2 Ctc with sherpa-onnx's -// C API and with tokens and hotwords loaded from buffered strings instead of +// C API and with tokens loaded from buffered strings instead of // from external files API. // clang-format off // @@ -65,7 +65,7 @@ int32_t main() { return -1; } - // reading tokens and hotwords to buffers + // reading tokens to buffers const char *tokens_buf; size_t token_buf_size = ReadFile(tokens_filename, &tokens_buf); if (token_buf_size < 1) { diff --git a/c-api-examples/streaming-paraformer-buffered-tokens-hotwords-c-api.c b/c-api-examples/streaming-paraformer-buffered-tokens-c-api.c similarity index 96% rename from c-api-examples/streaming-paraformer-buffered-tokens-hotwords-c-api.c rename to c-api-examples/streaming-paraformer-buffered-tokens-c-api.c index 00edbcbee..cd87177b5 100644 --- a/c-api-examples/streaming-paraformer-buffered-tokens-hotwords-c-api.c +++ b/c-api-examples/streaming-paraformer-buffered-tokens-c-api.c @@ -1,11 +1,11 @@ -// c-api-examples/streaming-paraformer-buffered-tokens-hotwords-c-api.c +// c-api-examples/streaming-paraformer-buffered-tokens-c-api.c // // Copyright (c) 2024 Xiaomi Corporation // Copyright (c) 2024 Luo Xiao // // This file demonstrates how to use streaming Paraformer with sherpa-onnx's C -// API and with tokens and hotwords loaded from buffered strings instead of from +// API and with tokens loaded from buffered strings instead of from // external files API. // clang-format off // @@ -65,7 +65,7 @@ int32_t main() { return -1; } - // reading tokens and hotwords to buffers + // reading tokens to buffers const char *tokens_buf; size_t token_buf_size = ReadFile(tokens_filename, &tokens_buf); if (token_buf_size < 1) {