Comments (5)
这个错误是验证码不通过,也就是apikey有问题。你可以自己上讯飞的机器翻译网站上 申请一个自己的账号,有免费额度。
另外,讯飞的接口就是,免费调佣次数少,准确度也不高。可以不用讯飞的 api,换用别的。
from jionlp.
from jionlp.
再请教博主一下哈
使用Tencent_APi时,
tencent_api = jio.TencentApi(
[{"project_id": "0",
"secret_id": "AKID84nJhqaLJm0xeHjWYQ4RoX", ## 这是我把我申请的API修改后错误的 API,非真
"secret_key": "cxhATebS9svtc4GKAtPvJUh3C"}])###这是错误的密匙
报:
2020-10-15 15:57:45 ERROR wrapper: 'TargetText'
Traceback (most recent call last):
File "/home/lmf/anaconda3/envs/tf/lib/python3.7/site-packages/jionlp/gadget/back_translation/translation_api.py", line 70, in wrapper
f = func(self, *args, **kargs)
File "/home/lmf/anaconda3/envs/tf/lib/python3.7/site-packages/jionlp/gadget/back_translation/translation_api.py", line 478, in call
return response_json['Response']['TargetText']
KeyError: 'TargetText'
这个错。
然后我去腾讯官网看我的API并没有调用
from jionlp.
再请教博主一下哈
使用Tencent_APi时,
tencent_api = jio.TencentApi(
[{"project_id": "0",
"secret_id": "AKID84nJhqaLJm0xeHjWYQ4RoX", ## 这是我把我申请的API修改后错误的 API,非真
"secret_key": "cxhATebS9svtc4GKAtPvJUh3C"}])###这是错误的密匙报:
2020-10-15 15:57:45 ERROR wrapper: 'TargetText'
Traceback (most recent call last):
File "/home/lmf/anaconda3/envs/tf/lib/python3.7/site-packages/jionlp/gadget/back_translation/translation_api.py", line 70, in wrapper
f = func(self, *args, **kargs)
File "/home/lmf/anaconda3/envs/tf/lib/python3.7/site-packages/jionlp/gadget/back_translation/translation_api.py", line 478, in call
return response_json['Response']['TargetText']
KeyError: 'TargetText'
这个错。
然后我去腾讯官网看我的API并没有调用
我试了一下,这里的问题,还是,你要按照腾讯规定的参数区请求。
你的问题是,你传了一个密钥 dict,但是密钥是错的,就报错了。把密钥改对了就可以 了。
若你一直在传错误的密钥,它会有一个针对多种语言的重复请求,所以就会看到重复报了好几次错误。
执行这个查看接口文档说明。
print(jio.TencentApi.__doc__)
文档里的 api密钥 dict 是我自己的,可以用。不过你还是自己申请一个,因为我的密钥已经用差不多了。
from jionlp.
from jionlp.
Related Issues (20)
- [BUG] 运行 jio.ner.extract_time('是一个十一点的事') 提取日期出错
- [BUG] remove_url 的功能不符合预期 HOT 1
- [BUG]2月份第二周 未支持 HOT 2
- [BUG]国家识别不出来,一些特殊地名无法识别 HOT 1
- 数据增强咨询
- [BUG]提取2024年冬至的时候,会提取到 2024年冬,实际提取到了 立冬的日期 HOT 1
- 已解决
- [功能请求]
- [BUG] HOT 4
- [BUG] ret_future 与预期不符 HOT 1
- [BUG] 日期解析错误 HOT 1
- [技术咨询] 关于多线程地址解析性能问题 HOT 1
- 时间解析问题 【年末、年初、月初、月末、年同期】相关
- [BUG]地址解析,文本:湖南永州市祁阳市梅溪镇湖南省祁阳县梅溪镇春光村十二组 解析不出来 HOT 1
- [BUG]解析20240307这种时间格式与预期不符 HOT 1
- 部分地址未能解析(2024.5.23)
- [BUG]特定地址解析失败 HOT 1
- [BUG]解析时间出现的两个问题
- 怎么更新地址表? HOT 3
- [BUG]最近 x 个月和最近 x 月两种返回不一致 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jionlp.