code: def named_entity_recognition(input: TextInput) -> NamedEntitiesOutput:
      doc = nlp(input.text)
      results = []
      for ent in doc.ents:
          try:
              entity_type = Entity(ent.label_)
              if entity_type in input.entity_types:
                  results.append(
                      NamedEntity(
                          text=ent.text,
                          start_char=ent.start_char,
                          end_char=ent.end_char,
                          label=entity_type,
                      )
                  )
          except ValueError:
              continue
  
      return NamedEntitiesOutput(__root__=results)
  
file_path: opyrator/examples/named_entity_recognition/app.py
imports: from enum import Enum
  from typing import List, Set
  import spacy
  from pydantic import BaseModel, Field
label_desc: Use image node_id 1 for calling a global function with example usage: named_entity_recognition(input) and returns: NamedEntitiesOutput