File size: 4,621 Bytes
aa853b8
 
 
 
 
 
 
c415c60
aa853b8
 
 
 
4f194a4
 
 
 
 
 
a9a8aac
 
 
 
 
 
4f194a4
a9a8aac
 
4f194a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a9a8aac
4f194a4
 
 
 
 
a9a8aac
4f194a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a9a8aac
4f194a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a9a8aac
 
4f194a4
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
title: "Audio and Video Content Analyzer"
emoji: "πŸŽ₯"
colorFrom: "blue"
colorTo: "green"
sdk: "streamlit"
python_version: "3.8"
sdk_version: 1.27.2
app_file: "app.py"
pinned: false
---

# Summarize Audio and Video with Semantic Retrieval, Chatbot, and LLM

## Description

This project is an all-in-one solution for audio and video content analysis:

1. **Summarization**: Generates concise summaries using advanced Natural Language Processing, powered by HuggingFace
   Transformers.
2. **Semantic Retrieval**: Enables you to find specific words, phrases, or segments, thanks to Whisper Timestamped by
   Linto.
3. **Chatbot Interface**: Features a chatbot that can answer queries about the audio or video content, leveraging
   Language Models for Machines (LLM).

The project is built using Python and integrates various libraries including Whisper Timestamped, HuggingFace
Transformers, and Streamlit for a seamless user experience.

## Project Structure

```plaintext
.
β”œβ”€β”€ Dockerfile                   # Dockerfile for setting up the environment
β”œβ”€β”€ LICENSE                      # License file
β”œβ”€β”€ README.md                    # This README file
β”œβ”€β”€ YoutubeAudios                # Directory containing YouTube audio files
β”œβ”€β”€ _requirements.txt            # Requirements file
β”œβ”€β”€ app.py                       # Streamlit application file
β”œβ”€β”€ config.py                    # Configuration file
β”œβ”€β”€ keyword_retriever            # Module for keyword retrieval
β”‚   └── keyword_retreiver.py     # Keyword retriever script
β”œβ”€β”€ logger.py                    # Logging utility
β”œβ”€β”€ notebooks                    # Jupyter notebooks for development and testing
β”œβ”€β”€ pdf_test.py                  # PDF testing script
β”œβ”€β”€ query_service                # Query service module
β”‚   └── query_engine.py          # Query engine script
β”œβ”€β”€ requirements.txt             # Requirements file
β”œβ”€β”€ resource_loader              # Resource loader module
β”‚   β”œβ”€β”€ json_loader.py           # JSON loader script
β”‚   β”œβ”€β”€ linkedin_loader.py       # LinkedIn loader script
β”‚   β”œβ”€β”€ uploaded_video_loader.py # Uploaded video loader script
β”‚   β”œβ”€β”€ video_loader_interface.py# Video loader interface script
β”‚   └── youtube_loader.py        # YouTube loader script
β”œβ”€β”€ summarization_service        # Summarization service module
β”‚   └── summarizer.py            # Summarizer script
β”œβ”€β”€ transcription_service        # Transcription service module
β”‚   └── transcriber.py           # Transcriber script
└── utils.py                     # Utility functions

```

## Prerequisites

- Python 3.8+
- Docker (optional)

## Built With

- [Llama_index](https://www.llamaindex.ai/) Framework for LLM application
- [Whisper Timestamped](https://github.com/linto-ai/whisper-timestamped) - For semantic retrieval and timestamping
- [HuggingFace Transformers](https://huggingface.co/transformers/) - For summarization and NLP
- [Streamlit](https://streamlit.io/) - For the web interface

## Setup and Installation

## Setup and Installation

There are two methods to get the project up and running:

### Method 1: Using Docker

1. Clone the repository.
2. Navigate to the project directory.
3. Build the Docker image:
    ```bash
    docker build -t summarizer .
    ```
4. Run the Docker container:
    ```bash
    docker run -p 8501:8501 summarizer
    ```
5. Open your web browser and go to `http://localhost:8501`.

### Method 2: Using Python Environment

1. Clone the repository.
2. Navigate to the project directory.
3. Install the requirements:
    ```bash
    pip install -r requirements.txt
    ```
4. Run the Streamlit app:
    ```bash
    streamlit run app.py
    ```
5. Open your web browser and go to `http://localhost:8501`.

### Using Python Environment

1. Clone the repository.
2. Navigate to the project directory.
3. Install the requirements:
    ```bash
    pip install -r requirements.txt
    ```
4. Run the Streamlit app:
    ```bash
    streamlit run app.py
    ```

## Usage

1. Open the Streamlit app in your web browser.
2. Follow the instructions on the screen to upload or specify your audio/video content.
3. Click "Submit" to generate a summary, perform semantic retrieval, or interact with the chatbot.

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull
requests.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.