File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
lib/idp_common_pkg/idp_common/evaluation Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -84,16 +84,23 @@ def _load_stickler_models(self) -> None:
8484
8585 def _load_extraction_results (self , uri : str ) -> Dict [str , Any ]:
8686 """
87- Load extraction results from S3.
87+ Load extraction results from S3 or local file .
8888
8989 Args:
90- uri: S3 URI to the extraction results
90+ uri: S3 URI or file:// URI to the extraction results
9191
9292 Returns:
9393 Dictionary of extraction results
9494 """
9595 try :
96- content = s3 .get_json_content (uri )
96+ # Handle local file paths (file:// URIs)
97+ if uri .startswith ("file://" ):
98+ file_path = uri .replace ("file://" , "" )
99+ with open (file_path , 'r' ) as f :
100+ content = json .load (f )
101+ else :
102+ # Handle S3 URIs
103+ content = s3 .get_json_content (uri )
97104
98105 # Check if results are wrapped in inference_result key
99106 if isinstance (content , dict ) and "inference_result" in content :
You can’t perform that action at this time.
0 commit comments