def get_pret_embs(self, word_dims=None):
assert (self._pret_embeddings is not None), "<STR_LIT>"<EOL>pret_embeddings = gluonnlp.embedding.create(self._pret_embeddings[<NUM_LIT:0>], source=self._pret_embeddings[<NUM_LIT:1>])<EOL>embs = [None] * len(self._id2word)<EOL>for idx, vec in enumerate(pret_embeddings.idx_to_vec):<EOL><INDENT>embs[idx] = vec.asnumpy()<EOL><DEDENT>if word_dims is None:<EOL><INDENT>word_dims = len(pret_embeddings.idx_to_vec[<NUM_LIT:0>])<EOL><DEDENT>for idx, emb in enumerate(embs):<EOL><INDENT>if emb is None:<EOL><INDENT>embs[idx] = np.zeros(word_dims)<EOL><DEDENT><DEDENT>pret_embs = np.array(embs, dtype=np.float32)<EOL>return pret_embs / np.std(pret_embs)<EOL>
Read pre-trained embedding file

        Parameters
        ----------
        word_dims : int or None
            vector size. Use `None` for auto-infer
        Returns
        -------
        numpy.ndarray
            T x C numpy NDArray