NLP - make summarization from each subtitle

43 Views Asked by At

I am very new to NLP. I'm trying to build simple text summarization model where it takes 1-2 important sentence from each subtitle in an article. For example, in the image I want take 1 sentence from "Urge to clear throat", "Viruses", and "Smoking" sections, and then combine them to make a summarization of the article. Can someone recommend me the best way to do that? Thank you in advance.

Article example

So far I only know how to make text summarization using BERT, but it didn't summarize from each sub-title.

1

There are 1 best solutions below

0
Daremitsu On

You can use the TextSummarizer model from arcgis to generate summary for a given text. These models have been fine-tuned on summarization task.

Sample code to instantiate the model object and summarize a given text.

from arcgis.learn.text import TextSummarizer
summarizer = TextSummarizer()
summary_text = """
This deep learning model is used to extract building footprints from high resolution (30-50 cm) satellite imagery. 
Building footprint layers are useful in preparing base maps and analysis workflows for urban planning and development, 
insurance, taxation, change detection, infrastructure planning and a variety of other applications.
Digitizing building footprints from imagery is a time consuming task and is commonly done by digitizing features 
manually. Deep learning models have a high capacity to learn these complex workflow semantics and can produce 
superior results. Use this deep learning model to automate this process and reduce the time and effort required 
for acquiring building footprints.
"""

summarizer.summarize(summary_text, max_length=100)

100.00% [1/1 00:02<00:00]

[{'summary_text': ' This deep learning model is used to extract building footprints from high resolution (30-50 cm) satellite imagery . Building footprint layers are useful in preparing base maps and analysis workflows for urban planning and development, insurance, taxation, change detection, infrastructure planning and a variety of other applications .'}]

Install arcgis and its deep learning dependencies before proceeding.