How Machine Learning Launched a Student's Sentiment Dashboard

Applied Statistics and Machine Learning course provides practical experience for students using modern AI tools — Photo by Pa
Photo by Pavel Danilyuk on Pexels

Why Build a Sentiment Dashboard?

In 2023, I built a live sentiment dashboard in just 90 minutes to demonstrate AI skills to recruiters, and it instantly proved more compelling than any Excel chart or R script. Most students rely on familiar tools like Excel, but modern AI platforms such as Hugging Face and Streamlit let you turn raw text into real-time insights without writing hundreds of lines of code.

Key Takeaways

  • Sentiment analysis can be set up in under two hours.
  • Hugging Face offers ready-made models for text classification.
  • Streamlit turns Python scripts into interactive web apps instantly.
  • No-code workflow tools can automate data collection and deployment.
  • Recruiters respond positively to live AI demos.

When I first heard about sentiment analysis, I imagined a wall of spreadsheets full of scores. Instead, I thought of it like a weather radar: you feed in clouds of text, and the model paints a live temperature map of emotions. The real power shows up when you can update the map in seconds as new data pours in - perfect for a career fair demo.

From a practical standpoint, a sentiment dashboard solves three common student problems:

  • It replaces manual tagging of survey responses.
  • It visualizes trends that would otherwise hide in tables.
  • It showcases machine-learning chops that stand out on a résumé.

Step 1: Selecting a Hugging Face Transformer Model

Choosing the right model feels like picking the right paint for a mural - you need the right colors and the right durability. Hugging Face hosts dozens of pretrained transformers, and for a quick demo I gravitated toward "distilbert-base-uncased-finetuned-sst-2-english," a lightweight sentiment classifier that runs on a laptop.

Why not use a bigger model like BERT-large? In my experience, the added accuracy is marginal for short social-media posts, while the inference time doubles. With a 90-minute deadline, speed wins.

Here’s how I installed the library and loaded the model:

pip install transformers
from transformers import pipeline
sentiment = pipeline("sentiment-analysis")

Once the pipeline is ready, testing it with a sample tweet is instantaneous:

result = sentiment("I love using Streamlit!")
print(result)
# [{'label': 'POSITIVE', 'score': 0.9985}]

Pro tip: Save the pipeline object globally in your Streamlit script to avoid re-loading the model on every interaction.

Step 2: Wiring Up Streamlit for Real-Time Interaction

Think of Streamlit as a rapid-prototype kitchen where you throw ingredients (code) into a pan and it serves a hot app in seconds. The framework abstracts away HTML, CSS, and JavaScript, letting you focus on the logic.

My first Streamlit file, app.py, starts with a title and a text input box:

import streamlit as st
st.title("Live Sentiment Dashboard")
user_input = st.text_area("Enter text or paste tweets")

When the user clicks a button, the app calls the Hugging Face pipeline and displays the sentiment score:

if st.button("Analyze"):
    if user_input:
        result = sentiment(user_input)
        label = result[0]["label"]
        score = result[0]["score"]
        st.metric(label, f"{score:.2%}")
    else:
        st.warning("Please enter some text.")

Because Streamlit reruns the script on every interaction, the UI stays fresh without explicit state management. I added a simple line chart to visualize sentiment over time as new entries arrive.

if "scores" not in st.session_state:
    st.session_state.scores = []

if st.button("Add & Plot"):
    if user_input:
        result = sentiment(user_input)
        st.session_state.scores.append(result[0]["score"])
        st.line_chart(st.session_state.scores)

Pro tip: Use st.session_state to preserve data across reruns; otherwise your chart would reset each click.

Step 3: Automating Data Collection with No-Code Workflow Tools

Collecting live data can be the bottleneck - like waiting for a coffee machine while the rest of the team is already coding. To keep the demo flowing, I leveraged a no-code workflow platform similar to Feathery, which recently raised $30 million for its AI-driven automation tools. Feathery’s funding announcement highlights the market’s appetite for tools that let you stitch together APIs without writing code.

In practice, I built a simple Zapier-like flow that pulls the latest tweets containing #AI from the Twitter API every minute and pushes them into a Google Sheet. Streamlit reads the sheet on each refresh, so the dashboard updates automatically.

ToolSetup TimeCostLearning Curve
R + Shiny2-3 daysFreeHigh for UI
Excel + Power Query1-2 daysOffice LicenseMedium
Python + Streamlit4-6 hoursFreeLow
Hugging Face + No-Code Flow2-4 hoursFree-TierVery Low

Pro tip: Use the free tier of a no-code platform for a demo; you rarely exceed the usage limits in a 90-minute session.

Step 4: Deploying the Dashboard for Recruiter Demos

When I shared the app with recruiters, I used Streamlit Community Cloud, which deploys your script with a single click. The process is comparable to uploading a PDF to Google Drive - simple and instantly shareable.

After pushing the code to a public GitHub repo, I linked it to Streamlit Cloud, set the required secrets (Twitter API keys), and hit “Deploy.” Within minutes, I had a public URL like https://yourname-sentiment-dashboard.streamlit.app. The recruiters could open the link on their phones and see the sentiment chart update as I typed new tweets.

Recruiters asked three recurring questions:

  1. How fast does the model respond? Answer: Sub-second latency on a laptop.
  2. Can you scale this to thousands of posts? Answer: Yes - swap the local model for an API endpoint.
  3. What’s the cost? Answer: Zero for the demo; cloud compute adds minimal expense.

Because the app runs on Python, I could later containerize it with Docker and push it to any cloud provider if a full-scale product emerged.

Step 5: Reflecting on the Experience and Next Steps

Building the dashboard taught me that the biggest hurdle isn’t the algorithm - it’s the data pipeline and the presentation layer. By treating the transformer as a black-box function and Streamlit as a UI wrapper, I reduced complexity dramatically.

In hindsight, I would add two features for future versions:

  • Sentiment heat-maps that aggregate scores by hour of day.
  • Export buttons that generate CSV reports for HR teams.

Pro tip: When you add a new feature, keep the core workflow in a single app.py file. Streamlit watches the file, so you see changes live without restarting the server.

Finally, the reaction from recruiters reinforced a broader trend: businesses want AI tools that can be deployed quickly, with minimal engineering overhead. The $30 million investment in Feathery’s workflow automation platform signals that the market is moving toward exactly this model - plug-and-play AI components that non-technical users can assemble.


Frequently Asked Questions

Q: Do I need a powerful GPU to run Hugging Face models?

A: For small models like DistilBERT, a modern CPU is sufficient for real-time inference on short texts. Larger models benefit from a GPU, but the demo can run comfortably on a laptop.

Q: Can I use a different language model for other tasks?

A: Absolutely. Hugging Face hosts models for topic classification, named-entity recognition, and more. Swap the pipeline name and adjust the UI accordingly.

Q: Is the no-code workflow secure for handling private data?

A: Most platforms encrypt data in transit and at rest. For highly sensitive data, keep the workflow within your own cloud environment or use self-hosted integrations.

Q: How do I share the dashboard with a non-technical audience?

A: Deploy to Streamlit Cloud and send a simple URL. The interface is browser-based, so anyone with a link can view and interact without installing anything.

Read more