-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
297231a
commit 7eb565d
Showing
4 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,13 +88,16 @@ transcript will also indicate the timeframe in seconds where each speaker speaks | |
### Transcription example: | ||
|
||
``` | ||
import os | ||
from speechlib import Transcriptor | ||
file = "obama_zach.wav" # your audio file | ||
voices_folder = "" # voices folder containing voice samples for recognition | ||
language = "en" # language code | ||
log_folder = "logs" # log folder for storing transcripts | ||
modelSize = "tiny" # size of model to be used [tiny, small, medium, large-v1, large-v2, large-v3] | ||
quantization = False # setting this 'True' may speed up the process but lower the accuracy | ||
ACCESS_TOKEN = "your hf key" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "huggingface api key" # get permission to access pyannote/[email protected] on huggingface | ||
# quantization only works on faster-whisper | ||
transcriptor = Transcriptor(file, log_folder, language, modelSize, ACCESS_TOKEN, voices_folder, quantization) | ||
|
@@ -112,7 +115,7 @@ res = transcriptor.custom_whisper("D:/whisper_tiny_model/tiny.pt") | |
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your api key") | ||
res = transcriptor.assemby_ai_model("assemblyAI api key") | ||
res --> [["start", "end", "text", "speaker"], ["start", "end", "text", "speaker"]...] | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,13 +70,16 @@ transcript will also indicate the timeframe in seconds where each speaker speaks | |
### Transcription example: | ||
|
||
``` | ||
import os | ||
from speechlib import Transcriptor | ||
file = "obama_zach.wav" # your audio file | ||
voices_folder = "" # voices folder containing voice samples for recognition | ||
language = "en" # language code | ||
log_folder = "logs" # log folder for storing transcripts | ||
modelSize = "tiny" # size of model to be used [tiny, small, medium, large-v1, large-v2, large-v3] | ||
quantization = False # setting this 'True' may speed up the process but lower the accuracy | ||
ACCESS_TOKEN = "your hf key" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "huggingface api key" # get permission to access pyannote/[email protected] on huggingface | ||
# quantization only works on faster-whisper | ||
transcriptor = Transcriptor(file, log_folder, language, modelSize, ACCESS_TOKEN, voices_folder, quantization) | ||
|
@@ -94,7 +97,9 @@ res = transcriptor.custom_whisper("D:/whisper_tiny_model/tiny.pt") | |
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your api key") | ||
res = transcriptor.assemby_ai_model("assemblyAI api key") | ||
res --> [["start", "end", "text", "speaker"], ["start", "end", "text", "speaker"]...] | ||
``` | ||
|
||
#### if you don't want speaker names: keep voices_folder as an empty string "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters