nordlys.logic.features.feature_cache module


Implements a generic feature class.

Authors: Faegheh Hasibi

class nordlys.logic.features.feature_cache.FeatureCache[source]

Bases: object

get_feature_val(feature_name, key, callback_func, *args)[source]

Checks the cache and computes the feature if it does not exists

set_feature_val(feature_name, key, value)[source]

Adds a feature and its value to the cache.

  • feature_name – Name of the feature
  • key – the name of what feature is computed for (e.g., a mention, entity)
  • value – feature value