Skip to main content

Command Palette

Search for a command to run...

What is text Summarization?

Hands-on text summarization using Huggingface Transformers Library

Updated
2 min read
P

🚀 I'm a Top Rated Plus NLP freelancer on Upwork with over $300K in earnings and a 100% Job Success rate. This journey began in 2022 after years of enriching experience in the field of Data Science. 📚 Starting my career in 2013 as a Software Developer focusing on backend and API development, I soon pursued my interest in Data Science by earning my M.Tech in IT from IIIT Bangalore, specializing in Data Science (2016 - 2018). 💼 Upon graduation, I carved out a path in the industry as a Data Scientist at MiQ (2018 - 2020) and later ascended to the role of Lead Data Scientist at Oracle (2020 - 2022). 🌐 Inspired by my freelancing success, I founded FutureSmart AI in September 2022. We provide custom AI solutions for clients using the latest models and techniques in NLP. 🎥 In addition, I run AI Demos, a platform aimed at educating people about the latest AI tools through engaging video demonstrations. 🧰 My technical toolbox encompasses: 🔧 Languages: Python, JavaScript, SQL. 🧪 ML Libraries: PyTorch, Transformers, LangChain. 🔍 Specialties: Semantic Search, Sentence Transformers, Vector Databases. 🖥️ Web Frameworks: FastAPI, Streamlit, Anvil. ☁️ Other: AWS, AWS RDS, MySQL. 🚀 In the fast-evolving landscape of AI, FutureSmart AI and I stand at the forefront, delivering cutting-edge, custom NLP solutions to clients across various industries.

Text summarization is the process of reducing a text document to its most important points.

The summary can be generated by extracting information from the text document or abstracting it.

The types of text summarization include extractive and abstractive summarization.

  1. Extractive summarization involves selecting and extracting information from the text document to form the summary.
  2. Conversely, Abstractive summarization involves generating a new summary based on the text document's information.

Applications of text summarization include generating summaries of news articles, emails, and other text documents. Summaries can also be generated from web pages, websites, and books.

It can generate customer feedback or reviews or create text summaries from social media posts.

Text Summarization code example using Huggingface Transformers Library

from transformers import pipeline

summarizer = pipeline("summarization",device=0)
text = """
    America has changed dramatically during recent years. Not only has the number of 
    graduates in traditional engineering disciplines such as mechanical, civil, 
    electrical, chemical, and aeronautical engineering declined, but in most of 
    the premier American universities engineering curricula now concentrate on 
    and encourage largely the study of engineering science. As a result, there 
    are declining offerings in engineering subjects dealing with infrastructure, 
    the environment, and related issues, and greater concentration on high 
    technology subjects, largely supporting increasingly complex scientific 
    developments. While the latter is important, it should not be at the expense 
    of more traditional engineering.
"""
summarizer(text, max_length=30, min_length=10)
[{'summary_text': ' America has changed dramatically during recent years . There are declining offerings in engineering subjects dealing with infrastructure,  the environment, and related issues .'}]

Learn How to use Hugging face Transformers Library

Looking to get started with using the transformers library from Hugging Face? Check out this video explaining how to perform various tasks like

  1. Classification
  2. Question Answering
  3. NER
  4. Summarization
  5. Text Generation

NLP Beginner to Advanced Playlist

This playlist is for you if you want to get started with NLP or level up your skills.

It covers everything from basic text classification to deploying a fine-tuned transformer model on AWS. And it's all delivered in a hands-on, code-along format.

More from this blog

Building Custom NLP Solutions using state of the art NLP models | FutureSmart AI

108 posts

FutureSmart AI provides custom Natural Language Processing (NLP) solutions.