, , , ,

SocialCloud – Services are here to serve – Part 4

jh176

http://giphy.com/gifs/season-15-the-simpsons-15×18-l2Je1wHsHqDv2aIne

‘To Start Press Any Key.’ Where’s the ANY key?

– Homer Simpson –

There are so many possibilities to start the next big thing and the great thing in the IT- world is, that it is happening with every pressing of  ‘any key’ on your Keyboard. So, press these keys and realize great and new ideas.

But there is a problem … TIME.

Fast development with services

Success of new ideas and IT products is strongly affected by their time to market. As a startup or a company that wants to test new approaches or technologies the cost of development also plays a main role. To be successful as a business in the software industry you have to choose a fitting infrastructure capable to allow fast changes and scaling. A cloud infrastructure frees you from setting up and buying your own infrastructure. As a startup or a company you normally don’t have the time and money for it. By using an existing cloud infrastructure you follow the rule “pay what you use” which keeps down the cost of development. An example for such a startup and why they have chosen to use a cloud infrastructure is described in a case study about slack.

Moreover does the cloud offer different services like monitoring and scaling of an application. Let’s have a deeper look at the definition of services in the cloud.

Definition of services

The NIST Definition of Cloud Computing defines three Service models:

  • Software as a Service  (SaaS) describes the ability to use the applications provided by the Cloud Service Provider  (Google drive, Adobe CC, etc.). The user does not have influence on the underlying resources like server, network, storage, etc.
  • Platform as a Service (PaaS) allows the user to deploy applications to the cloud infrastructure and use the provided services like programming languages, different services and tools. The user does not manage or control the underlying infrastructure (network, server, operating system or storage) but has control over the deployed application and can configure the hosting environment.
  • Infrastructure as a Service (IaaS) gives the user the possibility to manage computing resources such as processing, networking or storage. The user does not manage the  datacenter himself but has control over computing resources like virtual servers, storage or operating systems.

In our project we are using the IBM Bluemix cloud and its services for which we kindly got free usage accounts for a limited time by IBM.

services_filterServices in Bluemix

In Bluemix you are able to set up different applications in different programming languages. Launch container images and virtual machines (currently in beta status).  Bluemix also comes with a catalogue of different services divided in twelve categories as shown in the screenshot on the left.

Theory to practice

So in theory with a couple of mouse clicks you have a fully working application up and running in no time. That’s the theory but is it really that easy?

 

 

We are using the “IBM Watson Service”  called “Personality Insights” to program “our own psychologist in the cloud”.

The functionality of the service is described as follows.The service analyzes JSON, text or HTML (such as blogs, social media, …) as an input as long it is written by one person. As an output you receive cognitive and social information offered as a tree structure in JSON or CSV format.

Let’s see what Watson will tell us about ourselves.

Step 1: Launch the service
Select the Service, give it a name and start it. After the service started it is displayed in the dashboard as not binded to an application.

Watson

Step 2: Talk to the service
The Watson service can be addressed with curl by calling the API endpoint:

https://gateway.watsonplatform.net/personality-insights/api 

To be able to use the service you have to send the service credentials as part of the request:

curl -u "{username}":"{password}"
"https://gateway.watsonplatform.net/personality-insights/api/v2/{method}"

Another way is to use client-side libraries which are provided for Java and node. For this example we use a node server on a local machine with the respective library.

Step 3: Analyze the data
As input we use one of our recent blog posts and as a result we get data in JSON format.

In further steps we could add a graphical user interface for data input and display the resulting data graphically with a library such as d3.js. An example is provided by IBM itself:
https://personality-insights-livedemo.mybluemix.net/

An excerpt of our result is displayed below in plain text. As seen in the first message the analysed text is actually too short to make statistically significant estimates but it shows roughly how the service is working.

{
  "id": "*UNKNOWN*",
  "source": "*UNKNOWN*",
  "word_count": 1058,
  "word_count_message": "There were 1,058 words in the input. We need a minimum of 3,500, preferably 6,000 or more, to compute statistically significant estimates",
  "processed_lang": "en",
  "tree": {
    "id": "r",
    "name": "root",
    "children": [<span id="mce_marker" data-mce-type="bookmark"></span>

Personality Insights uses the psychology of language and algorithms to describe characteristics based on three models:

  • Big Five
  • Needs
  • Values

A deeper look on the science behind the service can be found in the documentation. We will pick a result set where our text scored high, to show how the resulting JSON is offered. We chose sympathy.

    {
             "id": "Sympathy",
             "name": "Sympathy",
             "category": "personality",
             "percentage": 0.9897799063460789,
             "sampling_error": 0.0955628778
     },

Our text scored very high with roughly 99%. We say thank you, Watson, for being that kind.

What’s next?

After using Services in Bluemix we learned, that we are able to add different services to our application by calling them over their Rest API or using a client-side library. This allows to add and remove  functionality to an application in a fast manner.

In the following posts we will see how services were used in a bigger context of our semester project.

Stay tuned for that and click here.


Written by Natali Bopp, Andreas Gold, Jonas Häfele, Merle Hiort, Martin Kopp, Christian Lang, Anna Poth und Eric Weislogel

Comments

Leave a Reply