chatterbox is a user-friendly text summarization application built using Streamlit and a fine-tuned language model. It allows users to input meeting notes or any text, and generates a concise summary of the provided text. This README file provides a detailed explanation of the code, making it easy for junior developers to understand and replicate the project.
Before you begin, ensure you have the following installed:
- Python 3 or higher
- Streamlit
- dotenv
- Clone the project repository or download the code.
- Open a terminal or command prompt and navigate to the project directory.
- Create a
.env
file in the project directory. This file will store your API key. - Add the following line to the
.env
file:
API_URL=https://api-inference.huggingface.co/models/knkarthick/MEETING_SUMMARY
- Replace the placeholder value with your actual API key obtained from Hugging Face.
The code consists of a single Python script (app.py
) that implements the text summarization functionality. Let's break down the code step by step:
# Import necessary libraries
from dotenv import find_dotenv, load_dotenv
import requests
import streamlit as st
- We start by importing the required libraries.
dotenv
is used to load the API key from the.env
file,requests
is used to make API calls, andstreamlit
is used to create the user interface.
# Set page background image
page_bg_img = """
<style>
body {
background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
background-size: cover;
}
</style>
"""
st.markdown(page_bg_img, unsafe_allow_html=True)
- This code sets a gradient background image for the Streamlit app.
# Load API key from .env file
load_dotenv(find_dotenv())
API_URL = os.getenv("API_URL")
HEADERS = {"Authorization": f"Bearer {os.getenv