Skip to content

Slainteee/Jatayu-ContentModeration

Repository files navigation

Jatayu-ContentModeration

All Contributors

Content Moderation for Online Chat Application

In today's world, it is a well known fact the internet and social media can be used to influence opinions and spread hate. Although the platform is not to blame, popular brands like facebook lose customers and their usage statistics go down because many people find some content offensive or inappropriate. In the recent past, people have been very vocal about their opinions, and have been posting offendable posts. This has caused social unrest and even riots between various sections of the society.

User generated contents contains different types of opinions and expressions through written texts, images or videos. And such contents may also contain objectionable visuals or which is not favorable for many people viewing such contents.

Why Content Moderation is important

Moderating the content on social media websites is important, as now such platforms are used to promote the business, products and brands and such spam contents can disappoint other customers and discourage them to either stay away from such platforms or minimize the use of social media sites.

The Solution

The idea is to develop a filter which can be embedded in any chat system or social media to prevent cyberbullying, hate spread, obscenity etc.

We have came up with a AI based Content Moderation model which is deployed as an API and it can be easily used in any Web or Mobile based platforms.

Process Flow

For the image data, we are checking for any inappropriate text in the image or whether the image contains violence. The API checks the same for audio and video data aswell . Apart from images and videos of violence, It will also check for sexual or nudity related contents like, sexual activities, pornography, offensive signs, stripped images of people, especially females with revealing dresses and erotic gestures that are against the community of the chat platforms. In case of text data, along with checking for hatefull speech , the API will even check for any malicious links in the text in order to prevent cyberattacks such as phishing attacks. It will also check for spam messages/mails with circulates in online chat plaforms in the form of fake advertisements,self promotion etc.

Architecture Diagram

picture alt

Tech Stack

  1. Languages : Python. We will use Python basically for everything, from Modeling to ETL
  2. AI/ML : Pytorch/Tensorflow(for most Deep Learning Tasks) and Scikit-Learn(Our go-to for most Non DL Tasks
  3. NLP : NLTK/spaCy for extracting features from the text data.
  4. OCR : For extracting Text from images, We rely on Tesseract OCR Engine.
  5. Speech Recognition : Analysing Audio input can be achieved through Speech to text Conversion. We have used Sphinx/Google Speech Recognition for the same.
  6. Version Control : Github is the best choice for any group project for code control and tracking.
  7. Additional Libraries: Pandas, Numpy, MatplotLib
  8. Google Colab for GPU support.
  9. Project Management: We used Notion and We find ourself using Notion for more than just project management and tracking. We were able to keep track of what Our Team Members do on a daily basis, make sure that we allocate time efficiently, and track what everyone on the team is up to.

Demo

Alt text

Installation Guide

  • For Windows
  1. CLone the Repo.
git clone https://github.com/Slainteee/Jatayu-ContentModeration.git
  1. Change the working directory.
cd Jatayu-ContentModeration
  1. Create and activate Virtual Environment (Conda is preferred).
  2. Install the required packages.
pip install -r requirements.txt
  1. Install OCR Engine: The project uses pytesseract OCR engine. To install pytesseract, Follow this

  2. After succesfully installing pytesseract, set the tesseract path in the script. Add the following line in the app.py

pytesseract.pytesseract.tesseract_cmd = <tesseract-path-here>

The Project is ready to run on your local machineπŸ’₯πŸ’₯

To Run

  • For Windows
  1. Open 2 tabs of Command prompt
  2. Change the working directory
cd Jatayu-ContentModeration
  1. Activate virtual Environment(Conda is preferred).
  2. In first CMD tab
python app.py

It will start the API server. 5) In second CMD tab, change the directory to run the UI sample

cd Web-Frontend
  1. Create a folder named upload inside the static folder
cd static && mkdir uploads
  1. Return to the Web-Frontend Directory
cd ..
  1. Execute the server.py to start flask web server
python server.py
  1. Flask server will run on host='127.0.0.1' and port=1025
  2. Open any web browser(Chrome preferred) and type 127.0.0.1:1025 to see the live demo

Tests

Testing will ensure that the api is working as expected. The project uses unittest as a test framework. After setting up the basic test structure, Unnitest framework makes it really easy to write and provides a lot of flexibility for running the tests.

To Run the tests:

  1. Navigate to the project directory
cd Jatayu-ContentModeration
  1. Activate virtual Environment
  2. Run the test script
python test.py

Wanna know a secret, You can add more tests 😊😊. So go ahead and create a pull requestπŸŽ‰πŸŽ‰

To Contribute

β€œNo one and nothing is perfect, or we wouldn't have uniqueness.” <-- Random quote from google. You can find more here -->. β€œNo matter how good you get you can always get better, and that's the exciting part.” <- Another one πŸ˜…πŸ˜…->. To Contribute to the project and make it better, follow the contributing guidelines for project specific details.

Maintainer πŸš€


Khushhal Reddy

Contributors ✨

Thanks goes to these wonderful people:


Khushhal Reddy

πŸš‡ ⚠️ πŸ’»

Ranjan Panda

πŸ”Œ

Aryamaan Srivastava

πŸ”£

This project follows the all-contributors specification. Contributions of any kind welcome!