Rasa train error

Hi everyone i got this error after typing rasa train Traceback (most recent call last): File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\runpy.py”, line 192, in _run_module_as_main return run_code(code, main_globals, None, File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\runpy.py”, line 85, in run_code exec(code, run_globals) File "C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\Scripts\rasa.exe_main.py", line 7, in File "C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa_main.py", line 117, in main cmdline_arguments.func(cmdline_arguments) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\cli\train.py”, line 59, in train_parser.set_defaults(func=lambda args: run_training(args, can_exit=True)) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\cli\train.py”, line 91, in run_training training_result = train_all( File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\api.py”, line 109, in train return rasa.utils.common.run_in_loop( File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\utils\common.py”, line 296, in run_in_loop result = loop.run_until_complete(f) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\asyncio\base_events.py”, line 608, in run_until_complete return future.result() File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\model_training.py”, line 100, in train_async domain = await file_importer.get_domain() File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\utils\common.py”, line 141, in decorated return await cache.cached_result() File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\importers\importer.py”, line 448, in get_domain original, e2e_domain = await asyncio.gather( File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\utils\common.py”, line 141, in decorated return await cache.cached_result() File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\importers\importer.py”, line 319, in get_domain existing_nlu_data = await self._importer.get_nlu_data() File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\utils\common.py”, line 141, in decorated return await cache.cached_result() File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\importers\importer.py”, line 292, in get_nlu_data nlu_data = await asyncio.gather(*nlu_data) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\importers\rasa.py”, line 69, in get_nlu_data return utils.training_data_from_paths(self._nlu_files, language) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\importers\utils.py”, line 11, in training_data_from_paths training_data_sets = [loading.load_data(nlu_file, language) for nlu_file in paths] File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\importers\utils.py”, line 11, in training_data_sets = [loading.load_data(nlu_file, language) for nlu_file in paths] File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\nlu\training_data\loading.py”, line 59, in load_data data_sets = [_load(f, language) for f in files] File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\nlu\training_data\loading.py”, line 59, in data_sets = [_load(f, language) for f in files] File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\nlu\training_data\loading.py”, line 111, in _load return reader.read(filename, language=language, fformat=fformat) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\nlu\training_data\formats\readerwriter.py”, line 38, in read return self.reads(rasa.shared.utils.io.read_file(filename), **kwargs) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\nlu\training_data\formats\rasa_yaml.py”, line 81, in reads self.validate(string) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\nlu\training_data\formats\rasa_yaml.py”, line 66, in validate validation.validate_yaml_schema(string, NLU_SCHEMA_FILE) File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\utils\validation.py”, line 143, in validate_yaml_schema source_data = rasa.shared.utils.io.read_yaml( File “C:\Users\Syed Mohammed Bilal\anaconda3\envs\rasa_install_demo\lib\site-packages\rasa\shared\utils\io.py”, line 346, in read_yaml content.encode(“utf-8”) UnicodeDecodeError: ‘rawunicodeescape’ codec can’t decode bytes in position 19-20: truncated \UXXXXXXXX escape

@SyedBilalHasan please share the screenshot of this error and even share both --debug logs of rasa and rasa action server.

This is the rest of the error

@SyedBilalHasan are you using some kind of excel sheet or any codec or conversation code for your action.py?

Yeah, I am using excel

@SyedBilalHasan can you share that code for me on which you using excel or give me brief steps what you doing and what you trying to archived thanks.

    wb = load_workbook("chatbot_database")
    ws = wb.active
    for row in range(1, 5):
        for column in range(1, 13):
            char = get_column_letter(column)
            print(ws[char + str(row)].value)

This is the code for importing the database from the excel sheet called “chatbot_database”.xlsx into the chatbot It prints all the rows and columns in the excel sheet

@SyedBilalHasan please share me complete code for our reference.

from typing import Any, Text, Dict, List from openpyxl import Workbook , load_workbook from openpyxl.utils import get_column_letter from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher

class ActionHelloWorld(Action):

def name(self) -> Text:
    return "action_name_queries"

def run(self, dispatcher:CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

    name = tracker.get_slot("name")
    wb = load_workbook("chatbot_database")
    ws = wb.active
    for row in range(1, 5):
        for column in range(1, 13):
            char = get_column_letter(column)
            print(ws[char + str(row)].value)

    if name in char or row:
        message = "yes"
    else:
        message = "no"

    dispatcher.utter_message(text=message)

@SyedBilalHasan are you able to fetch any data? or from where you got this idea load_workbook ?

@SyedBilalHasan share the schema of chatbot_database.xlxs also.

I had done this in a different program of mine and it worked perfectly well . For some unknown reason this error is coming up now i really don’t know why. I am not sure if the problem is in the code since i had removed the code from my program also but still this error came

@SyedBilalHasan Well, if this code is in python and can able to fetch the data then it should work. But, I never seen such code to load the workbook, as without extension like .csv or txt or xls etc, that why I asked are you getting any response by this code.

@SyedBilalHasan Whilst fetching or mention the path do mention this charset="utf8" after the file, it will solve your issue. But in this code I can’t help you.

@SyedBilalHasan please change the topic category to rasa open source.

Alright where exactly do i write that

@SyedBilalHasan google is your best friend :stuck_out_tongue:

I guess wb = load_workbook("chatbot_database", charset="utf8") I am not sure buddy, as this code is know to me. I am just guessing.

Alright how do i fetch data in rasa

@SyedBilalHasan do check this thread, but only SQL parts you need to focus and implement as based on your use case. I hope this thread will help you I want to see a picture of a character named IronMan - #42 by longnguyenQB

Oh i did not want to use SQL is there no alternative to that

@SyedBilalHasan have you seen the thread? please I insist just check you will get the idea.