@ -29,6 +29,12 @@ def my_local_get_prefix(prefixes, content):
return None
return None
class ENG_TRF :
ISO_639_1 = " en_core_web_trf "
ISO_639 = " eng "
ENGLISH_NAME = " English "
class ENG_LG :
class ENG_LG :
ISO_639_1 = " en_core_web_lg "
ISO_639_1 = " en_core_web_lg "
ISO_639 = " eng "
ISO_639 = " eng "
@ -57,7 +63,7 @@ class Chatter(Cog):
self . bot = bot
self . bot = bot
self . config = Config . get_conf ( self , identifier = 6710497116116101114 )
self . config = Config . get_conf ( self , identifier = 6710497116116101114 )
default_global = { " learning " : True }
default_global = { " learning " : True }
default_guild = {
self . default_guild = {
" whitelist " : None ,
" whitelist " : None ,
" days " : 1 ,
" days " : 1 ,
" convo_delta " : 15 ,
" convo_delta " : 15 ,
@ -70,7 +76,7 @@ class Chatter(Cog):
# TODO: Move training_model and similarity_algo to config
# TODO: Move training_model and similarity_algo to config
# TODO: Add an option to see current settings
# TODO: Add an option to see current settings
self . tagger_language = ENG_ MD
self . tagger_language = ENG_ S M
self . similarity_algo = SpacySimilarity
self . similarity_algo = SpacySimilarity
self . similarity_threshold = 0.90
self . similarity_threshold = 0.90
self . chatbot = self . _create_chatbot ( )
self . chatbot = self . _create_chatbot ( )
@ -79,7 +85,7 @@ class Chatter(Cog):
# self.trainer = ListTrainer(self.chatbot)
# self.trainer = ListTrainer(self.chatbot)
self . config . register_global ( * * default_global )
self . config . register_global ( * * default_global )
self . config . register_guild ( * * default_guild )
self . config . register_guild ( * * self . default_guild )
self . loop = asyncio . get_event_loop ( )
self . loop = asyncio . get_event_loop ( )
@ -365,11 +371,12 @@ class Chatter(Cog):
0 : Small
0 : Small
1 : Medium
1 : Medium
2 : Large ( Requires additional setup )
2 : Large ( Requires additional setup )
3. Accurate ( Requires additional setup )
"""
"""
models = [ ENG_SM , ENG_MD , ENG_LG ]
models = [ ENG_SM , ENG_MD , ENG_LG , ENG_TRF ]
if model_number < 0 or model_number > 2 :
if model_number < 0 or model_number > 3 :
await ctx . send_help ( )
await ctx . send_help ( )
return
return
@ -705,7 +712,9 @@ class Chatter(Cog):
)
)
replying = None
replying = None
if self . _guild_cache [ guild . id ] [ " reply " ] :
if (
" reply " not in self . _guild_cache [ guild . id ] and self . default_guild [ " reply " ]
) or self . _guild_cache [ guild . id ] [ " reply " ] :
if message != ctx . channel . last_message :
if message != ctx . channel . last_message :
replying = message
replying = message