logitorch.data_collators.prover_collator ======================================== .. py:module:: logitorch.data_collators.prover_collator Classes ------- .. autoapisummary:: logitorch.data_collators.prover_collator.Node logitorch.data_collators.prover_collator.PRoverProofWriterCollator Module Contents --------------- .. py:class:: Node(head: str) .. py:attribute:: head .. py:class:: PRoverProofWriterCollator(pretrained_roberta_tokenizer: str) A collator class for processing data in the PRoverProofWriter format. Args: | pretrained_roberta_tokenizer (str): The name or path of the pretrained RoBERTa tokenizer. Attributes: | tokenizer (RobertaTokenizer): The pretrained RoBERTa tokenizer. Methods: | get_proof_graph_with_fail(proof_str: str) -> Tuple[List[str], List[str]]: Extracts the proof graph and edges from a proof string with a "FAIL" node. | get_proof_graph(proof_str: str) -> Tuple[List[str], List[Tuple[str, str]]]: Extracts the proof graph and edges from a proof string. | get_node_edge_label_constrained(x: str) -> Tuple[List[int], List[np.ndarray]]: Generates node and edge labels for a given input. | __call__(batch) -> Tuple[Dict[str, torch.Tensor], torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: Collates a batch of data into tokenized tensors. .. py:method:: get_node_edge_label_constrained(x: str) -> Tuple[List[int], List[numpy.ndarray]] Generates node and edge labels for a given input. Args: | x (str): The input. Returns: | Tuple[List[int], List[np.ndarray]]: A tuple containing the list of node labels and the list of edge labels. .. py:method:: get_proof_graph(proof_str: str) -> Tuple[List[str], List[Tuple[str, str]]] Extracts the proof graph and edges from a proof string. Args: | proof_str (str): The proof string. Returns: | Tuple[List[str], List[Tuple[str, str]]]: A tuple containing the list of nodes and the list of edges. .. py:method:: get_proof_graph_with_fail(proof_str: str) -> Tuple[List[str], List[str]] Extracts the proof graph and edges from a proof string with a "FAIL" node. Args: | proof_str (str): The proof string. Returns: | Tuple[List[str], List[str]]: A tuple containing the list of nodes and the list of edges. .. py:attribute:: tokenizer