#include <nlp_feedback.h>
语音识别结果处理
Definition at line 49 of file nlp_feedback.h.
ResultFeedback::ResultFeedback |
( |
| ) |
|
|
inline |
int ResultFeedback::actionDetect |
( |
| ) |
|
监测是否需要机器人控制以及控制类型..
- Returns
- int - 返回RobotAciton.
Definition at line 100 of file nlp_feedback.cpp.
std::vector< std::string > ResultFeedback::answerContent |
( |
| ) |
|
返回一个反馈内容(包含语音和动作的反馈).
- Returns
- std::vector<std::string> answer_dictionary_ - 返回answer_dictionary_
Definition at line 84 of file nlp_feedback.cpp.
bool ResultFeedback::isKeywordRepeated |
( |
std::string |
key_word | ) |
|
判断新加的关键词是否已被定义过.
- Returns
- bool - 若已被定义过,则返回true.
Definition at line 31 of file nlp_feedback.cpp.
bool ResultFeedback::keywordDetection |
( |
| ) |
|
根据交互模式answer_table_判断识别出的关键词是否有对应的响应策略. 若该关键词有对应的响应回复,存入响应向量answer_dictionary_(4).
- Returns
- bool - 若该关键词有对应的响应回复,返回true.
Definition at line 51 of file nlp_feedback.cpp.
void ResultFeedback::keywordResponse |
( |
const std::string |
log_path | ) |
|
根据响应vector内的值调用不同的响应接口,如发布控制指令,播放音频文件等.
- Parameters
-
log_path | - [in] 语音合成的音频文件的缓存路径. |
Definition at line 114 of file nlp_feedback.cpp.
std::vector< std::vector< std::string > > ResultFeedback::readAnswerTable |
( |
std::string |
answer_config_file | ) |
|
读取离线对话库:defaultconfig/answer_dic.csv文件里的内容,存入answer_table_.
- Parameters
-
answer_config_file | - [in] 离线对话配置文件. |
- Returns
- std::vector<std::vector<std::string>> answer_table_ - 返回存储对话信息的vector.
Definition at line 75 of file nlp_feedback.cpp.
bool ResultFeedback::resultIsValid |
( |
const std::string |
recog_result | ) |
|
判断语音识别结果是否为有效结果,若语音识别模块传来的结果!=none_result,则为有效.
- Parameters
-
recog_result | - [in] 语音识别结果. |
- Returns
- bool - 若语音识别模块传来的结果!=none_result,则则返回结果为true.
Definition at line 18 of file nlp_feedback.cpp.
int ResultFeedback::robotAction |
( |
| ) |
|
|
private |
void ResultFeedback::robotPlay |
( |
| ) |
|
|
private |
void ResultFeedback::uninitNLP |
( |
| ) |
|
std::vector<std::string> ResultFeedback::answer_dictionary_ |
|
private |
std::vector<std::vector<std::string> > ResultFeedback::answer_table_ |
|
private |
std::string ResultFeedback::base_path_ |
|
private |
int ResultFeedback::detect_count_ = 0 |
|
private |
std::string ResultFeedback::recog_final_result_ |
|
private |
std::string ResultFeedback::tts_path_ |
|
private |
The documentation for this class was generated from the following files: