(self, vectors, text)
Initialize a SentenceVectors class object

        Arguments:
            vectors (ndarray, (#sentences, vector dimension)): sentence vectors
            text (list, #sentences): sentence texts
Initialize a SentenceVectors class object
Initialize a SentenceVectors class object
def __init__(self, vectors, text):
        """
        Initialize a SentenceVectors class object

        Arguments:
            vectors (ndarray, (#sentences, vector dimension)): sentence vectors
            text (list, #sentences): sentence texts
        """
        self.vectors = vectors
        self.text = text

        if isinstance(self.text, list):
            assert self.vectors.shape[0] == len(self.text)
        elif isinstance(self.text, np.ndarray):
            assert self.vectors.shape[0] == self.text.shape[0]

        norms = np.linalg.norm(self.vectors, axis=1)
        self.vectors = self.vectors / norms.reshape(-1, 1)
def __init__ ( self , vectors , text ) : self . vectors = vectors self . text = text if isinstance ( self . text , list ) : assert self . vectors . shape [ 0 ] == len ( self . text ) elif isinstance ( self . text , np . ndarray ) : assert self . vectors . shape [ 0 ] == self . text . shape [ 0 ] norms = np . linalg . norm ( self . vectors , axis = 1 ) self . vectors = self . vectors / norms . reshape ( - 1 , 1 )