Downloads · 30 days
0
Orhancan2099/Orhanex
Orhanex is a machine learning model from Orhancan2099. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
import nltk from nltk.chat.util import Chat, reflections
Downloads · 30 days
0
Access
Public
Updated Jul 26, 2024
Repo size
—
Likes
1
Public
Click a slice to open those files.
Other1.5 KB · 56%
From the Hugging Face model README
import nltk from nltk.chat.util import Chat, reflections
pairs_tr = [ (r'Merhaba', ['Merhaba! Size nasıl yardımcı olabilirim?', 'Selam!']), (r'Adın nedir?', ['Benim adım Sohbet Botu. Size nasıl yardımcı olabilirim?']), (r'Yardım edebilir misin?', ['Tabii ki! Ne konuda yardıma ihtiyacınız var?']), (r'Çıkış', ['Hoşça kal!', 'Görüşürüz!']), ]
pairs_en = [ (r'Hello', ['Hello! How can I help you?', 'Hi there!']), (r'What is your name?', ['My name is Chat Bot. How can I assist you?']), (r'Can you help?', ['Of course! What do you need help with?']), (r'Exit', ['Goodbye!', 'See you later!']), ]
def learn_response(language, question, response): if language == 'tr': pairs_tr.append((question, [response])) elif language == 'en': pairs_en.append((question, [response]))
def create_chatbot(language): if language == 'tr': return Chat(pairs_tr, reflections) elif language == 'en': return Chat(pairs_en, reflections) else: raise Value