sifujohn commited on
Commit
cc2d8c4
β€’
1 Parent(s): 0b7d19d

code update

Browse files

Code improvement with comments

Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,12 +1,18 @@
 
1
  import streamlit as st
2
-
3
  from transformers import pipeline
4
 
 
 
5
  pipe = pipeline('sentiment-analysis', model = 'SamLowe/roberta-base-go_emotions')
6
- text = st.text_area('Enter given text here')
7
 
 
8
  st.title ('Check the sentiment of your email before sending it outπŸ˜ŽπŸ˜­πŸ˜πŸ˜”β€οΈ')
9
 
 
 
 
 
10
  if text:
11
  out = pipe(text)
12
  st.json(out)
 
1
+ #import necessary libraries
2
  import streamlit as st
 
3
  from transformers import pipeline
4
 
5
+ #buidling a sentiment pipeline
6
+
7
  pipe = pipeline('sentiment-analysis', model = 'SamLowe/roberta-base-go_emotions')
 
8
 
9
+ #give a title to app
10
  st.title ('Check the sentiment of your email before sending it outπŸ˜ŽπŸ˜­πŸ˜πŸ˜”β€οΈ')
11
 
12
+ #text field for user to input data
13
+ text = st.text_area('Enter given text here')
14
+
15
+ # output formated in json format
16
  if text:
17
  out = pipe(text)
18
  st.json(out)