Skip to content

This nuget package is designed to help you easily identify and detect profanity or bad words within a given sentence or string. It works under a simple binary classifier that has been built and trained using ML.NET for accurate and efficient detection of inappropriate language.

License

Notifications You must be signed in to change notification settings

nikolliervin/profanity-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Profanity Detector NuGet Package NuGet Logo

Overview

This package is designed to help you easily identify and detect profanity or bad words within a given sentence or string. It leverages a simple binary classifier that has been built and trained for accurate and efficient detection of inappropriate language. The model was created using ML.Net and the dataset for training was obtained from Surge AI

Installation

To get started, install the Profanity Detector NuGet package into your project. You can do this using the following command in the Package Manager Console:

NuGet\Install-Package nikolliervin.profanity-detector -Version 1.0.5
dotnet add package nikolliervin.profanity-detector --version 1.0.5

Usage

Once the package is installed, integrating it into your code is straightforward. Here's a simple example of how to use the Profanity Detector:

using profanity_detector;

class Program
{
    static void Main(string[] args)
    {
        // Instantiate the ProfanityDetection class
        var profanityDetector = new ProfanityDetection();

        // Detect profanity in a string
        var hasProfanity = profanityDetector.isToxic("string to detect");

        // 'hasProfanity' will be true if profanity is detected, otherwise false
        if (hasProfanity)
        {
            Console.WriteLine("Profanity detected in the provided string!");
            // Handle the profanity as needed
        }
        else
        {
            Console.WriteLine("No profanity detected. The string is clean!");
        }
    }
}

How it Works

The Profanity Detector utilizes a simple binary classifier that has been built and trained to distinguish between clean and profane language. The underlying algorithm analyzes the input string and returns true if it contains bad words and false otherwise.

Model Accuracy

The machine learning model, trained using ML.NET, showed a good level of accuracy on the given dataset.

  • Accuracy: 80.90%

Note

While the Profanity Detector is effective in identifying common profanity and bad words, but it may not be exhaustive. I am actively working to increase the accuracy of the detection.

Feedback and Contributions

I welcome your feedback! If you encounter any issues, have suggestions for improvement, or want to contribute to the project, please visit my GitHub repository and create an issue or pull request.

About

This nuget package is designed to help you easily identify and detect profanity or bad words within a given sentence or string. It works under a simple binary classifier that has been built and trained using ML.NET for accurate and efficient detection of inappropriate language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages