def check_is_fitted(topic_model):
    """Checks if the model was fitted by verifying the presence of self.matches.

    Arguments:
        topic_model: BERTopic instance for which the check is performed.

    Returns:
        None

    Raises:
        ValueError: If the matches were not found.
    """
    msg = "This %(name)s instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator."

    if topic_model.topics_ is None:
        raise ValueError(msg % {"name": type(topic_model).__name__})
Checks if the model was fitted by verifying the presence of self.matches.

    Arguments:
        topic_model: BERTopic instance for which the check is performed.

    Returns:
        None

    Raises:
        ValueError: If the matches were not found.
    
bertopic/_utils.py