Giter Club home page Giter Club logo

Comments (5)

dongrixinyu avatar dongrixinyu commented on August 13, 2024

这个错误是验证码不通过,也就是apikey有问题。你可以自己上讯飞的机器翻译网站上 申请一个自己的账号,有免费额度。

另外,讯飞的接口就是,免费调佣次数少,准确度也不高。可以不用讯飞的 api,换用别的。

from jionlp.

fresh382227905 avatar fresh382227905 commented on August 13, 2024

from jionlp.

fresh382227905 avatar fresh382227905 commented on August 13, 2024

再请教博主一下哈
使用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.

dongrixinyu avatar dongrixinyu commented on August 13, 2024

再请教博主一下哈
使用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.

fresh382227905 avatar fresh382227905 commented on August 13, 2024

from jionlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.