From the course: AI Text Summarization with Hugging Face

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Generating multiple summaries and computing aggregate ROUGE scores

Generating multiple summaries and computing aggregate ROUGE scores - Hugging Face Tutorial

From the course: AI Text Summarization with Hugging Face

Generating multiple summaries and computing aggregate ROUGE scores

Now that we've generated a candidate summary for a single example text and computed the rouge score for that summary, let's do it for a set of articles. We'll generate summaries for 50 articles and compute the aggregate rouge scores across all of these 50 summaries. In the active code cell, I extract the article_text and article_summaries in two different variables. Once again, we'll use the tqdm or taqadum library to show a progress bar. I use a for loop to iterate over the first 50 articles. On line 6, I invoke the summarizer on the article. Once again, no prefix text is required because this model is primarily a summarizer. It doesn't perform other tasks. And I append every summary to the candidate_summaries list. I'm going to speed up this generation of summaries, but it took about 30 minutes when I ran it on Colab on a GPU. Now that we have the summaries, let's compute the aggregate rouge scores across these 50 summaries. Parse in the candidate summaries from the model, the…

Contents