API¶
BenchmarkSTT exposes its functionality through a JSON-RPC api.
Attention
Only supported for Python versions 3.6 and above!
Starting the server¶
You can launch a server to make the api available via:
Subcommand api (for debugging and local use only)
gunicorn, by running
gunicorn -b :8080 benchmarkstt.api.gunicorn
Usage¶
All requests must be HTTP POST requests, with the content containing valid JSON.
Using curl, for example:
curl -X POST \
http://localhost:8080/api \
-H 'Content-Type: application/json-rpc' \
-d '{
"jsonrpc": "2.0",
"method": "help",
"id": null
}'
If you started the service with parameter --with-explorer
(see Subcommand api), you can easily test the available JSON-RPC
api calls by visiting the api url (eg. http://localhost:8080/api in the above example).
Important
The API explorer is provided as-is, without any tests or code reviews. This is marked as a low-priority feature.
- Available JSON-RPC methods
- version
- list.normalization
- normalization.config
- normalization.file
- normalization.lowercase
- normalization.regex
- normalization.replace
- normalization.replacewords
- normalization.unidecode
- list.metrics
- metrics.beer
- metrics.cer
- metrics.diffcounts
- metrics.wer
- metrics.worddiffs
- list.benchmark
- benchmark.beer
- benchmark.cer
- benchmark.diffcounts
- benchmark.wer
- benchmark.worddiffs
- help