Attempt at functioning info
This commit is contained in:
parent
1e0b71b8b6
commit
2fe1278901
@ -13,7 +13,7 @@ from redbot.core.data_manager import cog_data_path
|
|||||||
|
|
||||||
|
|
||||||
class ENG_LG:
|
class ENG_LG:
|
||||||
ISO_639_1 = 'en_vectors_web_lg'
|
ISO_639_1 = 'en_core_web_lg'
|
||||||
ISO_639 = 'eng'
|
ISO_639 = 'eng'
|
||||||
ENGLISH_NAME = 'English'
|
ENGLISH_NAME = 'English'
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class Chatter(Cog):
|
|||||||
path: pathlib.Path = cog_data_path(self)
|
path: pathlib.Path = cog_data_path(self)
|
||||||
self.data_path = path / "database.sqlite3"
|
self.data_path = path / "database.sqlite3"
|
||||||
|
|
||||||
self.chatbot = self.create_chatbot(self.data_path, SpacySimilarity, 0.45, ENG_LG)
|
self.chatbot = self._create_chatbot(self.data_path, SpacySimilarity, 0.45, ENG_LG)
|
||||||
# self.chatbot.set_trainer(ListTrainer)
|
# self.chatbot.set_trainer(ListTrainer)
|
||||||
|
|
||||||
# self.trainer = ListTrainer(self.chatbot)
|
# self.trainer = ListTrainer(self.chatbot)
|
||||||
@ -42,7 +42,7 @@ class Chatter(Cog):
|
|||||||
|
|
||||||
self.loop = asyncio.get_event_loop()
|
self.loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
def create_chatbot(self, data_path, similarity_algorithm, similarity_threshold, tagger_language):
|
def _create_chatbot(self, data_path, similarity_algorithm, similarity_threshold, tagger_language):
|
||||||
return ChatBot(
|
return ChatBot(
|
||||||
"ChatterBot",
|
"ChatterBot",
|
||||||
storage_adapter="chatterbot.storage.SQLStorageAdapter",
|
storage_adapter="chatterbot.storage.SQLStorageAdapter",
|
||||||
@ -64,14 +64,14 @@ class Chatter(Cog):
|
|||||||
after = datetime.today() - timedelta(days=(await self.config.guild(ctx.guild).days()))
|
after = datetime.today() - timedelta(days=(await self.config.guild(ctx.guild).days()))
|
||||||
convo_delta = timedelta(minutes=(await self.config.guild(ctx.guild).convo_delta()))
|
convo_delta = timedelta(minutes=(await self.config.guild(ctx.guild).convo_delta()))
|
||||||
|
|
||||||
def new_message(msg, sent, out_in, convo_delta):
|
def new_message(msg, sent, out_in, delta):
|
||||||
if sent is None:
|
if sent is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if len(out_in) < 2:
|
if len(out_in) < 2:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return msg.created_at - sent >= convo_delta
|
return msg.created_at - sent >= delta
|
||||||
|
|
||||||
for channel in ctx.guild.text_channels:
|
for channel in ctx.guild.text_channels:
|
||||||
if in_channel:
|
if in_channel:
|
||||||
@ -151,7 +151,7 @@ class Chatter(Cog):
|
|||||||
await ctx.send_help()
|
await ctx.send_help()
|
||||||
return
|
return
|
||||||
|
|
||||||
self.chatbot = self.create_chatbot(self.data_path, algos[algo_number][0], algos[algo_number][1], ENG_LG)
|
self.chatbot = self._create_chatbot(self.data_path, algos[algo_number][0], algos[algo_number][1], ENG_LG)
|
||||||
|
|
||||||
await ctx.tick()
|
await ctx.tick()
|
||||||
|
|
||||||
|
@ -4,19 +4,32 @@
|
|||||||
],
|
],
|
||||||
"bot_version": [
|
"bot_version": [
|
||||||
3,
|
3,
|
||||||
0,
|
3,
|
||||||
0
|
10
|
||||||
],
|
],
|
||||||
"description": "Create an offline chatbot that talks like your average member using Machine Learning",
|
"description": "Create an offline chatbot that talks like your average member using Machine Learning",
|
||||||
"hidden": false,
|
"hidden": false,
|
||||||
"install_msg": "Thank you for installing Chatter! Get started ith `[p]load chatter` and `[p]help Chatter`",
|
"install_msg": "Thank you for installing Chatter! Get started ith `[p]load chatter` and `[p]help Chatter`",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
|
"git+git://github.com/gunthercox/chatterbot-corpus@master#egg=chatterbot_corpus",
|
||||||
|
"mathparse>=0.1,<0.2",
|
||||||
|
"nltk>=3.2,<4.0",
|
||||||
|
"pint>=0.8.1",
|
||||||
|
"python-dateutil>=2.8,<2.9",
|
||||||
|
"pyyaml>=5.3,<5.4",
|
||||||
|
"sqlalchemy>=1.3,<1.4",
|
||||||
|
"pytz",
|
||||||
|
"spacy>=2.3,<2.4",
|
||||||
|
"https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_sm",
|
||||||
|
"https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_md",
|
||||||
|
"https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_lg",
|
||||||
"chatterbot>=1.1"
|
"chatterbot>=1.1"
|
||||||
],
|
],
|
||||||
"short": "Local Chatbot run on machine learning",
|
"short": "Local Chatbot run on machine learning",
|
||||||
"tags": [
|
"tags": [
|
||||||
"chat",
|
"chat",
|
||||||
"chatbot",
|
"chatbot",
|
||||||
|
"chatterbot",
|
||||||
"cleverbot",
|
"cleverbot",
|
||||||
"clever",
|
"clever",
|
||||||
"bobloy"
|
"bobloy"
|
||||||
|
@ -7,3 +7,6 @@ pyyaml>=5.3,<5.4
|
|||||||
sqlalchemy>=1.3,<1.4
|
sqlalchemy>=1.3,<1.4
|
||||||
pytz
|
pytz
|
||||||
spacy>=2.3,<2.4
|
spacy>=2.3,<2.4
|
||||||
|
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_sm
|
||||||
|
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_md
|
||||||
|
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_lg
|
Loading…
x
Reference in New Issue
Block a user