class_docstr: Dataset implementation for text recognition tasks
  
  >>> from doctr.datasets import RecognitionDataset
  >>> train_set = RecognitionDataset(img_folder="/path/to/images",
  >>>                                labels_path="/path/to/labels.json")
  >>> img, target = train_set[0]
  
  Args:
  ----
      img_folder: path to the images folder
      labels_path: pathe to the json file containing all labels (character sequences)
      **kwargs: keyword arguments from `AbstractDataset`.
code: def __init__(
      self,
      img_folder: str,
      labels_path: str,
      **kwargs: Any,
  ) -> None:
      super().__init__(img_folder, **kwargs)
  
      self.data: List[Tuple[str, str]] = []
      with open(labels_path) as f:
          labels = json.load(f)
  
      for img_name, label in labels.items():
          if not os.path.exists(os.path.join(self.root, img_name)):
              raise FileNotFoundError(
                  f"unable to locate {os.path.join(self.root, img_name)}"
              )
  
          self.data.append((img_name, label))
  
file_path: doctr/doctr/datasets/recognition.py
imports: import json
  import os
  from pathlib import Path
  from typing import Any, List, Tuple
  from .datasets import AbstractDataset
label_desc: Use image node_id 1 to create a new RecognitionDataset object from inherited base classes: AbstractDataset with example: obj = RecognitionDataset(img_folder, labels_path)