October 2024

SpeechGuard

Technology to support counter-speech on social media

  • VITE
  • CI CD
  • TAILWIND CSS
  • EXPRESS
  • SHADCN UI
  • MYSQL
  • REST
  • SVELTE
  • MARIADB
  • SWAGGER
  • FastApi
  • Pocketbase
Visit live project
SpeechGuard

In times when hate comments, cyberbullying, and other forms of online attack disproportionately affect young people, it's essential to develop new strategies to push back. The project SpeechGuard sets out to realize automated methods for detecting hate speech and fostering counter-speech. Below I present its core functionality, interface, security, scalability, context-aware analysis, and evaluation processes.

1. Core functionality


Comment analysis

Cross-platform comment access: SpeechGuard reaches into comments across popular social platforms like TikTok, Instagram, and YouTube, capturing context such as parent comments, video titles, and video content to map the whole conversation around a comment.

Hate-speech detection: through the OpenAI API, hate comments are detected automatically. Detection is validated with test runs and pop-up notifications, so users are immediately informed when potentially problematic content is found.


Counter-speech generation

Generating counter-speech: the moment hate speech is identified, the system automatically generates several counter-speech options as a starting point for an appropriate, effective response.

Selection menu and feedback: an intuitive menu lets users choose among the suggestions. The choice is stored and analyzed to recognize patterns over time and — optionally — to power automatic recommendations based on the most common user choices.


Storage and training

Backend database with PocketBase: SpeechGuard uses PocketBase to reliably store comments, counter-speech interactions, and user decisions.

API endpoints and model training: dedicated endpoints store and retrieve the data, and collected user decisions feed continuous model improvement to make the counter-speech suggestions more effective. Optional advanced analytics surface trends in the database.


2. Interface


Integration into social platforms

Discreet SpeechGuard icon: the icon integrates unobtrusively into the supported platforms so it's always one tap away without disrupting the natural flow of conversation.

Pop-up notifications: when hate speech is detected, discreet pop-ups give immediate feedback and encourage a response.


Selection menu and feedback

Simple menu: a clearly structured menu offers counter-speech suggestions that are easy to pick and rate.

User feedback: a feedback function lets users rate the effectiveness of suggestions, with an optional points system to reward engagement with counter-speech.


3. Security and privacy


Authentication and access control

Verified users: a robust authentication system ensures only verified users reach critical functions.

API rate limiting: a limit of 100 requests per hour per user prevents overload.


Privacy and anonymization

Data anonymization: comments and user decisions are anonymized to protect privacy.

Optional encryption: data encryption can be added for extra security.


4. Scalability and performance


Deployment

Docker containers: SpeechGuard runs in Docker containers on school-owned servers for easy deployment and scaling.

Scalable system: the setup handles future user growth comfortably, with an optional cloud-based infrastructure as a backup.


5. Context-aware analysis


Context analysis

Capturing parent comments and video content: by including parent comments and the titles and content of videos, the system enables a comprehensive context analysis that situates interactions in a larger picture.


Context-aware counter-speech

Adapting suggestions: counter-speech suggestions adapt dynamically to the captured context, with tests ensuring the options fit the specific situation.


6. Evaluation and testing


Evaluation in schools

Workshops and questionnaires: to evaluate effectiveness, school workshops use purpose-built feedback and survey forms measuring both usability and the effectiveness of the counter-speech options.


User feedback and continuous improvement

Analysis and trends: collected feedback is evaluated systematically to drive improvements, with optional anonymized surveys to measure satisfaction and effectiveness more precisely.


Conclusion


SpeechGuard is an innovative way to give young people a voice against online hate. Combining advanced comment analysis, automated hate-speech detection, and context-aware counter-speech, it actively supports civic courage on social media. With a user-friendly interface, robust security, and a scalable infrastructure, it's well equipped for the challenges of modern online communication.


Continuous evaluation and direct user feedback flow back into the platform and help develop effective strategies to support counter-speech. Together, we can make a real contribution to a safer, more positive digital space.

Gallery