code: def _replace_stopwords(
      text: str, words: Set[str], symbol: str = " "
  ) -> str:
      """
      Remove words in a set from a string, replacing them with a symbol.
  
      Parameters
      ----------
      text: str
  
      stopwords : Set[str]
          Set of stopwords string to remove.
  
      symbol: str, optional, default=" "
          Character(s) to replace words with.
  
      Examples
      --------
      >>> from texthero.preprocessing import _replace_stopwords
      >>> s = "the book of the jungle"
      >>> symbol = "$"
      >>> stopwords = ["the", "of"]
      >>> _replace_stopwords(s, stopwords, symbol)
      '$ book $ $ jungle'
  
      """
  
      pattern = r"""(?x)                          # Set flag to allow verbose regexps
        \w+(?:-\w+)*                              # Words with optional internal hyphens 
        | \s*                                     # Any space
        | [][!"#$%&'*+,-./:;<=>?@\\^():_`{|}~]    # Any symbol 
      """
  
      return "".join(
          t if t not in words else symbol
          for t in re.findall(pattern, text)
      )
  
imports: from gensim.models.phrases import Phrases
  import re
  import string
  from typing import Optional, Set
  import unicodedata
  import numpy
  import pandas
  from texthero._types import TokenSeries, TextSeries, InputSeries
  from typing import List, Callable, Union
  import warnings
label_desc: Use image node_id 10 for calling a global function with example usage: _replace_stopwords(text, words, symbol) and returns: str