SCBert/SCBert.py
def __sentence_pooling (self, vectors , pooling_method) :
            """
            Parameters
            ----------
            vectors : list of vectors representing each words including the BOS and EOS tag
            
            pooling_method : string
                average or max.

            Returns
            -------
            pooled_vectors : tensor 
                pooled tensors according to the method.

            """

            pooled_vector = torch.tensor([])
            if pooling_method.lower() == "average" :
                pooled_vector = torch.mean(vectors, axis=0)
                
            elif pooling_method.lower() == "max" :
                pooled_vector = torch.max(vectors, axis=0)
            
            return pooled_vector

            Parameters
            ----------
            vectors : list of vectors representing each words including the BOS and EOS tag
            
            pooling_method : string
                average or max.

            Returns
            -------
            pooled_vectors : tensor 
                pooled tensors according to the method.

            
Parameters
vectors : list of vectors representing each words including the BOS and EOS tag

pooling_method : string
average or max.

Returns

pooled_vectors : tensor
pooled tensors according to the method.
Parameters vectors : list of vectors representing each words including the BOS and EOS tag pooling_method : string average or max . Returns pooled_vectors : tensor pooled tensors according to the method .
def __sentence_pooling (self, vectors , pooling_method) :
            pooled_vector = torch.tensor([])
            if pooling_method.lower() == "average" :
                pooled_vector = torch.mean(vectors, axis=0)
            elif pooling_method.lower() == "max" :
                pooled_vector = torch.max(vectors, axis=0)
            return pooled_vector
def __sentence_pooling ( self , vectors , pooling_method ) : pooled_vector = torch . tensor ( [ ] ) if pooling_method . lower ( ) == "average" : pooled_vector = torch . mean ( vectors , axis = 0 ) elif pooling_method . lower ( ) == "max" : pooled_vector = torch . max ( vectors , axis = 0 ) return pooled_vector
Parameters
vectors : list of vectors representing each words including the BOS and EOS tag
Parameters vectors : list of vectors representing each words including the BOS and EOS tag
"""
            Parameters
            ----------
            vectors : list of vectors representing each words including the BOS and EOS tag
            
            pooling_method : string
                average or max.

            Returns
            -------
            pooled_vectors : tensor 
                pooled tensors according to the method.

            """
self
vectors
pooling_method