Giter Site home page Giter Site logo

finnbear / moderation Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 1.51 MB

moderation is a profanity filter for Go

License: The Unlicense

Go 97.76% Makefile 2.24%
profanity-filter go golang go-package moderation profanity-detection profanity-check

moderation's Introduction

moderation

godocs

moderation is a profanity filter for Go.

Note: This project is not actively maintained, as I have moved on to working on a Rust version.

Goals

  1. Easy to use
  2. Minimum possible allocations, processing time, and binary size
  3. Minimum false negatives (including text like h3110_w0r!d)
  4. Minimum false positives
  5. (Experimental) Provide a way to censor text
  6. (Future) Other analysis types than inappropriate, profane, offensive, sexual, mean, spam (violence, contact info, etc.)
  7. (Future) Basic support for languages other than English

Example

package main

import (
	"fmt"
	"github.com/finnbear/moderation"
)

func main() {
	printResult("hello world")
	printResult("$#1t")
	printResult("a$$")
	printResult("assassin")
}

func printResult(phrase string) {
	description := "is appropriate"
	if moderation.IsInappropriate(phrase) {
		description = "is NOT appropriate"
	}
	fmt.Printf("\"%s\" %s.\n", phrase, description)
}
$ go run hello_world.go
"hello world" is appropriate.
"$#1t" is NOT appropriate.
"a$$" is NOT appropriate.
"assassin" is appropriate.

Comparison

Accuracy was evaluated based on the first 100,000 items from this dataset of moderated comments.

Package Time Accuracy Comment
finnbear/moderation 1.63s 92.21% Not stable, nor actively maintained
TwinProduction/go-away 2.16s 82.18% Many false positives from combined words like "push it"

Acknowledgements

  1. Radix implementation based on https://gitlab.com/caibear/go-boggle/
  2. Some profanities and test cases are based on https://github.com/TwinProduction/go-away

moderation's People

Contributors

finnbear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mprimeaux

moderation's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.