Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
0
stars
0
forks
source link
Refactor e2e_eval function in eval_end2end.py for modularity #13
This PR refactors the e2e_eval function in eval_end2end.py to improve modularity and maintainability. The function is broken down into smaller subfunctions, making the code easier to understand and test. The changes include:
Extracting the code for reading files into a separate function named read_files
Extracting the code for calculating metrics into separate functions
Extracting the code for printing results into a separate function named print_results
Updating the e2e_eval function to call these new functions and handle their returned values
Summary of Changes
Created a new function read_files to handle reading ground truth and prediction files
Created separate functions for calculating metrics such as Intersection over Union (IoU) and edit distance
Created a new function print_results to handle printing the evaluation results
Updated the e2e_eval function to call the new functions and handle their returned values
Added unit tests for the new functions to ensure their correctness
These changes improve the modularity and maintainability of the code, making it easier to understand, test, and maintain.
Fixes #1.
🎉 Latest improvements to Sweep:
Sweep now uses the rope library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, try sweep: Refactor <your_file>.py to be more modular!
Description
This PR refactors the
e2e_eval
function ineval_end2end.py
to improve modularity and maintainability. The function is broken down into smaller subfunctions, making the code easier to understand and test. The changes include:read_files
print_results
e2e_eval
function to call these new functions and handle their returned valuesSummary of Changes
read_files
to handle reading ground truth and prediction filesprint_results
to handle printing the evaluation resultse2e_eval
function to call the new functions and handle their returned valuesThese changes improve the modularity and maintainability of the code, making it easier to understand, test, and maintain.
Fixes #1.
🎉 Latest improvements to Sweep:
rope
library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, trysweep: Refactor <your_file>.py to be more modular
!💡 To get Sweep to edit this pull request, you can: