cnlpt.BaselineModels module

class cnlpt.BaselineModels.CnnSentenceClassifier

Bases: Module

__init__(vocab_size, embed_dims=100, num_labels_list=[2], num_filters=25, dropout=0.2, filters=(1, 2, 3))

Initializes internal Module state, shared by both nn.Module and ScriptModule.

forward(input_ids=None, event_tokens=None, labels=None, **kwargs)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class cnlpt.BaselineModels.LstmSentenceClassifier

Bases: Module

__init__(vocab_size, embed_dims=100, num_labels_list=[2], dropout=0.2, hidden_size=100)

Initializes internal Module state, shared by both nn.Module and ScriptModule.

forward(input_ids=None, event_tokens=None, labels=None, **kwargs)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.