Update app.py
Browse files
app.py
CHANGED
|
@@ -10,16 +10,18 @@ import ast
|
|
| 10 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
| 11 |
|
| 12 |
# Default article text
|
| 13 |
-
DEFAULT_ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
|
| 14 |
-
A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
|
| 15 |
-
Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared "I do" five more times, sometimes only within two weeks of each other.
|
| 16 |
-
In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her "first and only" marriage.
|
| 17 |
-
Barrientos, now 39, is facing two criminal counts of "offering a false instrument for filing in the first degree," referring to her false statements on the
|
| 18 |
-
2010 marriage license application, according to court documents.
|
| 19 |
-
"""
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Create a text area for user input
|
| 22 |
-
ARTICLE = st.sidebar.text_area('Enter Article', DEFAULT_ARTICLE, height=150)
|
| 23 |
|
| 24 |
# Define the summarization function
|
| 25 |
def summarize(txt):
|
|
@@ -45,15 +47,17 @@ else:
|
|
| 45 |
sentiment_pipeline = pipeline("sentiment-analysis")
|
| 46 |
|
| 47 |
# Default article text
|
| 48 |
-
DEFAULT_SENTIMENT = """[
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
]"""
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
DEFAULT_SENTIMENT = "I'm so happy today!"
|
| 55 |
# Create a text area for user input
|
| 56 |
-
SENTIMENT = st.sidebar.text_area('Enter Sentiment', DEFAULT_SENTIMENT, height=150)
|
| 57 |
|
| 58 |
def is_valid_list_string(string):
|
| 59 |
try:
|
|
|
|
| 10 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
| 11 |
|
| 12 |
# Default article text
|
| 13 |
+
# DEFAULT_ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
|
| 14 |
+
# A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
|
| 15 |
+
# Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared "I do" five more times, sometimes only within two weeks of each other.
|
| 16 |
+
# In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her "first and only" marriage.
|
| 17 |
+
# Barrientos, now 39, is facing two criminal counts of "offering a false instrument for filing in the first degree," referring to her false statements on the
|
| 18 |
+
# 2010 marriage license application, according to court documents.
|
| 19 |
+
# """
|
| 20 |
+
|
| 21 |
+
DEFAULT_ARTICLE = ""
|
| 22 |
|
| 23 |
# Create a text area for user input
|
| 24 |
+
ARTICLE = st.sidebar.text_area('Enter Article (String)', DEFAULT_ARTICLE, height=150)
|
| 25 |
|
| 26 |
# Define the summarization function
|
| 27 |
def summarize(txt):
|
|
|
|
| 47 |
sentiment_pipeline = pipeline("sentiment-analysis")
|
| 48 |
|
| 49 |
# Default article text
|
| 50 |
+
# DEFAULT_SENTIMENT = """[
|
| 51 |
+
# "I'm so happy today!",
|
| 52 |
+
# "This is the worst experience ever.",
|
| 53 |
+
# "It's a decent product, nothing special."
|
| 54 |
+
# ]"""
|
| 55 |
+
|
| 56 |
+
# DEFAULT_SENTIMENT = "I'm so happy today!"
|
| 57 |
+
DEFAULT_SENTIMENT = ""
|
| 58 |
|
|
|
|
| 59 |
# Create a text area for user input
|
| 60 |
+
SENTIMENT = st.sidebar.text_area('Enter Sentiment (String or List of Strings)', DEFAULT_SENTIMENT, height=150)
|
| 61 |
|
| 62 |
def is_valid_list_string(string):
|
| 63 |
try:
|