[improvement][chat]Use one RuleBasedParser to encapsulate all rule-based semantic parsers

This commit is contained in:
jerryjzhang
2023-11-09 16:09:56 +08:00
parent 16c3de44e4
commit 6ad74bb206
5 changed files with 60 additions and 48 deletions

View File

@@ -51,13 +51,14 @@ public class BaseQueryTest {
protected QueryResult submitMultiTurnChat(String queryText) throws Exception {
ParseResp parseResp = submitParse(queryText);
ExecuteQueryReq request = new ExecuteQueryReq();
request.setQueryId(parseResp.getQueryId());
request.setParseId(parseResp.getSelectedParses().get(0).getId());
request.setChatId(parseResp.getChatId());
request.setQueryText(parseResp.getQueryText());
request.setUser(DataUtils.getUser());
request.setParseInfo(parseResp.getSelectedParses().get(0));
ExecuteQueryReq request = ExecuteQueryReq.builder()
.queryId(parseResp.getQueryId())
.parseId(parseResp.getSelectedParses().get(0).getId())
.chatId(parseResp.getChatId())
.queryText(parseResp.getQueryText())
.user(DataUtils.getUser())
.parseInfo(parseResp.getSelectedParses().get(0))
.build();
return queryService.performExecution(request);
}
@@ -65,13 +66,14 @@ public class BaseQueryTest {
protected QueryResult submitNewChat(String queryText) throws Exception {
ParseResp parseResp = submitParse(queryText);
ExecuteQueryReq request = new ExecuteQueryReq();
request.setQueryId(parseResp.getQueryId());
request.setParseId(parseResp.getSelectedParses().get(0).getId());
request.setChatId(parseResp.getChatId());
request.setQueryText(parseResp.getQueryText());
request.setUser(DataUtils.getUser());
request.setParseInfo(parseResp.getSelectedParses().get(0));
ExecuteQueryReq request = ExecuteQueryReq.builder()
.queryId(parseResp.getQueryId())
.parseId(parseResp.getSelectedParses().get(0).getId())
.chatId(parseResp.getChatId())
.queryText(parseResp.getQueryText())
.user(DataUtils.getUser())
.parseInfo(parseResp.getSelectedParses().get(0))
.build();
QueryResult result = queryService.performExecution(request);

View File

@@ -2,11 +2,7 @@ com.tencent.supersonic.chat.api.component.SchemaMapper=\
com.tencent.supersonic.chat.mapper.HanlpDictMapper
com.tencent.supersonic.chat.api.component.SemanticParser=\
com.tencent.supersonic.chat.parser.rule.QueryModeParser, \
com.tencent.supersonic.chat.parser.rule.ContextInheritParser, \
com.tencent.supersonic.chat.parser.rule.AgentCheckParser, \
com.tencent.supersonic.chat.parser.rule.TimeRangeParser, \
com.tencent.supersonic.chat.parser.rule.AggregateTypeParser, \
com.tencent.supersonic.chat.parser.rule.RuleBasedParser, \
com.tencent.supersonic.chat.parser.llm.interpret.MetricInterpretParser
# com.tencent.supersonic.chat.parser.llm.DSLQueryFunction