code: def detect_negation_words_and_entities(nlp_doc):
      negation_tokens = list(
          filter(lambda tok: tok.dep_ == "neg", nlp_doc)
      )
      negated_entities = list(
          filter(lambda tok: tok._.negex, nlp_doc.ents)
      )
      return {
          "negation_words": len(negation_tokens),
          "negated_entities": len(negated_entities),
      }
  
file_path: responsible-ai-toolbox/nlp_feature_extractors/nlp_feature_extractors/attribute_extractors.py
imports: import pkg_resources
  from negspacy.negation import Negex
  from raiutils.dataset import fetch_dataset
label_desc: Use image node_id 13 for calling a global function with example usage: detect_negation_words_and_entities(nlp_doc) and returns: dict