
    Wi                     ,    d dl Zd dlmZ  G d d      Zy)    N)Listc                       e Zd ZdZddZddee   dedej                  fdZ
ddee   dedej                  fd	Zdd
ee   dedej                  fdZy)BaseEmbeddera  The Base Embedder used for creating embedding models.

    Arguments:
        embedding_model: The main embedding model to be used for extracting
                         document and word embedding
        word_embedding_model: The embedding model used for extracting word
                              embeddings only. If this model is selected,
                              then the `embedding_model` is purely used for
                              creating document embeddings.
    Nc                      || _         || _        y )N)embedding_modelword_embedding_model)selfr   r   s      b/home/sietch6/trending-topics-pipeline/venv/lib/python3.12/site-packages/bertopic/backend/_base.py__init__zBaseEmbedder.__init__   s    .$8!    	documentsverbosereturnc                      y)a  Embed a list of n documents/words into an n-dimensional
        matrix of embeddings.

        Arguments:
            documents: A list of documents or words to be embedded
            verbose: Controls the verbosity of the process

        Returns:
            Document/words embeddings with shape (n, m) with `n` documents/words
            that each have an embeddings size of `m`
        N )r	   r   r   s      r
   embedzBaseEmbedder.embed   s     	r   wordsc                 &    | j                  ||      S )aZ  Embed a list of n words into an n-dimensional
        matrix of embeddings.

        Arguments:
            words: A list of words to be embedded
            verbose: Controls the verbosity of the process

        Returns:
            Word embeddings with shape (n, m) with `n` words
            that each have an embeddings size of `m`

        r   )r	   r   r   s      r
   embed_wordszBaseEmbedder.embed_words#   s     zz%))r   documentc                 &    | j                  ||      S )ah  Embed a list of n words into an n-dimensional
        matrix of embeddings.

        Arguments:
            document: A list of documents to be embedded
            verbose: Controls the verbosity of the process

        Returns:
            Document embeddings with shape (n, m) with `n` documents
            that each have an embeddings size of `m`
        r   )r	   r   r   s      r
   embed_documentszBaseEmbedder.embed_documents2   s     zz(G,,r   )NN)F)__name__
__module____qualname____doc__r   r   strboolnpndarrayr   r   r   r   r   r
   r   r      sr    	9tCy 4 BJJ *c *T *bjj *-S	 -D -RZZ -r   r   )numpyr    typingr   r   r   r   r
   <module>r$      s     9- 9-r   