label_evaluation.evaluate_text

Functions

calculate_cer(reference, hypothesis)

Calculate the Character Error Rate (CER) between reference and hypothesis.

calculate_scores(gold_text, predicted_text)

Calculate Word Error Rate (WER) and Character Error Rate (CER) between ground truth and prediction.

create_plot(data, score_name, file_name)

Create and save a violin plot for the given error scores.

evaluate_text_predictions(ground_truth_file, ...)

Evaluate OCR predictions against a ground truth dataset.

get_gold_transcriptions(filename[, sep])

Load ground truth transcriptions from a CSV file into a dictionary.

load_json_predictions(filename)

Load predictions from a JSON file.

Exceptions

EmptyReferenceError([message])

Custom exception for handling cases where the reference string is empty.