The IBM Watson Tone Analyzer service is a cognitive linguistic analysis service that detects three types of tones from written text: emotions, social tendencies, and writing style. Emotions identified include things like anger, fear, joy, sadness, and disgust. Identified social tendencies include things from the Big Five personality traits used by some psychologists. These include openness, conscientiousness, extraversion, agreeableness, and neuroticism. Identified writing styles include confident, analytical, and tentative.
-
You need a Bluemix account. If you don't have one, sign up. Experimental Watson Services are free to use.
-
Download and install the Cloud-foundry CLI tool if you haven't already.
-
Edit the
manifest.yml
file and change<application-name>
to something unique. The name you use determines the URL of your application. For example,<application-name>.mybluemix.net
.
applications:
- services:
- my-service-instance
name: <application-name>
command: npm start
path: .
memory: 512M
- Connect to Bluemix with the command line tool.
cf api https://api.ng.bluemix.net
cf login
- Create and retrieve service keys to access the Tone Analyzer service:
cf create-service tone_analyzer lite my-tone-analyzer-service
cf create-service-key my-tone-analyzer-service myKey
cf service-key my-tone-analyzer-service myKey
- Create a
.env
file in the root directory by copying the sample.env.example
file using the following command:
cp .env.example .env
You will update the .env
with the information you retrieved in steps 5.
- Install the dependencies you application need:
npm install
- Start the application locally:
npm start
-
Point your browser to http://localhost:3000.
-
Optional: Push the application to Bluemix:
cf push
After completing the steps above, you are ready to test your application. Start a browser and enter the URL of your application.
<your application name>.mybluemix.net
For more details about developing applications that use Watson Developer Cloud services in Bluemix, see Getting started with Watson Developer Cloud and Bluemix.
-
The main source of troubleshooting and recovery information is the Bluemix log. To view the log, run the following command:
cf logs <application-name> --recent
-
For more details about the service, see the documentation for the Tone Analyzer.
This sample code is licensed under Apache 2.0. Full license text is available in LICENSE.
See CONTRIBUTING.
Find more open source projects on the IBM Github Page
This node sample web application includes code to track deployments to Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:
- Application Name (
application_name
) - Space ID (
space_id
) - Application Version (
application_version
) - Application URIs (
application_uris
)
This data is collected from the VCAP_APPLICATION
environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
Deployment tracking can be disabled by removing require('cf-deployment-tracker-client').track();
from the beginning of the server.js
file at the root of this repo.