YouTube2Text

How to Build a Text Summarizer using Huggingface Transformers | Turingtalks — Transcript

by TuringTalks · 1,088 words · 164 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hello guys welcome to this channel in
  2. 0:02today's video we're going to see how to
  3. 0:04build a tech summarizer using hugging
  4. 0:06phas
  5. 0:07Transformers so in this video I'll walk
  6. 0:09you through what a summarizer is its use
  7. 0:11cases what huging face Transformers are
  8. 0:14and how you can build your own text
  9. 0:15summarizer using huging face
  10. 0:16Transformers Library so let's get
  11. 0:19started a summarizer does exactly what
  12. 0:21the name suggests it takes a large block
  13. 0:24of text and condenses it into a shorter
  14. 0:26version so this shorter version keeps
  15. 0:28only the key points think think of it as
  16. 0:30the difference between reading a whole
  17. 0:31novel and glancing at its back cover so
  18. 0:34the aim is to save time while still
  19. 0:36getting the essence of the content now
  20. 0:38where do we use the summarizer for
  21. 0:40example journalists use them to quickly
  22. 0:42sift through reports and studies
  23. 0:44students can use them to summarize
  24. 0:46lengthy readings businesses can use them
  25. 0:48to condense market analysis or lengthy
  26. 0:50reports in essence anyone who needs to
  27. 0:53process large amounts of text can
  28. 0:55quickly benefit from a
  29. 0:57summarizer now what are hugin phace
  30. 0:58Transformers hugging face is a company
  31. 1:01that has created a state-of-the-art
  32. 1:03platform for natural language processing
  33. 1:05they have a library called the
  34. 1:07Transformers Library it is like a
  35. 1:09treasure toe for NLP tasks it includes
  36. 1:11pre-train models that can do everything
  37. 1:13from translation sentiment analysis and
  38. 1:15yes summarization so these models have
  39. 1:18learned from vast amounts of text and
  40. 1:20can understand and generate language in
  41. 1:21a surprisingly human-like way so we
  42. 1:23don't have to do a lot of the training
  43. 1:24in these models these are pre-trained
  44. 1:26models that we can take them and even
  45. 1:28fine-tune them to use it for our needs
  46. 1:31now let's see how we can build a
  47. 1:33summarizer using the hugging face
  48. 1:34Transformers model for this example we
  49. 1:37will be using Facebook's Bart model so
  50. 1:39Bart model is a pre-trained model on the
  51. 1:42English language so it is a sequence to
  52. 1:44sequence model and it is great for uh
  53. 1:45text generation for example
  54. 1:47summarization translation but it also
  55. 1:49works well for comprehension tasks like
  56. 1:51text classification question answering
  57. 1:53and so many others so a sequence to
  58. 1:54sequence model is where you input a
  59. 1:56sequence and it outputs a sequence for
  60. 1:58example Chach PT Hing Fai also has a
  61. 2:01concept called pipelines so pipelines
  62. 2:03offer a simpler approach to implementing
  63. 2:05various tasks so instead of preparing a
  64. 2:07data set training it with the model and
  65. 2:08then using it pipeline simplifies the
  66. 2:10code because it HIDs away a lot of the
  67. 2:13manual work uh like tokenization and
  68. 2:15model customization and you can just get
  69. 2:17started working with the model so we
  70. 2:18will be using a Google collab notebook
  71. 2:20for this project you can also find a
  72. 2:22link for the finished project in the
  73. 2:23description below so let's open the
  74. 2:25notebook and let's first install
  75. 2:27Transformers so installing Transformers
  76. 2:29will be a sh command whereas colloud
  77. 2:31notebooks read python so we will add an
  78. 2:33exclamation mark at the beginning so pip
  79. 2:35install Transformers let's wait for the
  80. 2:38Transformers library to be installed
  81. 2:40great Transformers library is now
  82. 2:42installed so now let's initialize a text
  83. 2:45summarization by bline using the huging
  84. 2:47face Transformers Library here I'll be
  85. 2:49typing summarizer equal to by blind
  86. 2:51summarizer model Facebook but L CNN so
  87. 2:54let's see what each part does the
  88. 2:57pipeline is a function provided by the
  89. 2:58huging face Transformers SL to make it
  90. 3:00easy to apply different types of natural
  91. 3:02language processing tasks so the
  92. 3:04function returns a ready to use pipeline
  93. 3:06object for the specified tasks
  94. 3:08summarization is the first argument we
  95. 3:09are telling the pipeline that task that
  96. 3:11we are going to perform is summarization
  97. 3:13and the model here is going to be
  98. 3:15Facebook's bot so we'll be using
  99. 3:17facebook/ bot CNN so this argument
  100. 3:20specifies the pre-train model that will
  101. 3:23be used for this project for this
  102. 3:24summarization task is Facebook's B Cloud
  103. 3:28CNN so this mod is provided by Facebook
  104. 3:30and it is placed on the bot model bot
  105. 3:32architecture which is effective for uh
  106. 3:34General NLP tasks so let's execute the
  107. 3:37code how creates a summarizer object so
  108. 3:39this object can be used to perform text
  109. 3:41summarization by passing Text data to it
  110. 3:44the model will generate a shorter
  111. 3:45version of the input text and it will
  112. 3:47capture the most important or relevant
  113. 3:49information according to its training on
  114. 3:50the summarization tasks so yeah we are
  115. 3:52now ready to use the model uh that's all
  116. 3:55it takes to build a summarization model
  117. 3:57using hugging the face pipeline so you
  118. 3:58can see how easy it is to build build
  119. 4:00NLP models using hugging face
  120. 4:02Transformers so we will fetch an anal
  121. 4:04report from FDA here it
  122. 4:06is so let's copy the text and create a
  123. 4:10variable called text and put in our text
  124. 4:13now let's use this text as input and
  125. 4:14call our summarizer here I'll be writing
  126. 4:16summarizer equal to summarizer text Max
  127. 4:18length Min length and do
  128. 4:22sample this line of code is using the
  129. 4:24summarizer object created from a hugging
  130. 4:26face pipeline to generate a summary of
  131. 4:28the input text so summarizer is the
  132. 4:30object initialized previously with the
  133. 4:32bip planine function the text we have
  134. 4:34already declared we setting the Max and
  135. 4:36Min length so the max length specifies
  136. 4:39the maximum length uh obviously and uh
  137. 4:42it'll be in terms of the number of
  138. 4:43tokens it's not the number of characters
  139. 4:45it's the number of tokens and the Min
  140. 4:46length is also the minimum length of the
  141. 4:48summary so we don't want the summary to
  142. 4:50be too short so now we can go ahead and
  143. 4:53print the summary and here's the
  144. 4:55response so in short this code loads a
  145. 4:57summarization pipeline that is
  146. 4:58preconfigured to use the Facebook B
  147. 5:00model feeds the text to A summarizer
  148. 5:03outputs a summary with a specified
  149. 5:04minimum and maximum length so you can
  150. 5:06see how easy it is to work with the
  151. 5:08hugging face Transformers Library there
  152. 5:10are many other features or NLP functions
  153. 5:13that are offered by hugging face
  154. 5:14Transformers Library so I'll be posting
  155. 5:16more videos on those topics if you want
  156. 5:18to get daily AI tutorials we have a
  157. 5:21newsletter called touring talks you can
  158. 5:23find the newsletter at during talks. you
  159. 5:26can also subscribe to this channel to
  160. 5:28get notified when we post new videos
  161. 5:30thanks for watching if you have any
  162. 5:32questions please let us know in the
  163. 5:33comments see you soon with a new topic
  164. 5:35cheers

About this transcript

This page contains the full transcript of How to Build a Text Summarizer using Huggingface Transformers | Turingtalks by TuringTalks, generated from the public captions YouTube serves with the video. The transcript has 1,088 words across 164 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.