DEV Community

Pasindu Dewviman
Pasindu Dewviman

Posted on

Guarding the Sinhala Web: Building Suba Bhas with Google Gemini

Built with Google Gemini: Writing Challenge

This is a submission for the Built with Google Gemini: Writing Challenge

What I Built with Google Gemini

The Suba Bhas is a browser extension and AI-powered filter designed to make the internet a safer space for Sinhala speakers. It acts as a real-time "shield" that detects offensive language and hate speech on web pages and automatically blurs it out.

  • The Problem: Online toxicity in local languages like Sinhala often goes undetected by global moderation tools.
  • The Tech: I built a Flask-based backend to serve a Bi-LSTM model trained on the SOLD (Sinhala Offensive Language Dataset).
  • Gemini's Role: I used Google Gemini to help architect the system, debug the complex JavaScript for the DOM observer (which scans the text in real-time), and refine the logic for dynamic keyword extraction. Gemini was also instrumental in helping me translate technical concepts between the Python backend and the Chrome extension frontend.

Demo

Github Link - [https://github.com/itspasindu/Suba-Bas-Project]

What I Learned

Building this was a massive learning curve. I improved my skills in:

  • atural Language Processing (NLP): Handling the unique nuances of the Sinhala script and offensive context.
  • Full-Stack Integration: Connecting a JavaScript extension to a Python Flask API seamlessly.
  • Soft Skills: I learned the importance of "ethical AI"—designing tools that protect users without over-censoring helpful content.
  • Unexpected Lesson: I realized how difficult real-time web scraping can be when you're trying to blur text without slowing down the user's browser.

Google Gemini Feedback

  • The Good: Gemini was incredibly fast at suggesting fixes for my Flask routes and helped me understand how to handle CORS issues between the extension and the server. It acted like a senior developer sitting right next to me.
  • The Friction: Sometimes, when I asked about specific Sinhala NLP libraries, Gemini would occasionally suggest generic English-centric models. I had to be very specific in my prompts to ensure the AI understood I was working with a low-resource language like Sinhala.

Top comments (0)