code: def merge_phrases(doc: Doc) -> Doc:
      """Transform a spaCy Doc to match the sense2vec format: merge entities
      into one token and merge noun chunks without determiners.
  
      doc (Doc): The document to merge phrases in.
      RETURNS (Doc): The Doc with merged tokens.
      """
      spans = get_phrases(doc)
      spans = filter_spans(spans)
      with doc.retokenize() as retokenizer:
          for span in spans:
              retokenizer.merge(span)
      return doc
  
file_path: sense2vec/sense2vec/util.py
imports: from typing import Union, List, Tuple, Set
  import re
  from spacy.tokens import Doc, Token, Span
  from spacy.util import filter_spans
  from thinc.api import get_array_module
  import catalogue
label_desc: Use image node_id 8 for calling a global function with example usage: merge_phrases(doc) and returns: doc