scorer
includes
Returns a True if the prompt_dict[“response”] includes the prompt_dict[“expected_response”].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_dict
|
dict
|
A dictionary containing a “response” and “expected_response” key |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary containing the “includes” key with a boolean value of the comparison between the “response” and “expected_response” keys. |
Source code in src/prompto/scorer.py
match
Returns a True if the prompt_dict[“response”] is equal to the prompt_dict[“expected_response”].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt_dict
|
dict
|
A dictionary containing a “response” and “expected_response” key |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary containing the “match” key with a boolean value of the comparison between the “response” and “expected_response” keys. |
Source code in src/prompto/scorer.py
obtain_scoring_functions
obtain_scoring_functions(
scorer: str | list[str], scoring_functions_dict: dict[str, Callable]
) -> list[Callable]
Check if the scorer(s) provided are in the scoring_functions_dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scorer
|
str | list[str]
|
A single scorer or a list of scorers to check if they are keys in the scoring_functions_dict dictionary |
required |
scoring_functions_dict
|
dict[str, Callable]
|
A dictionary of scoring functions with the keys as the scorer names and the values as the scoring functions |
required |
Returns:
| Type | Description |
|---|---|
list[Callable]
|
List of scoring functions that correspond to the scorers |