TIMBOVILL commited on
Commit
7be15fe
·
verified ·
1 Parent(s): 6885bcb

Upload TranscribedData.py

Browse files
Files changed (1) hide show
  1. src/modules/TranscribedData.py +19 -0
src/modules/TranscribedData.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Docstring"""
2
+
3
+
4
+ class TranscribedData:
5
+ """Transcribed data from json file"""
6
+
7
+ def __init__(self, transcribed_json):
8
+ # Vosk = conf, Whisper = confidence
9
+ self.conf = transcribed_json.get(
10
+ "conf", transcribed_json.get("confidence", None)
11
+ )
12
+ # Vosk = word, Whisper = text
13
+ self.word = transcribed_json.get(
14
+ "word", transcribed_json.get("text", None)
15
+ )
16
+ self.end = transcribed_json.get("end", None)
17
+ self.start = transcribed_json.get("start", None)
18
+ self.is_hyphen = transcribed_json.get("is_hyphen", None)
19
+ self.is_word_end = transcribed_json.get("is_word_end", True)