class_docstr: Dummy-valued seq2seq salience, for testing.
class_docstr_tok: ["Dummy-valued","seq2seq","salience",",","for","testing","."]
docstr: Compute salience matrix based on Levenshtein similarity.
docstr_tok: ["Compute","salience","matrix","based","on","Levenshtein","similarity","."]
code: def _dummy_sequence_salience(
      self, source_tokens: list[str], target_tokens: list[str]
  ):
      """Compute salience matrix based on Levenshtein similarity."""
      all_input_tokens = source_tokens + target_tokens
      smat = np.zeros([len(target_tokens), len(all_input_tokens)])
      for i, out_tok in enumerate(target_tokens):
          for j, in_tok in enumerate(
              all_input_tokens[: len(source_tokens) + i]
          ):
              smat[i, j] = 1.0 / (
                  Levenshtein.distance(out_tok, in_tok) + 1.0
              )
      return smat
  
file_path: lit/lit_nlp/components/sequence_salience.py
imports: from typing import Optional
  import Levenshtein
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import dtypes
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
  import numpy
label_desc: Use image node_id 2 for calling the DummySequenceSalience obj's underlying member method code with example usage: obj._dummy_sequence_salience(source_tokens, target_tokens) and returns: smat