code: def extract_vocab(
      mentions: List[MentionData], filter_stop_words: bool
  ) -> List[str]:
      """
      Extract Head, Lemma and mention string from all mentions to create a list of string vocabulary
      Args:
          mentions:
          filter_stop_words:
  
      Returns:
  
      """
      vocab = set()
      for mention in mentions:
          head = mention.mention_head
          head_lemma = mention.mention_head_lemma
          tokens_str = mention.tokens_str
          if not filter_stop_words:
              vocab.add(head)
              vocab.add(head_lemma)
              vocab.add(tokens_str)
          else:
              if not StringUtils.is_stop(head):
                  vocab.add(head)
              if not StringUtils.is_stop(head_lemma):
                  vocab.add(head_lemma)
              if not StringUtils.is_stop(tokens_str):
                  vocab.add(tokens_str)
      vocab_set = list(vocab)
      return vocab_set
  
file_path: nlp-architect/nlp_architect/models/cross_doc_coref/system/cdc_utils.py
imports: import logging
  import os
  from typing import List
  from nlp_architect.common.cdc.cluster import Clusters
  from nlp_architect.common.cdc.mention_data import MentionData
  from nlp_architect.common.cdc.topics import Topic
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 2 for calling a global function with example usage: extract_vocab(mentions, filter_stop_words) and returns: vocab_set