Views
No views yet
1from src.xVerify.model import Model
2from src.xVerify.eval import Evaluator
3
4# initialization
5model_name = 'xVerify-14B-Ia'
6model_path = 'IAAR-Shanghai/xVerify-14B-Ia'
7inference_mode = 'local' # or 'api'
8
9model = Model(
10 model_name=model_name,
11 model_path_or_url=model_path,
12 inference_mode=inference_mode
13)
14evaluator = Evaluator(model=model)
15
16# input evaluation information
17question = "In which year did Fayaz A. Malik receive the Young Scientist of the Year from the Council of Scientific and Industrial Research?"
18llm_output = "The year Fayaz A. Malik received the Young Scientist of the Year award from the Council of Scientific and Industrial Research was 2001.
19
20The answer is 2001."
21correct_answer = "2009"
22
23# evaluation
24result = evaluator.single_evaluate(
25 question=question,
26 llm_output=llm_output,
27 correct_answer=correct_answer
28)
29print(result) # Output: Incorrect1@article{xVerify,
2 title={xVerify: Efficient Answer Verifier for Reasoning Model Evaluations},
3 author={Ding Chen and Qingchen Yu and Pengyuan Wang and Wentao Zhang and Bo Tang and Feiyu Xiong and Xinchi Li and Minchuan Yang and Zhiyu Li},
4 journal={arXiv preprint arXiv:2504.10481},
5 year={2025},
6}