logitorch.models.fairr ====================== .. py:module:: logitorch.models.fairr Classes ------- .. autoapisummary:: logitorch.models.fairr.FactSelector logitorch.models.fairr.FaiRR logitorch.models.fairr.KnowledgeComposer logitorch.models.fairr.RuleSelector Module Contents --------------- .. py:class:: FactSelector(pretrained_roberta_model: str) Bases: :py:obj:`torch.nn.Module` FactSelector is a class that represents a fact-based selector model. It uses a pretrained RoBERTa model for encoding input sequences and a linear classifier for prediction. .. py:method:: forward(x, y=None) Forward pass of the FactSelector model. Args: x (dict): Input dictionary containing the input sequences. y (None): Placeholder for compatibility with other models. Returns: None: This method is not implemented. .. py:attribute:: classifier .. py:attribute:: dropout .. py:attribute:: model .. py:attribute:: out_dim .. py:attribute:: tokenizer .. py:class:: FaiRR Bases: :py:obj:`torch.nn.Module` FaiRR is a class that represents the FaiRR model, which combines rule-based and fact-based selectors. .. py:class:: KnowledgeComposer(pretrained_t5_model: str) Bases: :py:obj:`torch.nn.Module` KnowledgeComposer is a class that represents a knowledge composer model. It uses a pretrained T5 model for generating text based on input prompts. .. py:attribute:: model .. py:attribute:: tokenizer .. py:class:: RuleSelector(pretrained_roberta_model: str, cls_dropout=0.1) Bases: :py:obj:`torch.nn.Module` RuleSelector is a class that represents a rule-based selector model. It uses a pretrained RoBERTa model for encoding input sequences and a linear classifier for prediction. .. py:method:: forward(x, y=None) Forward pass of the RuleSelector model. Args: x (dict): Input dictionary containing the input sequences. y (None): Placeholder for compatibility with other models. Returns: torch.Tensor: Logits representing the predicted scores. .. py:attribute:: classifier .. py:attribute:: dropout .. py:attribute:: model .. py:attribute:: out_dim .. py:attribute:: tokenizer