wefe.metrics
.BaseMetric¶
- class wefe.metrics.BaseMetric[source]¶
A base class to implement any metric following the framework described by WEFE.
It contains the name of the metric, the templates (cardinalities) that it supports and the abstract function run_query, which must be implemented by any metric that extends this class.
- __init__(*args, **kwargs)¶
- abstract run_query(query: wefe.query.Query, word_embedding: wefe.word_embedding_model.WordEmbeddingModel, lost_vocabulary_threshold: float = 0.2, preprocessor_options: Dict[str, Optional[Union[bool, str, Callable]]] = {'lowercase': False, 'preprocessor': None, 'strip_accents': False}, secondary_preprocessor_options: Optional[Dict[str, Optional[Union[bool, str, Callable]]]] = None, warn_not_found_words: bool = False, *args: Any, **kwargs: Any) Dict[str, Any] [source]¶