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 = ( """ """ % bin_str ) st.markdown(page_bg_img, unsafe_allow_html=True) # Set background image set_background("tg_toxic.png") title_html = """
Toxicity Assessment of User Comments
""" st.markdown(title_html, unsafe_allow_html=True) # Title and text with styled hyperlink st.write( """Used model: rubert-tiny-toxicity
Accuracy:
Pretrained model: 82%
After training on user's data: 90%
Link: Toxicity Assessment Bot """, unsafe_allow_html=True, )