code: def _lcs(x, y):
      """Computes the length of the LCS between two seqs.
  
      The implementation below uses a DP programming algorithm and runs
      in O(nm) time where n = len(x) and m = len(y).
      Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
  
      Args:
        x: collection of words
        y: collection of words
  
      Returns:
        Table of dictionary of coord and len lcs
      """
      n, m = len(x), len(y)
      table = {}
      for i in range(n + 1):
          for j in range(m + 1):
              if i == 0 or j == 0:
                  table[i, j] = 0
              elif x[i - 1] == y[j - 1]:
                  table[i, j] = table[i - 1, j - 1] + 1
              else:
                  table[i, j] = max(table[i - 1, j], table[i, j - 1])
      return table
  
file_path: tensor2tensor/tensor2tensor/utils/rouge.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: _lcs(x, y) and returns: table