summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-11-03 18:59:11 +0100
committerGitHub <noreply@github.com>2021-11-03 18:59:11 +0100
commita2f3c58059a865eca070841d0d611b2f68088a75 (patch)
tree539c05e7488bba3a255b98fece874d7015b04032 /config-model
parent212511ce0f90db3d1e4527835393159eaf508f3c (diff)
parent243ce33fd58c2fe2b44ab71c233df5ce1e34548f (diff)
Merge pull request #19849 from vespa-engine/balder/add-long-value
Add a LongValue to preserve integer numbers.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/test/derived/neuralnet/rank-profiles.cfg86
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java4
2 files changed, 45 insertions, 45 deletions
diff --git a/config-model/src/test/derived/neuralnet/rank-profiles.cfg b/config-model/src/test/derived/neuralnet/rank-profiles.cfg
index 4530bff2e20..34133b2a8b6 100644
--- a/config-model/src/test/derived/neuralnet/rank-profiles.cfg
+++ b/config-model/src/test/derived/neuralnet/rank-profiles.cfg
@@ -70,7 +70,7 @@ rankprofile[].fef.property[].value "if (isNan(attribute(createdAt)) == 1, rankin
rankprofile[].fef.property[].name "rankingExpression(laAtToUse).rankingScript"
rankprofile[].fef.property[].value "if (isNan(attribute(laAt)) == 1, attribute(createdAt), attribute(laAt))"
rankprofile[].fef.property[].name "rankingExpression(markedAsAAtToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(markedAsAAt)) == 1, 9.223372036854776E18, attribute(markedAsAAt))"
+rankprofile[].fef.property[].value "if (isNan(attribute(markedAsAAt)) == 1, 9223372036854775807, attribute(markedAsAAt))"
rankprofile[].fef.property[].name "rankingExpression(tdToUse).rankingScript"
rankprofile[].fef.property[].value "pow(2,0 - ((rankingExpression(rankedAt) - rankingExpression(createdAtToUse)) / query(decay)))"
rankprofile[].fef.property[].name "rankingExpression(commentOverallScore).rankingScript"
@@ -94,68 +94,44 @@ rankprofile[].fef.property[].value "tensor(hidden[9],out[9])"
rankprofile[].fef.property[].name "vespa.type.query.W_0"
rankprofile[].fef.property[].value "tensor(hidden[9],x[9])"
rankprofile[].name "neuralNetworkProfile"
-rankprofile[].fef.property[].name "rankingExpression(log10_1p).rankingScript"
-rankprofile[].fef.property[].value "log10(x + 1)"
-rankprofile[].fef.property[].name "rankingExpression(textScoreToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(normalizedTextScore)) == 1, 0, attribute(normalizedTextScore))"
-rankprofile[].fef.property[].name "rankingExpression(rCountToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(rCount)) == 1, 0, if (attribute(rCount) < 0, 0, attribute(rCount)))"
+rankprofile[].fef.property[].name "rankingExpression(freshnessRank).rankingScript"
+rankprofile[].fef.property[].value "nativeRank + freshness(createdAt)"
+rankprofile[].fef.property[].name "rankingExpression(aVoteCountToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(aVoteCount)) == 1, 0, if (attribute(aVoteCount) < 0, 0, attribute(aVoteCount)))"
+rankprofile[].fef.property[].name "rankingExpression(log10_1p@af9a8c53ba738798).rankingScript"
+rankprofile[].fef.property[].value "log10(rankingExpression(aVoteCountToUse) + 1)"
+rankprofile[].fef.property[].name "rankingExpression(dvCountToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(dvCount)) == 1, 0, if (attribute(dvCount) < 0, 0, attribute(dvCount)))"
+rankprofile[].fef.property[].name "rankingExpression(log10_1p@6ad21b437fe95dd9).rankingScript"
+rankprofile[].fef.property[].value "log10(rankingExpression(dvCountToUse) + 1)"
rankprofile[].fef.property[].name "rankingExpression(uniqueRCountToUse).rankingScript"
rankprofile[].fef.property[].value "if (isNan(attribute(uniqueRCount)) == 1, 0, if (attribute(uniqueRACount) < 0, 0, attribute(uniqueRACount)))"
+rankprofile[].fef.property[].name "rankingExpression(log10_1p@c05478688f81fe20).rankingScript"
+rankprofile[].fef.property[].value "log10(rankingExpression(uniqueRCountToUse) + 1)"
rankprofile[].fef.property[].name "rankingExpression(uvCountToUse).rankingScript"
rankprofile[].fef.property[].value "if (isNan(attribute(uvCount)) == 1, 0, if (attribute(uvCount) < 0, 0, attribute(uvCount)))"
-rankprofile[].fef.property[].name "rankingExpression(dvCountToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(dvCount)) == 1, 0, if (attribute(dvCount) < 0, 0, attribute(dvCount)))"
-rankprofile[].fef.property[].name "rankingExpression(aVoteCountToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(aVoteCount)) == 1, 0, if (attribute(aVoteCount) < 0, 0, attribute(aVoteCount)))"
-rankprofile[].fef.property[].name "rankingExpression(totalPR).rankingScript"
-rankprofile[].fef.property[].value "rankingExpression(uniqueRCountToUse) + query(voteToRRatio) * (rankingExpression(uvCountToUse) - rankingExpression(dvCountToUse)) - rankingExpression(aVoteCountToUse)"
+rankprofile[].fef.property[].name "rankingExpression(log10_1p@53f0a2c000e82f4).rankingScript"
+rankprofile[].fef.property[].value "log10(rankingExpression(uvCountToUse) + 1)"
rankprofile[].fef.property[].name "rankingExpression(totalvote).rankingScript"
rankprofile[].fef.property[].value "query(reportaweight) * rankingExpression(aVoteCountToUse) + rankingExpression(dvCountToUse) + query(rweight) * rankingExpression(uniqueRCountToUse) + rankingExpression(uvCountToUse)"
rankprofile[].fef.property[].name "rankingExpression(phat).rankingScript"
rankprofile[].fef.property[].value "if (rankingExpression(totalvote) == 0, 0, (query(rweight) * rankingExpression(uniqueRCountToUse) + rankingExpression(uvCountToUse)) / rankingExpression(totalvote))"
-rankprofile[].fef.property[].name "rankingExpression(nCScoreToUse).rankingScript"
-rankprofile[].fef.property[].value "if (rankingExpression(totalPR) > 0, log10(rankingExpression(totalPR)), 0)"
+rankprofile[].fef.property[].name "rankingExpression(log10_1p@d7da61ad34902e89).rankingScript"
+rankprofile[].fef.property[].value "log10(rankingExpression(totalvote) + 1)"
rankprofile[].fef.property[].name "rankingExpression(hsScoreToUse).rankingScript"
rankprofile[].fef.property[].value "attribute(hsScore)"
-rankprofile[].fef.property[].name "rankingExpression(tScoreToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(t)) == 1, 0.6, attribute(t))"
-rankprofile[].fef.property[].name "rankingExpression(relevanceScoreToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(relevance)) == 1, 0.254, attribute(relevance))"
-rankprofile[].fef.property[].name "rankingExpression(freshnessToUse).rankingScript"
-rankprofile[].fef.property[].value "if (freshness(createdAt).logscale < 0.01, 0.01, freshness(createdAt).logscale)"
rankprofile[].fef.property[].name "rankingExpression(rankedAt).rankingScript"
rankprofile[].fef.property[].value "now"
rankprofile[].fef.property[].name "rankingExpression(createdAtToUse).rankingScript"
rankprofile[].fef.property[].value "if (isNan(attribute(createdAt)) == 1, rankingExpression(rankedAt), attribute(createdAt))"
-rankprofile[].fef.property[].name "rankingExpression(laAtToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(laAt)) == 1, attribute(createdAt), attribute(laAt))"
-rankprofile[].fef.property[].name "rankingExpression(markedAsAAtToUse).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(markedAsAAt)) == 1, 9.223372036854776E18, attribute(markedAsAAt))"
rankprofile[].fef.property[].name "rankingExpression(tdToUse).rankingScript"
rankprofile[].fef.property[].value "pow(2,0 - ((rankingExpression(rankedAt) - rankingExpression(createdAtToUse)) / query(decay)))"
-rankprofile[].fef.property[].name "rankingExpression(commentOverallScore).rankingScript"
-rankprofile[].fef.property[].value "query(textweight) * rankingExpression(textScoreToUse) + query(communityweight) * rankingExpression(nCScoreToUse)"
-rankprofile[].fef.property[].name "rankingExpression(pinScore).rankingScript"
-rankprofile[].fef.property[].value "if (isNan(attribute(pinned)) == 1, 0, query(pinweight) * attribute(pinned))"
-rankprofile[].fef.property[].name "rankingExpression(freshnessRank).rankingScript"
-rankprofile[].fef.property[].value "nativeRank + freshness(createdAt)"
-rankprofile[].fef.property[].name "rankingExpression(log10_1p@af9a8c53ba738798).rankingScript"
-rankprofile[].fef.property[].value "log10(rankingExpression(aVoteCountToUse) + 1)"
-rankprofile[].fef.property[].name "rankingExpression(log10_1p@6ad21b437fe95dd9).rankingScript"
-rankprofile[].fef.property[].value "log10(rankingExpression(dvCountToUse) + 1)"
-rankprofile[].fef.property[].name "rankingExpression(log10_1p@c05478688f81fe20).rankingScript"
-rankprofile[].fef.property[].value "log10(rankingExpression(uniqueRCountToUse) + 1)"
-rankprofile[].fef.property[].name "rankingExpression(log10_1p@53f0a2c000e82f4).rankingScript"
-rankprofile[].fef.property[].value "log10(rankingExpression(uvCountToUse) + 1)"
-rankprofile[].fef.property[].name "rankingExpression(log10_1p@d7da61ad34902e89).rankingScript"
-rankprofile[].fef.property[].value "log10(rankingExpression(totalvote) + 1)"
+rankprofile[].fef.property[].name "rankingExpression(tScoreToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(t)) == 1, 0.6, attribute(t))"
rankprofile[].fef.property[].name "rankingExpression(nn_input).rankingScript"
rankprofile[].fef.property[].value "concat(rankingExpression(log10_1p@af9a8c53ba738798), concat(rankingExpression(log10_1p@6ad21b437fe95dd9), concat(rankingExpression(log10_1p@c05478688f81fe20), concat(rankingExpression(log10_1p@53f0a2c000e82f4), concat(rankingExpression(phat), concat(rankingExpression(log10_1p@d7da61ad34902e89), concat(rankingExpression(hsScoreToUse), concat(rankingExpression(tdToUse), rankingExpression(tScoreToUse), x), x), x), x), x), x), x), x)"
rankprofile[].fef.property[].name "rankingExpression(nn_input).type"
rankprofile[].fef.property[].value "tensor(x[9])"
-rankprofile[].fef.property[].name "rankingExpression(get_model_weights).rankingScript"
-rankprofile[].fef.property[].value "if (query(field) == 0, constant(field), query(field))"
rankprofile[].fef.property[].name "rankingExpression(get_model_weights@1f2b4afc2c45fbee).rankingScript"
rankprofile[].fef.property[].value "if (query(W_0) == 0, constant(W_0), query(W_0))"
rankprofile[].fef.property[].name "rankingExpression(get_model_weights@e752cecc7900ff3e).rankingScript"
@@ -178,6 +154,30 @@ rankprofile[].fef.property[].name "rankingExpression(get_model_weights@23f46853c
rankprofile[].fef.property[].value "if (query(b_out) == 0, constant(b_out), query(b_out))"
rankprofile[].fef.property[].name "rankingExpression(layer_out).rankingScript"
rankprofile[].fef.property[].value "reduce(join(reduce(join(rankingExpression(layer_1), rankingExpression(get_model_weights@418462473aa32b7d), f(a,b)(a * b)), sum, out), rankingExpression(get_model_weights@23f46853cab72961), f(a,b)(a + b)), sum)"
+rankprofile[].fef.property[].name "rankingExpression(log10_1p).rankingScript"
+rankprofile[].fef.property[].value "log10(x + 1)"
+rankprofile[].fef.property[].name "rankingExpression(textScoreToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(normalizedTextScore)) == 1, 0, attribute(normalizedTextScore))"
+rankprofile[].fef.property[].name "rankingExpression(rCountToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(rCount)) == 1, 0, if (attribute(rCount) < 0, 0, attribute(rCount)))"
+rankprofile[].fef.property[].name "rankingExpression(totalPR).rankingScript"
+rankprofile[].fef.property[].value "rankingExpression(uniqueRCountToUse) + query(voteToRRatio) * (rankingExpression(uvCountToUse) - rankingExpression(dvCountToUse)) - rankingExpression(aVoteCountToUse)"
+rankprofile[].fef.property[].name "rankingExpression(nCScoreToUse).rankingScript"
+rankprofile[].fef.property[].value "if (rankingExpression(totalPR) > 0, log10(rankingExpression(totalPR)), 0)"
+rankprofile[].fef.property[].name "rankingExpression(relevanceScoreToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(relevance)) == 1, 0.254, attribute(relevance))"
+rankprofile[].fef.property[].name "rankingExpression(freshnessToUse).rankingScript"
+rankprofile[].fef.property[].value "if (freshness(createdAt).logscale < 0.01, 0.01, freshness(createdAt).logscale)"
+rankprofile[].fef.property[].name "rankingExpression(laAtToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(laAt)) == 1, attribute(createdAt), attribute(laAt))"
+rankprofile[].fef.property[].name "rankingExpression(markedAsAAtToUse).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(markedAsAAt)) == 1, 9223372036854775807, attribute(markedAsAAt))"
+rankprofile[].fef.property[].name "rankingExpression(commentOverallScore).rankingScript"
+rankprofile[].fef.property[].value "query(textweight) * rankingExpression(textScoreToUse) + query(communityweight) * rankingExpression(nCScoreToUse)"
+rankprofile[].fef.property[].name "rankingExpression(pinScore).rankingScript"
+rankprofile[].fef.property[].value "if (isNan(attribute(pinned)) == 1, 0, query(pinweight) * attribute(pinned))"
+rankprofile[].fef.property[].name "rankingExpression(get_model_weights).rankingScript"
+rankprofile[].fef.property[].value "if (query(field) == 0, constant(field), query(field))"
rankprofile[].fef.property[].name "vespa.rank.firstphase"
rankprofile[].fef.property[].value "rankingExpression(freshnessRank)"
rankprofile[].fef.property[].name "vespa.rank.secondphase"
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java
index 50c94ff38d4..0598fee538a 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java
@@ -69,10 +69,10 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase {
Schema s = builder.getSchema();
RankProfile parent = rankProfileRegistry.get(s, "parent").compile(new QueryProfileRegistry(), new ImportedMlModels());
- assertEquals("7.0 * (3 + attribute(a) + attribute(b) * (attribute(a) * 3 + if (7.0 < attribute(a), 1, 2) == 0))",
+ assertEquals("7 * (3 + attribute(a) + attribute(b) * (attribute(a) * 3 + if (7 < attribute(a), 1, 2) == 0))",
parent.getFirstPhaseRanking().getRoot().toString());
RankProfile child = rankProfileRegistry.get(s, "child").compile(new QueryProfileRegistry(), new ImportedMlModels());
- assertEquals("7.0 * (9 + attribute(a))",
+ assertEquals("7 * (9 + attribute(a))",
child.getFirstPhaseRanking().getRoot().toString());
}