def rouge_l_summary_level(evaluated_sentences, reference_sentences):
if len(evaluated_sentences) <= <NUM_LIT:0> or len(reference_sentences) <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>m = len(set(_split_into_words(reference_sentences)))<EOL>n = len(set(_split_into_words(evaluated_sentences)))<EOL>union_lcs_sum_across_all_references = <NUM_LIT:0><EOL>union = set()<EOL>for ref_s in reference_sentences:<EOL><INDENT>lcs_count, union = _union_lcs(evaluated_sentences,<EOL>ref_s,<EOL>prev_union=union)<EOL>union_lcs_sum_across_all_references += lcs_count<EOL><DEDENT>llcs = union_lcs_sum_across_all_references<EOL>r_lcs = llcs / m<EOL>p_lcs = llcs / n<EOL>beta = p_lcs / (r_lcs + <NUM_LIT>)<EOL>num = (<NUM_LIT:1> + (beta**<NUM_LIT:2>)) * r_lcs * p_lcs<EOL>denom = r_lcs + ((beta**<NUM_LIT:2>) * p_lcs)<EOL>f_lcs = num / (denom + <NUM_LIT>)<EOL>return {"<STR_LIT:f>": f_lcs, "<STR_LIT:p>": p_lcs, "<STR_LIT:r>": r_lcs}<EOL>
Computes ROUGE-L (summary level) of two text collections of sentences.
http://research.microsoft.com/en-us/um/people/cyl/download/papers/
rouge-working-note-v1.3.1.pdf

Calculated according to:
R_lcs = SUM(1, u)[LCS<union>(r_i,C)]/m
P_lcs = SUM(1, u)[LCS<union>(r_i,C)]/n
F_lcs = ((1 + beta^2)*R_lcs*P_lcs) / (R_lcs + (beta^2) * P_lcs)

where:
SUM(i,u) = SUM from i through u
u = number of sentences in reference summary
C = Candidate summary made up of v sentences
m = number of words in reference summary
n = number of words in candidate summary

Args:
  evaluated_sentences: The sentences that have been picked by the
                       summarizer
  reference_sentence: One of the sentences in the reference summaries

Returns:
  A float: F_lcs

Raises:
  ValueError: raises exception if a param has len <= 0