Update: Refactored the code

This commit is contained in:
Izaya Orihara
2023-10-06 15:28:26 +02:00
parent b43335400d
commit 0b1c24de2a
11 changed files with 265 additions and 60 deletions
+31 -3
View File
@@ -1,7 +1,5 @@
# Project_whisperTrans01_Code
## Content
Transcriber code
@@ -13,4 +11,34 @@ Currently very unorganized
- clean the code
- organize the stuff
- add functions for other data sources
- seperate data production form code
- seperate data production form code
```
project_root/
├── src/
│ ├── file_manager.py # Contains FileManager class
│ ├── transcriber.py # Contains Transcriber class
│ ├── transcript_generator.py # Contains TranscriptGenerator class
│ ├── data_handling.py # Contains download_audio and convert_to_wav methods
│ └── main.py # Main script that runs the process
├── tests/
│ ├── test_file_manager.py
│ ├── test_transcriber.py
│ └── test_transcript_generator.py
├── data/
│ ├── audio/ # downloaded mp4 and output wav files
│ └── transcripts/ # JSON and text transcript files
└── README.md
```
- **src/**: This directory will contain all your source code. Inside the src folder, I added:
- **main.py**: This will be the main entry point for the program. It will use the `TranscriptGenerator` class which
orchestrates the use of `FileManager` and `Transcriber`.
- **file_manager.py**: Contains the `FileManager` class implementation.
- **transcriber.py**: Contains the `Transcriber` class implementation.
- **transcript_generator.py**: Contains the `TranscriptGenerator` class implementation.
- **tests/**: This directory contains all your test scripts corresponding to your source files.
- **data/**: This directory contains all the data needed for your code. For simplicity, I categorize the files into
separate directories for audio and transcript files.