Weight

Configuration

Configuration is given as a JSON file. We show each field below:

The server will work even if method, parameter is specified in the configuration (the values are ignored) so that you can use configuration file for other engines.

converter

Specify configuration for data conversion. Its format is described in Data Conversion.

Example:
{
  "converter" : {
    "string_filter_types" : {},
    "string_filter_rules" : [],
    "num_filter_types" : {},
    "num_filter_rules" : [],
    "string_types" : {},
    "string_rules" : [
      { "key" : "*", "type" : "str", "sample_weight" : "bin", "global_weight" : "bin" }
    ],
    "num_types" : {},
    "num_rules" : [
      { "key" : "*", "type" : "num" }
    ]
  }
}

Data Structures

message feature

Represents a dimension of feature vector.

0: string key

Represents a name for the dimension of the feature vector.

1: double value

Represents a weight for the dimension of the feature vector.

message feature {
  0: string key
  1: double value
}

Methods

service weight
list<feature> update(0: datum d)
Parameters:
  • datadatum to extract feature
Returns:

Extarcted feature vector

Updates the weight using d, then returns the result of feature conversion of d using updated weight.

list<feature> calc_weight(0: datum d)
Parameters:
  • datadatum to extract feature
Returns:

Extarcted feature vector

Returns the result of feature conversion of d without updating the weight.