Skip to content

Commit 73705a6

Browse files
authored
refactor: Remove redundant file outputs in transcription process (#10)
1 parent 93fffb7 commit 73705a6

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

transcribe_me/audio/transcription.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -99,42 +99,6 @@ def transcribe_with_assemblyai(
9999
# Write additional information to separate files
100100
base_name = os.path.splitext(output_path)[0]
101101

102-
# Speaker Diarization
103-
with open(f"{base_name}_speakers.txt", "w", encoding="utf-8") as file:
104-
for utterance in transcript.utterances:
105-
file.write(f"Speaker {utterance.speaker}: {utterance.text}\n")
106-
# Summary
107-
with open(f"{base_name}_summary.txt", "w", encoding="utf-8") as file:
108-
file.write(transcript.summary)
109-
110-
# Sentiment Analysis
111-
with open(f"{base_name}_sentiment.txt", "w", encoding="utf-8") as file:
112-
for result in transcript.sentiment_analysis:
113-
file.write(f"Text: {result.text}\n")
114-
file.write(f"Sentiment: {result.sentiment}\n")
115-
file.write(f"Confidence: {result.confidence}\n")
116-
file.write(f"Timestamp: {result.start} - {result.end}\n\n")
117-
118-
# Topic Detection
119-
if transcript.iab_categories:
120-
with open(f"{base_name}_topics.txt", "w", encoding="utf-8") as file:
121-
# Detailed results
122-
file.write("Detailed Topic Results:\n")
123-
for result in transcript.iab_categories.results:
124-
file.write(f"Text: {result.text}\n")
125-
file.write(
126-
f"Timestamp: {result.timestamp.start} - {result.timestamp.end}\n"
127-
)
128-
for label in result.labels:
129-
file.write(f" {label.label} (Relevance: {label.relevance})\n")
130-
file.write("\n")
131-
132-
# Summary of all topics
133-
file.write("\nTopic Summary:\n")
134-
for topic, relevance in transcript.iab_categories.summary.items():
135-
file.write(f"Audio is {relevance * 100:.2f}% relevant to {topic}\n")
136-
137-
138102
def process_audio_files(
139103
input_folder: str, output_folder: str, config: Dict[str, Any]
140104
) -> None:

0 commit comments

Comments
 (0)