code: def find_merge_index(token_tags, indices=None):
      merge_indices = []
      if indices is None:
          indices = range(len(token_tags) - 1)
      for i in indices:
          cur_tag = token_tags[i]
          next_tag = token_tags[i + 1]
          if cur_tag == "NOUN" and next_tag == "NOUN":
              merge_indices.append(i)
          elif cur_tag == "ADJ" and next_tag in [
              "NOUN",
              "NUM",
              "ADJ",
              "ADV",
          ]:
              merge_indices.append(i)
          elif cur_tag == "ADV" and next_tag in ["ADJ", "VERB"]:
              merge_indices.append(i)
          elif cur_tag == "VERB" and next_tag in [
              "ADV",
              "VERB",
              "NOUN",
              "ADJ",
          ]:
              merge_indices.append(i)
          elif cur_tag == "DET" and next_tag in ["NOUN", "ADJ"]:
              merge_indices.append(i)
          elif cur_tag == "PRON" and next_tag in ["NOUN", "ADJ"]:
              merge_indices.append(i)
          elif cur_tag == "NUM" and next_tag in ["NUM", "NOUN"]:
              merge_indices.append(i)
      return merge_indices
  
file_path: TextAttack/textattack/transformations/word_merges/word_merge_masked_lm.py
imports: import re
  import torch
  from transformers import AutoModelForMaskedLM, AutoTokenizer
  from textattack.shared import utils
  from textattack.transformations.transformation import Transformation
label_desc: Use image node_id 1 for calling a global function with example usage: find_merge_index(token_tags, indices) and returns: merge_indices