classPDFNougatOCR(BaseReader):defnougat_ocr(self,file_path:Path)->str:cli_command=["nougat","--markdown","pdf",str(file_path),"--out","output"]try:result=subprocess.run(cli_command,capture_output=True,text=True)result.check_returncode()returnresult.stdoutexceptsubprocess.CalledProcessErrorase:logging.error(f"Nougat OCR command failed with return code {e.returncode}: {e.stderr}")raiseRuntimeError("Nougat OCR command failed.")fromedefload_data(self,file_path:Path,extra_info:Optional[Dict]=None)->List[Document]:try:# Ensure the 'output' folder exists or create it if notoutput_folder=Path("output")output_folder.mkdir(exist_ok=True)# Call the method to run the Nougat OCR commandself.nougat_ocr(file_path)# Rest of your code for reading and processing the outputfile_path=Path(file_path)output_path=output_folder/f"{file_path.stem}.mmd"withoutput_path.open("r")asf:content=f.read()content=(content.replace(r"\(","$").replace(r"\)","$").replace(r"\[","$$").replace(r"\]","$$"))# Need to chunk before creating Documentreturn[Document(text=content)]exceptExceptionase:logging.error(f"An error occurred while processing the PDF: {e!s}")