19 YARP_LOG_COMPONENT(WhisperSpeechTranscriptionParamsCOMPONENT,
"yarp.device.WhisperSpeechTranscription")
30 std::vector<std::string> params;
31 params.push_back(
"model_context");
32 params.push_back(
"model_name");
33 params.push_back(
"language");
34 params.push_back(
"remove_symbols");
41 if (paramName ==
"model_context")
46 if (paramName ==
"model_name")
51 if (paramName ==
"language")
56 if (paramName ==
"remove_symbols")
62 yError() <<
"parameter '" << paramName <<
"' was not found";
81 if (config.
check(
"help"))
90 if (config.
check(
"model_context"))
93 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'model_context' using value:" <<
m_model_context;
97 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'model_context' using DEFAULT value:" <<
m_model_context;
99 prop_check.
unput(
"model_context");
104 if (config.
check(
"model_name"))
107 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'model_name' using value:" <<
m_model_name;
111 yCError(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Mandatory parameter 'model_name' not found!";
112 yCError(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Description of the parameter: name of Whisper model";
115 prop_check.
unput(
"model_name");
120 if (config.
check(
"language"))
123 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'language' using value:" <<
m_language;
127 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'language' using DEFAULT value:" <<
m_language;
129 prop_check.
unput(
"language");
134 if (config.
check(
"remove_symbols"))
137 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'remove_symbols' using value:" <<
m_remove_symbols;
141 yCInfo(WhisperSpeechTranscriptionParamsCOMPONENT) <<
"Parameter 'remove_symbols' using DEFAULT value:" <<
m_remove_symbols;
143 prop_check.
unput(
"remove_symbols");
178 doc = doc + std::string(
"\n=============================================\n");
179 doc = doc + std::string(
"This is the help for device: WhisperSpeechTranscription\n");
180 doc = doc + std::string(
"\n");
181 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
182 doc = doc + std::string(
"'model_context': context of Whisper model\n");
183 doc = doc + std::string(
"'model_name': name of Whisper model\n");
184 doc = doc + std::string(
"'language': Language (??? TBC)\n");
185 doc = doc + std::string(
"'remove_symbols': If symbols from output text, (i.e. ...[bla bla]...) are removed\n");
186 doc = doc + std::string(
"\n");
187 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
188 doc = doc +
" yarpdev --device yarp_whisperSpeechTranscription --model_context <optional_value> --model_name <mandatory_value> --language auto --remove_symbols 1\n";
189 doc = doc + std::string(
"Using only mandatory params:\n");
190 doc = doc +
" yarpdev --device yarp_whisperSpeechTranscription --model_name <mandatory_value>\n";
191 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_model_context
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string m_provided_configuration
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string getConfiguration() const override
Return the configuration of the device.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
WhisperSpeechTranscription_ParamsParser()
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)