File size: 672 Bytes
7be15fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Docstring"""


class TranscribedData:
    """Transcribed data from json file"""

    def __init__(self, transcribed_json):
        # Vosk = conf, Whisper = confidence
        self.conf = transcribed_json.get(
            "conf", transcribed_json.get("confidence", None)
        )
        # Vosk = word, Whisper = text
        self.word = transcribed_json.get(
            "word", transcribed_json.get("text", None)
        )
        self.end = transcribed_json.get("end", None)
        self.start = transcribed_json.get("start", None)
        self.is_hyphen = transcribed_json.get("is_hyphen", None)
        self.is_word_end = transcribed_json.get("is_word_end", True)