ScorerBase#

class council.scorers.ScorerBase[source]#

Bases: Monitorable, ABC

Base class for implementing a Scorer

abstract _score(context: ScorerContext, message: ChatMessage) float[source]#

To be implemented with in derived classes with actual scoring logic

render_as_dict(include_children: bool = True) Dict[str, Any]#

returns the graph of operation as a dictionary

render_as_json() str#

returns the graph of operation as a JSON string

score(context: ScorerContext, message: ChatMessage) float[source]#

Score the given message

Parameters:
Returns:

similarity score. The greater the value to higher the similarity

Raises:

ScorerException – an unexpected error occurs

to_dict() Dict[str, Any][source]#

Serialize the instance into a dictionary. May need to be overridden in derived classes