Skip to content

Code for the publication "Think Twice Before Writing Angry Comments in WhatsApp"

Notifications You must be signed in to change notification settings

gsi-upm/offensive-tflite-android

Repository files navigation

WhatsCheck

About this application

WhatsCheck allows the users to analyze WhatsApp messages offensiveness before sending them. It also warns the user with a popup if the message to be sent was detected as offensive.

This application was developed using the interface of Direct to Chat, an open source application developed by Mohammad Yasir which has the logic to send the messages over WhatsApp using itsAPI through HTTP requests.

For the analysis of the messages, an average word vector TensorFlow Lite model has been trained using an english offensiveness dataset provided by Nitin Tiwari, as well as some of its examples to power up on-device inference of the model.

Technical information

This application works on Android 7.1+ (API Level 25) devices. It may not be usable on devices with very small screens or very low DPI.

TensorFlow Lite model train and evaluation

The file TrainingAndEvaluationNotebook.ipynb contains the Jupyter Notebook used to train and to evaluate the different model architectures proposed to be used with this application, including the final average word vector model deployed in the app, with a F1 macro score of 0.96.

Screenshots

Non-offensive message analyzed:

Offensive message analyzed:

Popup alerting the user of an offensive message before sending it:

About

Code for the publication "Think Twice Before Writing Angry Comments in WhatsApp"

Resources

Stars

Watchers

Forks

Packages

No packages published