diff options
author | Kristian Aune <kkraune@users.noreply.github.com> | 2022-11-16 08:12:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 08:12:46 +0100 |
commit | b88c7d56c33166d7f77c68ca2d5d0d9c684c4017 (patch) | |
tree | 083fd9cc5104c7f21f8ef81836ddca76f2546775 | |
parent | d0044e3926f7ee3af1b01081913822a76d3452d9 (diff) | |
parent | 9dd3382f2370f42f1d1d3d781fe7ec51354b2e69 (diff) |
Merge pull request #24850 from vespa-engine/bratseth/ms-marco-test
Test the MS marco notebook app application package
3 files changed, 49 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java b/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java index 8556fe491d0..f4ef5893279 100644 --- a/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java +++ b/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java @@ -2,15 +2,17 @@ package com.yahoo.schema.document; /** Which match algorithm is used by this matching setup */ - public enum MatchAlgorithm { + NORMAL("normal"), PREFIX("prefix"), SUBSTRING("substring"), SUFFIX("suffix"); - private String name; + private final String name; + MatchAlgorithm(String name) { this.name = name; } public String getName() { return name; } + } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java index 276092e61f4..2230f2df71d 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java @@ -64,7 +64,7 @@ public class RankSetupValidator extends Validator { ".") .toFile(); for (SearchCluster cluster : model.getSearchClusters()) { - // Skipping rannking expression checking for streaming clusters, not implemented yet + // Skipping ranking expression checking for streaming clusters, not implemented yet if (cluster.isStreaming()) continue; IndexedSearchCluster sc = (IndexedSearchCluster) cluster; diff --git a/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java b/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java index 54e47dea6bb..366c78e22c6 100644 --- a/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java @@ -68,6 +68,50 @@ public class SchemaTestCase { } @Test + void testOnnxModelWithColonInput() throws Exception { + String schema = + """ + schema msmarco { + document msmarco { + field id type string { + indexing: summary | attribute + } + field text type string { + indexing: summary | index + } + } + onnx-model ltr_tensorflow { + file: files/ltr_tensorflow.onnx + input input:0: vespa_input + output dense: dense + } + rank-profile tensorflow { + function vespa_input() { + expression { + tensor<float>(x[1],y[3]):[[fieldMatch(text).queryCompleteness, fieldMatch(text).significance, nativeRank(text)]] + } + } + first-phase { + expression: sum(onnx(ltr_tensorflow).dense) + } + summary-features { + onnx(ltr_tensorflow) + fieldMatch(text).queryCompleteness + fieldMatch(text).significance + nativeRank(text) + } + } + }"""; + ApplicationBuilder builder = new ApplicationBuilder(new DeployLoggerStub()); + builder.processorsToSkip().add(OnnxModelTypeResolver.class); // Avoid discovering the Onnx model referenced does not exist + builder.addSchema(schema); + var application = builder.build(true); + var input = application.schemas().get("msmarco").onnxModels().get("ltr_tensorflow").getInputMap().get("input:0"); + assertNotNull(input); + assertEquals("vespa_input", input); + } + + @Test void testSchemaInheritance() throws ParseException { String parentLines = joinLines( "schema parent {" + |