Alternate dependencies attempt
This commit is contained in:
parent
37c699eeee
commit
26234e3b18
@ -17,7 +17,8 @@
|
|||||||
"pytz",
|
"pytz",
|
||||||
"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_sm",
|
||||||
"https://github.com/explosion/spacy-models/releases/download/en_core_web_md-2.3.1/en_core_web_md-2.3.1.tar.gz#egg=en_core_web_md",
|
"https://github.com/explosion/spacy-models/releases/download/en_core_web_md-2.3.1/en_core_web_md-2.3.1.tar.gz#egg=en_core_web_md",
|
||||||
"spacy>=2.3,<2.4"
|
"spacy>=2.3,<2.4",
|
||||||
|
"--no-deps \"chatterbot>=1.1\""
|
||||||
],
|
],
|
||||||
"short": "Local Chatbot run on machine learning",
|
"short": "Local Chatbot run on machine learning",
|
||||||
"end_user_data_statement": "This cog only stores anonymous conversations data; no End User Data is stored.",
|
"end_user_data_statement": "This cog only stores anonymous conversations data; no End User Data is stored.",
|
||||||
|
@ -4,45 +4,46 @@ from chatterbot.trainers import Trainer
|
|||||||
|
|
||||||
|
|
||||||
class TwitterCorpusTrainer(Trainer):
|
class TwitterCorpusTrainer(Trainer):
|
||||||
def train(self, *args, **kwargs):
|
pass
|
||||||
"""
|
# def train(self, *args, **kwargs):
|
||||||
Train the chat bot based on the provided list of
|
# """
|
||||||
statements that represents a single conversation.
|
# Train the chat bot based on the provided list of
|
||||||
"""
|
# statements that represents a single conversation.
|
||||||
import twint
|
# """
|
||||||
|
# import twint
|
||||||
c = twint.Config()
|
#
|
||||||
c.__dict__.update(kwargs)
|
# c = twint.Config()
|
||||||
twint.run.Search(c)
|
# c.__dict__.update(kwargs)
|
||||||
|
# twint.run.Search(c)
|
||||||
|
#
|
||||||
previous_statement_text = None
|
#
|
||||||
previous_statement_search_text = ''
|
# previous_statement_text = None
|
||||||
|
# previous_statement_search_text = ''
|
||||||
statements_to_create = []
|
#
|
||||||
|
# statements_to_create = []
|
||||||
for conversation_count, text in enumerate(conversation):
|
#
|
||||||
if self.show_training_progress:
|
# for conversation_count, text in enumerate(conversation):
|
||||||
utils.print_progress_bar(
|
# if self.show_training_progress:
|
||||||
'List Trainer',
|
# utils.print_progress_bar(
|
||||||
conversation_count + 1, len(conversation)
|
# 'List Trainer',
|
||||||
)
|
# conversation_count + 1, len(conversation)
|
||||||
|
# )
|
||||||
statement_search_text = self.chatbot.storage.tagger.get_text_index_string(text)
|
#
|
||||||
|
# statement_search_text = self.chatbot.storage.tagger.get_text_index_string(text)
|
||||||
statement = self.get_preprocessed_statement(
|
#
|
||||||
Statement(
|
# statement = self.get_preprocessed_statement(
|
||||||
text=text,
|
# Statement(
|
||||||
search_text=statement_search_text,
|
# text=text,
|
||||||
in_response_to=previous_statement_text,
|
# search_text=statement_search_text,
|
||||||
search_in_response_to=previous_statement_search_text,
|
# in_response_to=previous_statement_text,
|
||||||
conversation='training'
|
# search_in_response_to=previous_statement_search_text,
|
||||||
)
|
# conversation='training'
|
||||||
)
|
# )
|
||||||
|
# )
|
||||||
previous_statement_text = statement.text
|
#
|
||||||
previous_statement_search_text = statement_search_text
|
# previous_statement_text = statement.text
|
||||||
|
# previous_statement_search_text = statement_search_text
|
||||||
statements_to_create.append(statement)
|
#
|
||||||
|
# statements_to_create.append(statement)
|
||||||
self.chatbot.storage.create_many(statements_to_create)
|
#
|
||||||
|
# self.chatbot.storage.create_many(statements_to_create)
|
Loading…
x
Reference in New Issue
Block a user