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","'","."]
docstr: Run generation on a set of inputs.
  
  Args:
    inputs: sequence of inputs, following model.input_spec()
    model: optional model to use to generate new examples.
    dataset: optional dataset which the current examples belong to.
    config: optional runtime config.
  
  Returns:
    list of list of new generated inputs, following model.input_spec()
docstr_tok: ["Run","generation","on","a","set","of","inputs",".","Args",":","inputs",":","sequence","of","inputs",",","following","model.input_spec","(",")","model",":","optional","model","to","use","to","generate","new","examples",".","dataset",":","optional","dataset","which","the","current","examples","belong","to",".","config",":","optional","runtime","config",".","Returns",":","list","of","list","of","new","generated","inputs",",","following","model.input_spec","(",")"]
code: def generate_all(
      self,
      inputs: list[_JsonDict],
      model: lit_model.Model,
      dataset: lit_dataset.Dataset,
      config: Optional[_JsonDict] = None,
  ) -> list[list[_JsonDict]]:
      """Run generation on a set of inputs.
  
      Args:
        inputs: sequence of inputs, following model.input_spec()
        model: optional model to use to generate new examples.
        dataset: optional dataset which the current examples belong to.
        config: optional runtime config.
  
      Returns:
        list of list of new generated inputs, following model.input_spec()
      """
      config: _JsonDict = config or {}
      text_fields_to_replace = self._compute_fields_to_replace(
          dataset, config
      )
      return [
          self.generate(
              ex, model, dataset, config, text_fields_to_replace
          )
          for ex in inputs
      ]
  
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 6 for calling the WordReplacer obj's underlying member method code with example usage: obj.generate_all(inputs, model, dataset, config) and returns: unknown