code: def test_highlighter(resources_path):
      with (resources_path / "visual/snippet.txt").open() as f:
          sentences = [x for x in f.read().split("\n") if x]
  
      embeddings = FlairEmbeddings("news-forward")
  
      features = embeddings.lm.get_representation(
          sentences[0], "", ""
      ).squeeze()
  
      Highlighter().highlight_selection(
          features,
          sentences[0],
          n=1000,
          file_=str(resources_path / "visual/highligh.html"),
      )
  
      # clean up directory
      (resources_path / "visual/highligh.html").unlink()
  
file_path: flair/tests/test_visual.py
imports: from flair.data import Sentence, Span, Token
  from flair.embeddings import FlairEmbeddings
  from flair.visual import Highlighter
  from flair.visual.ner_html import HTML_PAGE, PARAGRAPH, TAGGED_ENTITY, render_ner_html
  from flair.visual.training_curves import Plotter
label_desc: Use image node_id 1 for calling a global function with example usage: test_highlighter(resources_path) without return types