For that, there is LocalAgreement-n policy: if n consecutive updates, each with a newly…
- User
For that, there is LocalAgreement-n policy: if n consecutive updates, each with a newly available audio stream chunk, agree on a prefix transcript, it is confirmed. (Reference: CUNI-KIT at IWSLT 2022 etc.)
Can u explain it to me?
- Assistant
Certainly! The LocalAgreement-n policy is a method used in speech recognition systems, particularly those involved in real-time or streaming scenarios, to determine when a portion of a transcript can be considered reliable and fixed (or "confirmed"). Here's how it works:
-
Streaming Context: In real-time speech recognition, audio is processed in chunks as it becomes available. This means that the transcript is updated incrementally as more audio data is processed.
-
: A prefix of a transcript is the initial segment of the text that has been recognized so far. As more audio is processed, the entire transcript might change, but typically the beginning parts stabilize sooner than the newly added parts.
-
- User
Edit code accroding this policy
def audio_stream(): while True: global q global processed
codewhile not processed: time.sleep(0.1) processed = False item = q # bLast_point = int(fLast_point * sample_rate) bLast_point = int(fLast_point2 * sample_rate - fLast_point1 * sample_rate) print("bLast_point: ", bLast_point) print("q Len: ", len(q)) if bLast_point == 0: q = np.array([], dtype=np.int16) else: q = np.array(q[-bLast_point:], dtype=np.int16) if item is None: break # print(len(item)) # print(type(item)) yield item - Assistant