egumasa commited on
Commit
af5d4ec
1 Parent(s): 33a21ed
Files changed (1) hide show
  1. demo.py +6 -6
demo.py CHANGED
@@ -21,6 +21,10 @@ import streamlit as st
21
  # Load from huggingface
22
  # sm = spacy.load('en_core_web_sm', disable=['ner'])
23
 
 
 
 
 
24
 
25
  @st.cache(allow_output_mutation=True)
26
  def load_model(spacy_model):
@@ -28,7 +32,7 @@ def load_model(spacy_model):
28
  return (nlp)
29
 
30
 
31
- nlp = spacy.load("en_engagement_RoBERTa_combined")
32
 
33
  doc = nlp(
34
  'Welcome! Probably this is one of the few attempts to teach a machine how to read the discourse...! Although it is not perfect, you should be able to get a good place to start for your stance-taking analyses. The result will be presented here.'
@@ -181,10 +185,6 @@ def delete_overlapping_span(span_sc: dict):
181
  continue
182
 
183
 
184
- st.set_page_config(page_title="ENGAGEMENT analyzer (beta ver 0.1)",
185
- layout="wide",
186
- initial_sidebar_state="expanded")
187
-
188
  # st.markdown('''
189
  # <style>
190
  # .sidebar .sidebar-content {{
@@ -232,7 +232,7 @@ st.sidebar.markdown("""
232
  cc = '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.'
233
  st.sidebar.markdown(cc, unsafe_allow_html=True)
234
 
235
- st.title("Engagement Analyzer (beta ver 0.1)")
236
  st.write(
237
  "Engagement Analyzer is a free tool that analyzes English texts for rhetorical strategies under the Engagement system framework (Martin & White, 2005). Martin and White (2005) propose two basic stance-taking strategies: expansion and contraction, which are in turn divided into finer-grained rhetorical strategies. The current tool allows you to analyze texts for a total of nine rhetorical strategies. The definitions of each category label can be found from the side bar"
238
  )
 
21
  # Load from huggingface
22
  # sm = spacy.load('en_core_web_sm', disable=['ner'])
23
 
24
+ st.set_page_config(page_title="ENGAGEMENT analyzer (beta ver 0.1)",
25
+ layout="wide",
26
+ initial_sidebar_state="expanded")
27
+
28
 
29
  @st.cache(allow_output_mutation=True)
30
  def load_model(spacy_model):
 
32
  return (nlp)
33
 
34
 
35
+ nlp = load_model("en_engagement_RoBERTa_combined")
36
 
37
  doc = nlp(
38
  'Welcome! Probably this is one of the few attempts to teach a machine how to read the discourse...! Although it is not perfect, you should be able to get a good place to start for your stance-taking analyses. The result will be presented here.'
 
185
  continue
186
 
187
 
 
 
 
 
188
  # st.markdown('''
189
  # <style>
190
  # .sidebar .sidebar-content {{
 
232
  cc = '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.'
233
  st.sidebar.markdown(cc, unsafe_allow_html=True)
234
 
235
+ # st.title("Engagement Analyzer (beta ver 0.1)")
236
  st.write(
237
  "Engagement Analyzer is a free tool that analyzes English texts for rhetorical strategies under the Engagement system framework (Martin & White, 2005). Martin and White (2005) propose two basic stance-taking strategies: expansion and contraction, which are in turn divided into finer-grained rhetorical strategies. The current tool allows you to analyze texts for a total of nine rhetorical strategies. The definitions of each category label can be found from the side bar"
238
  )