mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(improvement)(launcher)Refactor config keys, use s2 as the prefix
This commit is contained in:
@@ -82,7 +82,7 @@ public abstract class BaseSemanticCorrector implements SemanticCorrector {
|
||||
|
||||
//decide whether add order by expression field to select
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
String correctorAdditionalInfo = environment.getProperty("corrector.additional.information");
|
||||
String correctorAdditionalInfo = environment.getProperty("s2.corrector.additional.information");
|
||||
if (StringUtils.isNotBlank(correctorAdditionalInfo) && Boolean.parseBoolean(correctorAdditionalInfo)) {
|
||||
needAddFields.addAll(SqlSelectHelper.getOrderByFields(correctS2SQL));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GroupByCorrector extends BaseSemanticCorrector {
|
||||
return false;
|
||||
}
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
String correctorAdditionalInfo = environment.getProperty("corrector.additional.information");
|
||||
String correctorAdditionalInfo = environment.getProperty("s2.corrector.additional.information");
|
||||
if (StringUtils.isNotBlank(correctorAdditionalInfo) && !Boolean.parseBoolean(correctorAdditionalInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class HavingCorrector extends BaseSemanticCorrector {
|
||||
|
||||
//decide whether add having expression field to select
|
||||
Environment environment = ContextUtils.getBean(Environment.class);
|
||||
String correctorAdditionalInfo = environment.getProperty("corrector.additional.information");
|
||||
String correctorAdditionalInfo = environment.getProperty("s2.corrector.additional.information");
|
||||
if (StringUtils.isNotBlank(correctorAdditionalInfo) && Boolean.parseBoolean(correctorAdditionalInfo)) {
|
||||
addHavingToSelect(semanticParseInfo);
|
||||
}
|
||||
|
||||
@@ -9,22 +9,21 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Data
|
||||
public class LLMParserConfig {
|
||||
|
||||
|
||||
@Value("${llm.parser.url:}")
|
||||
@Value("${s2.parser.url:}")
|
||||
private String url;
|
||||
|
||||
@Value("${query2sql.path:/query2sql}")
|
||||
@Value("${s2.query2sql.path:/query2sql}")
|
||||
private String queryToSqlPath;
|
||||
|
||||
@Value("${dimension.topn:10}")
|
||||
@Value("${s2.dimension.topn:10}")
|
||||
private Integer dimensionTopN;
|
||||
|
||||
@Value("${metric.topn:10}")
|
||||
@Value("${s2.metric.topn:10}")
|
||||
private Integer metricTopN;
|
||||
|
||||
@Value("${tag.topn:20}")
|
||||
@Value("${s2.tag.topn:20}")
|
||||
private Integer tagTopN;
|
||||
|
||||
@Value("${all.model:false}")
|
||||
@Value("${s2.all.model:false}")
|
||||
private Boolean allModel;
|
||||
}
|
||||
|
||||
@@ -14,72 +14,73 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Slf4j
|
||||
public class OptimizationConfig {
|
||||
|
||||
@Value("${one.detection.size:8}")
|
||||
@Value("${s2.one.detection.size:8}")
|
||||
private Integer oneDetectionSize;
|
||||
|
||||
@Value("${one.detection.max.size:20}")
|
||||
@Value("${s2.one.detection.max.size:20}")
|
||||
private Integer oneDetectionMaxSize;
|
||||
|
||||
@Value("${metric.dimension.min.threshold:0.3}")
|
||||
@Value("${s2.metric.dimension.min.threshold:0.3}")
|
||||
private Double metricDimensionMinThresholdConfig;
|
||||
|
||||
@Value("${metric.dimension.threshold:0.3}")
|
||||
@Value("${s2.metric.dimension.threshold:0.3}")
|
||||
private Double metricDimensionThresholdConfig;
|
||||
|
||||
@Value("${dimension.value.min.threshold:0.2}")
|
||||
@Value("${s2.dimension.value.min.threshold:0.2}")
|
||||
private Double dimensionValueMinThresholdConfig;
|
||||
|
||||
@Value("${dimension.value.threshold:0.5}")
|
||||
@Value("${s2.dimension.value.threshold:0.5}")
|
||||
private Double dimensionValueThresholdConfig;
|
||||
|
||||
@Value("${long.text.threshold:0.8}")
|
||||
@Value("${s2.long.text.threshold:0.8}")
|
||||
private Double longTextThreshold;
|
||||
|
||||
@Value("${short.text.threshold:0.5}")
|
||||
@Value("${s2.short.text.threshold:0.5}")
|
||||
private Double shortTextThreshold;
|
||||
|
||||
@Value("${query.text.length.threshold:10}")
|
||||
@Value("${s2.query.text.length.threshold:10}")
|
||||
private Integer queryTextLengthThreshold;
|
||||
@Value("${embedding.mapper.word.min:4}")
|
||||
|
||||
@Value("${s2.embedding.mapper.word.min:4}")
|
||||
private int embeddingMapperWordMin;
|
||||
|
||||
@Value("${embedding.mapper.word.max:4}")
|
||||
@Value("${s2.embedding.mapper.word.max:4}")
|
||||
private int embeddingMapperWordMax;
|
||||
|
||||
@Value("${embedding.mapper.batch:50}")
|
||||
@Value("${s2.embedding.mapper.batch:50}")
|
||||
private int embeddingMapperBatch;
|
||||
|
||||
@Value("${embedding.mapper.number:5}")
|
||||
@Value("${s2.embedding.mapper.number:5}")
|
||||
private int embeddingMapperNumber;
|
||||
|
||||
@Value("${embedding.mapper.round.number:10}")
|
||||
@Value("${s2.embedding.mapper.round.number:10}")
|
||||
private int embeddingMapperRoundNumber;
|
||||
|
||||
@Value("${embedding.mapper.min.threshold:0.6}")
|
||||
@Value("${s2.embedding.mapper.min.threshold:0.6}")
|
||||
private Double embeddingMapperMinThreshold;
|
||||
|
||||
@Value("${embedding.mapper.threshold:0.99}")
|
||||
@Value("${s2.embedding.mapper.threshold:0.99}")
|
||||
private Double embeddingMapperThreshold;
|
||||
|
||||
@Value("${s2SQL.linking.value.switch:true}")
|
||||
@Value("${s2.parser.linking.value.switch:true}")
|
||||
private boolean useLinkingValueSwitch;
|
||||
|
||||
@Value("${s2SQL.generation:TWO_PASS_AUTO_COT}")
|
||||
@Value("${s2.parser.generation:TWO_PASS_AUTO_COT}")
|
||||
private LLMReq.SqlGenType sqlGenType;
|
||||
|
||||
@Value("${s2SQL.use.switch:true}")
|
||||
@Value("${s2.parser.use.switch:true}")
|
||||
private boolean useS2SqlSwitch;
|
||||
|
||||
@Value("${text2sql.example.num:15}")
|
||||
@Value("${s2.parser.exemplar-recall.num:15}")
|
||||
private int text2sqlExampleNum;
|
||||
|
||||
@Value("${text2sql.fewShots.num:10}")
|
||||
@Value("${s2.parser.few-shot.num:10}")
|
||||
private int text2sqlFewShotsNum;
|
||||
|
||||
@Value("${text2sql.self.consistency.num:5}")
|
||||
@Value("${s2.parser.self-consistency.num:5}")
|
||||
private int text2sqlSelfConsistencyNum;
|
||||
|
||||
@Value("${parse.show.count:3}")
|
||||
@Value("${s2.parser.show-count:3}")
|
||||
private Integer parseShowCount;
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user