This app helps you to summarize podcast content.
The Web app to summarize the podcast content
In this project, first, we retrieve the related information of a specific podcast and related episode. Then, store the audio format of that episode. The audio file will be transcribed via OpenAI Whisper module. Finally, the extracted text of podcast content is fed into Google Gemini API to summarize and highlight the whole content.
The project prerequisites are outlined below:
- Python 3.10
- OpenAI Whisper
- Google I Generativelanguage (Gemini)
- libsndfile1 and ffmpeg packages on Linux
The project comprises a backend constructed with the FastAPI framework and a UI utilizing the Next.js framework. To install, follow the steps outlined below:
- Clone the repository to your local machine and navigate to the directory.
git clone https://github.com/PooriaT/Sumcast.git
cd Sumcast- Set up the virtual environment and activate it.
python -m venv venv
# On Linux
. venv/bin/activate- Setting up the necessary Python libraries using the
requirements.txtfile.
pip install -r requirements.txt- Install the following two packages on a Linux machine.
apt install -y libsndfile1 ffmpeg - Navigate to the UI folder and execute the command to install the Node packages.
cd ui
nmp install - Begin the development environment for the backend and frontend in separate terminals
In one terminal, navigate to the root directory and execute the following command:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload On another terminal, access the ui folder and then run:
(Attention: To test it locally, you need to change the base url in frontend to http://localhost:8000/api. You can find it in ui/utils/fastApiCall.ts.)
npm run dev- After that, navigate to
http://localhost:3000to see the application in action.
To deploy the application, you'll need to build UI and run the FastAPI server, taking into account the number of workers you want to use. So, we have:
cd ui
npm run build
npm startIn the root directory:
uvicorn main:app --host 0.0.0.0 --port 8000 --worker 4The Dockerfiles for both the backend and frontend are available. Follow the procedure below to build the images and run the containers:
To build the images:
docker build -t sumcast_backend .cd ui
docker build -t sumcast_frontend .To run the containers:
docker run -p 8000:8000 -name <name> sumcast_backenddocker run -p 3000:3000 -name <name> sumcast_frontendTo test the API, the below command can be used:
curl -X POST -H "Content-Type: application/json" -d '{"podcast_name": "startalk", "episode_name": "This is Your Brain on social media with anna lembke, MD"}' http://localhost:8000/api/summarize/We welcome contributions from the community! If you have suggestions, or bug reports, or would like to contribute code or documentation, please feel free to open an issue or submit a pull request on our GitHub repository.
