In a previous post, our interns demonstrated how to perform a simple sentiment analysis on Tweets during the World Cup Match. Recently, we had an interesting request from a client to analyze Tweets in a similar manner. The difference here will be to analyze Tweets which are specifically determined by Spotfire end users.
Simply put, the request was to query Twitter in Spotfire followed by and scoring the returned Tweets. We decided to welcome this challenge by treating it as another formidable task that could not be ignored. In other words, we couldn’t turn down a chance to just go for it.
An additional challenge for this particular request was that it needed to be contained within the standard Spotfire tools as opposed to the Spotfire Statistics Service. To accomplish this, we had to perform the API call either in TIBCO Enterprise Runtime for R (TERR), IronPython, or C#. We decided to go with TERR.
The basis for making the solution work in TERR was twofold:
• R has a robust community development of Twitter analytics tools.
• Our existing code base for Twitter sentiment analysis was already in R.
As you may recall from my previous post, TERR does not play nice with Curl. This meant we had to use REvaluate() to access Twitter. However, using REvaluate() presented another challenge in and of itself. That is, we knew how to get data out of REvaluate() and into Spotfire, but we did not know how to get data into REvaluate().
Due to a non-disclosure agreement, I cannot provide code specifics. But what I can do is share a brief tutorial of how to get data from Spotfire into TERR, then into R, and finally, how to get the data right back out.Access TERR Tutorial
As always, feel free to reach out with any questions that you may have!
Take your TERR knowledge to the next level with our latest Ebook!Download TERR Ebook