import base64 import streamlit as st 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 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("space_background.jpeg") # About section about = """

About

This is a multipage application created using the Streamlit library and hosted on HuggingFace Spaces. Our application focuses on solving various natural language processing (NLP) tasks using modern machine learning models.

""" # Page 1 content page_1 = """

Classification of Reviews on Clinics

You can input your review about a clinic here, and our application will classify it using three different models:

  1. Logistic Regression trained on TF-IDF representation.
  2. LSTM model with attention mechanism.
  3. ruBERTtiny2.
""" # Page 2 content page_2 = """

Text Generation with GPT Model

Ask about the mysteries of the universe

""" # Project collaborators section project_colaborators = """

Project Collaborators

""" st.markdown(about, unsafe_allow_html=True) static_toxicity_path = "https://imagizer.imageshack.com/v2/480x360q70/r/924/L4Ditq.jpg" animated_toxicity_path = ( "https://i.kym-cdn.com/photos/images/original/001/264/967/cdc.gif" ) animated_enlighten_path = "https://gifdb.com/images/high/zen-meditation-chakras-illustration-6lujnenasnfmn8dt.gif" static_enlighten_path = "https://imagizer.imageshack.com/v2/668x500q70/r/922/bpoy6G.jpg" # Toxicity image HTML toxicity_html = f"""
""" # Enlightenment image HTML enlighten_html = f"""
""" # Add shadow to text content text_shadow_style = """ """ st.markdown(text_shadow_style, unsafe_allow_html=True) # Display the styled text with shadow st.markdown(page_1, unsafe_allow_html=True) st.markdown(toxicity_html, unsafe_allow_html=True) st.markdown(page_2, unsafe_allow_html=True) st.markdown(enlighten_html, unsafe_allow_html=True) st.markdown(project_colaborators, unsafe_allow_html=True)