windows anaconda环境调用PaddleNLP智能识别
anaconda基本使用
paddleNLP版本要求python3.8
pip install –upgrade pip
路径
c:ProgramDataanaconda3envs askflow
python.exe -m pip install –upgrade paddleocr -i https://pypi.tuna.tsinghua.edu.cn/simple
python.exe -m pip install –upgrade paddlenlp -i https://mirror.baidu.com/pypi/simple
报错 根据报错开始处理
python.exe -m pip install –upgrade pip setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install tomli -i https://pypi.tuna.tsinghua.edu.cn/simple
python运行时 需要补充的库
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
from pprint import pprint
from paddlenlp import Taskflow
if __name__ == __main__ :
schema = {"姓名": ["招聘单位", "报考岗位"]}
ie = Taskflow("information_extraction", schema=schema, model="uie-x-base")
pprint(ie({"doc": "D:\images\1.jpg"}))
[{ 姓名 : [{ bbox : [[503, 68, 551, 94]],
end : 29,
probability : 0.6852083499421724,
relations : { 报考岗位 : [{ bbox : [[352, 68, 416, 90]],
end : 26,
probability : 0.9605496317630084,
start : 21,
text : 学前教育1 }],
招聘单位 : [{ bbox : [[125, 70, 237, 90]],
end : 21,
probability : 0.9390176901924505,
start : 13,
text : 曲阜市机关幼儿园 }]},
start : 26,
text : 丁文杰 },
{ bbox : [[502, 115, 550, 141]],
end : 50,
probability : 0.985311831192277,
relations : { 报考岗位 : [{ bbox : [[351, 116, 417, 137]],
end : 47,
probability : 0.915143021764095,
start : 42,
text : 学前教育3 }],
招聘单位 : [{ bbox : [[96, 117, 262, 136]],
end : 42,
probability : 0.9761005840384307,
start : 30,
text : 曲阜市明德学校附属幼儿园 }]},
start : 47,
text : 陈雨涵 }]}]
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...
