Skip to content

Repository files navigation

Text Classification for Hate Speech or Offensive language with Python and different models

  This repository contains Python code for text classification tasks, focusing on cleaning text data, preparing models, comparing different classification algorithms, and web crawling.

Table of Contents

  Introduction
  Steps Involved in Cleaning
  Model Preparation
  Various Models
  Comparison Between Different Models
  Web Crawling

Introduction

  Text classification is the process of assigning predefined categories to free-text documents. This repository provides a Python implementation for text classification tasks, including cleaning text data, preparing models, comparing different classification algorithms, and web crawling.

Steps Involved in Cleaning

  Converting all the letters to lowercase: Convert all letters in the text to lowercase to ensure uniformity.
  Remove punctuation, newlines: Eliminate punctuation marks and newlines from the text data.
  Tokenize: Split the text into individual words or tokens.
  Remove stopwords: Remove common words that carry little to no meaning in the context of text analysis, such as 'and', 'the', 'is', etc.

Model Preparation

train_test_split: Prepare the dataset by splitting it into training and testing sets for model evaluation.

Various Models

1.Desicion Tree Classifier: A decision tree is a flowchart-like tree structure where an internal node represents a feature, the branch represents a decision rule, and each leaf node represents the outcome.
2.Random Forest Classifier: Random forest is an ensemble learning method that constructs a multitude of decision trees at training time and outputs the class that is the mode of the classes of the individual trees.
3.Ada Booster Classifier: AdaBoost, short for Adaptive Boosting, is a boosting technique that aims to correct the errors of the weak classifiers iteratively.
4.LSTM: Long Short-Term Memory (LSTM) is a type of recurrent neural network (RNN) architecture designed to overcome the vanishing gradient problem.

Comparison Between Different Models

This section compares the performance of various classification models implemented in this repository.

Web Crawling

Web crawling is the process of automatically collecting information from the web. This repository includes tools for web crawling to gather data for text classification tasks.

Usage

Clone the repository: git clone https://github.com/your-username/text-classification.git

Copy code

  https://colab.research.google.com/drive/1OVzL2FkXGIUGI_AgF-Og3s4BTMPAdG6b?usp=sharing

Install dependencies:

Copy code
pip install -r requirements.txt
Run the Python scripts to perform text classification tasks.

Thanks For Visiting Us.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages