SenticGCNBertConfig

class SenticGCNBertConfig(embed_dim: int = 300, hidden_dim: int = 768, max_seq_len: int = 85, polarities_dim: int = 3, dropout: float = 0.3, loss_function: str = 'cross_entropy', **kwargs)[source]

This is the configuration class to store the configuration of a SenticBertGCNModel. It is used to instantiate a SenticBertGCNModel network according to the specific arguments, defining the model architecture.

Parameters
  • embed_dim (int, defaults to 300) – The input dimension for the LSTM layer

  • hidden_dim (int, defaults to 768) – The embedding dimension size for the Bert model as well as GCN dimension.

  • max_seq_len (int, defaults to 85) – The max sequence length to pad and truncate.

  • dropout (float, defaults to 0.3) – Dropout percentage.

  • polarities_dim (int, defaults to 3) – Size of output dimension representing available polarities (e.g. Positive, Negative, Neutral).

  • loss_function (str, defaults to ‘cross_entropy’) – Loss function for training/eval.

Example

from sgnlp.models.sentic_gcn import SenticGCNBertConfig

# Initialize with default values config = SenticGCNBertConfig()