wordList[:1]
[['2020', '拿红本', '出去玩', '退回来', '见面会', '墨绿色', 'iPhone11', 'pro', '256G']
1 umap_model=UMAP(n_neighbors=15,n_components=5,min_dist=0.0,metric='cosine',random_state=100)
2 topic_model=BERTopic(umap_model=umap_model,calculate_probabilities=True,nr_topics="auto")
----> 3 topics,probabilities=topic_model.fit_transform(wordlist)
File ~\AppData\Roaming\Python\Python310\site-packages\bertopic_utils.py:37, in check_documents_type(documents)
35 if isinstance(documents, Iterable) and not isinstance(documents, str):
36 if not any([isinstance(doc, str) for doc in documents]):
---> 37 raise TypeError("Make sure that the iterable only contains strings.")
39 else:
40 raise TypeError("Make sure that the documents variable is an iterable containing strings only.")
TypeError: Make sure that the iterable only contains strings.
为什么用bertopic进行主题识别时会出现这样的问题,明明是跟着别人步骤一步步来的