I'm trying to use the Tesseract.js library to convert an ID image to text but the ID has two English and Arabic languages and it totally ruins my translation. Is there a way to translate two languages or ignore one language? I have attached my code, here in the code I only translate from English and everything in Arabic destroys the output.
const convertImageToText = useCallback(async () => {
if (!selectedImage) return;
await worker.load(); // Load the tesseract.js worker
await worker.loadLanguage("eng"); // Load the english language
await worker.initialize("eng"); // Initialize the english language
const { data } = await worker.recognize(selectedImage);
setTextResult(data.text);
}
If we want to add more than one language option at the same time, it will be enough to put '+' between them.