-
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.
Merge pull request #48 from NavodPeiris/dev
fixed empty trascription outputs when speaker is not speaking
- Loading branch information
Showing
7 changed files
with
22 additions
and
18 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 |
---|---|---|
|
@@ -86,15 +86,13 @@ transcript will also indicate the timeframe in seconds where each speaker speaks | |
### Transcription example: | ||
|
||
``` | ||
from speechlib import Transcriptor | ||
file = "obama_zach.wav" # your audio file | ||
voices_folder = "voices" # voices folder containing voice samples for recognition | ||
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 huggingface access token" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "your hf 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) | ||
|
@@ -111,6 +109,9 @@ res = transcriptor.custom_whisper("D:/whisper_tiny_model/tiny.pt") | |
# use a huggingface whisper model | ||
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your 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 |
---|---|---|
|
@@ -7,3 +7,6 @@ __pycache__ | |
logs | ||
greek_convo_short.mp3 | ||
greek_convo_short.wav | ||
my_test.py | ||
greek_convo.mp3 | ||
greek_convo.wav |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,15 +70,13 @@ transcript will also indicate the timeframe in seconds where each speaker speaks | |
### Transcription example: | ||
|
||
``` | ||
from speechlib import Transcriptor | ||
file = "obama_zach.wav" # your audio file | ||
voices_folder = "voices" # voices folder containing voice samples for recognition | ||
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 huggingface access token" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "your hf 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) | ||
|
@@ -95,7 +93,8 @@ res = transcriptor.custom_whisper("D:/whisper_tiny_model/tiny.pt") | |
# use a huggingface whisper model | ||
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
res --> [["start", "end", "text", "speaker"], ["start", "end", "text", "speaker"]...] | ||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your api key") | ||
``` | ||
|
||
#### 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
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