Sentiment_Analysis
A prototype run for a sentiment analysis group project where we get get comments from facebook and determine their sentiment towards a said topic,
A sentiment analysis tool for Facebook comments in a low-resource, code-switched language, comparing simple and neural network models.
What This Project Does
This project automatically detects whether Facebook comments are negative, neutral, or positive—a task called sentiment analysis. The twist is that it works on comments written in a low-resource language (a language with limited training data available), and people often mix languages or use slang and emojis in their posts. Instead of manually reading thousands of comments to figure out what people think about a topic, this tool does it automatically.
How It Works
The project takes Facebook comments, cleans them up (keeping things like emojis and punctuation that carry emotional meaning), and then feeds them into one of two types of models. The simpler approach uses a technique called TF-IDF, which essentially counts character patterns in the text. The more advanced approach uses a pre-trained neural network model called AfriBERTa, which has already learned patterns from other African-language text and can be fine-tuned for this specific task. The project compares how well different models perform and picks the best one. So far, the simpler character-based model is actually winning with 61% accuracy, though the team is still experimenting with the neural network approach to see if it can improve.
Who Would Use This
A researcher or organization interested in public opinion could use this to monitor Facebook discussions about a particular topic—say, a public health campaign or political issue—without having to read every single comment. The project includes tools to collect comments directly from Facebook via Apify (a web scraping service), automatically score them with sentiment, and visualize the results in a dashboard. A team member could also feed in new unlabeled comments and let the system predict their sentiment, or use "active learning" to smartly pick which new comments are worth manually labeling to improve the model further.
How It's Built
The project is organized like a professional data science workflow: separate folders for raw data, cleaned data, trained models, and results. It includes Jupyter notebooks (interactive Python documents) for exploration and a set of reusable Python scripts for preprocessing, training, and prediction. There's even a web API that serves predictions over HTTP, so the model can run as a service rather than just a one-off script. The README emphasizes practical concerns for low-resource, code-switched text—like avoiding English-specific text cleaning that would break local languages, and keeping emojis intact because they carry real sentiment information. The project is still in prototype stage (it has 1 star), but the structure suggests the team is thinking about making it production-ready.
Where it fits
- Monitor Facebook discussions about a public health campaign or political issue at scale.
- Automatically score newly scraped comments for sentiment instead of reading them manually.
- Compare a simple TF-IDF model against a neural network model to pick the best performer.
- Run the trained model as a web API service serving live predictions.