Spaces:
Sleeping
Sleeping
| from typing import Dict | |
| import streamlit as st | |
| class TranscriptViewer: | |
| 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}") | |