-
Chore: don't pass empty language code to tesseract CLI (#1996)
发布于
2023-11-07 01:30:12 +00:00 Summary:
Close: https://github.com/Unstructured-IO/unstructured/issues/1920
- stop passing in empty string from
languagesto tesseract, which will
result in passing empty string to language config-lfor the tesseract
CLI - also stop passing in duplicate language code from
languagesto
tesseract OCR - if we failed to convert any iso languages from the
languages
parameter, proceed OCR withengas default
Test
- First confirm the tesseract error
Estimating resolution as Xbefore
this: - on the
unstructured-apirepo with main branch, runmake run-web-app - curl to test error from empty string, or just any wrong input like
-F 'languages="eng,de"':
curl -X 'POST' 'http://0.0.0.0:8000/general/v0/general' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -F 'files=@sample-docs/layout-parser-paper-with-table.jpg' \ -F 'languages=""' \ -F 'strategy=hi_res' \ -F 'pdf_infer_table_structure=True' \ | jq -C . | less -R- after this change:
- in your unstructured API env, cd to unstructured repo and install it locally with
pip install -e . - check out to this branch
- run
make run-web-appagain in api repo - the curl command return output and see warning in log
- in your unstructured API env, cd to unstructured repo and install it locally with
Co-authored-by: qued 64741807+qued@users.noreply.github.com
下载附件
- stop passing in empty string from