Ë
    ØWŠiñ  ã                   óN   — d dl Zd dlmZ d dlmZ d dlmZmZm	Z	  G d„ de«      Z
y)é    N)Ú
csr_matrix)ÚBaseEstimator)ÚMappingÚListÚTuplec                   óp   — e Zd ZdZdej
                  dedeee	e
eef      f   deee	e
eef      f   fd„Zy)ÚBaseRepresentationzDThe base representation model for fine-tuning topic representations.Ú	documentsÚc_tf_idfÚtopicsÚreturnc                 ó   — |j                   S )a¥  Extract topics.

        Each representation model that inherits this class will have
        its arguments (topic_model, documents, c_tf_idf, topics)
        automatically passed. Therefore, the representation model
        will only have access to the information about topics related
        to those arguments.

        Arguments:
            topic_model: The BERTopic model that is fitted until topic
                         representations are calculated.
            documents: A dataframe with columns "Document" and "Topic"
                       that contains all documents with each corresponding
                       topic.
            c_tf_idf: A c-TF-IDF representation that is typically
                      identical to `topic_model.c_tf_idf_` except for
                      dynamic, class-based, and hierarchical topic modeling
                      where it is calculated on a subset of the documents.
            topics: A dictionary with topic (key) and tuple of word and
                    weight (value) as calculated by c-TF-IDF. This is the
                    default topics that are returned if no representation
                    model is used.
        )Útopic_representations_)ÚselfÚtopic_modelr
   r   r   s        úi/home/sietch6/trending-topics-pipeline/venv/lib/python3.12/site-packages/bertopic/representation/_base.pyÚextract_topicsz!BaseRepresentation.extract_topics
   s   € ð< ×1Ñ1Ð1ó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚpdÚ	DataFramer   r   Ústrr   r   Úfloatr   © r   r   r	   r	      sf   „ ÙNð2ð —<‘<ð2ð ð	2ð
 ˜˜T %¨¨U¨
Ñ"3Ñ4Ð4Ñ5ð2ð 
d˜5  e Ñ,Ñ-Ð-Ñ	.ô2r   r	   )Úpandasr   Úscipy.sparser   Úsklearn.baser   Útypingr   r   r   r	   r   r   r   ú<module>r"      s    ðÛ Ý #Ý &ß 'Ñ 'ô!2˜õ !2r   