| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.IvrLibaTargetMapper; |
| | | import com.smartor.mapper.IvrLibaTargetTagMapper; |
| | | import com.smartor.mapper.IvrLibaTargetoptionMapper; |
| | | import com.smartor.service.IIvrLibaTargetService; |
| | | import com.smartor.service.IServiceSubtaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | |
| | | @Autowired |
| | | private IvrLibaTargetoptionMapper ivrLibaTargetoptionMapper; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Autowired |
| | | private IServiceSubtaskService serviceSubtaskService; |
| | | |
| | | /** |
| | | * 查询指标选项库 |
| | |
| | | */ |
| | | @Override |
| | | public String targetQuesMate(IvrLibaTargetVO ivrLibaTargetVO) { |
| | | //1-AI识别 |
| | | |
| | | String url = configService.selectConfigByKey("sys.voice.match.ai.url"); |
| | | if (ObjectUtils.isNotEmpty(url)) { |
| | | String matchedText = ""; |
| | | String questionText = ivrLibaTargetVO.getQuestionText(); |
| | | String voiceText = ivrLibaTargetVO.getContent(); |
| | | List<IvrTaskTemplateTargetoption> options = DtoConversionUtils.sourceToTarget(ivrLibaTargetVO.getTargetoptionList(), IvrTaskTemplateTargetoption.class); |
| | | //1-AI识别 |
| | | Integer matched = serviceSubtaskService.matchOptionIndex(url, questionText, voiceText, options, "1"); |
| | | if (ObjectUtils.isNotEmpty(matched)) { |
| | | if (matched >= 0) { |
| | | matchedText = options.get(matched).getTargetvalue(); |
| | | } |
| | | } |
| | | log.info("ai匹配成功,匹配结果是:" + matchedText); |
| | | return matchedText; |
| | | } |
| | | for (IvrLibaTargetoption ivrLibaTargetoption : ivrLibaTargetVO.getTargetoptionList()) { |
| | | |
| | | Matcher matcher = null; |