MaartenGr / MaartenGr/BERTopic
Nan Representative Docs when loading a serialized model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 920
- Avg merge
- 22h 24m
- Merged PRs (30d)
- 5
Description
Hi,
I've serialized my model using the command `topic_model.save(folder_path, serialization="safetensors", save_ctfidf=True, save_embedding_model=model_name)`. But when I load the model with BERTopic.load(topic_model_path), the column 'Representative_Docs' is filled with NaN values. How can I recover or recompute them after loading the model?
Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the shown BERTopic.save call using serialization="safetensors" and then BERTopic.load(topic_model_path). Trace how Representative_Docs is written and restored during serialization, and compare the loaded model with the original; done means representative documents are preserved or the missing restoration behavior is covered by a focused regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100