NVIDIA Riva is a GPU-accelerated SDK for building Speech AI applications that are customized for your use
case and deliver real-time performance. This repo provides performant client example command-line clients.
Main API
riva.client.ASRService is a class for speech recognition,
riva.client.TTSService is a class for speech synthesis,
riva.client.NLPService is a class for natural language processing.
CLI interface
Automatic Speech Recognition (ASR)
scripts/asr/riva_streaming_asr_client.py demonstrates streaming transcription in several threads, can print time stamps.
If you would like to use output and input audio devices
(scripts scripts/asr/transcribe_file_rt.py, scripts/asr/transcribe_mic.py, scripts/tts/talk.py, scripts/asr/realtime_asr_client.py, scripts/tts/realtime_tts_client.py or module
riva.client/audio_io.py), you will need to install PyAudio.
conda install -c anaconda pyaudio
If you would like to use Realtime ASR or TTS (WebSocket-based real-time transcription or synthesis) scripts scripts/asr/realtime_asr_client.py or scripts/tts/realtime_tts_client.py, you will need the following dependencies:
NER client can output 1 of the following: label name, span start, span end
python scripts/nlp/ner_client.py \
--query "Where is San Francisco?" "Jensen Huang is the CEO of NVIDIA Corporation." \
--test label
or
python scripts/nlp/ner_client.py \
--query "Where is San Francisco?" "Jensen Huang is the CEO of NVIDIA Corporation." \
--test span_start
or
python scripts/nlp/ner_client.py \
--query "Where is San Francisco?" "Jensen Huang is the CEO of NVIDIA Corporation." \
--test span_end
Provide query and context to QA client.
python scripts/nlp/qa_client.py \
--query "How many gigatons of carbon dioxide was released in 2005?" \
--context "In 2010 the Amazon rainforest experienced another severe drought, in some ways "\
"more extreme than the 2005 drought. The affected region was approximate 1,160,000 square "\
"miles (3,000,000 km2) of rainforest, compared to 734,000 square miles (1,900,000 km2) in "\
"2005. The 2010 drought had three epicenters where vegetation died off, whereas in 2005 the "\
"drought was focused on the southwestern part. The findings were published in the journal "\
"Science. In a typical year the Amazon absorbs 1.5 gigatons of carbon dioxide; during 2005 "\
"instead 5 gigatons were released and in 2010 8 gigatons were released."
Text classification requires only a query.
python scripts/nlp/text_classify_client.py --query "How much sun does california get?"
TTS
Call scripts/tts/talk.py script, and you will be prompted to enter a text for speech
synthesis. Set --play-audio option, and a synthesized speech will be played.