richardorama commited on
Commit
fcee72e
1 Parent(s): 0d5bacb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -57,7 +57,7 @@ MODEL_NAME = "facebook/bart-large-cnn" # A commonly used summarization model
57
  tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
58
  model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_NAME)
59
 
60
- st.sidebar.markdown("<h3 style='text-align: center; font-size: 20px; background-color: white; color: black;'>xxxText Summarization with BART</h3>", unsafe_allow_html=True)
61
  DEFAULT_STATEMENT = ""
62
  # Create a text area for user input
63
  STATEMENT = st.sidebar.text_area('Enter Statement (String1)', DEFAULT_STATEMENT, height=150)
@@ -99,6 +99,7 @@ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
99
  # summary = summarizer(txt, max_length=500, min_length=30, do_sample=False)
100
  # st.write(summary[0]['summary_text'])
101
 
 
102
  DEFAULT_STATEMENT = ""
103
  # Create a text area for user input
104
  STATEMENT = st.sidebar.text_area('Enter Statement (String)', DEFAULT_STATEMENT, height=150)
@@ -150,7 +151,7 @@ def analyze_sentiment(txt):
150
  st.write(f"Text: {txt}")
151
  st.write(f"Sentiment: {results[0]['label']}, Score: {results[0]['score']:.2f}\n")
152
 
153
-
154
  DEFAULT_SENTIMENT = ""
155
  # Create a text area for user input
156
  SENTIMENT = st.sidebar.text_area('Enter Sentiment (String or List of Strings)', DEFAULT_SENTIMENT, height=150)
 
57
  tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
58
  model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_NAME)
59
 
60
+ st.sidebar.markdown("<h3 style='text-align: center; font-size: 16px; background-color: white; color: black;'>Text Summarization - BART</h3>", unsafe_allow_html=True)
61
  DEFAULT_STATEMENT = ""
62
  # Create a text area for user input
63
  STATEMENT = st.sidebar.text_area('Enter Statement (String1)', DEFAULT_STATEMENT, height=150)
 
99
  # summary = summarizer(txt, max_length=500, min_length=30, do_sample=False)
100
  # st.write(summary[0]['summary_text'])
101
 
102
+ st.sidebar.markdown("<h3 style='text-align: center; font-size: 16px; background-color: white; color: black;'>Text Summarization - BART</h3>", unsafe_allow_html=True)
103
  DEFAULT_STATEMENT = ""
104
  # Create a text area for user input
105
  STATEMENT = st.sidebar.text_area('Enter Statement (String)', DEFAULT_STATEMENT, height=150)
 
151
  st.write(f"Text: {txt}")
152
  st.write(f"Sentiment: {results[0]['label']}, Score: {results[0]['score']:.2f}\n")
153
 
154
+ st.sidebar.markdown("<h3 style='text-align: center; font-size: 16px; background-color: white; color: black;'>Sentiment Analysis</h3>", unsafe_allow_html=True)
155
  DEFAULT_SENTIMENT = ""
156
  # Create a text area for user input
157
  SENTIMENT = st.sidebar.text_area('Enter Sentiment (String or List of Strings)', DEFAULT_SENTIMENT, height=150)