Skip to content

An API for detecting hate speech related to Philippine elections and politics.

Notifications You must be signed in to change notification settings

alliyah95/detoX-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

detoX Logo

detoX API

This API serves as the backend for the detoX browser extension designed to address hate speech detection with a particular focus on election-related and politics-related content in the Philippines. It employs a fine-tuned RoBERTA Tagalog Base model, a variant of the BERT (Bidirectional Encoder Representations from Transformers) model known for its exceptional performance in NLP tasks.

The model was trained using a combined dataset from two sources. The first dataset was a pre-labeled Filipino hate speech dataset. The second dataset consisted of newly crawled 2022 Philippine Presidential Elections-related Tweets.

🌐 Relevant Links

🗂️ Datasets

🤖 Models

🧰 Browser Extension

💻 Local Setup and Installation

  1. Download or clone the repository to your local machine using the following command:

    git clone https://github.com/alliyah95/detoX-api.git
    
  2. Navigate to the project directory:

    cd detoX-api
    
  3. Install the project dependencies:

    pip install -r requirements.txt
    
  4. Run the app by executing the following command:

    uvicorn main:app --reload
    
  5. To test the API endpoints with a GUI, navigate to the following URL in your browser. The default port is 8000.

    http://127.0.0.1:<PORT>/docs#/
    

🔍 Endpoints

/ (Root endpoint)

  • Used for checking whether the server is running.

    Response:

    {
        "1": "Server is up and running"
    }

/api/v1/detect

  • Returns the result of the hate speech detection.

    Parameter:

    ?content - the text content used for hate speech classification.

    Example:

    /api/v1/detect?content=hahaha%20basta%20pulangaw%20bobo
    

    Response:

    {
        "result": 1
    }

🛠️ Built With

Tools used for building the detoX API

💙 Acknowledgements

Name Contribution
🌟 Dr. Mary Jane Rabena Our Thesis Adviser
🌟 Dr. Arlan Dela Cruz Our Thesis Co-Adviser
🌟 Ms. Abijah Louise Dela Cruz Dataset Validator
🌟 Dr. Alma Theresa Manaloto Expert Evaluator
🌟 Dr. Ocirne Jun-Jun Liwanag Expert Evaluator
🌟 Mr. Arvin del Rosario Expert Evaluator
🌟 Mr. John Montes Expert Evaluator
🌟 Mr. Nelson Dizon Expert Evaluator
🌟 Mr. Alberto Castro Jr. Expert Evaluator
🌟 Mr. Blaise Cruz Publisher of the RoBERTa Tagalog Base model and the Hate Speech Filipino Dataset

🧠 Authors

  • 👧 Danica L. Castro
  • 👧 Lenina Jemima V. Dizon
  • 👧 Alliyah Joyce M. Sarip
  • 👦 Mark Aaron P. Soriano

About

An API for detecting hate speech related to Philippine elections and politics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published