File size: 1,389 Bytes
d632bd4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import base64

import streamlit as st


# Function to get base64 string from an image file
def get_base64(file_path):
    with open(file_path, "rb") as file:
        base64_bytes = base64.b64encode(file.read())
        base64_string = base64_bytes.decode("utf-8")
    return base64_string


# Function to set background image
def set_background(png_file):
    bin_str = get_base64(png_file)
    page_bg_img = (
        """
    <style>
    .stApp {
    background-image: url("data:image/png;base64,%s");
    background-size: auto;
    }
    </style>
    """
        % bin_str
    )
    st.markdown(page_bg_img, unsafe_allow_html=True)


# Set background image
set_background("tg_toxic.png")

title_html = """<p style='font-size: 50px; color: black;'>Toxicity Assessment of User Comments</p>"""
st.markdown(title_html, unsafe_allow_html=True)
# Title and text with styled hyperlink
st.write(
    """<p style='font-size: 18px; color: black;'>Used model: rubert-tiny-toxicity</p>
    <p style='font-size: 18px; color: black;'>Accuracy:</p>
    <p style='font-size: 18px; color: black;'>Pretrained model: 82%</p>
    <p style='font-size: 18px; color: black;'>After training on user's data: 90%</p>
    <a href='https://t.me/toxicity_assessment12345_bot' style='font-size: 18px; color: black; text-decoration: underline;'>Link: Toxicity Assessment Bot</a>
    """,
    unsafe_allow_html=True,
)