Python 3.x Tesseract-为什么我对一种不同于原始语言的语言有着字符级的自信

Python 3.x Tesseract-为什么我对一种不同于原始语言的语言有着字符级的自信,python-3.x,ocr,tesseract,python-tesseract,Python 3.x,Ocr,Tesseract,Python Tesseract,我试图根据tesseract生成的置信度分数检测图像中的语言。我正在检查每个图像中的不同语言。我使用的是: text1 = pytesseract.image_to_data(full_path, lang='eng', config=tessdata_dir_config, output_type='data.frame') text1 = pd.DataFrame(text1) text1 = text1[text1.conf != -1] text1 = text1[~text1.te

我试图根据tesseract生成的置信度分数检测图像中的语言。我正在检查每个图像中的不同语言。我使用的是:

text1 = pytesseract.image_to_data(full_path, lang='eng', config=tessdata_dir_config, output_type='data.frame') 
text1 = pd.DataFrame(text1) text1 = text1[text1.conf != -1] 
text1 = text1[~text1.text.str.contains('-')] 
text1 = text1[~text1.text.str.contains(' ')] 
text1 = text1[~text1.text.str.contains("\.")] 
text1 = text1[~text1.text.str.contains("[0-9]")] 
text1 = text1[~text1.text.str.contains("[:,\n,/,%,|,;,!,&,(,),\*,\",\?,\',_,=,é,$,@,#]")]


text2 = pytesseract.image_to_data(full_path, lang='hin', config=tessdata_dir_config, output_type='data.frame') 
text2 = pd.DataFrame(text2) 
text2 = text2[text2.conf != -1] 
text2 = text2[~text2.text.str.contains('-')] 
text2 = text2[~text2.text.str.contains(' ')] 
text2 = text2[~text2.text.str.contains("\.")] 
text2 = text2[~text2.text.str.contains("[0-9]")] 
text2 = text2[~text2.text.str.contains("[:,\n,/,%,|,;,!,&,(,),\*,\",\?,\',_,=,é,$,@,#]")]
对于英语它正在生成文本和相应的置信度分数,但当我通过指定印地语作为语言时,我也会获得印地语的文本和置信度分数,而图像中只有英语语言

以下是示例图像:

我做错了什么?