code: def check_if_nlp_feature(X: Series) -> bool:
      type_family = get_type_family_raw(X.dtype)
      if type_family != "object":
          return False
      if len(X) > 5000:
          # Sample to speed-up type inference
          X = X.sample(n=5000, random_state=0)
      X_unique = X.unique()
      num_unique = len(X_unique)
      num_rows = len(X)
      unique_ratio = num_unique / num_rows
      if unique_ratio <= 0.01:
          return False
      try:
          avg_words = Series(X_unique).str.split().str.len().mean()
      except AttributeError:
          return False
      if avg_words < 3:
          return False
  
      return True
  
file_path: autogluon/common/src/autogluon/common/features/infer_types.py
imports: import logging
  from collections import defaultdict
  from typing import List
  import numpy
  import pandas
  from pandas import DataFrame, Series
label_desc: Use image node_id 11 for calling a global function with example usage: check_if_nlp_feature(X) and returns: True, False, False, False, False