-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate_json_based_on_label_edit.py
29 lines (22 loc) · 1.13 KB
/
update_json_based_on_label_edit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from process_trans import Transcription
from sys import argv
if __name__ == "__main__":
# Example of usage
# Call on file path for either AWS Transcribe JSON output file or
# processed labeled words JSON file
t = Transcription(argv[1])
# Read in edited lablel file (only touch the label not the timing) modified in
# Audacity
t.load_edited_debug_label_file(argv[2])
# Now recreate files based on edits
print("Currently only prints out differences")
exit(0)
# Create label files for Audacity. Two files created one with just speaker labels
# The other with speaker labels and full content
t.make_audacity_label_files(argv[2])
# Create label file with speaker label, word index and word content (for later correcting miss labeled speaker)
t.make_audacity_label_correction_file(argv[2])
# Save intermediate each word and punctuation with speaker_label, times, and type
t.save_labeled_words_json(f"{argv[2]}_processed.json")
# Save Transcription (spoken otterances with speak_labels and start_time and end time)
t.save_transcription_json(f"{argv[2]}_transcription.json")