RasaHQ / rasalit

Visualizations and helpers to improve and debug machine learning models for Rasa Open Source
Apache License 2.0
306 stars 63 forks source link

KeyError: "['support'] not found in axis" #21

Closed dingusagar closed 4 years ago

dingusagar commented 4 years ago

I followed the readme file instructions to test the nlu model on mulitple config.yml files and stored results to gridresults folder.

after that on running python -m rasalit overview --folder gridresults I get the following error in the browser

KeyError: "['support'] not found in axis" Traceback: File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/streamlit/script_runner.py", line 324, in _run_script exec(code, module.__dict__) File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/rasalit/apps/overview/app.py", line 21, in <module> df_response = read_reports(root_folder, report="response") File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/rasalit/apps/overview/common.py", line 16, in read_reports return pd.DataFrame(data).drop(columns=["support"]).melt("config") File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/pandas/core/frame.py", line 4169, in drop errors=errors, File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 3884, in drop obj = obj._drop_axis(labels, axis, level=level, errors=errors) File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 3918, in _drop_axis new_axis = axis.drop(labels, errors=errors) File "/home/dingusagar/PycharmProjects/rasa-demo/venv/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 5278, in drop raise KeyError(f"{labels[mask]} not found in axis")

Anybody knows whats going on here?

sara-tagger commented 4 years ago

Thanks for raising this issue, @rgstephens will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗
dingusagar commented 4 years ago

Found the cause of this issue. This was happening because response_selection_report.json was missing in the gridresults directory containing the reports. rasa test nlu command does not create a response_selection_report.json file if response selection examples are not there in the training dataset. have created a fix for this here #23 please review it and give comments if any. @rgstephens

koaning commented 4 years ago

Thanks for reporting this ... and fixing it! I just got back from my honeymoon and will review this first thing on monday.

koaning commented 4 years ago

I just merged the PR. Thanks for reporting, and fixing :)