Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import torch
|
3 |
+
import requests
|
4 |
+
import time
|
5 |
+
import numpy as np
|
6 |
+
import os
|
7 |
+
from toxic1 import toxicity_page
|
8 |
+
from strim_nlp import classic_ml_page
|
9 |
+
from lstm import lstm_model_page
|
10 |
+
from bert_strim import bert_model_page
|
11 |
+
|
12 |
+
|
13 |
+
def app_description_page():
|
14 |
+
st.title("Welcome to My App!")
|
15 |
+
st.write("This is a Streamlit application where you can explore two different models.")
|
16 |
+
|
17 |
+
def model_selection_page():
|
18 |
+
st.sidebar.title("Model Selection")
|
19 |
+
selected_model = st.sidebar.radio("Select a model", ("Classic ML", "LSTM", "BERT"))
|
20 |
+
|
21 |
+
if selected_model == "Classic ML":
|
22 |
+
classic_ml_page()
|
23 |
+
st.write("You selected Classic ML.")
|
24 |
+
elif selected_model == "LSTM":
|
25 |
+
lstm_model_page()
|
26 |
+
st.write("You selected LSTM.")
|
27 |
+
elif selected_model == "BERT":
|
28 |
+
bert_model_page()
|
29 |
+
st.write("You selected BERT.")
|
30 |
+
|
31 |
+
def main():
|
32 |
+
page = st.sidebar.radio("Go to", ("App Description", "Model Selection", "Toxicity Model"))
|
33 |
+
|
34 |
+
if page == "App Description":
|
35 |
+
app_description_page()
|
36 |
+
elif page == "Model Selection":
|
37 |
+
model_selection_page()
|
38 |
+
elif page == "Toxicity Model":
|
39 |
+
toxicity_page()
|
40 |
+
|
41 |
+
if __name__ == "__main__":
|
42 |
+
main()
|