WhisperSpeechTranscription: A yarp device which performs audio-to-text transcription using OpenAI Whisper models.
More...
Inheritance diagram for WhisperSpeechTranscription:Public Member Functions | |
| WhisperSpeechTranscription () | |
| virtual | ~WhisperSpeechTranscription () |
| WhisperSpeechTranscription (const WhisperSpeechTranscription &)=delete | |
| WhisperSpeechTranscription (WhisperSpeechTranscription &&)=delete | |
| WhisperSpeechTranscription & | operator= (const WhisperSpeechTranscription &)=delete |
| WhisperSpeechTranscription & | operator= (WhisperSpeechTranscription &&)=delete |
| bool | open (yarp::os::Searchable &config) override |
| Open the DeviceDriver. | |
| bool | close () override |
| Close the DeviceDriver. | |
| virtual yarp::dev::ReturnValue | setLanguage (const std::string &language) override |
| Sets the language for speech transcription. | |
| virtual yarp::dev::ReturnValue | getLanguage (std::string &language) override |
| Gets the current language set for speech transcription. | |
| virtual yarp::dev::ReturnValue | transcribe (const yarp::sig::Sound &sound, std::string &transcription, double &score) override |
| Performs the speech transcription. | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
| DeviceDriver () | |
| DeviceDriver (const DeviceDriver &other)=delete | |
| DeviceDriver (DeviceDriver &&other) noexcept=delete | |
| DeviceDriver & | operator= (const DeviceDriver &other)=delete |
| DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
| virtual | ~DeviceDriver () |
| virtual std::string | id () const |
| Return the id assigned to the PolyDriver. | |
| virtual void | setId (const std::string &id) |
| Set the id for this device. | |
| template<class T > | |
| bool | view (T *&x) |
| Get an interface to the device driver. | |
| virtual DeviceDriver * | getImplementation () |
| Some drivers are bureaucrats, pointing at others. | |
Public Member Functions inherited from yarp::dev::ISpeechTranscription | |
| virtual | ~ISpeechTranscription () |
Public Member Functions inherited from WhisperSpeechTranscription_ParamsParser | |
| WhisperSpeechTranscription_ParamsParser () | |
| ~WhisperSpeechTranscription_ParamsParser () override=default | |
| bool | parseParams (const yarp::os::Searchable &config) override |
| Parse the DeviceDriver parameters. | |
| std::string | getDeviceClassName () const override |
| Get the name of the DeviceDriver class. | |
| std::string | getDeviceName () const override |
| Get the name of the device (i.e. | |
| std::string | getDocumentationOfDeviceParams () const override |
| Get the documentation of the DeviceDriver's parameters. | |
| std::vector< std::string > | getListOfParams () const override |
| Return a list of all params used by the device. | |
| bool | getParamValue (const std::string ¶mName, std::string ¶mValue) const override |
| Return the value (represented as a string) of the requested parameter. | |
| std::string | getConfiguration () const override |
| Return the configuration of the device. | |
Public Member Functions inherited from yarp::dev::IDeviceDriverParams | |
| virtual | ~IDeviceDriverParams () |
Additional Inherited Members | |
Public Attributes inherited from WhisperSpeechTranscription_ParamsParser | |
| const std::string | m_device_classname = {"WhisperSpeechTranscription"} |
| const std::string | m_device_name = {"yarp_whisperSpeechTranscription"} |
| bool | m_parser_is_strict = false |
| const parser_version_type | m_parser_version = {} |
| std::string | m_provided_configuration |
| const std::string | m_model_context_defaultValue = {""} |
| const std::string | m_model_name_defaultValue = {""} |
| const std::string | m_language_defaultValue = {"auto"} |
| const std::string | m_remove_symbols_defaultValue = {"1"} |
| std::string | m_model_context = {} |
| std::string | m_model_name = {} |
| std::string | m_language = {"auto"} |
| int | m_remove_symbols = {1} |
WhisperSpeechTranscription: A yarp device which performs audio-to-text transcription using OpenAI Whisper models.
This device implements the ISpeechTranscription and can be used with a speechTranscription_nws_yarp device and a AudioRecorderWrapper to transcribe audio in real time.
Parameters required by this device are described in the class WhisperSpeechTranscription_ParamsParser
Definition at line 28 of file whisperSpeechTranscription.h.
| WhisperSpeechTranscription::WhisperSpeechTranscription | ( | ) |
Definition at line 25 of file whisperSpeechTranscription.cpp.
|
virtual |
Definition at line 32 of file whisperSpeechTranscription.cpp.
|
delete |
|
delete |
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 157 of file whisperSpeechTranscription.cpp.
|
overridevirtual |
Gets the current language set for speech transcription.
| language | the returned string (code) representing the speech language (e.g. ita, eng...). Default value is "auto". |
Implements yarp::dev::ISpeechTranscription.
Definition at line 174 of file whisperSpeechTranscription.cpp.
|
overridevirtual |
Open the DeviceDriver.
| config | is a list of parameters for the device. Which parameters are effective for your device can vary. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 37 of file whisperSpeechTranscription.cpp.
|
delete |
|
delete |
|
overridevirtual |
Sets the language for speech transcription.
| language | a string (code) representing the speech language (e.g. ita, eng...). Default value is "auto". |
Implements yarp::dev::ISpeechTranscription.
Definition at line 167 of file whisperSpeechTranscription.cpp.
|
overridevirtual |
Performs the speech transcription.
| sound | the audio data to transcribe |
| transcription | the returned transcription (it may be empty) |
| score | the returned score/confidence value in the range (0-1.0). It may be not implemented. |
Implements yarp::dev::ISpeechTranscription.
Definition at line 180 of file whisperSpeechTranscription.cpp.