[Guest Post] Catilu – 2nd place winner of RPA League Iași

Published on in Robotic Process Automation by Cristian Ignat

This is a series of guest blog posts written by the winners of the RPA League Challenge from Iași, Romania that happened on 29th June 2019. The members of the team entirely wrote this content.

Let me tell you a story about how IT won.

With two hours of sleep, we arrived from Galați to RPA League Challenge – Iași, with hope in our hearts and confidence in our brains after 3 hours and a half drive. Fab Lab was the host of this RPA Hackathon. The teams from UiPath and Aggranda were up and running the whole time, filled with ideas and information, all wrapped up in a big smile and good vibes. 12 hours flew like 12 minutes.

Who is IT?

A simple idea with which we came with two days before the big day. The robot auto-replies Facebook comments based on sentiment analysis.

We knew nothing about their privacy policy and how we’re not allowed to use any Get Text activities, but we managed to figure out how to use their API to achieve our plan. How to extract the info we needed and how to do it efficiently.

So, we taught the robot to extract the comments from your Facebook page’s posts.

The extraction part is done using HTTP requests. At first run, in INIT, it retrieves the posts IDs. Then, for each post aka a Transaction Item, using another HTTP request, it makes a list with all the comments IDs of that particular post.

With a simple For Each activity, each comment ID from that list is used in another HTTP request, to see if there are any replies from the page itself.

The next step was to implement the sentiment analysis, and we did it by creating a custom activity that takes as input a string and returns a double value between -1 and 1.

The key to this activity is the VADER library.

Valence Aware Dictionary and sEntiment Reasoner is a lexicon and rule-based sentiment analysis tool. We chose to use this one because it’s specifically attuned to sentiments expressed in social media.
VADER not only tells about the Positivity and Negativity score but also tells us about how positive or negative a sentiment is.

So, if there are no replies yet, the comment is extracted and used in our activity, named “What’s the emotion”, from the package “SentimentFinder”.

Depending on the output from What’s the emotion activity, the robot is choosing a reply that fits the sentiment behind the comment.
The choosing part is done with an Excel Sheet that is read in INIT and wrote as a Dictionary of Double, String.
The first column is a double number (all the output possibilities, rounded to one decimal) and the second is the text that will be sent as a comment, using the fourth request.

Best part? Anyone can use it. You’ll only need a token generated from your Facebook Developer account. And no worries. If you don’t own one now, it couldn’t be easier to get one. Just follow the steps on developers.facebook.com.
Oh, and of course, a Facebook Page that you manage. Those two main variables, the token and the page name, are two assets that you can customize in Orchestrator.

Our project was conceived as to be a tool for anyone with a high volume of comments, but there are no restraints in using it.

Yet, the main goal was not to reply to them for the sake of doing it. The main goal is to reach all the opinions out there, better said, all the sentiments behind the comments, to get a clearer picture of how your followers are responding to your posts. Going through huge volumes of posts and comments is difficult, and it requires a lot of time, and of course, some expertise and resources to analyze them — not an easy or very pleasing task.

We didn’t have the time to generate any statistics, but these and more other features are on our To-Do list.

Speaking of time, we estimated that the robot could post 1 comment every 3 seconds. From getting the comment – checking if it has already a reply from us – running it through What’s the emotion – post the reply, all this in just 3 seconds.
To sum it up, in a minute the robot will answer to 20 comments, while an average professional typist types usually in speeds of 50 to 80 wpm.

We took the robot to a quick run. I would have recorded it, but all the work is done in the back-end — no need for more words.

Now let’s see how the robot works. For this post:[Guest Post] Catilu - 2nd place winner of RPA League Iași 1

The robot automatically gave these answers:[Guest Post] Catilu - 2nd place winner of RPA League Iași 2

And here is a short look on the log side, from the start:

[Guest Post] Catilu - 2nd place winner of RPA League Iași 3

to the end:

[Guest Post] Catilu - 2nd place winner of RPA League Iași 4

The members of the CaTiLu Team are Camelia Vasilescu, Bogdan Luca and Tiberiu Niculescu.

The software robot can be found on UiPath Connect here.