KomalDahiya commited on
Commit
90d8b57
·
verified ·
1 Parent(s): 1e961f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
2
  from transformers import pipeline
3
 
4
  st.set_page_config(page_title="LLM Text Summarizer", layout="centered")
5
- st.title("LLM-Powered Text Summarizer")
6
  #st.markdown("This app summarizes long texts using a Hugging Face transformer model (`facebook/bart-large-cnn`).")
7
 
8
  @st.cache_resource
@@ -10,8 +10,20 @@ def load_model():
10
  return pipeline("summarization", model="facebook/bart-large-cnn")
11
 
12
  summarizer = load_model()
 
 
13
 
14
- text = st.text_area("Enter text to summarize", height=300)
 
 
 
 
 
 
 
 
 
 
15
  text = " ".join(text.split()[:700]) # Truncate input to ~700 words
16
 
17
 
 
2
  from transformers import pipeline
3
 
4
  st.set_page_config(page_title="LLM Text Summarizer", layout="centered")
5
+ #st.title("LLM-Powered Text Summarizer")
6
  #st.markdown("This app summarizes long texts using a Hugging Face transformer model (`facebook/bart-large-cnn`).")
7
 
8
  @st.cache_resource
 
10
  return pipeline("summarization", model="facebook/bart-large-cnn")
11
 
12
  summarizer = load_model()
13
+ st.markdown("<h1 style='text-align: center;'>🧠 Smart Document Summarizer using BART</h1>", unsafe_allow_html=True)
14
+ st.markdown("<p style='text-align: center; color: gray;'>This app splits long text into chunks and summarizes each part individually for better results.</p>", unsafe_allow_html=True)
15
 
16
+ # Two columns: Input and Output
17
+ col1, col2 = st.columns(2)
18
+
19
+ with col1:
20
+ st.markdown("### 📝 Enter Document")
21
+ text = st.text_area("Paste your long document here...", height=400, label_visibility="collapsed")
22
+
23
+ with col2:
24
+ st.markdown("### 🧾 Combined Summary")
25
+ summary_box = st.empty()
26
+ #text = st.text_area("Enter text to summarize", height=300)
27
  text = " ".join(text.split()[:700]) # Truncate input to ~700 words
28
 
29