Implementing ROUGE Score

Text Generation & NLP Evaluation DS practice problem on Onlearn.

Difficulty: medium.

Topics: Implementing ROUGE Score, ROUGE-N Precision, ROUGE-L Longest Common Subsequence, Recall-Oriented Understudy, Stemming and Tokenization, F-measure Calculation, Natural Language Processing, Information Retrieval, Statistical Evaluation Metrics, Software Engineering for ML, Computational Linguistics, Text Summarization Evaluation, N-gram Analysis, String Matching Algorithms, Performance Benchmarking, Sequence Alignment.

Implement the ROUGE 1 (Recall Oriented Understudy for Gisting Evaluation) score to evaluate the quality of a generated summary by comparing it to a reference summary. ROUGE 1 focuses on unigram (single word) overlaps between the candidate and reference texts. Your task is to write a function that computes the ROUGE 1 recall, precision, and F1 score based on the number of overlapping unigrams.