Kristofer Rolf Söderström c319316a4d Add files via upload
2023-03-27 21:25:11 +02:00
2023-03-22 14:32:27 +01:00
2023-03-22 21:56:05 +01:00
2023-03-23 15:14:03 +01:00
2023-03-23 15:14:03 +01:00
2023-03-27 21:25:11 +02:00
2023-03-27 09:57:28 +02:00
2023-03-22 11:21:02 +01:00
2023-03-27 21:24:12 +02:00

transcribe

Simple script that uses OpenAI's Whisper to transcribe audio files from your local folders.

Note

This implementation and guide is mostly made for researchers not familiar with programming that want a way to transcribe their files locally, without internet connection, usually required within ethical data practices and frameworks. Two examples are shown, a normal workflow with internet connection. And one in which the model is loaded first, via openai-whisper, and then the transcription can be done without being connected to the internet.

Instructions

Requirements

  1. This script was made and tested in an Anaconda environment with python 3.10. I recommend this method if you're not familiar with python. See here for instructions. You might need administrator rights.
  2. Whisper requires some additional libraries. The setup page states: "The codebase also depends on a few Python packages, most notably HuggingFace Transformers for their fast tokenizer implementation and ffmpeg-python for reading audio files." Users might not need to specifically install Transfomers. However, a conda installation might be needed for ffmepg1 , which takes care of setting up PATH variables. From the anaconda prompt, type or copy the following:
 conda install -c conda-forge ffmpeg-python
  1. The main functionality comes from openai-whisper. See their page for details. As of 2023-03-22 you can install via:
pip install -U openai-whisper
  1. There is an option to run a batch file, which launches a GUI built on TKinter and TTKthemes. If using these options, make sure they are installed in your python build. You can install them via pip.
pip install tk

and

pip install ttkthemes 

Using the script

This is a simple script with no installation. You can either clone the repository with

git clone https://github.com/soderstromkr/transcribe.git

and use the example.ipynb template to use the script. OR download the transcribe.py file into your work folder. Then you can either import it to another script or notebook for use. I recommend jupyter notebook for new users, see the example below. (Remember to have transcribe.py and example.ipynb in the same working folder).
You can also run the GUI version from your terminal or with the batch file called run_gui.bat, just make sure to add your conda path to it. img!

Example

See example for an implementation on jupyter notebook, also added an example for a simple workaround to transcribe while offline.

DOI


  1. Advanced users can use pip install ffmpeg-python but be ready to deal with some PATH issues, which I encountered in Windows 11. ↩︎

Description
Simple implementation of OpenAI's whisper model to transcribe audio files from your local folders.
Readme MIT Cite this repository 3 MiB
Languages
Python 88.2%
Jupyter Notebook 9%
Shell 1.6%
Batchfile 1.2%