SenticGCNBertModel¶
-
class
SenticGCNBertModel
(config: sgnlp.models.sentic_gcn.config.SenticGCNBertConfig)[source]¶ The SenticGCNBert Model for aspect based sentiment analysis.
This method inherits from
SenticGCNBertPreTrainedModel
for weights initalization and utility functions from transformerPreTrainedModel
class.- Parameters
config (
SenticGCNBertConfig
) – Model configuration class with all parameters required for the model. Initializing with a config file does not load the weights associated with the model, only the configuration. Use thefrom_pretrained
method to load the model weights.
-
forward
(inputs: List[torch.Tensor], labels: Optional[torch.Tensor] = None) → sgnlp.models.sentic_gcn.modeling.SenticGCNBertModelOutput[source]¶ 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.