Tag: ibm watson cognitive

如何排除周日从沃森谈话

我在编码和沃森谈话新手,我试图做一个chatbot安排星期一到星期六约会。 我使用@ sys-date实体,它工作正常,但我不知道如何排除星期日。例如: 沃森 :什么是你最好的日子? 用户 :星期天 华生 :在这一天build立closures 我在工作区尝试:(condition)if: action =='sunday'like this: workspace 并在nodejs中这样编码 // Send the input to the conversation service conversation.message(payload, function (err, data) { if (err) { return res.status(err.code || 500).json(err) }else if(data.output.action==='sunday'){ var date = new Date(); if(!(date.getDay() % 6)){ return res.json(payload,data.output.text["On this day the establishment is closed"]); }}else{ return […]

chatbot Watson对话服务超时

目前,我正在开发一些聊天机器人,我想知道如何用超时的方式完成对话。 示例I: if(callback.error){ data.output.text = "The server is offline now. Please try again later. Goodbye!"; return res.json(data); //send the message exit(); //example (I did with sucess) } 例二: if(userInputText == false && data.context.time === 120){ //time = seconds data.output.text = "Are you still there?"; return res.json(data); //send the message exit(); //example if user did not […]

沃森视觉识别运行错误

我正在尝试使用Watson视觉识别API来设置视觉识别应用程序。 为了做到这一点,我开始下载watson-developer-cloud,并将其放在我的index.html和api_request.js旁边的node_modules文件夹中。 这是我的api_request.js文件: var watson = require('./node_modules/watson-developer-cloud'); var visual_recognition = watson.visual_recognition({ username: '*********', password: '*********', version: 'v2-beta', version_date: '2015-12-02' }); visual_recognition.listClassifiers({}, function(err, response) { if (err){ console.log(err); } else { console.log(JSON.stringify(response, null, 2)); } } ); 它直接从视觉识别api文档中获取。 我在terminal运行这个文件,它提供了所需的输出,这是一个视觉识别分类器的列表。 然而,因为它有node.jsfunction,我决定使用browserify来允许它在浏览器中运行。 我在api_request.js和index.html文件的同一目录中安装了browserify,并将api_request.js中的bundle.js构build出来。 一旦index.html链接到bundle.js,我在浏览器中打开它,并没有任何与node.js函数有关的问题。 但是,当watson-developer-cloud中的文件找不到watson-developer-cloud中的另一个文件时发生错误。 具体index.js找不到v2-beta(我没有编辑watson-developer-cloud文件)。 我觉得奇怪的是,当我在terminal中运行api_request.js时,没有一个watson-developer-cloud文件有任何问题,但是一旦我使用了browserify,bundle.jslogging了index.js无法find的错误。公测。 "build": "browserify api_request.js -o bundle.js" ^这是我用来构buildbundle.js的脚本。 我能想到的唯一可能导致这个错误是browserify。 还有什么可能导致这个?

IBM Watson语音到Node.js Web应用程序上的文本audio转换

问题的关键是IBM Watson Speech to Text只允许FLAC,WAV和OGG文件格式上传并与API一起使用。 我的解决scheme是,如果用户上传一个MP3,在发送文件到Watson之前,数据转换将发生。 本质上,用户上传一个mp3,然后使用ffmpeg或sox将audio转换为OGG,然后将audio上传到Watson。 我不确定的是:为了允许audio转换发生,我必须在Node.js Watson代码中修改哪些内容? 下面链接是我正在通过的沃森回购。 我相信这个文件必须被修改,就是我已经链接到的fileupload.js文件,但是修改的地方是我不确定的。 我已经通过SO和developerWorks,IBM SO来了解这个问题的答案,但是我还没有看到这是我在这里发布的原因。 如果有必要,我会很乐意澄清我的问题。 沃森演讲到文本回复

使用Bluemix对​​图像进行分类

经过深入研究,我决定使用Bluemix来分类和识别图像。 我有一个关于如何开始使用node.js运行时编程的初学者问题。 我试图按照这个教程。 但是,这只是代码片段。 您如何运行它们并在Bluemix环境中查看它们? 我的进展: – 我在Bluemix中启动了node.js starter应用程序。 – 我添加了下面的代码,app.js看起来像这样: /*eslint-env node*/ //————————————————————————– // node.js starter application for Bluemix //————————————————————————– // This application uses express as its web server // for more info, see: http://expressjs.com var express = require('express'); // cfenv provides access to your Cloud Foundry environment // for more info, see: https://www.npmjs.com/package/cfenv […]

访问watson检索并排在Node中的代理之后

我需要知道R&R服务是否可以在代理之后使用。 看看下一部分,看看我的调查。 我正在使用的代码在我家里工作。 (没有防火墙/没有代理,只有路由器) 我从下面的代码开始。 https://console.eu-gb.bluemix.net/catalog/starters/personality-insights-nodejs-web-starter 我尝试在本地执行它,它正在使用以下configuration来安装模块。 npm config set registry http://registry.npmjs.org npm config set proxy http://xxxx:xx npm config set https-proxy http://xxxx:xx npm config set strict-ssl false set http_proxy=http://xxxx:xx set https_proxy=http://xxxx:xx set HTTP_PROXY=http://xxxx:xx set HTTPS_PROXY=http://xxxx:xx 在工作的过程中,我开始玩R&R。 但我只是有一个错误。 Error searching for documents: Error: connect ETIMEDOUT 158.85.132.88:443 其中ip地址对应gateway.watsonplatform.net ping gateway.watsonplatform.net PING gateway.watsonplatform.net (158.85.132.88) 56(84) bytes of data. […]

Watson对话服务+将对话推送到HTML中

我正在使用基于示例应用程序的Watson对话服务,使用NodeJS服务器和HTML客户端实现。 我有一个单独的事件触发器应用程序与NodeJS通信。 给定一个特定的事件触发器,我想在HTML客户端显示Watson的输出文本。 由于它不会有任何的HTML请求,我想知道如何能够显示或进行conversation.message api。

npm ELIFECYCLE错误

我在ibm watson上部署了testing机器人( https://github.com/eciggaar/text-bot) ,当我尝试在本地使用CLI代码部署代码时,它会得到以下错误。 我正在使用Nodejs版本6.10.3和npm版本5.0.4 有人可以帮助我这个。 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! text-bot@0.1.2 start: `node server.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the text-bot@0.1.2 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A […]

使用node.js的Watson api

我正在尝试使用这个node.js代码来使用我们的ios应用程序中的ibm cloud bluemix中的watson api。 任何人都可以告诉我这个代码在做什么,并给我们一个答案如何使用我们的应用程序的watson服务。 var express = require('express'); var https = require('https'); var url = require('url'); // setup middleware var app = express(); app.use(express.errorHandler()); app.use(express.urlencoded()); // to support URL-encoded bodies app.use(app.router); app.use(express.static(__dirname + '/public')); //setup static public directory app.set('view engine', 'jade'); app.set('views', __dirname + '/views'); //optional since express defaults to CWD/views // There are […]