A Flask-based web application that uses the Hugging Face API to generate summaries of text input. The app features user authentication with Firebase, profile management, and customizable summarization parameters.
- Text summarization with customizable parameters (min/max length, beam search)
- User authentication with Firebase
- Profile management with photo upload
- Responsive design
- Fallback summarization when API is unavailable
- Python 3.8 or higher
- Firebase account
- Hugging Face API key
-
Clone the repository:
git clone <your-repository-url> cd text-summarization
-
Create and activate a virtual environment:
python -m venv venv # On Windows venv\Scripts\activate # On Unix or MacOS source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory with your configuration:HUGGINGFACE_API_KEY=your_huggingface_api_key FIREBASE_API_KEY=your_firebase_api_key FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain FIREBASE_PROJECT_ID=your_firebase_project_id FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id FIREBASE_APP_ID=your_firebase_app_id FLASK_ENV=development FLASK_APP=app.py SECRET_KEY=your_secret_key PORT=10000 -
Set up Firebase configuration:
- Copy
firebaseConfig.example.jstofirebaseConfig.jsand update with your Firebase project settings - Copy
serviceAccountKey.example.jsontoserviceAccountKey.jsonand update with your Firebase service account key - You can find these values in your Firebase Console under Project Settings
- Copy
-
Run the application:
python app.py
- Create a Render account at render.com
- Connect your GitHub repository
- Create a new Web Service
- Configure the service:
- Name: text-summarizer
- Environment: Python
- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn app:app - Add your environment variables from
.env - Add your Firebase service account key as a secret file
- Create a Netlify account at netlify.com
- Connect your GitHub repository
- Configure the build settings:
- Build command:
echo 'No build step needed' - Publish directory:
templates
- Build command:
- Add your environment variables in Netlify dashboard
- Add your Firebase configuration in the Netlify environment variables
HUGGINGFACE_API_KEY: Your Hugging Face API keyFIREBASE_API_KEY: Firebase API keyFIREBASE_AUTH_DOMAIN: Firebase auth domainFIREBASE_PROJECT_ID: Firebase project IDFIREBASE_STORAGE_BUCKET: Firebase storage bucketFIREBASE_MESSAGING_SENDER_ID: Firebase messaging sender IDFIREBASE_APP_ID: Firebase app IDFLASK_ENV: Flask environment (development/production)SECRET_KEY: Flask secret keyPORT: Port to run the application on
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.