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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Accessing the BBC dataset on Google Drive3m 34s
-
(Locked)
Instantiating and cleaning the BBC News summaries dataset3m 48s
-
(Locked)
Generating summaries using Pegasus4m 55s
-
(Locked)
Generating multiple summaries and computing aggregate ROUGE scores2m 49s
-
(Locked)
Generating summaries using BART3m 19s
-
(Locked)
Computing ROUGE metrics for a set of summaries2m 9s
-
(Locked)
-