mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(improvement)(common|headless|chat|auth) 鉴权优化与召回优化
1 修复生成的用户token 一生成就失效的问题 2 如果用户设置的token ,需校验是否数据库存在,因为用户可设置一年的token 有泄露风险 3 结果解析优化, 去除不可以解析的情况,解析问题需要改写后的问, 4 召回样例,用相似度,保住至少有一个样例是高相似度的 5 数据集召回,填加完全匹配格式筛选逻辑
This commit is contained in:
@@ -21,7 +21,8 @@ public class LoadRemoveService {
|
||||
List<String> resultList = new ArrayList<>(value);
|
||||
if (!CollectionUtils.isEmpty(modelIdOrDataSetIds)) {
|
||||
resultList.removeIf(nature -> {
|
||||
if (Objects.isNull(nature)||!nature.startsWith("_")) { // 系统的字典是以 _ 开头的, 过滤因引用外部字典导致的异常
|
||||
if (Objects.isNull(nature) || !nature.startsWith("_")) { // 系统的字典是以 _ 开头的,
|
||||
// 过滤因引用外部字典导致的异常
|
||||
return false;
|
||||
}
|
||||
Long id = getId(nature);
|
||||
|
||||
@@ -23,5 +23,5 @@ public class Text2SQLExemplar implements Serializable {
|
||||
|
||||
private String sql;
|
||||
|
||||
protected double similarity; // 传递相似度,可以作为样本筛选的依据
|
||||
protected double similarity; // 传递相似度,可以作为样本筛选的依据
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ExemplarServiceImpl implements ExemplarService, CommandLineRunner {
|
||||
embeddingService.retrieveQuery(collection, retrieveQuery, num);
|
||||
results.forEach(ret -> {
|
||||
ret.getRetrieval().forEach(r -> {
|
||||
Text2SQLExemplar tmp = //传递相似度,可以作为样本筛选的依据
|
||||
Text2SQLExemplar tmp = // 传递相似度,可以作为样本筛选的依据
|
||||
JsonUtil.mapToObject(r.getMetadata(), Text2SQLExemplar.class);
|
||||
tmp.setSimilarity(r.getSimilarity());
|
||||
exemplars.add(tmp);
|
||||
|
||||
Reference in New Issue
Block a user