commentclassification

package
v0.0.0-...-8aa1adc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package commentclassification provides a job that classifies comments as toxic or not toxic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(conf *env.Config)

Init gets and sets the comment classifier api url

func IsAuthenticated

func IsAuthenticated(r *http.Request) error

IsAuthenticated checks if the request is authenticated for comment classification calls

This is a temporary solution.

func PollAndClassifyNewComments

func PollAndClassifyNewComments()

PollAndClassifyNewComments looks for new comments and updates them by calling classification api

I'm using the existing jobs code to make organization obvious. But its called much more frequently than the other jobs, so it's a bit of a kludge. Related to this, this function quits early to prevent two competing poll jobs from running at once (which could lead to some non-fatal but annoying data processing errors), this function will quit early. This makes the poll_and_classify_new_comments` job metric a misleading under some circumstances.

The commentron::moderation::comments_classified counter is much clearer for grafana stats.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL