![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
This module is in npm as askwatson
. It provides a simple API for asking Watson a question on Bluemix using the
question_and_answer service
.
Basically you will need to get set up on Bluemix/CF and follow the instructions given
for the sample Node.js application here https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/qaapi/#commonApplication, including running the cf
commands, but
I have factored out that code a bit into two modules, so your application can
be cleaner. In case you need help finding the cf
command line program you can download it from here https://github.com/cloudfoundry/cli/releases (under Installers) and install it with dpkg -i <filename>
.
The first module is called bluemix-request-simple
and it has the parts for pulling
the host and port out of the environment and using them in a request.
The other module is this one, which is very simple to use:
watson.ask('healthcare', 'What is the most common kind of cancer', function(err, answers) {
console.log(answers);
});
This will need to run on Bluemix so a more complete example would be:
var watson = require('askwatson')
, restify = require('restify');
var server = restify.createServer();
server.get('/:domain/:question', function(req, res) {
watson.ask(req.params.domain, req.params.question, function(e, ans) {
res.send(ans);
});
});
server.listen(process.env.VCAP_APP_PORT, process.env.VCAP_APP_HOST, function() {
console.log('%s listening at %s', server.name, server.url);
});
Note that if you use GET as in this example it will be simpler to test but you can only use short questions (try curl "http://whatever.mybluemix.net/healthcare/What+is+the+most+common+kind+of+cancer"
). If you use something longer for the question it will blow up the app, so you will probably want to use POST.
FAQs
Ask IBM Watson a question on Bluemix
The npm package askwatson receives a total of 0 weekly downloads. As such, askwatson popularity was classified as not popular.
We found that askwatson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.