Attempt at functioning info

pull/107/head
bobloy 5 years ago
parent 1e0b71b8b6
commit 2fe1278901

@ -13,7 +13,7 @@ from redbot.core.data_manager import cog_data_path
class ENG_LG:
ISO_639_1 = 'en_vectors_web_lg'
ISO_639_1 = 'en_core_web_lg'
ISO_639 = 'eng'
ENGLISH_NAME = 'English'
@ -32,7 +32,7 @@ class Chatter(Cog):
path: pathlib.Path = cog_data_path(self)
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.trainer = ListTrainer(self.chatbot)
@ -42,7 +42,7 @@ class Chatter(Cog):
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(
"ChatterBot",
storage_adapter="chatterbot.storage.SQLStorageAdapter",
@ -64,14 +64,14 @@ class Chatter(Cog):
after = datetime.today() - timedelta(days=(await self.config.guild(ctx.guild).days()))
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:
return False
if len(out_in) < 2:
return False
return msg.created_at - sent >= convo_delta
return msg.created_at - sent >= delta
for channel in ctx.guild.text_channels:
if in_channel:
@ -151,7 +151,7 @@ class Chatter(Cog):
await ctx.send_help()
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()

@ -4,21 +4,34 @@
],
"bot_version": [
3,
0,
0
3,
10
],
"description": "Create an offline chatbot that talks like your average member using Machine Learning",
"hidden": false,
"install_msg": "Thank you for installing Chatter! Get started ith `[p]load chatter` and `[p]help Chatter`",
"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"
],
"short": "Local Chatbot run on machine learning",
"tags": [
"chat",
"chatbot",
"chatterbot",
"cleverbot",
"clever",
"bobloy"
]
}
}

@ -6,4 +6,7 @@ python-dateutil>=2.8,<2.9
pyyaml>=5.3,<5.4
sqlalchemy>=1.3,<1.4
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…
Cancel
Save