diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-03 16:56:45 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-03 16:56:45 +0100 |
commit | 4cc0c0885fd8b5f5e2fde130cfe409bbc9990455 (patch) | |
tree | 09e0d16df9c0db8b6bafaf82ee865844b86e5886 /config-model | |
parent | 9d5f4971e89870ec61b1b309287c563ead7d8b75 (diff) |
Add a LongValue to preserve integer numbers.
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/test/derived/neuralnet/rank-profiles.cfg | 86 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java | 4 |
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()); } |