class_docstr: This dataset is a variant of the original `LAMA <https://github.com/facebookresearch/LAMA>`_ dataset, which adds train and dev split, and was created by `AutoPrompt <https://github.com/ucinlp/autoprompt>`_ .
  
  The code of this Processor refers to `the data processing phase in P-tuning <https://github.com/THUDM/P-tuning/tree/main/LAMA>`_
  
  Args:
      model_name (str): PLM model name.
      tokenizer (PreTrainedTokenizer): tokenizer of the corresponding PLM
      vocab_strategy (str): ["original", "share", "lama"]. "original" use the vocab of PLM; "share" use the vocab of LAMA-29k; "lama" use the vocab of LAMA-34k.
      relation_id (str, optional): [description]. Defaults to "P1001".
  
  Examples: # TODO test needed
class_docstr_tok: ["This","dataset","is","a","variant","of","the","original","`","LAMA","<","https",":","\/\/github.com\/facebookresearch\/LAMA",">","`","_","dataset",",","which","adds","train","and","dev","split",",","and","was","created","by","`","AutoPrompt","<","https",":","\/\/github.com\/ucinlp\/autoprompt",">","`","_",".","The","code","of","this","Processor","refers","to","`","the","data","processing","phase","in","P-tuning","<","https",":","\/\/github.com\/THUDM\/P-tuning\/tree\/main\/LAMA",">","`","_","Args",":","model_name","(","str",")",":","PLM","model","name",".","tokenizer","(","PreTrainedTokenizer",")",":","tokenizer","of","the","corresponding","PLM","vocab_strategy","(","str",")",":","[","``","original","''",",","``","share","''",",","``","lama","''","]",".","``","original","''","use","the","vocab","of","PLM",";","``","share","''","use","the","vocab","of","LAMA-29k",";","``","lama","''","use","the","vocab","of","LAMA-34k",".","relation_id","(","str",",","optional",")",":","[","description","]",".","Defaults","to","``","P1001","''",".","Examples",":","#","TODO","test","needed"]
code: def get_examples(self, data_dir, split):
      path = os.path.join(
          data_dir,
          "fact-retrieval/original/{}/{}.jsonl".format(
              self.relation_id, split
          ),
      )  # TODO oprinal_rob or trex option
      examples = []
      with open(path, encoding="utf8") as f:
          for choicex, line in enumerate(f):
              example_json = json.loads(line)
              token_ids = self.tokenizer(
                  " " + example_json["obj_label"],
                  add_special_tokens=False,
              )["input_ids"]
              if (
                  len(token_ids) != 1
                  or token_ids[0] not in self.allowed_vocab_ids
              ):
                  continue
              example = InputExample(
                  guid=str(choicex),
                  text_a=example_json["sub_label"],
                  label=token_ids[0],
              )
              examples.append(example)
      return examples
  
file_path: OpenPrompt/openprompt/data_utils/lama_dataset.py
imports: import os
  import re
  import json, csv
  from abc import ABC, abstractmethod
  from collections import defaultdict, Counter
  from typing import *
  import tokenizers
  import sys
  from transformers.tokenization_utils import PreTrainedTokenizer
  from openprompt.utils.logging import logger
  from openprompt.data_utils.utils import InputExample
  from openprompt.data_utils.data_processor import DataProcessor
label_desc: Use image node_id 4 for calling the LAMAProcessor obj's underlying member method code with example usage: obj.get_examples(data_dir, split) and returns: examples