feat: Update to docling-parse v2 without history (#170)
* updated the pyproject (still need to run poetry lock after docling-parse is accepted) Signed-off-by: Peter Staar <taa@zurich.ibm.com> * Update imports for docling_parse.pdf_parser_v1 Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Lock docling-parse 2.0.0 Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Lock docling-parse 2.0.0 Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * repin poetry.lock Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> --------- Signed-off-by: Peter Staar <taa@zurich.ibm.com> Signed-off-by: Christoph Auer <cau@zurich.ibm.com> Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> Co-authored-by: Christoph Auer <cau@zurich.ibm.com> Co-authored-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
committed by
GitHub
parent
3023f18ba0
commit
4116819b51
@@ -6,7 +6,7 @@ from typing import Iterable, List, Optional, Union
|
||||
|
||||
import pypdfium2 as pdfium
|
||||
from docling_core.types.doc import BoundingBox, CoordOrigin, Size
|
||||
from docling_parse.docling_parse import pdf_parser
|
||||
from docling_parse.docling_parse import pdf_parser_v1
|
||||
from PIL import Image, ImageDraw
|
||||
from pypdfium2 import PdfPage
|
||||
|
||||
@@ -19,7 +19,7 @@ _log = logging.getLogger(__name__)
|
||||
|
||||
class DoclingParsePageBackend(PdfPageBackend):
|
||||
def __init__(
|
||||
self, parser: pdf_parser, document_hash: str, page_no: int, page_obj: PdfPage
|
||||
self, parser: pdf_parser_v1, document_hash: str, page_no: int, page_obj: PdfPage
|
||||
):
|
||||
self._ppage = page_obj
|
||||
parsed_page = parser.parse_pdf_from_key_on_page(document_hash, page_no)
|
||||
@@ -192,7 +192,7 @@ class DoclingParseDocumentBackend(PdfDocumentBackend):
|
||||
super().__init__(in_doc, path_or_stream)
|
||||
|
||||
self._pdoc = pdfium.PdfDocument(self.path_or_stream)
|
||||
self.parser = pdf_parser()
|
||||
self.parser = pdf_parser_v1()
|
||||
|
||||
success = False
|
||||
if isinstance(self.path_or_stream, BytesIO):
|
||||
|
||||
Reference in New Issue
Block a user