{"id":2336,"date":"2024-09-26T13:00:23","date_gmt":"2024-09-26T18:00:23","guid":{"rendered":"https:\/\/www.rodaportal.net\/?p=2336"},"modified":"2024-09-26T13:05:40","modified_gmt":"2024-09-26T18:05:40","slug":"build_your_own_chatbot_app_for_pdf_summarization","status":"publish","type":"post","link":"https:\/\/www.rodaportal.net\/?p=2336","title":{"rendered":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App &#8211; Code Provided!"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"youtube-embed\" data-video_id=\"yq803m5ESXI\"><iframe loading=\"lazy\" title=\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/yq803m5ESXI?feature=oembed&#038;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>In the field of science and artificial intelligence utilizing language models (LLMs) has gained traction. This article will walk you through the steps of creating a Streamlit application that utilizes OpenAIs API to summarize PDF files and respond to inquiries based on their content. By the conclusion of this tutorial you&#8217;ll possess a working chatbot application capable of managing PDF documents.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting Started<\/h2>\n\n\n\n<p>Before we jump into the code let&#8217;s talk about the libraries and tools required to build your PDF summarization and question answering application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Required Libraries<\/h3>\n\n\n\n<p>To get started you&#8217;ll need to set up a few libraries.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>PDFPlumber:<\/strong> This library helps in extracting text from PDF files.<\/li>\n\n\n\n<li><strong>OpenAI:<\/strong> This is the API that allows you to interact with the OpenAI models, such as ChatGPT.<\/li>\n\n\n\n<li><strong>Streamlit:<\/strong> This library helps you create web applications using Python.<\/li>\n\n\n\n<li><strong>Pillow:<\/strong> This library is used for image processing if you want to include images in your app.<\/li>\n<\/ul>\n\n\n\n<p>You can install these libraries by using the command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install pdfplumber openai streamlit pillow<\/code><\/pre>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2F9b10e76a-f485-482b-8913-8230ce5b6b08.webp?alt=media&amp;token=3089601a-f733-472b-aabe-40b0f96243ca\" alt=\"Installing required libraries\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting Up the OpenAI API Key<\/h2>\n\n\n\n<p>Now it&#8217;s time to configure your OpenAI API key. This key is crucial for sending requests to the OpenAI API. If you haven&#8217;t registered an account with OpenAI you can sign up and obtain your API key through their platform.<\/p>\n\n\n\n<p>After obtaining your API key you can incorporate it into your application code as demonstrated below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import openai\n\nopenai.api_key = 'YOUR_API_KEY'<\/code><\/pre>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2F900ab2c4-7121-400a-b35f-25897cff0dcb.webp?alt=media&amp;token=40f910e0-42df-4afe-bc47-971e6bce1f3b\" alt=\"Setting up OpenAI API key\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Extracting Text from PDF Files<\/h2>\n\n\n\n<p>Now, let&#8217;s develop a function that can pull out text from a PDF document. We&#8217;ll utilize the PDFPlumber library for this task. The function will go through the PDF file one page at a time and provide the extracted text as output.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pdfplumber\n\ndef extract_text_from_pdf(pdf_path):\n    text = \"\"\n    with pdfplumber.open(pdf_path) as pdf:\n        for page in pdf.pages:\n            text += page.extract_text() + \"\\n\"\n    return text<\/code><\/pre>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2Ff4739daa-e5f9-446f-aa0c-505afe962b90.webp?alt=media&amp;token=3951601e-1ae4-40b3-bd9a-e218cb875314\" alt=\"Extracting text from PDF\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summarizing the Extracted Text<\/h2>\n\n\n\n<p>Next up well be developing a function that leverages the OpenAI API to condense the extracted content. This function will transmit the text to the OpenAI model and provide a summarized version in return.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def summarize_text(text):\n    response = openai.ChatCompletion.create(\n        model=\"gpt-3.5-turbo\",\n        messages=&#91;\n            {\"role\": \"system\", \"content\": \"You are a helpful assistant that summarizes text.\"},\n            {\"role\": \"user\", \"content\": f\"Summarize the following text: {text}\"}\n        ],\n        max_tokens=300,\n        temperature=0.5\n    )\n    return response.choices&#91;0].message&#91;'content']<\/code><\/pre>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2F0c358def-1947-4f8d-9e5d-4aad913d966d.webp?alt=media&amp;token=0ed5cfc0-9c67-41d9-b0fa-dc0955577ecb\" alt=\"Summarizing text using OpenAI API\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Asking Questions about the PDF<\/h2>\n\n\n\n<p>To enhance the interactivity of our application we plan to implement a feature that enables users to inquire about the information contained in the PDF. This feature will utilize the text and the users query to generate a response using the OpenAI model.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def ask_question(text, question):\n    response = openai.ChatCompletion.create(\n        model=\"gpt-3.5-turbo\",\n        messages=&#91;\n            {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n            {\"role\": \"user\", \"content\": f\"Based on the following text, answer this question: {question} Text: {text}\"}\n        ],\n        max_tokens=300,\n        temperature=0.5\n    )\n    return response.choices&#91;0].message&#91;'content']<\/code><\/pre>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2Fc48c8bf7-f138-462b-9c22-dc9da15d6033.webp?alt=media&amp;token=265c5cde-e2a8-4a4c-871f-144bf3f130f3\" alt=\"Asking questions about the PDF\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating the Streamlit Application<\/h2>\n\n\n\n<p>With our functions prepared its time to build the Streamlit application. Well start by setting the title then implement a file uploader for the PDF format. Additionally well include buttons for generating summaries and posing questions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import streamlit as st\n\nst.title(\"PDF Summarization and Question Answering Chatbot\")\n\nuploaded_file = st.file_uploader(\"Choose a PDF file\", type=\"pdf\")\n\nif uploaded_file is not None:\n    text = extract_text_from_pdf(uploaded_file)\n    st.subheader(\"Text Extracted from PDF\")\n    st.text_area(\"Extracted Text\", text, height=300)\n\n    if st.button(\"Summarize Text\"):\n        summary = summarize_text(text)\n        st.subheader(\"Summary\")\n        st.write(summary)\n\n    question = st.text_input(\"Ask a question about the text\")\n    if st.button(\"Get Answer\"):\n        answer = ask_question(text, question)\n        st.subheader(\"Answer\")\n        st.write(answer)<\/code><\/pre>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2F1f3ab535-e93a-439d-a679-d7258e3b76bd.webp?alt=media&amp;token=9d6b6a4f-ef0c-4ab2-8075-72cdb016f678\" alt=\"Creating the Streamlit app\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Deploying the Streamlit App<\/h2>\n\n\n\n<p>Once you&#8217;ve built the application you can execute it by using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>streamlit run your_app.py<\/code><\/pre>\n\n\n\n<p>By running this command you will initiate a server and access your application through the web browser.<img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2F03fcaffd-26a6-49ff-957c-5339d3973bdf.webp?alt=media&amp;token=d1fde1f9-0e0d-4087-bf13-f7f44963769a\" alt=\"Deploying the Streamlit app\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing the App<\/h2>\n\n\n\n<p>Once your application is up and running you can test it out by uploading a PDF document summarizing what it says and asking questions based on it. Be sure to experiment with PDF files to gauge its performance!<img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FabZb3eTt2t1fjDgGYw14%2Fscreenshots%2Fe07de490-2ba1-416e-b23b-fd084a74d9bb.webp?alt=media&amp;token=42dc46f9-b931-4ed4-8fa1-15f486c589cf\" alt=\"Testing the Streamlit app\" width=\"100%\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Well done! You&#8217;ve created a chatbot app that summarizes PDF files and responds to queries about their content using Python, OpenAIs API and Streamlit. You&#8217;re encouraged to experiment with and customize the code to improve your app even more.<\/p>\n\n\n\n<p>If you have any inquiries or suggestions feel free to drop a comment below. Enjoy your coding journey!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the field of science and artificial intelligence utilizing language models (LLMs) has gained traction. This article will walk you through the steps of creating a Streamlit application that utilizes OpenAIs API to summarize PDF files and respond to inquiries based on their content. By the conclusion of this tutorial you&#8217;ll possess a working chatbot [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2950],"tags":[2955,2959,2958,2952,2956,2957,2953,2951,2954],"class_list":{"0":"post-2336","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data_analytics_101","8":"tag-ai","9":"tag-build-a-chat-bot-app","10":"tag-chat-gpt-and-python","11":"tag-chatbot","12":"tag-chatgpt","13":"tag-gpt-ai","14":"tag-pdf","15":"tag-python","16":"tag-streamlit"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided! - Rodaportal<\/title>\n<meta name=\"description\" content=\"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/18.220.63.61\/?p=2336\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!\" \/>\n<meta property=\"og:description\" content=\"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/18.220.63.61\/?p=2336\" \/>\n<meta property=\"og:site_name\" content=\"Rodaportal\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Rodaportal\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-26T18:00:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-26T18:05:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/09\/image.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Rodaportal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!\" \/>\n<meta name=\"twitter:description\" content=\"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/09\/image.webp\" \/>\n<meta name=\"twitter:creator\" content=\"@RodaPP1\" \/>\n<meta name=\"twitter:site\" content=\"@RodaPP1\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rodaportal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336\"},\"author\":{\"name\":\"Rodaportal\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/person\\\/1ed067be473943abefead5f395f0bf70\"},\"headline\":\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App &#8211; Code Provided!\",\"datePublished\":\"2024-09-26T18:00:23+00:00\",\"dateModified\":\"2024-09-26T18:05:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336\"},\"wordCount\":567,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\"},\"image\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image.webp\",\"keywords\":[\"AI\",\"build a Chat-bot App\",\"Chat GPT and Python\",\"Chatbot\",\"chatgpt\",\"gpt ai\",\"PDF\",\"Python\",\"Streamlit\"],\"articleSection\":[\"Data Analytics 101\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/18.220.63.61\\\/?p=2336#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336\",\"url\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336\",\"name\":\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided! - Rodaportal\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#primaryimage\"},\"image\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image.webp\",\"datePublished\":\"2024-09-26T18:00:23+00:00\",\"dateModified\":\"2024-09-26T18:05:40+00:00\",\"description\":\"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/18.220.63.61\\\/?p=2336\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#primaryimage\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image.webp\",\"contentUrl\":\"https:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/image.webp\",\"width\":1280,\"height\":720,\"caption\":\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2336#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rodaportal.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App &#8211; Code Provided!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#website\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/\",\"name\":\"Rodaportal\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rodaportal.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\",\"name\":\"Rodaportal\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"http:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/imageedit_1_9835162131.png\",\"contentUrl\":\"http:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/imageedit_1_9835162131.png\",\"width\":112,\"height\":112,\"caption\":\"Rodaportal\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Rodaportal\",\"https:\\\/\\\/x.com\\\/RodaPP1\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/person\\\/1ed067be473943abefead5f395f0bf70\",\"name\":\"Rodaportal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"caption\":\"Rodaportal\"},\"sameAs\":[\"http:\\\/\\\/www.rodaportal.net\"],\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided! - Rodaportal","description":"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/18.220.63.61\/?p=2336","og_locale":"en_US","og_type":"article","og_title":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!","og_description":"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.","og_url":"http:\/\/18.220.63.61\/?p=2336","og_site_name":"Rodaportal","article_publisher":"https:\/\/www.facebook.com\/Rodaportal","article_published_time":"2024-09-26T18:00:23+00:00","article_modified_time":"2024-09-26T18:05:40+00:00","og_image":[{"width":1280,"height":720,"url":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/09\/image.webp","type":"image\/webp"}],"author":"Rodaportal","twitter_card":"summary_large_image","twitter_title":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!","twitter_description":"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.","twitter_image":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/09\/image.webp","twitter_creator":"@RodaPP1","twitter_site":"@RodaPP1","twitter_misc":{"Written by":"Rodaportal","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/18.220.63.61\/?p=2336#article","isPartOf":{"@id":"http:\/\/18.220.63.61\/?p=2336"},"author":{"name":"Rodaportal","@id":"https:\/\/www.rodaportal.net\/#\/schema\/person\/1ed067be473943abefead5f395f0bf70"},"headline":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App &#8211; Code Provided!","datePublished":"2024-09-26T18:00:23+00:00","dateModified":"2024-09-26T18:05:40+00:00","mainEntityOfPage":{"@id":"http:\/\/18.220.63.61\/?p=2336"},"wordCount":567,"commentCount":0,"publisher":{"@id":"https:\/\/www.rodaportal.net\/#organization"},"image":{"@id":"http:\/\/18.220.63.61\/?p=2336#primaryimage"},"thumbnailUrl":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/09\/image.webp","keywords":["AI","build a Chat-bot App","Chat GPT and Python","Chatbot","chatgpt","gpt ai","PDF","Python","Streamlit"],"articleSection":["Data Analytics 101"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/18.220.63.61\/?p=2336#respond"]}]},{"@type":"WebPage","@id":"http:\/\/18.220.63.61\/?p=2336","url":"http:\/\/18.220.63.61\/?p=2336","name":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided! - Rodaportal","isPartOf":{"@id":"https:\/\/www.rodaportal.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/18.220.63.61\/?p=2336#primaryimage"},"image":{"@id":"http:\/\/18.220.63.61\/?p=2336#primaryimage"},"thumbnailUrl":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/09\/image.webp","datePublished":"2024-09-26T18:00:23+00:00","dateModified":"2024-09-26T18:05:40+00:00","description":"Discover how to create a PDF summarization and question-answering chatbot using Python and Streamlit. Learn about essential libraries and coding techniques to build your app.","breadcrumb":{"@id":"http:\/\/18.220.63.61\/?p=2336#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/18.220.63.61\/?p=2336"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/18.220.63.61\/?p=2336#primaryimage","url":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/09\/image.webp","contentUrl":"https:\/\/www.rodaportal.net\/wp-content\/uploads\/2024\/09\/image.webp","width":1280,"height":720,"caption":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App - Code Provided!"},{"@type":"BreadcrumbList","@id":"http:\/\/18.220.63.61\/?p=2336#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rodaportal.net\/"},{"@type":"ListItem","position":2,"name":"How to use Chat GPT and Python to Analyse Text and build a Chat-bot App &#8211; Code Provided!"}]},{"@type":"WebSite","@id":"https:\/\/www.rodaportal.net\/#website","url":"https:\/\/www.rodaportal.net\/","name":"Rodaportal","description":"","publisher":{"@id":"https:\/\/www.rodaportal.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rodaportal.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rodaportal.net\/#organization","name":"Rodaportal","url":"https:\/\/www.rodaportal.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rodaportal.net\/#\/schema\/logo\/image\/","url":"http:\/\/www.rodaportal.net\/wp-content\/uploads\/2023\/10\/imageedit_1_9835162131.png","contentUrl":"http:\/\/www.rodaportal.net\/wp-content\/uploads\/2023\/10\/imageedit_1_9835162131.png","width":112,"height":112,"caption":"Rodaportal"},"image":{"@id":"https:\/\/www.rodaportal.net\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Rodaportal","https:\/\/x.com\/RodaPP1"]},{"@type":"Person","@id":"https:\/\/www.rodaportal.net\/#\/schema\/person\/1ed067be473943abefead5f395f0bf70","name":"Rodaportal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","caption":"Rodaportal"},"sameAs":["http:\/\/www.rodaportal.net"],"url":"https:\/\/www.rodaportal.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts\/2336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2336"}],"version-history":[{"count":2,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts\/2336\/revisions"}],"predecessor-version":[{"id":2340,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/posts\/2336\/revisions\/2340"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=\/wp\/v2\/media\/2338"}],"wp:attachment":[{"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rodaportal.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}