Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAvis: broken after wrong input #1001

Closed
wvdvegte opened this issue Aug 24, 2023 · 2 comments · Fixed by #1008
Closed

LDAvis: broken after wrong input #1001

wvdvegte opened this issue Aug 24, 2023 · 2 comments · Fixed by #1008

Comments

@wvdvegte
Copy link

Describe the bug
I was demonstrating Topic Modelling to a colleague. Its output was connected to LDAvis. After switching Topic Modelling from LDA to LSI, an error message (that I can no longer reproduce) came up, and LDAvis could no longer show its visualization, even after setting Topic Modelling back to LDA. I can understand that LDAvis works with LDA-based input only, but it shouldn't crash. Restarting Orange and even restarting my Mac couldn't get LDAvis back to work, and each time I open a workflow with the widget, the attached error message comes up. And if I open LDAvis and select a topic, the following message appears:

Error encountered in widget LDAvis:

Traceback (most recent call last):
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangewidget/gui.py", line 2261, in call
self.func(**kwds)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangecontrib/text/widgets/owldavis.py", line 316, in on_params_change
adj_prob = self.compute_relevance(topic)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangecontrib/text/widgets/owldavis.py", line 297, in compute_relevance
tp, mp = topic[nonzero], self.term_frequency[nonzero]
IndexError: boolean index did not match indexed array along dimension 1; dimension is 1 but corresponding boolean dimension is 928

To Reproduce
Steps to reproduce the behavior:

  1. Connect Topic Modelling to a Corpus output
  2. Select Latent Dirichlet Allocation
  3. Connect LDAvis to its output
  4. Select latent Semantic Indexing in Topic Modelling
    (or perhaps one of the other options)

Expected behavior
No crash - perhaps the input connector to LDAvis should become a dashed one

Orange version:
3.35.0

Text add-on version:
1.14.0

Operating system:
Mac OS Ventura 13.5 on Silicon

Exception.txt

@PrimozGodec
Copy link
Collaborator

Thank you for reporting. I can reproduce the error after selecting LSI and then back to LDA.

@PrimozGodec
Copy link
Collaborator

In #1008, I propose a fix. Hopefully, it fixes the error completely (at least, it fixes it in my case).

Setting a connection to dashed lines is technically impossible, so we keep an error in a widget that warns that data are unsuitable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants