ChatterBot icon indicating copy to clipboard operation
ChatterBot copied to clipboard

Add WikipediaResponseAdapter

Open ghost opened this issue 6 years ago • 2 comments

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?'))

ghost avatar Jun 09 '19 17:06 ghost

A Feature Flag could be a nice implementation for make able to set this off.

Congratz, nice commit. .

matbrgz avatar May 21 '20 23:05 matbrgz

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

[email protected]

ahmet-soner avatar Feb 27 '21 23:02 ahmet-soner