A Streamlit application that summarizes documents using the Longformer Encoder-Decoder (LED) model, specifically the "pszemraj/led-large-book-summary" model which is fine-tuned for book summarization.
requirements.txt for complete dependenciesgit clone https://github.com/yourusername/document-summarization-app.git
cd document-summarization-app
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
mkdir -p models
python download_model.py
# Or use the model directly from HuggingFace by setting
# MODEL_PATH=pszemraj/led-large-book-summary in your .env file
cp .env.example .env
# Edit .env file to match your environment
streamlit run app.py
Open your browser at http://localhost:8501
Upload a PDF document and configure summarization parameters in the sidebar
Click "Summarize Document" to generate a summary
The application is configured to use the LED Large Book Summary model by default. This model:
To add or change models:
models directory or specify its path in the .env fileAVAILABLE_MODELS dictionary in tools.py with your new modelFor best results with the LED model, the application uses these parameters:
no_repeat_ngram_size=3encoder_no_repeat_ngram_size=3repetition_penalty=3.5num_beams=4early_stopping=TrueThese settings help create more coherent and less repetitive summaries.
app.py: Main Streamlit applicationtools.py: Model loading and text processing utilitiesrequirements.txt: Package dependenciesDockerfile: Container configuration.env.example: Example environment configurationdata/: Directory for uploaded documents (created automatically)models/: Directory for model filesA Streamlit application that summarizes documents using the Longformer Encoder-Decoder (LED) model, specifically the "pszemraj/led-large-book-summary" model which is fine-tuned for book summarization.
requirements.txt for complete dependenciesgit clone https://github.com/yourusername/document-summarization-app.git
cd document-summarization-app
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
mkdir -p models
python download_model.py
# Or use the model directly from HuggingFace by setting
# MODEL_PATH=pszemraj/led-large-book-summary in your .env file
cp .env.example .env
# Edit .env file to match your environment
streamlit run app.py
Open your browser at http://localhost:8501
Upload a PDF document and configure summarization parameters in the sidebar
Click "Summarize Document" to generate a summary
The application is configured to use the LED Large Book Summary model by default. This model:
To add or change models:
models directory or specify its path in the .env fileAVAILABLE_MODELS dictionary in tools.py with your new modelFor best results with the LED model, the application uses these parameters:
no_repeat_ngram_size=3encoder_no_repeat_ngram_size=3repetition_penalty=3.5num_beams=4early_stopping=TrueThese settings help create more coherent and less repetitive summaries.
app.py: Main Streamlit applicationtools.py: Model loading and text processing utilitiesrequirements.txt: Package dependenciesDockerfile: Container configuration.env.example: Example environment configurationdata/: Directory for uploaded documents (created automatically)models/: Directory for model files