как построить шабо, используя NLTK, отражение которого может ответить только один раз в python - PullRequest
0 голосов
/ 15 января 2020
from nltk.chat.util import Chat, reflections

pairs = [

     ['my name is (.*)', ['hi %1']],
     ['(hi|hello|hey|holla|hola)', ['hey there', 'hi there', 'haayyy']],
     ['(.*) created you ?', ['Suraj verma did using NLTK']],
     ['how (is|was) the weather in (.*)', ['the weather in %1 is amazing like always']]
     ]



chat = Chat(pairs,reflections)

s="my name is suraj"

print(chat.respond(string))
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...