CoolFace
Apppublic

bhaveshw/document-summarizer-app

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
App README

Document Summarizer App

This is a Streamlit-based document summarization app that allows users to upload PDF files, text files, or directly input text to generate a summary using a pre-trained T5 model.

How It Works

1. Imports

The app starts by importing the necessary libraries:

  • streamlit: For creating the web app.
  • PyPDF2: For reading PDF files.
  • transformers: For using pre-trained language models.
  • langchain: For text splitting and document loading.
  • torch: For handling PyTorch models.
  • base64: For encoding and decoding data.

2. Extract Text from PDF

The function extract_text_from_pdf reads a PDF file and extracts text from each page.

3. Model and Tokenizer Loading

The code loads a pre-trained T5 model and tokenizer.

4. File Preprocessing

The function file_preprocessing processes a PDF file to prepare it for summarization.

Running the App

1. Install Dependencies

Ensure you have the required libraries installed.

2. Run the App

Run the Streamlit app using the appropriate command.

3. Access the App

After running the above command, Streamlit will start a local web server. Open a web browser and go to the URL provided in the terminal output.

License

This project is licensed under the MIT License.

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference