问题标签 [alchemyapi]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
352 浏览

ibm-cloud - 如何在 Bluemix Node-RED 中使用 alchemyAPI 新闻数据?

我正在使用 Bluemix 环境和 Node-RED 流编辑器。在尝试为 AlchemyAPI 服务使用内置 Node-RED 的特征提取节点时,我发现它很难使用。

我尝试将它连接到 HTTP 请求节点、HTTP 响应节点等,但没有结果。也许我没有正确完成连接过程?

我需要这段代码来使用特定公司的 AlchemyAPI 新闻数据获取 Twitter 新闻和新闻,并为 IBM HDFS 提供情绪评分并存储在其中。

这是代码:

[{"id":"8bd03bb4.742fc8","type":"twitter
在","z":"5fa9e76b.a05618","twitter":"","tags":"Ashok Leyland, Tata Communication, Welspun, HCL Info,Fortis H, JSW Steel, Unichem Lab, Graphite India, DB Realty , Eveready Ind, Birla Corporation, Camlin Fine Sc, 印度经济, 印度储备银行, 太阳能, 电信, 印度电信监管局","user":"false","name":"Tweets","topic" :"tweets","x":93,"y":92,"wires":[["f84ebc6a.07b14"]]},{"id":"db13f5f.f24ec08","type":"ibm hdfs ","z":"5fa9e76b.a05618","name":"Dec12Alchem","文件名":"/12dec_alchem","appendNewline":true,"overwriteFile":false,"x":564,"y":226,"wires":[]},{"id":"4a1ed314.b5e12c","type":"debug","z":"5fa9e76b .a05618","name":"","active":true,"console":"false","complete":"false","x":315,"y":388,"wires":[ ]},{"id":"f84ebc6a.07b14","type":"alchemy-feature-extract","z":"5fa9e76b.a05618","name":"TrailRun","page-image": "","image-kw":"","feed":true,"entity":true,"keyword":true,"title":true,"author":"","taxonomy":true,"概念”:真实,“关系”:“”,pub-date":"","doc-sentiment":true,"x":246,"y":160,"wires":[["c0d3872.f3f2c78"]]},{"id":"c0d3872 .f3f2c78","type":"function","z":"5fa9e76b.a05618","name":"标记推文","func":"msg.payload={tweet: msg.payload,score: msg.features};\nreturn msg;\n","outputs":1,"noerr":0,"x":405,"y":217,"wires":[["db13f5f.f24ec08"," 4a1ed314.b5e12c"]]},{"id":"4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618","name":"News","method": "GET","re​​t":"obj","url":"doc-sentiment":true,"x":246,"y":160,"wires":[["c0d3872.f3f2c78"]]},{"id":"c0d3872.f3f2c78","type":" function","z":"5fa9e76b.a05618","name":"标记推文","func":"msg.payload={tweet: msg.payload,score:msg.features};\nreturn msg; \n","输出":1,"noerr":0,"x":405,"y":217,"wires":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{ "id":"4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618","name":"News","method":"GET","re​​t":"对象","网址":"doc-sentiment":true,"x":246,"y":160,"wires":[["c0d3872.f3f2c78"]]},{"id":"c0d3872.f3f2c78","type":" function","z":"5fa9e76b.a05618","name":"标记推文","func":"msg.payload={tweet: msg.payload,score:msg.features};\nreturn msg; \n","输出":1,"noerr":0,"x":405,"y":217,"wires":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{ "id":"4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618","name":"News","method":"GET","re​​t":"对象","网址":"电线":[["c0d3872.f3f2c78"]]},{"id":"c0d3872.f3f2c78","type":"function","z":"5fa9e76b.a05618","name":"标记tweets","func":"msg.payload={tweet: msg.payload,score:msg.features};\nreturn msg;\n","outputs":1,"noerr":0,"x": 405,"y":217,"wires":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{"id":"4181cf8.fbe7e3","type":"http 请求"," z":"5fa9e76b.a05618","name":"News","method":"GET","re​​t":"obj","url":"电线":[["c0d3872.f3f2c78"]]},{"id":"c0d3872.f3f2c78","type":"function","z":"5fa9e76b.a05618","name":"标记tweets","func":"msg.payload={tweet: msg.payload,score:msg.features};\nreturn msg;\n","outputs":1,"noerr":0,"x": 405,"y":217,"wires":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{"id":"4181cf8.fbe7e3","type":"http 请求"," z":"5fa9e76b.a05618","name":"News","method":"GET","re​​t":"obj","url":"z":"5fa9e76b.a05618","name":"标记推文","func":"msg.payload={tweet: msg.payload,score:msg.features};\nreturn msg;\n", "输出":1,"noerr":0,"x":405,"y":217,"wires":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{"id": "4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618","name":"News","method":"GET","re​​t":"obj","网址“:”z":"5fa9e76b.a05618","name":"标记推文","func":"msg.payload={tweet: msg.payload,score:msg.features};\nreturn msg;\n", "输出":1,"noerr":0,"x":405,"y":217,"wires":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{"id": "4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618","name":"News","method":"GET","re​​t":"obj","网址“:”电线":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{"id":"4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618", "名称":"新闻","方法":"GET","re​​t":"obj","url":"电线":[["db13f5f.f24ec08","4a1ed314.b5e12c"]]},{"id":"4181cf8.fbe7e3","type":"http 请求","z":"5fa9e76b.a05618", "名称":"新闻","方法":"GET","re​​t":"obj","url":"https://gateway-a.watsonplatform.net/calls/data/GetNews?apikey= &outputMode=json&start=now-1d&end=now&count=1&q.enriched.url.enrichedTitle.relations.relation=|action.verb.text=acquire ,object.entities.entity.type=公司|&return=enriched.url.title","x":105,"y":229,"wires":[["f84ebc6a.07b14"]]},{"id ":"53cc794e.ac3388","type":"inject","z":"5fa9e76b.a05618","name":"GetNews","topic":"News","payload":""," payloadType":"string","re​​peat":"","crontab":"","once":false,"x":75,"y":379,"wires":[["4181cf8.fbe7e3" ]]}]

0 投票
1 回答
215 浏览

python - KeyError: 'docSentiment' 用于在 Python 中使用 AlchemyAPI 进行情绪分析

我有一个文本文件,其中用户 ID 和推文文本由“-->”分隔。我想将这些加载到字典中,然后迭代这些值,使用 AlchemyAPI 计算每条推文的情绪。我的输入数据与此类似(真实文件有数百万条记录):

我的代码是:

我收到错误消息:

我不明白我做错了什么。有人可以帮忙吗?

0 投票
1 回答
232 浏览

node.js - 同步使用 Alchemy API

我正在尝试编写一个纯函数以将 Alchemy API 与 watson-developer-cloud npm 包一起使用,但我无法弄清楚如何同步执行其调用。是否有替代方法或包可以让我同步接收其结果?在 I/O 发生时阻塞是绝对没问题的。

0 投票
1 回答
159 浏览

ibm-cloud - 如何从 Alchemy DataNews API 中采样最近的文章?

有谁知道我如何查询 Alchemy News API 以检索过去 24 小时内所有文章的样本,直到指定的计数?昨天,我使用下面的查询来获取 1,000 篇提取概念的文章,并且运行良好。但是,由于某种原因,今天的相同查询只给出了大约 24 个结果。

谢谢。

0 投票
1 回答
250 浏览

ibm-watson - 如何在 AlchemyData News 中指定多个不同类型的实体?

我正在尝试查询 AlchemyData 新闻以查找由不同类型的多个实体(例如,文章正文中的公司“IBM”和操作系统“Linux”)缩小的文章,但运气不佳。

我可以在标题中找到或找出多个实体文本的示例:

q.enriched.url.title=A[IBM^Linux]

对于标题中的单个文本和类型:

q.enriched.url.enrichedTitle.relations.relation=|object.entities.entity.text=IBM,object.entities.entity.type=Company|

但这种组合让我望而却步。

我也不确定在搜索文章正文时使用哪个字段名称,而不仅仅是标题。

0 投票
1 回答
185 浏览

javascript - Is there a javascript/Node.js library for accessing the Alchemy Data News API?

I've looked in the watson-developer-cloud package and its namesake namespace on GitHub. Will I need to go directly to the REST API in my app?

0 投票
1 回答
781 浏览

symfony - 作曲家要求:“找不到包 alchemyai/alchemyapi_php”

  • 我按照这里的说明在 symfony2 中安装 alchemyapi_php 包: https ://packagist.org/packages/alchemyai/alchemyapi_php
  • 我收到此错误:
    [InvalidArgumentException] 无法在任何版本中找到包 alchemyai/alchemyapi_php 以获得最低稳定性(稳定)。检查包装拼写或您的最低稳定性
  • 可能有什么问题?
0 投票
1 回答
28 浏览

alchemyapi - 访问 JSO 中的值

我正在尝试使用 JSONP 帖子通过 JavaScript 客户端应用程序测试调用 Alchemy News API。

我的 JSON 结果如下所示:

我可以使用以下代码成功调用 API(取自How do I get the JSON from an API request into my page's javascript?

我真正苦苦挣扎的是访问返回对象中的数据。我可以毫无问题地读取诸如状态
之类的 顶级值,但我似乎可以从架构中更深层次的信息中加载任何值。

谁能发布我如何访问标题字段中的数据?

提前谢谢了。

0 投票
2 回答
125 浏览

ibm-cloud - 是否有 Alchemy API 的 iOS SDK?

是否有适用于 iOS 原生开发人员的使用 Swift/Objective-C 的 AlchemyAPI 软件开发工具包 (sdk)?

0 投票
2 回答
221 浏览

alchemyapi - AlchemyAPI News API 返回旧消息

我一直在对 AlchemyAPI 中的 News API 进行一些研究。我发现有时即使我在查询中包含“start=now-1d&end=now”,它也会返回几年前的新闻。谁能告诉我如何解决这个问题?非常感谢。