modbot.environment.ProcessingConfig

class modbot.environment.ProcessingConfig(file_name=None, run_config=None)[source]

Bases: BaseConfig

Configuration for preprocessing routines

Methods

get_config([file_name, config])

Get configuration from file

save(outpath)

Save config to json file

update_config(args)

Update config with args

Attributes

ACT_PMIN

Threshold probability for moderation

BAN_CHECKS

review bans of these moderators during training

BERT_ENCODER

Path to bert encoder

BERT_PREPROCESS

Path to bert preprocess model

BLACKLIST

BLACKLIST_OPTIONS

Phrase lists for filtering and manual checking signals

CHANNEL

Channel to moderate

CHATTY_DIR

Path to Chatty data for training

CHECK_PMIN

Threshold probability to check for new classification

DATA_DIR

Directory where training data and model is stored

DELETE_CHECKS

review deletions by these moderators during training

EMOTELIST

List of emotes to use for filtering

FILE_NAME

config file path

GRAYLIST

Phrases to check

IGNORE_ACTIONS

ignore actions of these moderators during training

IGNORE_USERS

ignore messages of these users during training

INFILE

file for training

LINKLIST

Strings to indicate if message contains a link

LOGGER_LEVEL

Log level.

LOG_DIR

Directory to write logs

LOG_PATH

Get default log file name

MODEL_PATH

Path to ML model

MODEL_TYPE

Type of model to use for moderation

NICKNAME

Bot username

NOLINKS

Whether to allow links in chat or not

OFFENSIVE_WEIGHT

Ratio of ones to total number of samples for training data

PMSG_ON

Whether to send message in chat when probability is exceeded

TRAIN_ACTIONS

WHITELIST

Allowed phrases

WRITE_LOG

Whether to write chat messages to log file

attrs

Config attributes info

public_attrs

Get public attributes

ACT_PMIN = 0.6

Threshold probability for moderation

BAN_CHECKS = []

review bans of these moderators during training

BERT_ENCODER = 'https://tfhub.dev/tensorflow/small_bert/bert_en_uncased_L-2_H-128_A-2/2'

Path to bert encoder

BERT_PREPROCESS = 'https://tfhub.dev/tensorflow/bert_en_uncased_preprocess/3'

Path to bert preprocess model

BLACKLIST_OPTIONS = ['#removethemole', 'super hottie', 'thicc', 't h i c c', 'u are hot', 'you are hot', 'your hot', 'ur hot', 'u are sexy', 'you are sexy', 'your sexy', 'ur sexy', 'why is this in just chatting', 'u a virgin', 'wrong category', 'si1mp', 's1mp', 'simp', 'T H I C C', 'onlyfans', 'thicc(.*)Botez', 'thicc(.*)Alex', 'thicc(.*) andrea', 'Botez(.*) thicc', 'Botez is(.*) hot', 'Andrea is(.*) hot', 'Alex is(.*) hot', 'Alex(.*)thicc', 'andrea(.*) thicc', 'she(.*)thicc', 'sexy(.*) Alex', 'sexy(.*) andrea', 'Botez(.*) sexy', 'sexy(.*) Botez', 'Andrea(.*)sexy', 'Alex(.*) sexy', 'andrea(.*) sexy', 'ur so hawt', 'u so hawt', 'rape', 'your butthole', 'mybutthole', 'give me a kiss', 'gimme a kiss', 'blow me a kiss', 'cunt', 'suck dick', 'lick(.*) feet', 'suck my', 'whore', 'simp', 'lick(.*) toes', 'suck(.*) toes', 'your vagina', 'your vag', 'show vag', 'vagene', 'show bobs', 'you(.*)ugly', 'your booty', 'ur so hot', 'u so hot', 'slut', 'what happened to you(.*) face']

Phrase lists for filtering and manual checking signals

CHANNEL = None

Channel to moderate

CHATTY_DIR = None

Path to Chatty data for training

CHECK_PMIN = 0.4

Threshold probability to check for new classification

DATA_DIR = '/home/runner/work/modbot/modbot/data'

Directory where training data and model is stored

DELETE_CHECKS = []

review deletions by these moderators during training

EMOTELIST = ['NotLikeThis', '<3', 'LUL', 'WutFace', 'ResidentSleeper', 'pepeLa', 'pepeDS', 'pepeJAM', 'pepePls', 'FeelsBadMan', 'FeelsGoodMan', 'monkaS', 'monkaHmm', 'KEKW', 'Kapp', 'Hypers', 'HandsUp', 'FeelsWeirdMan', 'EZY', '5Head', '3Lass', 'Pog', 'Pepega', 'PagChomp', 'OMEGALUL', 'monkaW', 'PogU', 'PepeHands', 'PepoThink', 'alexandraSub', 'PepePls', 'PixelBob', 'Jebaited', 'TriHard', 'MrDestructoid', 'Keepo', 'HeyGuys', 'PepeLaugh', 'SquadP', 'PJSugar', 'ammoHeman', 'SourPls', 'peepoHappy', 'HotPokket', 'BibleThump', 'DansGame', 'orbThonk', 'malexaH', 'electraSad', 'TopHat', 'FutureMan', 'PokGengar', 'OMEGA', 'onetri2Hii', 'bayliunSad', 'bayliunVictory', 'cheer100', 'cheer10', 'cheer1', 'TBAngel', 'chesscoachHi', 'chesscoachWhat', 'TwitchUnity', 'justbu8', 'blinkxXmas', 'symfNerd', 'malexaHi', 'HahaTurtledove', 'HahaThisisfine', 'HahaThink', 'HahaSweat', 'HahaSleep', 'HahaShrugRight', 'HahaShrugMiddle', 'HahaLean', 'HahaNutcracker', 'HahaPoint', 'HahaSnowhal', 'HahaPresent', 'HahaReindeer', 'HahaShrugLeft', 'HahaHide', 'HahaGoose', 'HahaGingercat', 'HahaElf', 'HahaDoge', 'HahaCat', 'HahaBaby', 'HahaNyandeer', 'Haha2020', 'HahaBall', 'HahaDreidel', 'gutBaby']

List of emotes to use for filtering

FILE_NAME = None

config file path

GRAYLIST = []

Phrases to check

IGNORE_ACTIONS = []

ignore actions of these moderators during training

IGNORE_USERS = []

ignore messages of these users during training

INFILE = None

file for training

Strings to indicate if message contains a link

LOGGER_LEVEL = 'VERBOSE'

Log level.

LOG_DIR = '/home/runner/work/modbot/modbot/data/logs'

Directory to write logs

property LOG_PATH

Get default log file name

MODEL_PATH = None

Path to ML model

MODEL_TYPE = 'SVM'

Type of model to use for moderation

NICKNAME = None

Bot username

Whether to allow links in chat or not

OFFENSIVE_WEIGHT = 0.01

Ratio of ones to total number of samples for training data

PMSG_ON = False

Whether to send message in chat when probability is exceeded

WHITELIST = ['LUL', 'KEKW', '!drama', 'http://', 'https://', '/tv', 'tv/']

Allowed phrases

WRITE_LOG = True

Whether to write chat messages to log file

property attrs

Config attributes info

get_config(file_name=None, config=None)

Get configuration from file

Parameters
  • file_name (str) – Path to configuration file

  • config (RunConfig) – Optional config class with stored parameters

Returns

Config class with run time configuration stored in attributes

Return type

RunConfig

property public_attrs

Get public attributes

Returns

Dictionary of public global attributes

Return type

dict

save(outpath)

Save config to json file

Parameters

outpath (str) – Path to save public attrs

update_config(args)

Update config with args

Parameters

args (parser.parse_args) – Args from argparser with which to update config