je suis debutante en python et en executant le code suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
from chatterbot  import ChatBot
from chatterbot.trainers import ListTrainer
 
bot = ChatBot('MyChatBot')
bot.set_trainer(ListTrainer) 
conversation = open('chats.txt','r').readlines()
bot.train(conversation)
 
while True:
	message = input('You:')
	print(message)
	if message.strip() == 'Bye':
		print('ChatBot: Bye')
		break
	else:
		reply = bot.get_response(message)
		print('ChatBot:', reply)
avec le fichier chats.txt
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-Good morning, how are you?
-I am doing well, how about you?
-I'm also good.
-That's good to hear.
-Yes it is.
-Hello
-Hi
-How are you doing?
-I am doing well.
-That is good to hear
-Yes it is.
-Can I help you with anything?
-Yes, I have a question.
-What is your question?
-Could I borrow a cup of sugar?
-I'm sorry, but I don't have any.
-Thank you anyway
-No problemHow are you doing?
-I am doing well, how about you?
-I am also good.
-That's good.Have you heard the news?
-What good news?What is your favorite book?
-I can't read.
-So what's your favorite color?
-lue
-Who are you?I am working on a project
-What are you working on?
-I am baking a cake.The cake is a lie.
-No it is not. The cake is delicious.
-What else is delicious?
-Nothing
-Or something
-Tell me about your self.
-What do you want to know?
-Are you a robot?
-Yes I am.
-What is it like?
-What is it that you want to know?
-How do you work?
-Its complicated.
-Complex is better than complicated.
-Simple is better than complex.
-In the face of ambiguity, refuse the temptation to guess.
-It seems your familiar with the Zen of Python.
-I am.
-Do you know all of it?
-Beautiful is better than ugly.
-Explicit is better than implicit.
-Simple is better than complex.
-Complex is better than complicated.
-Flat is better than nested.
-Sparse is better than dense.
-Readability counts.
-Namespaces are one honking great idea. Let's do more of -those!
-I agree.Are you a programmer?
-Of course I am a programmer.
-I am indeed.What languages do you like to use?
-I use Python, Java and C++ quite often.
-I use Python quite a bit myself.
-I'm not incredibly fond of Java
j'ai eu "this big error!" veuillez m'aider SVP
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
List Trainer: [                    ] 2%Traceback (most recent call last):
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\base.py", line 1236, in _execute_context
    cursor, statement, parameters, context
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\default.py", line 536, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such column: statement.extra_data
The above exception was the direct cause of the following exception:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
Traceback (most recent call last):
  File "mebot.py", line 7, in <module>
    bot.train(conversation)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\chatterbot\trainers.py", line 110, in train
    statement = self.get_or_create(text)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\chatterbot\trainers.py", line 48, in get_or_create
    statement = self.storage.find(temp_statement.text)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\chatterbot\storage\sql_storage.py", line 132, in find
    record = query.first()
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\orm\query.py", line 2979, in first
    ret = list(self[0:1])
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\orm\query.py", line 2771, in __getitem__
    return list(res)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\orm\query.py", line 3081, in __iter__
    return self._execute_and_instances(context)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\orm\query.py", line 3106, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\base.py", line 980, in execute
    return meth(self, multiparams, params)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\sql\elements.py", line 273, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\base.py", line 1099, in _execute_clauseelement
    distilled_params,
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\base.py", line 1240, in _execute_context
    e, statement, parameters, cursor, context
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\base.py", line 1458, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\util\compat.py", line 296, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\util\compat.py", line 276, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\base.py", line 1236, in _execute_context
    cursor, statement, parameters, context
  File "C:\Users\naouel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\sqlalchemy\engine\default.py", line 536, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: stat
ement.extra_data [SQL: 'SELECT statement.id AS statement_id, statement.text AS s
tatement_text, statement.extra_data AS statement_extra_data \nFROM statement \nW
HERE statement.text = ?\n LIMIT ? OFFSET ?'] [parameters: ('-Good morning, how a
re you?', 1, 0)] (Background on this error at: <a href="http://sqlalche.me/e/e3q8" target="_blank">http://sqlalche.me/e/e3q8</a>)