mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
@@ -23,11 +23,15 @@ public class TermDescMapper extends BaseMapper {
|
|||||||
chatQueryContext.setOriQueryText(chatQueryContext.getQueryText());
|
chatQueryContext.setOriQueryText(chatQueryContext.getQueryText());
|
||||||
}
|
}
|
||||||
for (SchemaElement schemaElement : termDescriptionToMap) {
|
for (SchemaElement schemaElement : termDescriptionToMap) {
|
||||||
|
if (schemaElement.isDescriptionMapped()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (chatQueryContext.getQueryText().equals(schemaElement.getDescription())) {
|
if (chatQueryContext.getQueryText().equals(schemaElement.getDescription())) {
|
||||||
schemaElement.setDescriptionMapped(true);
|
schemaElement.setDescriptionMapped(true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
chatQueryContext.setQueryText(schemaElement.getDescription());
|
chatQueryContext.setQueryText(schemaElement.getDescription());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty(chatQueryContext.getMapInfo().getTermDescriptionToMap())) {
|
if (CollectionUtils.isEmpty(chatQueryContext.getMapInfo().getTermDescriptionToMap())) {
|
||||||
chatQueryContext.setQueryText(chatQueryContext.getOriQueryText());
|
chatQueryContext.setQueryText(chatQueryContext.getOriQueryText());
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public class ChatWorkflowEngine {
|
|||||||
parseResult.setState(ParseResp.ParseState.FAILED);
|
parseResult.setState(ParseResp.ParseState.FAILED);
|
||||||
parseResult.setErrorMsg("No semantic entities can be mapped against user question.");
|
parseResult.setErrorMsg("No semantic entities can be mapped against user question.");
|
||||||
queryCtx.setChatWorkflowState(ChatWorkflowState.FINISHED);
|
queryCtx.setChatWorkflowState(ChatWorkflowState.FINISHED);
|
||||||
|
} else if (queryCtx.getMapInfo().needContinueMap()) {
|
||||||
|
queryCtx.setChatWorkflowState(ChatWorkflowState.MAPPING);
|
||||||
} else {
|
} else {
|
||||||
queryCtx.setChatWorkflowState(ChatWorkflowState.PARSING);
|
queryCtx.setChatWorkflowState(ChatWorkflowState.PARSING);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user