Skip to content
New issue

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

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

Already on GitHub? # to your account

Topic modelling: pyLDAvis fix #2

Open
Firefly55lm opened this issue Jun 16, 2023 · 0 comments
Open

Topic modelling: pyLDAvis fix #2

Firefly55lm opened this issue Jun 16, 2023 · 0 comments

Comments

@Firefly55lm
Copy link
Owner

Firefly55lm commented Jun 16, 2023

Only old versions of the library support scikitlearn models.
To perform the topic modelling visualization ensure you installed the version of pyLDAvis indicated in requirements.txt.

Run topic_modelling_tweets and wait the error message that brakes the code.
Click to the last link given by the error message [File "C:\Users\feder\PycharmProjects\footballers_performances\lib\site-packages\pyLDAvis\sklearn.py", line 20, in _get_vocab] and change the function _get_vocab adding "_out" as follows:

def _get_vocab(vectorizer):
return vectorizer.get_feature_names_out()

Save and run again. You will get a new error. Click again on the last blue path given.
Change the code from head(R).drop('saliency', 1) to head(R).drop('saliency', axis = 1).

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

No branches or pull requests

1 participant