class_docstr: Generate new examples by replacing words in examples.
  
  Substitutions must be of the form 'foo -> bar, spam -> eggs'.
class_docstr_tok: ["Generate","new","examples","by","replacing","words","in","examples",".","Substitutions","must","be","of","the","form","'foo","-",">","bar",",","spam","-",">","eggs","'","."]
code: def config_spec(self) -> types.Spec:
      return {
          # Requires a substitution string. Include a default.
          SUBSTITUTIONS_KEY: types.TextSegment(
              default="great -> terrible"
          ),
          FIELDS_TO_REPLACE_KEY: types.MultiFieldMatcher(
              spec="input", types=["TextSegment"], select_all=True
          ),
      }
  
file_path: lit/lit_nlp/components/word_replacer.py
imports: from collections.abc import Iterator, Sequence
  import re
  from typing import Optional
  from absl import logging
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
label_desc: Use image node_id 9 for calling the WordReplacer obj's underlying member method code with example usage: obj.config_spec() and returns: dict