utils.eval_utils
Response Parsing and Evaluation for various models.
Functions
|
Parse the prediction from the generated response. |
|
Check if the given string a number. |
|
Normalize the str to lower case and make them float numbers if possible. |
|
Exact all forms of numbers from a string with regex. |
|
Parse the prediction from the generated response. |
|
Evaluate a multiple choice instance. |
|
Evaluate an open question instance. |
|
Batch evaluation for multiple choice and open questions. |
|
Calculate the instruction level accuracy for given Subject results. |
Module Contents
- utils.eval_utils.parse_multi_choice_response(response, all_choices, index2ans)[source]
Parse the prediction from the generated response.
Return the predicted index e.g., A, B, C, D.
- utils.eval_utils.normalize_str(string)[source]
Normalize the str to lower case and make them float numbers if possible.
- utils.eval_utils.extract_numbers(string)[source]
Exact all forms of numbers from a string with regex.
- utils.eval_utils.parse_open_response(response)[source]
Parse the prediction from the generated response.
Return a list of predicted strings or numbers.