Python Forum
LDA Model prepare() method failure in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LDA Model prepare() method failure in Python
#1
I'm trying to utilize the pyLDAvis Python package in Spyder, and while the LdaModel() function appears to work correctly, when I enable_notebook() and then attempt to prepare() the model for visualization, I run into the following error: 'NoneType' object has no attribute 'memmap'.

Can anybody shed some light on what might be going on? The internet seems to suggest the issue might be tied to invalid inputs to the prepare() function, but I'm following this reference guide line-for-line: Mastering Text Analysis and Topic Modeling with spaCy and Gensim

I'm using Python 3.12 with fresh installs of Anaconda and Spyder. I'm not above using a different package/approach if it gets me to a similar end-point re visualization of topic modeling.

The full Traceback is:

Cell In[5], line 1 topic_model(3,Child_Category_Notes_df['answer_note_clean_list'])

File ~\OneDrive - JFCS\Credible\Web Services\Additional_Custom_Functions.py:90 in topic_model vis = pyLDAvis.gensim_models.prepare(lda_model,corpus, dictionary=lda_model.id2word)

File ~\anaconda3\Lib\site-packages\pyLDAvis\gensim_models.py:123 in prepare return pyLDAvis.prepare(**opts)

File ~\anaconda3\Lib\site-packages\pyLDAvis_prepare.py:432 in prepare topic_info = _topic_info(topic_term_dists, topic_proportion,

File ~\anaconda3\Lib\site-packages\pyLDAvis_prepare.py:273 in _topic_info top_terms = pd.concat(Parallel(n_jobs=n_jobs)

File ~\anaconda3\Lib\site-packages\joblib\parallel.py:1952 in call return output if self.return_generator else list(output)

File ~\anaconda3\Lib\site-packages\joblib\parallel.py:1595 in _get_outputs yield from self._retrieve()

File ~\anaconda3\Lib\site-packages\joblib\parallel.py:1699 in _retrieve self._raise_error_fast()

File ~\anaconda3\Lib\site-packages\joblib\parallel.py:1734 in _raise_error_fast error_job.get_result(self.timeout)

File ~\anaconda3\Lib\site-packages\joblib\parallel.py:736 in get_result return self._return_or_raise()

File ~\anaconda3\Lib\site-packages\joblib\parallel.py:754 in _return_or_raise raise self._result
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run a linear model by group in Python? Betty775522 0 553 Oct-18-2023, 07:09 PM
Last Post: Betty775522
  issue displaying summary of whole keras CNN model on TensorFlow with python Afrodizzyjack 0 1,663 Oct-27-2021, 04:07 PM
Last Post: Afrodizzyjack
  How to prepare a NumPy array which include float type array elements subhash 0 1,927 Mar-02-2020, 06:46 AM
Last Post: subhash
  arima model error in python wissam1974 0 4,225 Jan-23-2019, 09:37 AM
Last Post: wissam1974
  How to use a pmml model in Python FlamingGuava 3 13,411 Aug-05-2017, 05:15 PM
Last Post: radioactive9

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020