aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/tensor_from_weighted_set_feature.h
blob: 1c9719c26db2afcad2e87b7c2887b8d0d1940fb6 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "tensor_factory_blueprint.h"

namespace search::features {

/**
 * Feature blueprint for a rank feature that creates a tensor from a weighted set.
 * The weighted set source can be either an attribute vector or query parameter.
 */
class TensorFromWeightedSetBlueprint : public TensorFactoryBlueprint
{
public:
    TensorFromWeightedSetBlueprint();
    fef::Blueprint::UP createInstance() const override {
        return Blueprint::UP(new TensorFromWeightedSetBlueprint());
    }
    fef::ParameterDescriptions getDescriptions() const override {
        return fef::ParameterDescriptions().
            desc().string().
            desc().string().string();
    }
    bool setup(const fef::IIndexEnvironment &env, const fef::ParameterList &params) override;
    fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override;
};

}