A Python-based microservice designed to generate concise summaries from large text inputs. Built with modular components, this project facilitates easy integration into larger applications and supports scalable deployment.
- Modular Architecture: Organized codebase with clear separation of concerns.
- Summarization Pipeline: Processes raw text through a series of components to produce summaries.
- Configurable Parameters: Easily adjust settings via YAML configuration files.
- Logging: Comprehensive logging for monitoring and debugging.
- Docker Support: Containerized setup for consistent deployment across environments.
text-summarizer-microservice/
├── textSummarizer/
│ ├── components/
│ ├── config/
│ ├── constants/
│ ├── entity/
│ ├── logging/
│ ├── pipeline/
│ └── utils/
├── notebooks/
│ └── trial.ipynb
├── config/
│ └── config.yaml
├── parameters.yaml
├── app.py
├── main.py
├── requirements.txt
├── setup.py
├── Dockerfile
├── folder_template.py
└── README.md
- Python 3.7 or higher
- pip package manager
- Docker (optional, for containerized deployment)
- Clone the Repository
git clone https://github.com/your-username/text-summarizer-microservice.git
cd text-summarizer-microservice- Create a Virtual Environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install Dependencies
pip install -r requirements.txt- Configure Settings
Edit config/config.yaml and parameters.yaml to adjust configurations as needed.
python main.pyThis will initiate the summarization pipeline, processing input text and generating summaries based on the configured parameters.
If app.py is set up with a web framework like Flask or FastAPI, you can run:
python app.pyThis will start the web service, exposing endpoints for text summarization.
- Build the Docker Image
docker build -t text-summarizer-microservice .- Run the Docker Container
docker run -p 8000:8000 text-summarizer-microserviceThis will start the service inside a Docker container, accessible at http://localhost:8000.
config/config.yaml: Contains general configuration settings for the application.parameters.yaml: Holds parameters specific to the summarization process, such as model settings.
Ensure these files are properly configured before running the application.
folder_template.py: Script to set up the project directory structure with necessary files and folders.- Logging: Implemented using Python's
loggingmodule, with logs stored as per configurations in thelogging/directory.