SAP HANA Real Time Sentiment Analysis and Text Min...
Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
Finally we are publishing all HANA apps that all of us, B1 Solution Architects, developed to demonstrate how far you can go using SAP HANA!
If you are seeing this application for the first time, you didn’t go to one of the Business One Innovation Summits 2015 (Bangkok, Barcelona or Miami). Shame on you and you have to be there next year.
This application implements 2 interesting HANA functionalities:
1 - SAP HANA Text Analysis
This functionality allows us to handle "Unstructured Data" (in our case tweets). This feature classifies terms of a given input in several categories (People, companies, locations etc). Its is also possible to extract the whole meaning of an unstructured text and classify in a Positive or Negative Sentiment.
2 - SAP HANA Text Mining (Available on SPS09 only)
This feature works with a concept called Bag of words not only acting at a document level (tweet) but a whole set of documents (an entire table of tweets for example).
With those features we can classify documents relevancy for a given input. E.g. give me the tweets that are more relevant for the term "Steve Jobs" or suggest me terms that are related to it ("apple").
Lets see the app running in this conceptual demonstration:
App Installation (SPS08 or higher required)
As Sally’s just explained on the video. This solution in composed by 2 applications:
You just have to import the Delivery Unit (file .tgz) on your HANA System to have all the App structure set up. If you don’t know how to work with DUs, use this simple example of how to import it as a guide.
As by the time of this blog, XS Engine has no Text Analysis APIs, the DU import might fail the first time and only import part of the components. This ok.
After the import (even partially), on the development perspective of HANA Studio, check the software repositories and execute all the SQL commands that are listed on the file Summit15 > SQL > CreateIndexes.sql. These commands will Activate Text Analysis features on the app.
If you got the initial error, re-import the delivery unit again and now you should get no error messages.
Open the node script (twitterSummit.js) and fill your twitter keys and HANA server information.
Run the Tweets Retriever scripts with the commands
node twitterSummit.js
And it should work like this:
Final Considerations
This app is, off course, for demonstration purposes. It is 100% open source and can be enhanced or modified accordingly. It was developed under a didactical perspective, in a matter that you could have a comprehensive experience understanding each step.
One point to be emphasized it’s the amount of free third party resources that I used here to show you that, once working on HANA, we are free to work with a infinite of libraries and resources. Examples: