Spaces:
Runtime error
Runtime error
Andy Lau
commited on
Commit
·
e334be7
1
Parent(s):
9697e74
wip initial modelcc
Browse files- app.py +53 -0
- figures/ModelCC.png +0 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import PIL
|
4 |
+
|
5 |
+
from bokeh.models.widgets import Div
|
6 |
+
|
7 |
+
|
8 |
+
def url_button(button_name,url):
|
9 |
+
if st.button(button_name):
|
10 |
+
js = """window.open('{url}')""".format(url=url) # New tab or window
|
11 |
+
html = '<img src onerror="{}">'.format(js)
|
12 |
+
div = Div(text=html)
|
13 |
+
st.bokeh_chart(div)
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
st.markdown("# Character Counter: Email Industry")
|
18 |
+
|
19 |
+
col1, col2, col3 = st.columns([1,1,1])
|
20 |
+
|
21 |
+
with col2:
|
22 |
+
img = PIL.Image.open("figures/ModelCC.png")
|
23 |
+
st.image(img)
|
24 |
+
|
25 |
+
stats_col1, stats_col2, stats_col3, stats_col4 = st.columns([1,1,1,1])
|
26 |
+
|
27 |
+
with stats_col1:
|
28 |
+
st.metric(label="Production", value="Ready")
|
29 |
+
with stats_col2:
|
30 |
+
st.metric(label="Accuracy", value="85%")
|
31 |
+
|
32 |
+
with stats_col3:
|
33 |
+
st.metric(label="Speed", value="3.86 ms")
|
34 |
+
|
35 |
+
with stats_col4:
|
36 |
+
st.metric(label="Industry", value="Email")
|
37 |
+
|
38 |
+
|
39 |
+
with st.sidebar:
|
40 |
+
|
41 |
+
url_button('Model Homepage','https://www.loxz.com/#/models/CC')
|
42 |
+
st.text('')
|
43 |
+
|
44 |
+
url_button('Full Report','https://resources.loxz.com/reports/realtime-ml-character-count-model')
|
45 |
+
st.text('')
|
46 |
+
|
47 |
+
# with info_col3:
|
48 |
+
url_button('Amazon Market Place','https://aws.amazon.com/marketplace')
|
49 |
+
st.text('')
|
50 |
+
|
51 |
+
with st.expander('Model Description', expanded=False):
|
52 |
+
st.markdown('Finding the correct length for an email campaign to maximize user engagement can be an ambiguous task. The Loxz Character Count Model allows you to predict the correct length of your emails for a particular industry and a particular type of email. Using these inputs and trained on an extensive proprietary data set from the Loxz family digital archive, the models incorporate real-world and synthetic data to find the optimized character counts. We applied the random forest algorithm in this model. Bootstrapping was also ensembled in the algorithm which effectively prevents overfitting by reducing variance. The model achieves an 86% accuracy on the test set. This inference-based ML model will help the campaign engineers start with an acceptable length and zero in on the best character count, maximizing engagement in their campaign.')
|
53 |
+
|
figures/ModelCC.png
ADDED
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
bokeh
|