From the course: Hands-On Generative AI: Applying Your Tabular Data With ChatGPT, GPT-4, and LangChain

Unlock the full course today

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

Text summarization with a focus

Text summarization with a focus

- [Instructor] Time is limited. Summarization in natural language processing is like having a magical assistant who can tell you the essential details of a long text in just a few sentences. Summarization can be targeted at different audiences with a different focus. Let's explore summarization with some real life examples. Click upload button on top left to upload data file. Fictitious movie data. You can find this data in the exercise file. Fictitious movie data. Load the data to a pandas data frame. Let's check the first few rows. There are movie titles, descriptions, directors, ratings, reviews, and the synopsis. We can see that the synopsis is lengthy. Our goal is to summarize a long synopsis to a shorter, easy to digest version. First, import the libraries from langchain. There are LLMChain, PromptTemplate, and the chat model, ChatOpenAI. Second, create a prompt template to give instructions to the AI model.…

Contents