python人工智能判断文字内容意思

Python016

python人工智能判断文字内容意思,第1张

python人工智能通过文字识别判断文字内容意思。文字识别主要是识别图片上的文字,使其变成电子稿。身份证识别可以识别身份证号码、地址、性别、出生年月、签发机关等信息,无需手动输入银行卡识别就是自动识别银行卡的签发行、类型、卡号,无需手动输入。

你好,如果是英文的话。你可以用下面的库。

pytesser,OCR in Python using the Tesseract engine from Google。是谷歌OCR开源项目的一个模块,可将图片中的文字转换成文本(主要是英文)

如果要识别中文还需要下载对应的训练集:https://github.com/tesseract-ocr/tessdata

,下载”chi_sim.traineddata”,然后copy到训练数据集的存放路径。下面是一个例子的代码。

#!/usr/bin/env python3

# -*- coding: utf-8 -*-

import pytesseract

from PIL import Image

# open image

image = Image.open('test.png')

code = pytesseract.image_to_string(image, lang='chi_sim')

print(code)