Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
small changes to styling
Browse files- pages/1_๐ท_Label_Clause_Demo.py +2 -2
- pages/2_๐ท_Label_Contract_Demo.py +2 -2
- pages/3_โ_Extract_Demo.py +2 -2
- pages/5_๐_Organise_Demo.py +1 -0
- pages/6_๐_Find_Demo.py +1 -0
- pages/7_โ๏ธ_Draft_Demo.py +24 -0
- pages/8_๐_Summarise_Demo.py +24 -0
- utils.py +4 -2
- ๐ก_Home.py +13 -4
pages/1_๐ท_Label_Clause_Demo.py
CHANGED
@@ -76,7 +76,7 @@ if button:
|
|
76 |
top_labels=1)
|
77 |
col1, col2 = st.columns(2)
|
78 |
with col1:
|
79 |
-
st.
|
80 |
st.write(
|
81 |
f"The model predicts that this is a **{y_pred}** clause with **{y_probs.max() * 100:.2f}%** confidence.")
|
82 |
|
@@ -92,7 +92,7 @@ if button:
|
|
92 |
st.plotly_chart(fig, use_container_width=True)
|
93 |
|
94 |
with col2:
|
95 |
-
st.
|
96 |
st.write(
|
97 |
'We can perform an analysis to work out what terms in the clause were most important in deciding the predicted clause type:')
|
98 |
components.html(exp.as_html(predict_proba=False), height=600)
|
|
|
76 |
top_labels=1)
|
77 |
col1, col2 = st.columns(2)
|
78 |
with col1:
|
79 |
+
st.markdown('### ๐ค Prediction Results')
|
80 |
st.write(
|
81 |
f"The model predicts that this is a **{y_pred}** clause with **{y_probs.max() * 100:.2f}%** confidence.")
|
82 |
|
|
|
92 |
st.plotly_chart(fig, use_container_width=True)
|
93 |
|
94 |
with col2:
|
95 |
+
st.markdown('### ๐ฎ Prediction Explainability')
|
96 |
st.write(
|
97 |
'We can perform an analysis to work out what terms in the clause were most important in deciding the predicted clause type:')
|
98 |
components.html(exp.as_html(predict_proba=False), height=600)
|
pages/2_๐ท_Label_Contract_Demo.py
CHANGED
@@ -101,7 +101,7 @@ if button:
|
|
101 |
top_labels=1)
|
102 |
col1, col2 = st.columns(2)
|
103 |
with col1:
|
104 |
-
st.
|
105 |
st.write(
|
106 |
f"The model predicts that this contract is a **{y_pred.title()}** with **{y_probs.max() * 100:.2f}%** confidence.")
|
107 |
|
@@ -117,7 +117,7 @@ if button:
|
|
117 |
st.plotly_chart(fig, use_container_width=True)
|
118 |
|
119 |
with col2:
|
120 |
-
st.
|
121 |
st.write(
|
122 |
'We can perform an analysis to work out what terms in the contract were most important in deciding the predicted contract type:')
|
123 |
|
|
|
101 |
top_labels=1)
|
102 |
col1, col2 = st.columns(2)
|
103 |
with col1:
|
104 |
+
st.subheader('๐ค Prediction Results')
|
105 |
st.write(
|
106 |
f"The model predicts that this contract is a **{y_pred.title()}** with **{y_probs.max() * 100:.2f}%** confidence.")
|
107 |
|
|
|
117 |
st.plotly_chart(fig, use_container_width=True)
|
118 |
|
119 |
with col2:
|
120 |
+
st.subheader('๐ฎ Prediction Explainability')
|
121 |
st.write(
|
122 |
'We can perform an analysis to work out what terms in the contract were most important in deciding the predicted contract type:')
|
123 |
|
pages/3_โ_Extract_Demo.py
CHANGED
@@ -144,7 +144,7 @@ if button:
|
|
144 |
doc = add_detected_persons_as_parties(doc)
|
145 |
|
146 |
with col1:
|
147 |
-
st.
|
148 |
|
149 |
colors = {'party': "#85C1E9", "address": "#ff6961", "agreement_date": "#5de36f", "role": "#b05de3"}
|
150 |
options = {"ents": ['party', 'address', 'agreement_date', 'role'], "colors": colors}
|
@@ -170,7 +170,7 @@ if button:
|
|
170 |
'Label': []
|
171 |
}
|
172 |
|
173 |
-
st.
|
174 |
for span in doc.spans['sc']:
|
175 |
data['Label'].append(span.label_)
|
176 |
data['Text'].append(span.text)
|
|
|
144 |
doc = add_detected_persons_as_parties(doc)
|
145 |
|
146 |
with col1:
|
147 |
+
st.subheader('๐จ Highlighted Text')
|
148 |
|
149 |
colors = {'party': "#85C1E9", "address": "#ff6961", "agreement_date": "#5de36f", "role": "#b05de3"}
|
150 |
options = {"ents": ['party', 'address', 'agreement_date', 'role'], "colors": colors}
|
|
|
170 |
'Label': []
|
171 |
}
|
172 |
|
173 |
+
st.subheader('๐ Extracted Data')
|
174 |
for span in doc.spans['sc']:
|
175 |
data['Label'].append(span.label_)
|
176 |
data['Text'].append(span.text)
|
pages/5_๐_Organise_Demo.py
CHANGED
@@ -14,6 +14,7 @@ st.set_page_config(
|
|
14 |
)
|
15 |
|
16 |
add_logo_to_sidebar()
|
|
|
17 |
|
18 |
st.title('๐ Organise Demo')
|
19 |
st.markdown("๐ This demo is under construction. Please visit back soon.")
|
|
|
14 |
)
|
15 |
|
16 |
add_logo_to_sidebar()
|
17 |
+
st.sidebar.success("๐ Select a demo above.")
|
18 |
|
19 |
st.title('๐ Organise Demo')
|
20 |
st.markdown("๐ This demo is under construction. Please visit back soon.")
|
pages/6_๐_Find_Demo.py
CHANGED
@@ -14,6 +14,7 @@ st.set_page_config(
|
|
14 |
)
|
15 |
|
16 |
add_logo_to_sidebar()
|
|
|
17 |
|
18 |
st.title('๐ Find Demo')
|
19 |
st.markdown("๐ This demo is currently under construction. Please visit back soon.")
|
|
|
14 |
)
|
15 |
|
16 |
add_logo_to_sidebar()
|
17 |
+
st.sidebar.success("๐ Select a demo above.")
|
18 |
|
19 |
st.title('๐ Find Demo')
|
20 |
st.markdown("๐ This demo is currently under construction. Please visit back soon.")
|
pages/7_โ๏ธ_Draft_Demo.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from utils import add_logo_to_sidebar, add_footer, add_email_signup_form
|
3 |
+
|
4 |
+
st.set_page_config(
|
5 |
+
page_title="Draft Demo",
|
6 |
+
page_icon="โ๏ธ",
|
7 |
+
layout="wide",
|
8 |
+
initial_sidebar_state="expanded",
|
9 |
+
menu_items={
|
10 |
+
'Get Help': 'mailto:[email protected]',
|
11 |
+
'Report a bug': None,
|
12 |
+
'About': "## This a demo showcasing different Legal AI Actions"
|
13 |
+
}
|
14 |
+
)
|
15 |
+
|
16 |
+
add_logo_to_sidebar()
|
17 |
+
st.sidebar.success("๐ Select a demo above.")
|
18 |
+
|
19 |
+
st.title('โ๏ธ Draft Demo')
|
20 |
+
st.markdown("๐ This demo is currently under construction. Please visit back soon.")
|
21 |
+
|
22 |
+
add_email_signup_form()
|
23 |
+
|
24 |
+
add_footer()
|
pages/8_๐_Summarise_Demo.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from utils import add_logo_to_sidebar, add_footer, add_email_signup_form
|
3 |
+
|
4 |
+
st.set_page_config(
|
5 |
+
page_title="Summarise Demo",
|
6 |
+
page_icon="๐",
|
7 |
+
layout="wide",
|
8 |
+
initial_sidebar_state="expanded",
|
9 |
+
menu_items={
|
10 |
+
'Get Help': 'mailto:[email protected]',
|
11 |
+
'Report a bug': None,
|
12 |
+
'About': "## This a demo showcasing different Legal AI Actions"
|
13 |
+
}
|
14 |
+
)
|
15 |
+
|
16 |
+
add_logo_to_sidebar()
|
17 |
+
st.sidebar.success("๐ Select a demo above.")
|
18 |
+
|
19 |
+
st.title('๐ Summarise Demo')
|
20 |
+
st.markdown("๐ This demo is currently under construction. Please visit back soon.")
|
21 |
+
|
22 |
+
add_email_signup_form()
|
23 |
+
|
24 |
+
add_footer()
|
utils.py
CHANGED
@@ -7,7 +7,7 @@ import mailerlite as MailerLite
|
|
7 |
import streamlit as st
|
8 |
|
9 |
client = MailerLite.Client({
|
10 |
-
'api_key':
|
11 |
})
|
12 |
NEWSLETTER_GROUP_ID = "74940965074240697"
|
13 |
|
@@ -35,10 +35,12 @@ def add_logo_to_sidebar():
|
|
35 |
|
36 |
def add_footer():
|
37 |
st.markdown("""
|
38 |
-
###
|
39 |
- ๐ Check out our [website](https://simplexico.ai)
|
40 |
- ๐ Book a call with [us](https://calendly.com/uwais-iqbal/discovery-call)
|
41 |
- โ๏ธ Send us an [email](mailto:[email protected])
|
|
|
|
|
42 |
""")
|
43 |
|
44 |
|
|
|
7 |
import streamlit as st
|
8 |
|
9 |
client = MailerLite.Client({
|
10 |
+
'api_key': 'HELLO'
|
11 |
})
|
12 |
NEWSLETTER_GROUP_ID = "74940965074240697"
|
13 |
|
|
|
35 |
|
36 |
def add_footer():
|
37 |
st.markdown("""
|
38 |
+
### ๐โโ๏ธ Hire us to build out your own tailored Legal AI solutions!
|
39 |
- ๐ Check out our [website](https://simplexico.ai)
|
40 |
- ๐ Book a call with [us](https://calendly.com/uwais-iqbal/discovery-call)
|
41 |
- โ๏ธ Send us an [email](mailto:[email protected])
|
42 |
+
|
43 |
+
**Follow Us on Social Media** - [๐ฅ Twitter](https://twitter.com/_simplexico) | [๐ผ LinkedIn](https://www.linkedin.com/company/simplexico/?viewAsMember=true)
|
44 |
""")
|
45 |
|
46 |
|
๐ก_Home.py
CHANGED
@@ -16,7 +16,7 @@ st.set_page_config(
|
|
16 |
## Add logo to sidebar
|
17 |
add_logo_to_sidebar()
|
18 |
|
19 |
-
st.title("๐ Welcome
|
20 |
|
21 |
st.sidebar.success("๐ Select a demo above.")
|
22 |
|
@@ -33,9 +33,19 @@ st.markdown(
|
|
33 |
- ๐ **Compare** - Using AI to **compare** passages of text
|
34 |
- ๐ **Organise** - Using AI to **organise** a collection of texts
|
35 |
- ๐ **Find** - Using AI to **find** relevant information from a collection of texts
|
|
|
|
|
36 |
|
37 |
**๐ Select a demo from the sidebar** to see some examples of what Legal AI can do!
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
### ๐ What goes into making an AI model?
|
40 |
Building an AI model is a lot like cooking.
|
41 |
A ๐ฉโ๐ณ chef (data scientist) combines the ๐ฅ ingredients (data) according to a recipe ๐ (algorithm)
|
@@ -56,8 +66,7 @@ st.markdown(
|
|
56 |
We have the Legal AI Chefs ๐ฉโ๐ณ and recipes ๐.
|
57 |
You have the ingredients ๐ฅ (data).
|
58 |
We can tailor some yummy Legal AI meals for your taste ๐ฅง!
|
59 |
-
"""
|
60 |
-
|
61 |
-
add_email_signup_form()
|
62 |
|
63 |
add_footer()
|
|
|
16 |
## Add logo to sidebar
|
17 |
add_logo_to_sidebar()
|
18 |
|
19 |
+
st.title("๐ Welcome - Legal AI Demos from simplexico!")
|
20 |
|
21 |
st.sidebar.success("๐ Select a demo above.")
|
22 |
|
|
|
33 |
- ๐ **Compare** - Using AI to **compare** passages of text
|
34 |
- ๐ **Organise** - Using AI to **organise** a collection of texts
|
35 |
- ๐ **Find** - Using AI to **find** relevant information from a collection of texts
|
36 |
+
- โ๏ธ **Draft** - Using AI to **draft** text
|
37 |
+
- ๐ **Summarise** - Using AI to **summarise** text
|
38 |
|
39 |
**๐ Select a demo from the sidebar** to see some examples of what Legal AI can do!
|
40 |
|
41 |
+
๐ข FYI - These demos are to help you understand AI better. They have not been optimised for prediction performance.
|
42 |
+
""")
|
43 |
+
|
44 |
+
add_email_signup_form()
|
45 |
+
|
46 |
+
|
47 |
+
st.markdown(
|
48 |
+
"""
|
49 |
### ๐ What goes into making an AI model?
|
50 |
Building an AI model is a lot like cooking.
|
51 |
A ๐ฉโ๐ณ chef (data scientist) combines the ๐ฅ ingredients (data) according to a recipe ๐ (algorithm)
|
|
|
66 |
We have the Legal AI Chefs ๐ฉโ๐ณ and recipes ๐.
|
67 |
You have the ingredients ๐ฅ (data).
|
68 |
We can tailor some yummy Legal AI meals for your taste ๐ฅง!
|
69 |
+
"""
|
70 |
+
)
|
|
|
71 |
|
72 |
add_footer()
|