camel
camel copied to clipboard
feat:medcalculator toolkit
PR Description: Modify and Update Medicine Toolkit (verifier)
Related Issues:
Resolves #2178.
Changes Made:
-
Rewrote
medcalc_benchtools:- Included all tool functions from
medcalc_benchwith enhanced implementation. - Added standardized docstrings to clearly describe the functionality, parameters, and return values of each tool.
- Provided test cases and practical examples for validating each tool’s correctness and usability.
- Fixed existing bugs and errors identified within the original implementation.
- Improved the directory structure of
medcalc_bench, distinctly organizing tool modules and foundational utility modules.
- Included all tool functions from
-
Created
medcalc_toolkit.py:- Developed a centralized interface for invoking all rewritten tools.
- Ensured each function includes clear, standardized docstrings.
-
Added a Toolkit Example (
tool_example.py):- Included detailed usage examples demonstrating how to effectively utilize the
medcalc_toolkit.
- Included detailed usage examples demonstrating how to effectively utilize the
Testing Details:
- Conducted testing using one data sample per tool, totaling 44 tools tested.
- Noted 4-5 tools lacking official test data from
medcalc_bench; thus, these tools have not been verified. - Identified discrepancies between gold labels and inference results for approximately 3 tools, requiring further review.
Motivation:
This update directly addresses the feature request raised in #2178, aiming to improve maintainability, usability, and reliability within the Loong project's medical calculation components.
How to Test:
- Verify availability and documentation quality of tools within
medcalc_toolkit.py. - Run provided test cases to ensure functionality and accuracy.
- Review
tool_example.pyto validate practical usage scenarios. - Pay special attention to tools identified with test data issues or discrepancies noted above.
Additional Notes:
- PR addresses multiple issues highlighted during initial assessments, particularly related to accuracy and organizational clarity.
- Careful review of untested tools or those showing result mismatches is advised during code review.
Thanks @ZackZikaiXiao @13204942 for contributing this pull request! Please also make sure we follow their license during the development: https://github.com/ncbi-nlp/MedCalc-Bench/blob/main/CODE-LICENSE.
thanks @ZackZikaiXiao @13204942 ,please fix the pre-commit error