IBM BlueMix – Cognitive Computing using Node-Red Flows

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 following 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.

https://simpletestapp.eu-gb.cf.appdomain.cloud/

Personality Insights Application

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:

  • Node.js
  • Node-RED
  • Watson Personality Insights
  • Cloudandt NoSQL persistence
  • HTML, CSS, JavaScript

Here is the screenshot of how the application looks:

IBM BlueMix

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 DevOps pipeline:

Node-RED Flows

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 this link.

Personality Insights

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: AgreeablenessConscientiousnessExtraversionEmotional 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: ExcitementHarmonyCuriosityIdealClosenessSelf-expressionLibertyLovePracticalityStabilityChallenge, and Structure.
  • Values describe motivating factors that influence a person’s decision making. The model includes five values: Self-transcendence / Helping othersConservation / TraditionHedonism / Taking pleasure in lifeSelf-enhancement / Achieving success, and Open to change / Excitement.

You can get more information about this service on this link.

Cloudant Persistence

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:

Node.JS Application

A simple Node.js SPA is also developed and that servves as a front-end. From UI, Ajax calls are made to Node-RED workflows and the response is then displayed on the web-page.

Summary

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. 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 i 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. Till Next time, happy coding.

References


Discover more from Hex Quote

Subscribe to get the latest posts sent to your email.

Discover more from Hex Quote

Subscribe now to keep reading and get access to the full archive.

Continue reading