Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import spacy
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
st.title('Strong Word Highlighter')
|
5 |
+
st.write('Strong words evoke emotions, may offend and may indicate bias. Write or paste text and the machine will attempt to identify strong words.')
|
6 |
+
|
7 |
+
with st.spinner('The model is loading.')
|
8 |
+
nlp = space.load('en_pipeline')
|
9 |
+
|
10 |
+
input = st.text_area()
|
11 |
+
text = nlp(input)
|
12 |
+
|
13 |
+
output_html = spacy.displacy.render(text, style='ent', jupyter=False, options = {"colors": {'bias': 'ff5a36'}})
|
14 |
+
|
15 |
+
st.markdown(output_html, unsafe_allow_html=True)
|