class_docstr: Displays text that contains spans that are highlighted by category or numerical value.
  Preprocessing: passes a list of tuples as a {List[Tuple[str, float | str | None]]]} into the function. If no labels are provided, the text will be displayed as a single span.
  Postprocessing: expects a {List[Tuple[str, float | str]]]} consisting of spans of text and their associated labels, or a {Dict} with two keys: (1) "text" whose value is the complete text, and (2) "entities", which is a list of dictionaries, each of which have the keys: "entity" (consisting of the entity label, can alternatively be called "entity_group"), "start" (the character index where the label starts), and "end" (the character index where the label ends). Entities should not overlap.
  
  Demos: diff_texts, text_analysis
  Guides: named-entity-recognition
class_docstr_tok: ["Displays","text","that","contains","spans","that","are","highlighted","by","category","or","numerical","value",".","Preprocessing",":","passes","a","list","of","tuples","as","a","{","List","[","Tuple","[","str",",","float","|","str","|","None","]","]","]","}","into","the","function",".","If","no","labels","are","provided",",","the","text","will","be","displayed","as","a","single","span",".","Postprocessing",":","expects","a","{","List","[","Tuple","[","str",",","float","|","str","]","]","]","}","consisting","of","spans","of","text","and","their","associated","labels",",","or","a","{","Dict","}","with","two","keys",":","(","1",")","``","text","''","whose","value","is","the","complete","text",",","and","(","2",")","``","entities","''",",","which","is","a","list","of","dictionaries",",","each","of","which","have","the","keys",":","``","entity","''","(","consisting","of","the","entity","label",",","can","alternatively","be","called","``","entity_group","''",")",",","``","start","''","(","the","character","index","where","the","label","starts",")",",","and","``","end","''","(","the","character","index","where","the","label","ends",")",".","Entities","should","not","overlap",".","Demos",":","diff_texts",",","text_analysis","Guides",":","named-entity-recognition"]
code: def preprocess(
      self, payload: HighlightedTextData | None
  ) -> dict | None:
      if payload is None:
          return None
      return payload.model_dump()
  
file_path: gradio/gradio/components/highlighted_text.py
imports: from __future__ import annotations
  from typing import Any, Callable, List, Union
  from gradio_client.documentation import document, set_documentation_group
  from gradio.components.base import Component
  from gradio.data_classes import GradioModel, GradioRootModel
  from gradio.events import Events
label_desc: Use image node_id 4 for calling the HighlightedText obj's underlying member method code with example usage: obj.preprocess(payload) and returns: payload, None