首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >学习使用微软情感API分析特朗普和克林顿的辩论视频

学习使用微软情感API分析特朗普和克林顿的辩论视频
EN

Stack Overflow用户
提问于 2016-10-23 22:53:17
回答 1查看 339关注 0票数 0

阅读这篇文章:https://benheubl.github.io/data%20analysis/fr/,试着跟上。

我分离了两个python代码,在运行其中一个代码后,我复制了视频位置。但到目前为止,还不能进行到阶段2,即获取结果,然后将其保存以供R进行分析。我的响应文件是

代码语言:javascript
复制
getResponse.text is : 
{"status":"Failed","progress":null,"createdDateTime":"2016-10-
23T12:03:50.525844Z","lastActionDateTime":"2016-10-
23T12:03:50.5414685Z","message":"Failed to start job."}



Traceback (most recent call last):

File "...face-recognition1-after-waiting.py", line 63, in <module>
rawData = json.loads(json.loads(getResponse.text)
['processingResult'])

KeyError: 'processingResult'

密钥是正确的,上一个响应是ok:

代码语言:javascript
复制
202

{'Content-Length': '0', 'Expires': '-1', 'X-AspNet-Version': '4.0.30319', 'Operation-Location': 'https://api.projectoxford.ai/emotion/v1.0/operations/aad68da1-38e4-4722-8c64-cfbf19d1de97', 'X-Powered-By': 'ASP.NET', 'apim-request-id': '7cdb9bf5-234e-4566-afeb-b68a0dfd25df', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Date': 'Sun, 23 Oct 2016 12:03:52 GMT'}

似乎不能继续下去...有什么帮助吗?

EN

回答 1

Stack Overflow用户

发布于 2016-10-25 12:17:34

在这个问题上做了更多的工作后,我发现问题是,虽然有一个202的答案,但细节是上传不起作用。因此,没有文件可供我下载。考虑到这一点,该过程将是

从benheubl.github.io/data%20analysis/fr/中读取并复制这些代码/fr/(这是http://www.economist.com/blogs/graphicdetail/2016/10/daily-chart-12)

  • Sign in的基本材料,并从www.microsoft.com/cognitive-services/en-us/subscriptions

  • run获取密钥脚本的第一部分到“print videoIDLocation"

  • Note down videoIDLocation something like api.projectoxford.ai/emotion/v1.0/operations/a2fcb40e-d7d0-4483-89e7-250201ac01d5 # a2fc...c01d5 part24小时后,
  1. 检查状态转到“认知服务”下的“获取视频识别操作结果”运行“开放应用编程接口测试控制台”你需要的订阅密钥和oid是a2fcb40e-d7d0-4483-89e7-250201ac01d5以上的
  2. ,这是等待咖啡的部分(也是你没有等待Godet由于错误,因为202并不是真正的确认到处都是ok。你在上面的测试脚本中看到了很多代码,在复制了R代码后运行python脚本的第二部分,但要注意(# somethings.)
  3. When location.
  4. Run I use - as comments)

代码语言:javascript
复制
- use getcwd, setcwd('~/...'), getcwd, list.files etc to ensure dir is right
- you need to install.packages including 
- install.packages('magrittr')
- install.packages('dplR')  # <-- not sure about this
- install.packages('dplyr')
- install.packages('tidyr') # need for the %>%  
- install.packages('ggplot2')
- and amend one of the mistakes of the code i.e. 
- View(trump\_g) should be View(blog\_trump)
- comment this line out in the ggplot  
- would display all the non-smoothed lines

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40204288

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档