mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-10-07 14:06:34 +00:00
forward declaration of AnalyzeResult (#7523)
This commit is contained in:
parent
39be515ba6
commit
843376bb1b
@ -185,7 +185,7 @@ class AzureOCRDocumentConverter:
|
||||
docs = [*tables, text]
|
||||
return docs
|
||||
|
||||
def _convert_tables(self, result: AnalyzeResult, meta: Optional[Dict[str, Any]]) -> List[Document]:
|
||||
def _convert_tables(self, result: "AnalyzeResult", meta: Optional[Dict[str, Any]]) -> List[Document]:
|
||||
"""
|
||||
Converts the tables extracted by Azure's Document Intelligence service into Haystack Documents.
|
||||
:param result: The AnalyzeResult Azure object
|
||||
@ -294,7 +294,7 @@ class AzureOCRDocumentConverter:
|
||||
|
||||
return converted_tables
|
||||
|
||||
def _convert_to_natural_text(self, result: AnalyzeResult, meta: Optional[Dict[str, Any]]) -> Document:
|
||||
def _convert_to_natural_text(self, result: "AnalyzeResult", meta: Optional[Dict[str, Any]]) -> Document:
|
||||
"""
|
||||
This converts the `AnalyzeResult` object into a single Document. We add "\f" separators between to
|
||||
differentiate between the text on separate pages. This is the expected format for the PreProcessor.
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Forward declaration of `AnalyzeResult` type in `AzureOCRDocumentConverter`.
|
||||
|
||||
`AnalyzeResult` is already imported in a lazy import block.
|
||||
The forward declaration avoids issues when `azure-ai-formrecognizer>=3.2.0b2` is not installed.
|
Loading…
x
Reference in New Issue
Block a user