mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(project) dsl support get topN dimension/metric filter by modelId (#106)
This commit is contained in:
@@ -411,12 +411,14 @@ public class LLMDslParser implements SemanticParser {
|
|||||||
Map<Long, String> itemIdToName = getItemIdToName(modelId, semanticSchema);
|
Map<Long, String> itemIdToName = getItemIdToName(modelId, semanticSchema);
|
||||||
|
|
||||||
Set<String> results = semanticSchema.getDimensions().stream()
|
Set<String> results = semanticSchema.getDimensions().stream()
|
||||||
|
.filter(schemaElement -> modelId.equals(schemaElement.getModel()))
|
||||||
.sorted(Comparator.comparing(SchemaElement::getUseCnt).reversed())
|
.sorted(Comparator.comparing(SchemaElement::getUseCnt).reversed())
|
||||||
.limit(llmParserConfig.getDimensionTopN())
|
.limit(llmParserConfig.getDimensionTopN())
|
||||||
.map(entry -> entry.getName())
|
.map(entry -> entry.getName())
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
Set<String> metrics = semanticSchema.getMetrics().stream()
|
Set<String> metrics = semanticSchema.getMetrics().stream()
|
||||||
|
.filter(schemaElement -> modelId.equals(schemaElement.getModel()))
|
||||||
.sorted(Comparator.comparing(SchemaElement::getUseCnt).reversed())
|
.sorted(Comparator.comparing(SchemaElement::getUseCnt).reversed())
|
||||||
.limit(llmParserConfig.getMetricTopN())
|
.limit(llmParserConfig.getMetricTopN())
|
||||||
.map(entry -> entry.getName())
|
.map(entry -> entry.getName())
|
||||||
|
|||||||
Reference in New Issue
Block a user