markitdown
markitdown copied to clipboard
ChatGPT OCR results are generated in different languages
The text written in Japanese on the image is translated into English and output.
from markitdown import MarkItDown
from openai import OpenAI
client = OpenAI()
md = MarkItDown(llm_client=client, llm_model="gpt-4o")
result = md.convert("example.jpg") ### Japanese Language Image
print(result.text_content) ### English output
In some cases, the entire document will be in English, while in other cases only part of the document (only the title) will be in English.
Depending on the requirements of your RAG, this may not be desirable, so it is better to be able to specify the output language or to fix it to the original language found in the image.