IBM BlueMix – Cognitive Computing using Node-Red Flows
In this post, I will describe how to use IBM Cloud offering to build cognitive applications. I will also show how to build a Personality Insights App using Node-RED flows and Watson cognitive services.
Join the DZone community and get the full member experience.Join For Free
If you’re doing it right, life is a process of continuous learning. If you’ve learned something today that you didn’t know when you got out of bed this morning, you’ve had a good day – no matter what else happened.
Today I learned a little more about IBM Cloud offerings – more than I knew some time ago when I was working with cloud offerings from Azure and AWS. I not only learned more, but I also checked some of the services available on IBM cloud and use those to develop an application. So, If you haven’t used it before or you’re new to cloud computing, now would be a good time to get started.
I also build and deploy a simple application (details below) to test couple of ideas and to demonstrate how these services can work together to build interesting applications.
I will suggest to check the application first on the this URL and then you can check more details in the next sections. Application is very simple, user is required to add only name and some details of the person for the analysis. You can copy some personality bio from Wikipedia for testing purpose or use your own CV/info if you want to see insights about yourselves.
Personality Insights Application
The application itself is hosted on the IBM Cloud. Following technologies are used for the purpose of the demo application and IBM BlueMix offers all of these from code to deploy:
- Watson Personality Insights
- Cloudandt NoSQL persistence
Here is the screenshot of how the application looks:
BlueMix is a cloud platform as a service developed by IBM that supports a range of programming languages and services as well as integrated DevOps.
BlueMix is based on Cloud Foundry open-source technology and runs on software-layer infrastructure.
Cloud Foundry is an open-source PAAS for running orchestrated polyglot applications in a public or private environment
.IBM BlueMix offers multiple compute options:
- Cloud Foundry applications
- Docker Containers
- Open source Virtual Machines
BlueMix offerings make it very easy to start application development and also integrated DevOps services provides a very nice experience to deploy your code.
You can create a free account and that is what I used for this application.
Once you login to BlueMix, you will see the dashboard where you can manage all your resources.
Here is the screenshot of the DevOps pipeline:
I used Node-RED flows for the backed part of the application. I used HTTP Nodes to create a simple REST API.
Get Insights Node is consuming Watson Personality Insights service for analysis. The save data node is persisting the data to Cloudandt NoSQL database. For basic introduction of Node-RED, you can refer to my earlier article on DZone on this link.
The IBM Watson Personality Insights service derives insights about personality characteristics from social media, enterprise data, or other digital communications. Wiring this service to Node-Red is very straight-forward.
The Personality Insights service infers personality characteristics based on three primary models:
- Big Five personality characteristics represent the most widely used model for generally describing how a person engages with the world. The model includes five primary dimensions: Agreeableness, Conscientiousness, Extraversion, Emotional range, and Openness. Each dimension has six facets that further characterize an individual according to the dimension.
- Needs describe which aspects of a product are likely to resonate with a person. The model includes twelve characteristic needs: Excitement, Harmony, Curiosity, Ideal, Closeness, Self-expression, Liberty, Love, Practicality, Stability, Challenge, and Structure.
- Values describe motivating factors that influence a person’s decision making. The model includes five values: Self-transcendence / Helping others, Conservation / Tradition, Hedonism / Taking pleasure in life, Self-enhancement / Achieving success, and Open to change / Excitement.
You can get more information about this service on this link.
At one point in my life, I hated databases. I don’t know why but databases were just something that didn’t excite me at all. I loved programming but programming a database seemed irrelevant. But I guess those days are over. NoSQL databases simplify things a lot and Cloudant is one of those. Cloudant is a scalable distributed database for mobile, web, and IoT and serverless applications. It is optimized for handling heavy workloads that are typical of large, fast-growing web and mobile apps. On IBM Bluemix, Node-RED used it to persist flows. I also used it to persist insights data as well. Here is screenshot of the dashboard of Cloudant persistence:
A simple Node.js SPA is also developed and that serves as a front-end. From UI, Ajax calls are made to Node-RED workflows and the response is then displayed on the web-page.
IBM Cloud offerings are easy to use and by utilizing various services, its very easy to build and deploy applications. The cloud dashboard is also very simple. The free account doesn’t require your credit card information (which is the case for AWS and Azure). I will recommend you to check it out. In later post, I will include some other services from BlueMix as well in this application. Feel free the check the sample application for analysis, you can grab some info from Wikipedia about a personality or write something about yourself to see the results. Until next time, happy coding.
Published at DZone with permission of Jawad Hasan Shani. See the original article here.
Opinions expressed by DZone contributors are their own.