docstr: This tagger is capable of tagging sentence objects with given regexp -> label mappings.
  
  I.e: The tuple (r'(["\'])(?:(?=(\\?))\2.)*?\1', 'QUOTE') maps every match of the regexp to
  a <QUOTE> labeled span and therefore labels the given sentence object with RegexpTagger.predict().
  This tagger supports multilabeling so tokens can be included in multiple labeled spans.
  The regexp are compiled internally and an re.error will be raised if the compilation of a given regexp fails.
  
  If a match violates (in this case overlaps) a token span, an exception is raised.
  
  Args:
      mapping: A list of tuples or a single tuple representing a mapping as regexp -> label
docstr_tok: ["This","tagger","is","capable","of","tagging","sentence","objects","with","given","regexp","-",">","label","mappings",".","I.e",":","The","tuple","(","r","'","(","[","``","\\","'","]",")","(","?",":","(","?","=","(","\\\\","?",")",")","\\2",".",")","*","?","\\1","'",",","'QUOTE","'",")","maps","every","match","of","the","regexp","to","a","<","QUOTE",">","labeled","span","and","therefore","labels","the","given","sentence","object","with","RegexpTagger.predict","(",")",".","This","tagger","supports","multilabeling","so","tokens","can","be","included","in","multiple","labeled","spans",".","The","regexp","are","compiled","internally","and","an","re.error","will","be","raised","if","the","compilation","of","a","given","regexp","fails",".","If","a","match","violates","(","in","this","case","overlaps",")","a","token","span",",","an","exception","is","raised",".","Args",":","mapping",":","A","list","of","tuples","or","a","single","tuple","representing","a","mapping","as","regexp","-",">","label"]
code: def __init__(
      self, mapping: Union[List[Tuple[str, str]], Tuple[str, str]]
  ) -> None:
      r"""This tagger is capable of tagging sentence objects with given regexp -> label mappings.
  
      I.e: The tuple (r'(["\'])(?:(?=(\\?))\2.)*?\1', 'QUOTE') maps every match of the regexp to
      a <QUOTE> labeled span and therefore labels the given sentence object with RegexpTagger.predict().
      This tagger supports multilabeling so tokens can be included in multiple labeled spans.
      The regexp are compiled internally and an re.error will be raised if the compilation of a given regexp fails.
  
      If a match violates (in this case overlaps) a token span, an exception is raised.
  
      Args:
          mapping: A list of tuples or a single tuple representing a mapping as regexp -> label
      """
      self._regexp_mapping: Dict[str, typing.Pattern] = {}
      self.register_labels(mapping=mapping)
  
file_path: flair/flair/models/regexp_tagger.py
imports: import re
  import typing
  from dataclasses import dataclass, field
  from typing import Dict, List, Tuple, Union
  from flair.data import Sentence, Span, Token
label_desc: Use image node_id 1 to create a new RegexpTagger object  with example: obj = RegexpTagger(mapping)