class_docstr: `TAC Relation Extraction Dataset (TACRED) <https://nlp.stanford.edu/projects/tacred/>`_ is one of the largest and most widely used datasets for relation classification.
  It was released together with the paper `Position-aware Attention and Supervised Data Improve Slot Filling (Zhang et al. 2017) <https://nlp.stanford.edu/pubs/zhang2017tacred.pdf>`_
  This processor is also inherited by :py:class:`TACREVProcessor` and :py:class:`ReTACREDProcessor`.
  
  Examples:
  
  ..  code-block:: python
  
      from openprompt.data_utils.relation_classification_dataset import PROCESSORS
  
      base_path = "datasets/RelationClassification"
  
      dataset_name = "TACRED"
      dataset_path = os.path.join(base_path, dataset_name)
      processor = PROCESSORS[dataset_name.lower()]()
      train_dataset = processor.get_train_examples(dataset_path)
      dev_dataset = processor.get_dev_examples(dataset_path)
      test_dataset = processor.get_test_examples(dataset_path)
  
      assert processor.get_num_labels() == 42
      assert processor.get_labels() == ["no_relation", "org:founded", "org:subsidiaries", "per:date_of_birth", "per:cause_of_death", "per:age", "per:stateorprovince_of_birth", "per:countries_of_residence", "per:country_of_birth", "per:stateorprovinces_of_residence", "org:website", "per:cities_of_residence", "per:parents", "per:employee_of", "per:city_of_birth", "org:parents", "org:political/religious_affiliation", "per:schools_attended", "per:country_of_death", "per:children", "org:top_members/employees", "per:date_of_death", "org:members", "org:alternate_names", "per:religion", "org:member_of", "org:city_of_headquarters", "per:origin", "org:shareholders", "per:charges", "per:title", "org:number_of_employees/members", "org:dissolved", "org:country_of_headquarters", "per:alternate_names", "per:siblings", "org:stateorprovince_of_headquarters", "per:spouse", "per:other_family", "per:city_of_death", "per:stateorprovince_of_death", "org:founded_by"]
      assert len(train_dataset) == 68124
      assert len(dev_dataset) == 22631
      assert len(test_dataset) == 15509
      assert train_dataset[0].text_a == 'Tom Thabane resigned in October last year to form the All Basotho Convention -LRB- ABC -RRB- , crossing the floor with 17 members of parliament , causing constitutional monarch King Letsie III to dissolve parliament and call the snap election .'
      assert train_dataset[0].meta["head"] == "All Basotho Convention"
      assert train_dataset[0].meta["tail"] == "Tom Thabane"
      assert train_dataset[0].label == 41
code: def get_examples(self, data_dir, split):
      path = os.path.join(data_dir, "{}.json".format(split))
      examples = []
      with open(path, encoding="utf8") as f:
          example_jsons = json.load(f)
          for example_json in example_jsons:
              guid = example_json["id"]
              label = self.get_label_id(example_json["relation"])
              tokens = example_json["token"]
              text_a = " ".join(tokens)
              meta = {
                  "head": " ".join(
                      tokens[
                          example_json["subj_start"] : example_json[
                              "subj_end"
                          ]
                          + 1
                      ]
                  ),
                  "tail": " ".join(
                      tokens[
                          example_json["obj_start"] : example_json[
                              "obj_end"
                          ]
                          + 1
                      ]
                  ),
              }
  
              example = InputExample(
                  guid=guid, text_a=text_a, meta=meta, label=label
              )
              examples.append(example)
      return examples
  
imports: import os
  import json, csv
  from abc import ABC, abstractmethod
  from collections import defaultdict, Counter
  from typing import *
  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 2 for calling the TACREDProcessor obj's underlying member method code with example usage: obj.get_examples(data_dir, split) and returns: examples