uqlm.nli.cluster.SemanticClusterer#
- class uqlm.nli.cluster.SemanticClusterer(nli=None)#
Bases:
object- __init__(nli=None)#
Methods
__init__([nli])cluster_responses(responses[, prompt])This method create clusters from a list of responses based on the semantic meaning of each response.
evaluate(responses[, prompt, ...])Evaluate the cluster of responses.
- cluster_responses(responses, prompt=None)#
This method create clusters from a list of responses based on the semantic meaning of each response.
- Return type:
Any- Parameters:
responses (list of str, default=None) – A list of model responses
prompt (str, default=None) – A prompt for the responses.
- Return type:
A list of lists, where each list represents a cluster.
- evaluate(responses, prompt=None, response_probabilities=None)#
Evaluate the cluster of responses.
- Return type:
Tuple[str,List[List[str]],List[float],Dict[Tuple[str,str],float]]
References