Skip to content

InsiderCloud/Cogniezer-Backend

Repository files navigation

Cogniezer-Backend

GitHub license GitHub repo size GitHub issues GitHub pull requests GitHub last commit

Overview

Cogniezer-Backend is the backbone of the Cogniezer project, aimed at providing real-time audio summarization services. Developed as part of the BSc Hons Computer Science program at the University of Kelaniya, this REST API leverages the power of FastAPI, Azure Speech-to-Text, and the T5-base transformer model. Our system is trained on a diverse range of datasets, ensuring robust and accurate summarization.

Table of Contents

Features

  • Audio to text summarization
  • Integration with Azure Speech-to-Text
  • Built using FastAPI for high performance
  • Utilizes T5-base transformer model for summarization
  • Trained on diverse datasets for robust performance

Installation

Prerequisites

  • Python 3.7 or higher
  • Conda
  • Git

Clone the Repository

git clone https://github.com/InsiderCloud/Cogniezer-Backend

Setup the Environment

conda create -n cogniezer python=3.7
conda activate cogniezer
pip install -r requirements.txt

Configure the Project

Update the configuration files with your settings:

.
├── config
│ ├── config.yaml
├── params.yaml
. 

Environment Variables

Add the following environment variables to the .env file:

AZURE_KEY=your_azure_key
AZURE_REGION=your_azure_region
HOST=localhost
PORT=8000

Run the Project

gunicorn app:app

Docker Support

Build the Docker Image

Modify the IMAGE_NAME and IMAGE_TAG in the build.sh file and run:

./build.sh

API Endpoints

Index

GET /

Returns the main page.

http://{host}:{port}/

Text Summarization

POST /api/predict

Predicts the summary of the provided text.

curl -X POST http://{host}:{port}/api/predict \
    -H 'Content-Type: application/json' \
    -d '{"text": "Text to be summarized"}'

Upload File

POST /api/uploadfile/

Uploads an audio file, transcribes it, and returns the summary.

curl -X POST http://{host}:{port}/api/uploadfile/ \
    -H 'Content-Type: multipart/form-data' \
    -F 'wav_file=@path_to_your_audio_file.wav'

Contributing

We welcome contributions from the community! Please follow these steps to contribute:

  • Fork the repository
  • Create a new branch for your feature or bugfix
  • Commit your changes
  • Push the branch to your fork
  • Open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages