无法使用知识型学术API [英] Cannot use the Knowledge academic API

查看:57
本文介绍了无法使用知识型学术API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用学术知识API中提出的功能相似性时遇到问题.

I have a problem when I try to use the function similarity proposed in the academic knowledge API.

我测试了以下commad来计算两个串之间的相似性:

I tested the following commad to compute the similarity between two string:

curl -v -X GET "https://api.labs.cognitive.microsoft.com/academic/v1.0/similarity?s1={string}&s2={string}" -H "Ocp-Apim-Subscription-Key: {subscription key}"

我得到的错误是:

{错误":{代码":未指定",消息":由于无效而被拒绝访问 下标离子键.确保您已订阅API 尝试调用并提供右键.}}

{"error":{"code":"Unspecified","message":"Access denied due to invalid subscript ion key. Make sure you are subscribed to an API you are trying to call and provi de the right key."}}

  • Curl_http_done:称为过早== 0
  • 与主机(nil)的连接#0完好无损

您能告诉我如何生成Ocp-Apim-Subscription-Key吗?

Can you tell how can I generate the Ocp-Apim-Subscription-Key?

此刻,我使用了访问以下URL时自动生成的密钥:

At the moment I used the key generated automatically when I visit the following url : https://labs.cognitive.microsoft.com/en-us/subscriptions?productId=/products/5636d970e597ed0690ac1b3f&source=labs

谢谢您的帮助

推荐答案

不幸的是,主要不是您的问题的答案,而是对所有带有相同"问题的人的警告,他们可能会遇到像我这样的原始问题,因为该问题帮助我解决了一个非常非常相似的问题:请检查您是否使用的是api.labs.cognitive.microsoft.com而不是westus.api.cognitive.microsoft.com.但是也许您需要相反的选择.

Unfortunately, primarily not an answer to your question, but rather a warning for all with the "same" problem, who could came across the original question like me, as the question helped me to solve a very, very similar problem: check whether you are using api.labs.cognitive.microsoft.com instead of westus.api.cognitive.microsoft.com. But may be you need the opposite.

似乎整个项目已在Microsoft内部移动(请参阅 https://docs.microsoft.com/zh- us/azure/cognitive-services/academic-knowledge/home (在子菜单参考中)链接到API的两个版本",这两个URL似乎几乎相同,但URL分别为westus.api...api.labs... .但是似乎没有信息有什么区别,应该优先选择哪一个,等等.

It seems the whole project has been moved inside Microsoft (see https://www.microsoft.com/en-us/research/project/academic/articles/sign-academic-knowledge-api/, I would bet that this blogpost was at the top of some "entrypoint" blog even yesterday morning, but now I am not able to find this blog, perhaps the things are changing right now) and may be the project is somewhere in the middle of the transition process and not all documentation etc. corresponds with the new state. E.g. https://docs.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/home, in the submenu Reference, links to two "versions" of API which seem to be almost same except for the URLs westus.api... and api.labs..., respectively. But there seem to be no info what is the difference, which one should be preferred etc.

我的原始密钥已于昨天过期,因此由于您的问题,我将URL更改为api.labs...后,才生成新密钥,并且无法使用它们.可能是您遇到了相反的问题,您仍然有旧"键,因此您需要使用旧" URL westus.api...,但是我无法对其进行测试,因为我的原始键可以与已过期.

My original keys expired yesterday, thus I generated new ones and was not able to use them until I have changed the URL to api.labs..., thanks to your question. May be you have the opposite problem, that you still have the "old" keys, so you need to use the "old" url westus.api..., but I am not able to test it, as my original keys which worked with westus.api... are expired.

您的查询和获取密钥的链接都可以,并且对我有用.只是一个额外的细节:您是否尝试过键值旁边的圆圈箭头,这会生成一个新的键?可能是您的钥匙以某种方式损坏或过期,这可以解决您的问题.您也可以尝试在MS网站上创建一个全新的帐户.

Both your query and your link where to get keys are OK and work for me. Just one additional detail: did you try the circle arrow next to the key value, which generates a new key? May be your key is somehow broken or expired and this could solve your problem. You can also try to create a completely new account at MS site.

PS:我添加了microsoft-cognitive标记,因为MS指的是 https://stackoverflow.com/questions/tagged/与认知服务相关的许多页面中的microsoft-cognitive

PS: I have added microsoft-cognitive tag as MS refers to https://stackoverflow.com/questions/tagged/microsoft-cognitive from many pages related to Cognitive Services

这篇关于无法使用知识型学术API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆