code: def filter_noun_chunks(
      chunks,
      exclude_pronouns=False,
      exclude_query=None,
      exact_match=False,
  ):
      if exclude_pronouns:
          chunks = [
              np
              for np in chunks
              if (
                  np.lemma_ != "-PRON-"
                  and not all(tok.pos_ == "PRON" for tok in np)
              )
          ]
  
      if exclude_query is not None:
          excl_txt = [exclude_query.lower()]
          filtered_chunks = []
          for chunk in chunks:
              lower_chunk = chunk.text.lower()
              found = False
              for excl in excl_txt:
                  if (
                      not exact_match
                      and (lower_chunk in excl or excl in lower_chunk)
                  ) or lower_chunk == excl:
                      found = True
                      break
              if not found:
                  filtered_chunks.append(chunk)
          chunks = filtered_chunks
  
      return chunks
  
file_path: fairseq/examples/roberta/wsc/wsc_utils.py
imports: import json
  from functools import lru_cache
label_desc: Use image node_id 9 for calling a global function with example usage: filter_noun_chunks(chunks, exclude_pronouns, exclude_query, exact_match) and returns: chunks