Views
No views yet
1# Single sample evaluation test
2from src.xVerify.model import Model
3from src.xVerify.eval import Evaluator
4
5# initialization
6model_name = 'xVerify-1B-I' # Model name
7url = 'IAAR-Shanghai/xVerify-1B-I' # Model path or URL
8inference_mode = 'local' # Inference mode, 'local' or 'api'
9api_key = None # API key used to access the model via API, if not available, set to None
10
11model = Model(
12 model_name=model_name,
13 model_path_or_url=url,
14 inference_mode=inference_mode,
15 api_key=api_key
16)
17evaluator = Evaluator(model=model)
18
19# input evaluation information
20question = "New steel giant includes Lackawanna site A major change is coming to the global steel industry and a galvanized mill in Lackawanna that formerly belonged to Bethlehem Steel Corp.
21Classify the topic of the above sentence as World, Sports, Business, or Sci/Tech."
22llm_output = "The answer is Business."
23correct_answer = "Business"
24
25# evaluation
26result = evaluator.single_evaluate(
27 question=question,
28 llm_output=llm_output,
29 correct_answer=correct_answer
30)
31print(result)1@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}