target_extraction.allen.modules package

Submodules

target_extraction.allen.modules.word_dropout module

class target_extraction.allen.modules.word_dropout.WordDrouput(p)[source]

Bases: torch.nn.modules.module.Module

Word Dropout will randomly drop whole words/timesteps. This is equivalent to `1D Spatial Dropout`_.

forward(embedded_text)[source]
Parameters

embedded_text (FloatTensor) – A tensor of shape: [batch_size, timestep, embedding_dim] of which the dropout will drop entire timestep which is the equivalent to words.

Return type

FloatTensor

Returns

The given tensor but with timesteps/words dropped.

Module contents