DEV Community

Varsini S.J
Varsini S.J

Posted on

Simplify Your Study Life with AI Notes Summarizer using Streamlit & Gemini!

Ever wished you could quickly go through your lengthy PDF notes just before an exam or review session?

What if you could upload a PDF and instantly get a neat bullet-point summary?

Sounds magical, right? πŸͺ„ Well, it’s possible β€” thanks to the power of Large Language Models (LLMs) and the simplicity of Streamlit. Let's build an interactive AI Notes Summarizer that combines Python, Streamlit, and Google's Gemini API to create intelligent, readable summaries of your PDFs.


🧠 Technologies Used

  • Python – The base programming language
  • Streamlit – For building the web interface
  • PyMuPDF (fitz) – For PDF text extraction
  • Google Gemini API – To generate bullet-point summaries

πŸ› οΈ Step 1 – Setup

Install the required libraries:

```

bash
pip install streamlit google-generativeai pymupdf


Enter fullscreen mode Exit fullscreen mode

Also, get an API key from Google AI Studio to use Gemini.


🧾 Step 2 – Build the App

πŸ“€ Extract Text from PDF


python
import fitz

def extract_text_from_pdf(uploaded_file):
    doc = fitz.open(stream=uploaded_file.read(), filetype="pdf")
    text = ""
    for page in doc:
        text += page.get_text()
    return text


Enter fullscreen mode Exit fullscreen mode

✨ Summarize Using Gemini


python
import google.generativeai as genai

genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel(model_name="gemini-1.5-flash-001")

def summarize_text(text):
    prompt = f"Summarize this in simple bullet points:\n\n{text}"
    response = model.generate_content(prompt)
    return response.text


Enter fullscreen mode Exit fullscreen mode

πŸ’» Streamlit UI


python
import streamlit as st

st.title("🧠 AI Notes Summarizer")

uploaded_file = st.file_uploader("Upload PDF", type="pdf")

if uploaded_file:
    extracted_text = extract_text_from_pdf(uploaded_file)
    st.text_area("πŸ“„ Extracted Text", extracted_text, height=300)

    if st.button("Summarize Notes"):
        summary = summarize_text(extracted_text)
        st.subheader("πŸ“š Summary")
        st.markdown(summary)


Enter fullscreen mode Exit fullscreen mode

πŸ“‘ Step 3 – Run Locally


bash
streamlit run app.py


Enter fullscreen mode Exit fullscreen mode

Open your browser and test it live!


☁️ Step 4 – Deploy to Streamlit Cloud

  1. Push your project to GitHub
  2. Go to Streamlit Cloud
  3. Create a new app and select your repo, branch, and Python file

Boom! You’ve deployed your own AI Notes Summarizer 🧠


This is how your app looks like

Summarized version

πŸ’‘ Final Thoughts

This project falls under LLM application β€” specifically Document AI / Educational Tools.

It’s a simple yet powerful example of how LLMs can turn hours of reading into a few minutes of review.

πŸ”— GitHub Repo

Let me know what you think and how you improve it!


πŸ“’ Stay tuned for more projects like this β€” and happy learning!

Top comments (1)

Collapse
 
sabarish_s12 profile image
Sabarish S

Nicee

Some comments may only be visible to logged-in visitors. Sign in to view all comments.