SenticGCNModel¶
-
class
SenticGCNModel
(config: sgnlp.models.sentic_gcn.config.SenticGCNConfig)[source]¶ The SenticGCN Model for aspect based sentiment analysis.
This method inherits from
SenticGCNPreTrainedModel
for weights initalization and utility functions from transformerPreTrainedModel
class.- Parameters
config (
SenticGCNConfig
) – 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.SenticGCNModelOutput[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.