[docs]classLReasoner(nn.Module):def__init__(self,pretrained_model:str)->None:""" Initializes an instance of the LReasoner class. Args: pretrained_model (str): The name or path of the pre-trained model to use. Returns: None """super().__init__()
[docs]defforward(self,**x:Dict[str,torch.Tensor])->SequenceClassifierOutput:""" Performs forward pass through the LReasoner model. Args: **x (Dict[str, torch.Tensor]): Input tensors for the model. Returns: SequenceClassifierOutput: The output of the model. """returnself.model(**x)
[docs]defpredict(self,**x:Dict[str,torch.Tensor])->List[str]:""" Predicts the class labels for the input tensors. Args: **x (Dict[str, torch.Tensor]): Input tensors for prediction. Returns: List[str]: The predicted class labels. """pass