Skip to content

Chatterbot / python3.11 #1

Description

@DonatoReis

Is Chatterbot already compatible with the new year updates? including compatibility with python3.11 ?

Libraries:

Python==3.11.3
charset-normalizer==3.1.0
ChatterBot==1.1.0a7
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.5.0/en_core_web_sm-3.5.0-py3-none-any.whl#sha256=0964370218b7e1672a30ac50d72cdc6b16f7c867496f1d60925691188f4d2510
nltk==3.8.1
numpy==1.24.3
pt-core-news-sm @ https://github.com/explosion/spacy-models/releases/download/pt_core_news_sm-3.5.0/pt_core_news_sm-3.5.0-py3-none-any.whl#sha256=1513c9f3d3f2aad6750c109ad36ddb38d57e20ebf26b903999fc8f6f86a230f3
PyYAML==6.0
spacy==3.5.3
spacy-legacy==3.0.12
spacy-loggers==1.0.4
SQLAlchemy==1.3.24
urllib3==2.0.2
wasabi==1.1.1

I am getting this error below:

Traceback (most recent call last):
  File "d:\Pasta Windows 11 - 2023\Desktop\chatbot\main2.py", line 31, in <module>
    conversa.train('chatterbot.corpus.portuguese')
  File "C:\Users\caiqu\AppData\Local\Programs\Python\Python311\Lib\site-packages\chatterbot\trainers.py", line 135, in train
    for corpus, categories, file_path in load_corpus(*data_file_paths):
  File "C:\Users\caiqu\AppData\Local\Programs\Python\Python311\Lib\site-packages\chatterbot\corpus.py", line 84, in load_corpus
    corpus_data = read_corpus(file_path)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\caiqu\AppData\Local\Programs\Python\Python311\Lib\site-packages\chatterbot\corpus.py", line 58, in read_corpus
    with io.open(file_name, encoding='utf-8') as data_file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\caiqu\\chatterbot_corpus\\data\\portuguese'

Code:

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer
import pt_core_news_sm
from training_data import training_data
import threading

# Carregando o modelo de linguagem portuguesa
nlp = pt_core_news_sm.load()

# Criando o bot com o nome 'Samy'
bot = ChatBot(
    'Samy',
    storage_adapter='chatterbot.storage.SQLStorageAdapter',
    database_uri='sqlite:///database.sqlite3',
    logic_adapters=[
        'chatterbot.logic.BestMatch',
        'chatterbot.logic.MathematicalEvaluation',
        'chatterbot.logic.TimeLogicAdapter',
        'chatterbot.logic.SpecificResponseAdapter'
    ],
    preprocessors=[
        "chatterbot.preprocessors.clean_whitespace",
        'chatterbot.preprocessors.unescape_html'
    ],
    read_only=False
)

# Treinando o bot com corpus em diferentes idiomas
conversa = ChatterBotCorpusTrainer(bot)
conversa.train('chatterbot.corpus.portuguese')

# Treinando o bot com exemplos específicos
conversa.train(training_data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions