class_docstr: Searching by similarity.
class_docstr_tok: ["Searching","by","similarity","."]
docstr: Find similar examples for an example/model/dataset.
docstr_tok: ["Find","similar","examples","for","an","example\/model\/dataset","."]
code: def generate(  # pytype: disable=signature-mismatch  # overriding-parameter-type-checks
      self,
      example: types.Input,
      model: lit_model.Model,
      dataset: lit_dataset.IndexedDataset,
      config: Optional[JsonDict] = None,
  ) -> list[JsonDict]:
      """Find similar examples for an example/model/dataset."""
      model_name = config["model_name"]
      dataset_name = config["dataset_name"]
      embedding_name = config["Embedding Field"]
      embedding = self._get_embedding(example, model, embedding_name)
      neighbors = self._find_nn(
          model_name, dataset_name, embedding_name, embedding
      )
      return neighbors
  
file_path: lit/lit_nlp/components/similarity_searcher.py
imports: from typing import Optional
  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.components import index
  from lit_nlp.lib import utils
label_desc: Use image node_id 5 for calling the SimilaritySearcher obj's underlying member method code with example usage: obj.generate(example, model, dataset, config) and returns: neighbors