mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
(fix)(chat)多个数据集也只保留召回的第一个结果
这里的多数据集其实对召回的结果没有影响,取第一个就好了
This commit is contained in:
@@ -22,6 +22,9 @@ public class NL2PluginParser implements ChatQueryParser {
|
|||||||
public void parse(ParseContext parseContext) {
|
public void parse(ParseContext parseContext) {
|
||||||
pluginRecognizers.forEach(pluginRecognizer -> {
|
pluginRecognizers.forEach(pluginRecognizer -> {
|
||||||
pluginRecognizer.recognize(parseContext);
|
pluginRecognizer.recognize(parseContext);
|
||||||
|
if (parseContext.getResponse().getSelectedParses().size()>=2){
|
||||||
|
parseContext.getResponse().setSelectedParses(parseContext.getResponse().getSelectedParses().subList(0, 1));
|
||||||
|
}
|
||||||
log.info("{} recallResult:{}", pluginRecognizer.getClass().getSimpleName(),
|
log.info("{} recallResult:{}", pluginRecognizer.getClass().getSimpleName(),
|
||||||
JsonUtil.toString(parseContext.getResponse()));
|
JsonUtil.toString(parseContext.getResponse()));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user