logitorch.models.prover ======================= .. py:module:: logitorch.models.prover Classes ------- .. autoapisummary:: logitorch.models.prover.PRover Module Contents --------------- .. py:class:: PRover(pretrained_roberta_model: str, num_labels: int = 2) Bases: :py:obj:`torch.nn.Module` Initializes the PRover model. Args: pretrained_roberta_model: The path or name of the pretrained RoBERTa model. num_labels: The number of labels for classification. .. py:method:: forward(x, proof_offsets=None, node_labels=None, edge_labels=None, qa_labels=None, max_node_length=None, max_edge_length=None, device: str = 'cpu') Forward pass of the PRover model. Args: x: The input tensor. proof_offsets: The proof offsets. node_labels: The node labels. edge_labels: The edge labels. qa_labels: The QA labels. max_node_length: The maximum node length. max_edge_length: The maximum edge length. device: The device to run the model on. Returns: The model outputs. .. py:method:: predict(triples, rules, question, device: str = 'cpu') Predicts the label for a given question. Args: triples: The triples. rules: The rules. question: The question. device: The device to run the model on. Returns: The predicted label. .. py:attribute:: classifier .. py:attribute:: classifier_edge .. py:attribute:: classifier_node .. py:attribute:: config .. py:attribute:: encoder .. py:attribute:: naf_layer .. py:attribute:: num_labels :value: 2 .. py:attribute:: num_labels_edge :value: 2 .. py:attribute:: proofwriter_collator