|
|
|
@ -81,6 +81,9 @@ public class MatchToolServiceImpl implements MatchToolService {
|
|
|
|
|
public List<MatchQuestionAnswerDTO> execMatch(String question) {
|
|
|
|
|
log.info("开始调用talkQaSimilarity,问题:{}", question);
|
|
|
|
|
try {
|
|
|
|
|
// 清洗数据,去除句子中的字母和数字,以提高相似度
|
|
|
|
|
question = StrUtil.replace(question, "[a-zA-Z0-9\\s+]", m->"");
|
|
|
|
|
log.info("经过去除字母和数字清洗后的字符串是:{}",question);
|
|
|
|
|
TimeInterval timer = DateUtil.timer();
|
|
|
|
|
String post = HttpUtil.post(matchToolUrl + "/matchQuestion", JSONUtil.toJsonStr(new QuestionReqDTO(question, Double.valueOf(scoreThreshold))));
|
|
|
|
|
log.info("相似度匹配答案:{},耗时:{} 毫秒", post,timer.intervalMs());
|
|
|
|
@ -100,7 +103,6 @@ public class MatchToolServiceImpl implements MatchToolService {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ExtractInformationDTO extractInformation(String message) {
|
|
|
|
|
log.info("开始调用extractInformation,message:{}", message);
|
|
|
|
|