from typing import Dict import streamlit as st class TranscriptViewer: @staticmethod def create(analyzed_transcript: Dict) -> None: """트랜스크립트 분석 결과를 표시하는 컴포넌트 생성""" if not analyzed_transcript: return for i, segment in enumerate(analyzed_transcript.get("chunked_segments", [])): if segment["toxicity_score"] > 0.7: st.error( f"청크 {i+1} ({segment['start']:.1f}s - {segment['end']:.1f}s) - 유해도 점수: {segment['toxicity_score']:.3f}" ) elif segment["toxicity_score"] > 0.5: st.warning( f"청크 {i+1} ({segment['start']:.1f}s - {segment['end']:.1f}s) - 유해도 점수: {segment['toxicity_score']:.3f}" ) else: st.success( f"청크 {i+1} ({segment['start']:.1f}s - {segment['end']:.1f}s) - 유해도 점수: {segment['toxicity_score']:.3f}" ) st.text(segment["transcript"]) st.progress(float(segment["toxicity_score"])) st.text(f"유해도 점수: {segment['toxicity_score']:.3f}")