@@ -23,6 +23,7 @@ class EvaluationResult:
2323 extractor_name : str
2424 timestamp : str
2525 total_samples : int
26+ version : str # 抽取器版本
2627
2728 # Overall metrics
2829 overall_metrics : Dict [str , float ]
@@ -48,6 +49,7 @@ def to_dict(self) -> Dict[str, Any]:
4849 "extractor_name" : self .extractor_name ,
4950 "timestamp" : self .timestamp ,
5051 "total_samples" : self .total_samples ,
52+ "version" : self .version
5153 },
5254 "overall_metrics" : self .overall_metrics ,
5355 "sample_results" : self .sample_results ,
@@ -72,6 +74,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "EvaluationResult":
7274 error_analysis = data .get ("error_analysis" ),
7375 extractor_config = data .get ("extractor_config" ),
7476 metric_config = data .get ("metric_config" ),
77+ version = metadata .get ("version" , "unknown" ),
7578 )
7679
7780
@@ -182,6 +185,8 @@ def evaluate(self,
182185 error_analysis = error_analysis ,
183186 extractor_config = extractor .get_config (),
184187 metric_config = self .metric_config ,
188+ # 新增:传入抽取器版本(从extractor对象获取)
189+ version = getattr (extractor , 'version' , 'unknown' ),
185190 )
186191
187192 return evaluation_result
0 commit comments