from bertopic import BERTopic 后如果报错:
ImportError: cannot import name ‘UMAP’ from ‘umap’ (unknown location)
很可能是先安装的umap导致,bertopic中的umap版本冲突。
解决方法,亲测有效:
可以尝试先pip uninstall umap, pip uninstall bertopic,
然后进入pip的下载路径,会发现,即使卸载了umap,他的相关文件夹依然存在,手动删掉。
最后直接pip install bertopic。
问题解决。
bertopic相关问题官网原址:https://github.com/MaartenGr/BERTopic/issues/723