harshildarji
commited on
Commit
•
5d0f703
1
Parent(s):
4ec4c3d
Add example text, modify the UI
Browse files
app.py
CHANGED
@@ -218,11 +218,20 @@ def color_substrings(input_string, model_output, ner_labels, current_classes):
|
|
218 |
st.title("CAROLL Language Models - Demo")
|
219 |
st.markdown("<hr>", unsafe_allow_html=True)
|
220 |
|
221 |
-
|
222 |
-
|
|
|
|
|
|
|
223 |
"Choose a model:", ["German Legal NER", "GDPR Privacy Policy NER"], index=0
|
224 |
)
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
if st.button("Analyze"):
|
227 |
if model_choice == "German Legal NER":
|
228 |
ner_model = ner_legal
|
|
|
218 |
st.title("CAROLL Language Models - Demo")
|
219 |
st.markdown("<hr>", unsafe_allow_html=True)
|
220 |
|
221 |
+
# Example texts
|
222 |
+
example_text_legal = "1. Das Bundesarbeitsgericht ist gemäß § 9 Abs. 2 Satz 2 ArbGG iVm. § 201 Abs. 1 Satz 2 GVG für die beabsichtigte Klage gegen den Bund zuständig ."
|
223 |
+
example_text_gdpr = "We do not knowingly collect personal information from anyone under 16. We may limit how we collect, use and store some of the information of EU or EEA users between ages 13 and 16."
|
224 |
+
|
225 |
+
model_choice = st.radio(
|
226 |
"Choose a model:", ["German Legal NER", "GDPR Privacy Policy NER"], index=0
|
227 |
)
|
228 |
|
229 |
+
# Set example text based on model choice
|
230 |
+
if model_choice == "German Legal NER":
|
231 |
+
test_sentence = st.text_area("Enter Text:", value=example_text_legal, height=150)
|
232 |
+
else:
|
233 |
+
test_sentence = st.text_area("Enter Text:", value=example_text_gdpr, height=150)
|
234 |
+
|
235 |
if st.button("Analyze"):
|
236 |
if model_choice == "German Legal NER":
|
237 |
ner_model = ner_legal
|