A friend of mine wanted to use natural language processing (NLP) to analyze the tweets by French presidential candidate Eric Zemmour. This is how we went about it.
All tools mentioned in this tutorial are free (Google Sheets, Twitter API), open source (Facepager, DB Browser for SQLite), or freemium (IBM Watson).
We used Facepager to collect the tweets.
This tool comes with a number of useful presets.
We took advantage of a preset titled Twitter >> Get tweets of user
and tweaked the parameters accordingly.
We also used Facepager to submit the tweets to IBM Watson's Natural Language Understanding, a reputable NLP cloud solution, and retrieve the responses.
To make it easier for other people to reproduce this step, we created this Facepager preset for IBM Watson's Natural Language Understanding.
We were interested in extracting keywords, concepts, categories, sentiment, and entities from those tweets. You can read this documentation to learn about IBM Watson's NLP capabilities.
We could export data as CSV files directly from Facepager, but we decided to take a different route in order to have more control over the output.
Facepager stores data as SQLite files. We opened our SQLite file on DB Browser for SQLite. Then we created views to query the data according to our needs. We published in this repository the SQL statements used to create those views. To understand those statements, it is useful to have a basic knowledge of SQL and read the documentation on SQLite's JSON1 Extension.
As an example, we also published in this repository our SQLite file with tweets, IBM Watson's analyses, and our customized views.
On DB Browser for SQLite, we exported all views as CSV files and imported them on Google Sheets.
Then, on Google Sheets, we created pivot tables and a couple of charts to make sense of the data.
There is a copy of the resulting spreadsheet here.