code: def chunk_finder(current_token, previous_token, tag):
      current_tag = current_token.split("-", 1)[-1]
      previous_tag = previous_token.split("-", 1)[-1]
      if previous_tag != tag:
          previous_tag = "O"
      if current_tag != tag:
          current_tag = "O"
  
      if current_tag != "O" and (
          previous_tag == "O"
          or previous_token
          in ["E-" + tag, "L-" + tag, "S-" + tag, "U-" + tag]
          or current_token in ["B-" + tag, "S-" + tag, "U-" + tag]
      ):
          create_chunk = True
      else:
          create_chunk = False
  
      if previous_tag != "O" and (
          current_tag == "O"
          or previous_token
          in ["E-" + tag, "L-" + tag, "S-" + tag, "U-" + tag]
          or current_token in ["B-" + tag, "S-" + tag, "U-" + tag]
      ):
          pop_out = True
      else:
          pop_out = False
      return create_chunk, pop_out
  
file_path: DeepPavlov/deeppavlov/metrics/fmeasure.py
imports: import itertools
  from collections import OrderedDict
  from itertools import chain
  from logging import getLogger
  import numpy
  from sklearn.metrics import f1_score
  from deeppavlov.core.common.metrics_registry import register_metric
label_desc: Use image node_id 8 for calling a global function with example usage: chunk_finder(current_token, previous_token, tag) and returns: create_chunk,  pop_out