Peggy Fan commited on
Commit
c74a2f4
1 Parent(s): 94f9477
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,7 +6,7 @@ st.title('Text Analysis using Spacy Textblob')
6
  st.markdown('Type a sentence in the below text box and choose the desired option in the adjacent menu.')
7
  side = st.sidebar.selectbox("Select an option below", ("Sentiment", "Subjectivity", "NER"))
8
  Text = st.text_input("Enter the sentence")
9
- @st.cache
10
  def sentiment(text):
11
  nlp = spacy.load('en_core_web_sm')
12
  nlp.add_pipe('spacytextblob')
@@ -17,7 +17,7 @@ def sentiment(text):
17
  return "Neutral"
18
  else:
19
  return "Positive"
20
- @st.cache
21
  def subjectivity(text):
22
  nlp = spacy.load('en_core_web_sm')
23
  nlp.add_pipe('spacytextblob')
@@ -28,7 +28,7 @@ def subjectivity(text):
28
  return "Less Opinionated sentence"
29
  else:
30
  return "Neutral sentence"
31
- @st.cache
32
  def ner(sentence):
33
  nlp = spacy.load("en_core_web_sm")
34
  doc = nlp(sentence)
 
6
  st.markdown('Type a sentence in the below text box and choose the desired option in the adjacent menu.')
7
  side = st.sidebar.selectbox("Select an option below", ("Sentiment", "Subjectivity", "NER"))
8
  Text = st.text_input("Enter the sentence")
9
+ @st.cache_data
10
  def sentiment(text):
11
  nlp = spacy.load('en_core_web_sm')
12
  nlp.add_pipe('spacytextblob')
 
17
  return "Neutral"
18
  else:
19
  return "Positive"
20
+ @st.cache_data
21
  def subjectivity(text):
22
  nlp = spacy.load('en_core_web_sm')
23
  nlp.add_pipe('spacytextblob')
 
28
  return "Less Opinionated sentence"
29
  else:
30
  return "Neutral sentence"
31
+ @st.cache_data
32
  def ner(sentence):
33
  nlp = spacy.load("en_core_web_sm")
34
  doc = nlp(sentence)