def register(embedding_cls):
register_text_embedding = registry.get_register_func(TokenEmbedding, '<STR_LIT>')<EOL>return register_text_embedding(embedding_cls)<EOL>
Registers a new token embedding.


    Once an embedding is registered, we can create an instance of this embedding with
    :func:`~gluonnlp.embedding.create`.


    Examples
    --------
    >>> @gluonnlp.embedding.register
    ... class MyTextEmbed(gluonnlp.embedding.TokenEmbedding):
    ...     def __init__(self, source='my_pretrain_file'):
    ...         pass
    >>> embed = gluonnlp.embedding.create('MyTextEmbed')
    >>> print(type(embed))
    <class 'MyTextEmbed'>