<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from cleverbot import Cleverbot
import pdb

def talk(response, args=[]):
    r = ""
    for s in args:
        r = r + s + " "
    r = r.encode(encoding='utf-8')
    try:
        return [Cleverbot('PantherBot').ask(r)]
    except:
        return ["Zzzzz. Leave me be..."]<commit_msg>Implemented ChatterBot API in place of Chatbot<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import pdb

def talk(response, args=[]):
    cb = ChatBot('PantherBot')
    cb.set_trainer(ChatterBotCorpusTrainer)
    cb.train(
    "chatterbot.corpus.english"
    )
    try:
        return [cb.get_response(" ".join(args)).text]
    except:
        return ['shit broke']
    

    # try:
    #     return [ChatBot('PantherBot').get_response(r)]
    # except:
    #     return ["Zzzzz. Leave me be..."]
{'fraction_non_alphanumeric': 0.14861995753715498, 'fraction_numerical': 0.0031847133757961785, 'mean_word_length': 2.7125984251968505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3776508', 'n_tokens_mistral': 329, 'n_tokens_neox': 325, 'n_words': 76}