blob: 549c9e9a4a42d268c9e742e42cbe99c8bfa9af99 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.ranking;
import ai.vespa.models.evaluation.FunctionEvaluator;
import com.yahoo.search.result.FeatureData;
import com.yahoo.search.result.Hit;
import com.yahoo.tensor.Tensor;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
class DummyEvaluator implements Evaluator {
private final String input;
private Tensor result = null;
DummyEvaluator(String input) {
this.input = input;
}
@Override
public Evaluator bind(String name, Tensor value) {
result = value;
return this;
}
@Override
public double evaluateScore() {
return result.asDouble();
}
@Override
public String toString() {
return "DummyEvaluator(" + input + ")";
}
}
|