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 _compute_fields_to_replace(
      self, dataset: lit_dataset.Dataset, config: _JsonDict
  ) -> Sequence[str]:
      fields_to_replace: tuple[str] = tuple(
          config.get(FIELDS_TO_REPLACE_KEY, [])
      )
      if not fields_to_replace:
          return []
  
      text_fields = utils.find_spec_keys(
          dataset.spec(), types.TextSegment
      )
      return [key for key in text_fields if key in fields_to_replace]
  
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 8 for calling the WordReplacer obj's underlying member method code with example usage: obj._compute_fields_to_replace(dataset, config) and returns: unknown, list