Rust Verbio SpeechCenter Client
How to build
In order to build the system
$ cargo build --release --all
It will build two binaries: batch-client
and cli-client
.
How to use
CLI client
The CLI client allows you to launch a single file to the server. It also allows you to use either a grammar or a language model.
λ ./target/release/cli-client --help
cli-client 0.1.0
USAGE:
cli-client [OPTIONS] --audio
An example execution could be:
λ ./target/debug/cli-client -a example.wav -l en-US -t my.token -T generic
Batch client
The batch client iterates over wav files inside a directory, sends them in parallel to the server and stores the transcription in another directory.
λ ./target/release/batch-client --help
batch-client 0.1.0
USAGE:
batch-client [OPTIONS] --dest-dir
--language
--dir
--token-file
--topic
--url
FLAGS: -h, --help Prints help information -V, --version Prints version information OPTIONS: -D, --dest-dir
Destination directory for the transcriptions -l, --language
Language to use for the recognision [default: en-US] -L, --log-level
Log level. Must be TRACE | DEBUG | INFO | WARN | ERROR [default: info] -d, --dir
Directory containing audios to use for the recognision -t, --token-file
Path to the token file -T, --topic
Topic to use for the recognision. Must be GENERIC | BANKING | TELCO -u, --url
URL of the server [default: https://speechcenter.verbio.com:2424] -w, --workers
Number of workers to use for the recognision [default: 4]
An example execution could be:
λ ./target/release/batch-client -w 4 -d ~/tmp/commonvoice/clips -D /tmp/results -t my.token -T generic --log-level debug
Improvements to be done
Right now, the build process generates the speech-center-client/src/csr_grpc_gateway.rs
file. However, the tonic-build
is able to generate it into the target directory and include it via macros. Unfortunately, my IDE was not able to detect the file, so autocomplete didn't work and I prioritized developer ergonomy over "correctness" for this PoC (sorry guys).
In order to change it, edit the build.rs
and see the documentation of tonic-build.