File size: 1,210 Bytes
2c97228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
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}")