class_docstr: Class for computing ROUGE-L score for a set of candidate sentences for the MS COCO test set
docstr: Compute ROUGE-L score given one candidate and references for an image
  :param candidate: str : candidate sentence to be evaluated
  :param refs: list of str : COCO reference sentences for the particular image to be evaluated
  :returns score: int (ROUGE-L score for the candidate evaluated against references)
docstr_tok: ["Compute","ROUGE-L","score","given","one","candidate","and","references","for","an","image",":","param","candidate",":","str",":","candidate","sentence","to","be","evaluated",":","param","refs",":","list","of","str",":","COCO","reference","sentences","for","the","particular","image","to","be","evaluated",":","returns","score",":","int","(","ROUGE-L","score","for","the","candidate","evaluated","against","references",")"]
code: def calc_score(self, candidate, refs):
      """
      Compute ROUGE-L score given one candidate and references for an image
      :param candidate: str : candidate sentence to be evaluated
      :param refs: list of str : COCO reference sentences for the particular image to be evaluated
      :returns score: int (ROUGE-L score for the candidate evaluated against references)
      """
      assert len(candidate) == 1
      assert len(refs) > 0
      prec = []
      rec = []
  
      # split into tokens
      token_c = candidate[0].split(" ")
  
      for reference in refs:
          # split into tokens
          token_r = reference.split(" ")
          # compute the longest common subsequence
          lcs = my_lcs(token_r, token_c)
          prec.append(lcs / float(len(token_c)))
          rec.append(lcs / float(len(token_r)))
  
      prec_max = max(prec)
      rec_max = max(rec)
  
      if prec_max != 0 and rec_max != 0:
          score = ((1 + self.beta**2) * prec_max * rec_max) / float(
              rec_max + self.beta**2 * prec_max
          )
      else:
          score = 0.0
      return score
  
imports: import numpy
label_desc: Use image node_id 2 for calling the Rouge obj's underlying member method code with example usage: obj.calc_score(candidate, refs) and returns: score