Public Member Functions | Private Member Functions | Private Attributes | List of all members
ResultFeedback Class Reference

#include <nlp_feedback.h>

Public Member Functions

int actionDetect ()
 监测是否需要机器人控制以及控制类型.. More...
 
std::vector< std::string > answerContent ()
 返回一个反馈内容(包含语音和动作的反馈). More...
 
bool isKeywordRepeated (std::string key_word)
 判断新加的关键词是否已被定义过. More...
 
bool keywordDetection ()
 根据交互模式answer_table_判断识别出的关键词是否有对应的响应策略. 若该关键词有对应的响应回复,存入响应向量answer_dictionary_(4). More...
 
void keywordResponse (const std::string log_path)
 根据响应vector内的值调用不同的响应接口,如发布控制指令,播放音频文件等. More...
 
std::vector< std::vector< std::string > > readAnswerTable (std::string answer_config_file)
 读取离线对话库:defaultconfig/answer_dic.csv文件里的内容,存入answer_table_. More...
 
 ResultFeedback ()
 
bool resultIsValid (const std::string recog_result)
 判断语音识别结果是否为有效结果,若语音识别模块传来的结果!=none_result,则为有效. More...
 
void uninitNLP ()
 一次处理结束后释放资源. More...
 

Private Member Functions

int robotAction ()
 
void robotPlay ()
 

Private Attributes

std::vector< std::string > answer_dictionary_
 
std::vector< std::vector< std::string > > answer_table_
 
std::string base_path_
 
int detect_count_ = 0
 
std::string recog_final_result_
 
std::string tts_path_
 

Detailed Description

语音识别结果处理

Definition at line 49 of file nlp_feedback.h.

Constructor & Destructor Documentation

ResultFeedback::ResultFeedback ( )
inline

Definition at line 52 of file nlp_feedback.h.

Member Function Documentation

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

Definition at line 93 of file nlp_feedback.cpp.

void ResultFeedback::robotPlay ( )
private

Definition at line 106 of file nlp_feedback.cpp.

void ResultFeedback::uninitNLP ( )

一次处理结束后释放资源.

Definition at line 44 of file nlp_feedback.cpp.

Member Data Documentation

std::vector<std::string> ResultFeedback::answer_dictionary_
private

Definition at line 115 of file nlp_feedback.h.

std::vector<std::vector<std::string> > ResultFeedback::answer_table_
private

Definition at line 116 of file nlp_feedback.h.

std::string ResultFeedback::base_path_
private

Definition at line 119 of file nlp_feedback.h.

int ResultFeedback::detect_count_ = 0
private

Definition at line 117 of file nlp_feedback.h.

std::string ResultFeedback::recog_final_result_
private

Definition at line 118 of file nlp_feedback.h.

std::string ResultFeedback::tts_path_
private

Definition at line 120 of file nlp_feedback.h.


The documentation for this class was generated from the following files:


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54