gunthercox / ChatterBot

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
https://chatterbot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
13.96k stars 4.42k forks source link

Attribute Error #2345

Closed LiX-001 closed 1 month ago

LiX-001 commented 6 months ago

Here's my code:

import time 
time.clock = time.time
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer

chatbot = ChatBot('Rema')

trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train("chatterbot.corpus.english")

response = chatbot.get_response("Hey, how are you?")
print(response)

And here's the error:

[nltk_data] Error loading averaged_perceptron_tagger: <urlopen error
[nltk_data]     [WinError 10060] A connection attempt failed because
[nltk_data]     the connected party did not properly respond after a
[nltk_data]     period of time, or established connection failed
[nltk_data]     because connected host has failed to respond>
[nltk_data] Error loading punkt: <urlopen error [WinError 10060] A
[nltk_data]     connection attempt failed because the connected party
[nltk_data]     did not properly respond after a period of time, or
[nltk_data]     established connection failed because connected host
[nltk_data]     has failed to respond>
[nltk_data] Error loading stopwords: <urlopen error [WinError 10061]
[nltk_data]     No connection could be made because the target machine
[nltk_data]     actively refused it>
[nltk_data] Error loading wordnet: <urlopen error [WinError 10061] No
[nltk_data]     connection could be made because the target machine
[nltk_data]     actively refused it>
Traceback (most recent call last):
  File "c:\Users\---------", line 9, in <module>
    trainer.train("chatterbot.corpus.english")
  File "C:\Users\---------\AppData\Local\Programs\Python\Python310-32\lib\site-packages\chatterbot\trainers.py", 
line 138, in train
    for corpus, categories, file_path in load_corpus(*data_file_paths):
  File "C:\Users\----------\AppData\Local\Programs\Python\Python310-32\lib\site-packages\chatterbot\corpus.py", line 64, in load_corpus
    corpus_data = read_corpus(file_path)
  File "C:\Users\-----------\AppData\Local\Programs\Python\Python310-32\lib\site-packages\chatterbot\corpus.py", line 38, in read_corpus
    return yaml.load(data_file)
TypeError: load() missing 1 required positional argument: 'Loader'

any fix?

SarthakNikhal commented 5 months ago

Can I work on this issue?

LiX-001 commented 5 months ago

Can I work on this issue?

why not