In order to build the system
$ cargo build --release --all
It will build two binaries: batch-client
and 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 <audio> --language <language> --token-file <token-file> --url <url>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-a, --audio <audio> Audio to use for the recognision
-g, --grammar <grammar> Path to the grammar file to use for the recognision
-l, --language <language> Language to use for the recognision [default: en-US]
-t, --token-file <token-file> Path to the token file
-T, --topic <topic> Topic to use for the recognision. Must be GENERIC | BANKING | TELCO
-u, --url <url> URL of the server [default: https://speechcenter.verbio.com:2424]
An example execution could be:
λ ./target/debug/cli-client -a example.wav -l en-US -t my.token -T generic
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 <dest-dir> --language <language> --dir <source-dir> --token-file <token-file> --topic <topic> --url <url>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-D, --dest-dir <dest-dir> Destination directory for the transcriptions
-l, --language <language> Language to use for the recognision [default: en-US]
-L, --log-level <log-level> Log level. Must be TRACE | DEBUG | INFO | WARN | ERROR [default: info]
-d, --dir <source-dir> Directory containing audios to use for the recognision
-t, --token-file <token-file> Path to the token file
-T, --topic <topic> Topic to use for the recognision. Must be GENERIC | BANKING | TELCO
-u, --url <url> URL of the server [default: https://speechcenter.verbio.com:2424]
-w, --workers <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
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.