WordEncoder

class WordEncoder(config)[source]

Encodes the information into vectors

There are 2 pieces of information that goes into the encoded information: 1. Word Embedding 2. Position Embedding

forward(token_ids)[source]

Encodes input using word embedding. :param token_ids: LongTensor shape of (batch_size, num_posts, num_words)

Returns

Tensor with shape of (batch_size, num_posts, num_words, emb_dim)

Return type

encoded_we_features