ChatterBot
ChatterBot copied to clipboard
Add WikipediaResponseAdapter
Adds a logic_adapter from which the response is obtained from Wikipedia.
you can test this pull request using this code.
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot('Ron Obvious',
storage_adapter='chatterbot.storage.SQLStorageAdapter',
logic_adapters=[
{
'import_path': 'chatterbot.logic.BestMatch'
},
{
'import_path': 'chatterbot.logic.WikipediaResponseAdapter',
}
])
trainer = ChatterBotCorpusTrainer(chatbot)
# Train the chatbot based on the english corpus
trainer.train("chatterbot.corpus.english")
print(chatbot.get_response('What is Cat?'))
A Feature Flag could be a nice implementation for make able to set this off.
Congratz, nice commit. .
Where can I save these codes and how can I use them in the project? Can you help a little more with wikipedia adapter? logicadapter wikipedia https://github.com/gunthercox/ChatterBot/pull/1748/commits/9a30db227c27d8f636b52ccdfa906fce1e432112