-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to refine OCR result and choose custom model? #806
Comments
Just updated - still, the same failure: |
After some investigation, this is the current situation:
For example, assuming that the det_model_path = os.path.join(rapidocr_models_root, "en_PP-OCRv3_det_infer.onnx")
rec_model_path = os.path.join(rapidocr_models_root, "ch_PP-OCRv4_rec_server_infer.onnx")
cls_model_path = os.path.join(rapidocr_models_root, "ch_ppocr_mobile_v2.0_cls_train.onnx")
ocr_options = RapidOcrOptions(
det_model_path=det_model_path,
rec_model_path=rec_model_path,
cls_model_path=cls_model_path,
)
pipeline_options = PdfPipelineOptions(
ocr_options=ocr_options
)
# Convert the document
converter = DocumentConverter(
format_options={
InputFormat.PDF: PdfFormatOption(
pipeline_options=pipeline_options
),
},
)
pdf_file = Path("WO2021041671A1-small.pdf")
conversion_result: ConversionResult = converter.convert(source=pdf_file)
doc = conversion_result.document
md = doc.export_to_markdown()
print(md) The problem is that Therefore, although Docling has a @cau-git , @dolfim-ibm We could assist Docling users by implementing the following approach inside Docling:
|
Very good analysis and findings. I propose the following approach to take as a new enhancement.
|
@dolfim-ibm regarding passing the Maybe instead of introducing the |
Many thanks @nikos-livathinos for supporting and suggesting a further refinement. You mention:
Given the particular file from the issue (RapidAI/RapidOCR#330)
the columns are still confused even with the custom english model. Is there any option I can feed for correctly identifying the table? Is this also the case for you? |
@geoHeil the quality of the end-to-end conversion depends on many factors and I feel this goes beyond the scope of this issue. However, this is the input PDF: WO2021041671A1-small.pdf |
let me close this issue and ask for mroe details on this file in another none #866 |
Question
and observe that:
The model is not downloaded from huggingface - the normal (default model) is downloaded.
This leads me to the 2nd question: I can this default behaviour be kept to still download the model and in addition refine the OCR result?
The text was updated successfully, but these errors were encountered: