Spaces:
Running
Running
done
Browse files- advice_model.pkl +3 -0
- app.py +52 -0
- requirements.txt +4 -0
- vectorizer.pkl +3 -0
advice_model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bbc334a5527d8cecf31ea7094926afa1f8e8c0fe0c7334ed197c4bc0f301ca9e
|
3 |
+
size 19075
|
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import joblib
|
3 |
+
|
4 |
+
# Load model and vectorizer
|
5 |
+
model = joblib.load('advice_model.pkl')
|
6 |
+
vectorizer = joblib.load('vectorizer.pkl')
|
7 |
+
|
8 |
+
# Streamlit app
|
9 |
+
st.title('Advice on How to Talk to Girls π¬β€οΈ')
|
10 |
+
st.write('Enter your scenario below and get advice!')
|
11 |
+
|
12 |
+
user_input = st.text_area("Your Scenario:")
|
13 |
+
|
14 |
+
if st.button('Get Advice'):
|
15 |
+
if user_input:
|
16 |
+
X = vectorizer.transform([user_input])
|
17 |
+
prediction = model.predict(X)
|
18 |
+
st.write(f'Advice: {prediction[0]}')
|
19 |
+
else:
|
20 |
+
st.write('Please enter a scenario.')
|
21 |
+
|
22 |
+
# Styling the app
|
23 |
+
st.markdown("""
|
24 |
+
<style>
|
25 |
+
body {
|
26 |
+
background-image: url("https://your-image-url.jpg");
|
27 |
+
background-size: cover;
|
28 |
+
font-family: Arial, Helvetica, sans-serif;
|
29 |
+
}
|
30 |
+
h1 {
|
31 |
+
color: #333399;
|
32 |
+
text-shadow: 2px 2px #ff99cc;
|
33 |
+
}
|
34 |
+
.stButton>button {
|
35 |
+
background-color: #333399;
|
36 |
+
color: white;
|
37 |
+
border: none;
|
38 |
+
padding: 10px 20px;
|
39 |
+
border-radius: 5px;
|
40 |
+
cursor: pointer;
|
41 |
+
}
|
42 |
+
.stButton>button:hover {
|
43 |
+
background-color: #ff99cc;
|
44 |
+
}
|
45 |
+
.stTextArea>div>div>textarea {
|
46 |
+
background-color: #f0f0f5;
|
47 |
+
border-radius: 10px;
|
48 |
+
}
|
49 |
+
</style>
|
50 |
+
""", unsafe_allow_html=True)
|
51 |
+
|
52 |
+
st.markdown("<div style='text-align: center;'>πππΈπ¬</div>", unsafe_allow_html=True)
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pandas
|
2 |
+
scikit-learn
|
3 |
+
joblib
|
4 |
+
streamlit
|
vectorizer.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7cfc2a36a32c66256c3f868af13a9c1fea888893398816d1d86bd8dcbb38b5fe
|
3 |
+
size 2966
|