A python package to run contextualized topic modeling. CTMs combine contextualized embeddings (e.g., BERT) with topic models to get coherent topics. Published at EACL and ACL 2021 (Bianchi et al.).
MIT License
1.21k
stars
147
forks
source link
Bug Report: Error When Using Custom Embeddings with None Contextualized Model #149
There seems to be a potential bug in the data_preparation.py script, specifically at this line. I propose adjusting the conditional statement to:
if self.contextualized_model is None and custom_embeddings is None:
instead of:
if self.contextualized_model is None:
Currently, when self.contextualized_model is set to None and custom_embeddings are provided (such as when using externally sourced embeddings), the code erroneously raises an error. This issue occurs because the conditional logic does not adequately account for the scenario where custom_embeddings is used independently of self.contextualized_model.
The expected behavior is that when custom_embeddings are provided, the method should proceed without requiring self.contextualized_model. This adjustment will allow the use of alternative embeddings without triggering unnecessary errors.
Description
There seems to be a potential bug in the
data_preparation.py
script, specifically at this line. I propose adjusting the conditional statement to:instead of:
Currently, when
self.contextualized_model
is set to None andcustom_embeddings
are provided (such as when using externally sourced embeddings), the code erroneously raises an error. This issue occurs because the conditional logic does not adequately account for the scenario where custom_embeddings is used independently ofself.contextualized_model
.What I Did
Here's how the error can be reproduced:
The expected behavior is that when custom_embeddings are provided, the method should proceed without requiring
self.contextualized_model
. This adjustment will allow the use of alternative embeddings without triggering unnecessary errors.