Surendradjh commited on
Commit
566b1df
·
verified ·
1 Parent(s): abae5e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -89,24 +89,29 @@ if choice == "Sentiment Analysis":
89
  elif choice == "Text Summarization":
90
  st.title("Text Summarization")
91
  option = st.selectbox("Choose Input Type", ["Sample Input", "Enter your own"])
92
-
93
  if option == "Sample Input":
94
  text = """Title: The Lost Treasure of Eldoria
95
  In the small village of Eldoria, nestled between towering mountains and lush green forests, lived a young girl named Lila. She was known for her adventurous spirit and her insatiable curiosity about the tales and legends of her land...
96
  [You can keep full text here if desired]
97
- """
98
- st.write(text)
 
99
  data = summary(text)
100
  st.subheader("Summary")
101
- st.write(data[0]['summary_text'])
 
102
 
103
  else:
104
- text = st.text_area("Enter your text here", height=300)
 
105
  if st.button("Find"):
106
  if text.strip():
 
107
  data = summary(text)
108
  st.subheader("Summary")
109
- st.write(data[0]['summary_text'])
 
110
  else:
111
  st.warning("Please enter some text.")
112
 
 
89
  elif choice == "Text Summarization":
90
  st.title("Text Summarization")
91
  option = st.selectbox("Choose Input Type", ["Sample Input", "Enter your own"])
92
+ col1, col2 = st.columns(2)
93
  if option == "Sample Input":
94
  text = """Title: The Lost Treasure of Eldoria
95
  In the small village of Eldoria, nestled between towering mountains and lush green forests, lived a young girl named Lila. She was known for her adventurous spirit and her insatiable curiosity about the tales and legends of her land...
96
  [You can keep full text here if desired]
97
+ """
98
+ with col1:
99
+ st.write(text)
100
  data = summary(text)
101
  st.subheader("Summary")
102
+ with col2:
103
+ st.write(data[0]['summary_text'])
104
 
105
  else:
106
+ with col1:
107
+ text = st.text_area("Enter your text here", height=300)
108
  if st.button("Find"):
109
  if text.strip():
110
+
111
  data = summary(text)
112
  st.subheader("Summary")
113
+ with col2:
114
+ st.write(data[0]['summary_text'])
115
  else:
116
  st.warning("Please enter some text.")
117