From 3eb986f86fa806a7577779e1e9849baffcb701a1 Mon Sep 17 00:00:00 2001 From: zide05 <845465009@qq.com> Date: Fri, 16 Aug 2019 16:16:55 +0800 Subject: [PATCH] Update elmo_embedding.py --- fastNLP/embeddings/elmo_embedding.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fastNLP/embeddings/elmo_embedding.py b/fastNLP/embeddings/elmo_embedding.py index af94e8ec..73def086 100644 --- a/fastNLP/embeddings/elmo_embedding.py +++ b/fastNLP/embeddings/elmo_embedding.py @@ -21,6 +21,9 @@ class ElmoEmbedding(ContextualEmbedding): Example:: + >>> import torch + >>> from fastNLP import Vocabulary + >>> from fastNLP.embeddings import ElmoEmbedding >>> vocab = Vocabulary().add_word_lst("The whether is good .".split()) >>> # 使用不同层的concat的结果 >>> embed = ElmoEmbedding(vocab, model_dir_or_name='en', layers='1,2', requires_grad=False)