markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

ChatGPT OCR results are generated in different languages

Open tanreinama opened this issue 1 week ago • 1 comments

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.

tanreinama avatar Feb 16 '25 05:02 tanreinama