mishrasahil934 commited on
Commit
dac916b
·
verified ·
1 Parent(s): ad376bb
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -61,9 +61,10 @@ def displayPDF(file_path):
61
 
62
  # Streamlit App
63
  def main():
64
- st.title('Content Summarizer')
65
 
66
  # PDF Upload Section
 
67
  uploaded_file = st.file_uploader("Upload your PDF file", type=['pdf'])
68
  if uploaded_file is not None:
69
  if st.button("Summarize PDF"):
@@ -92,13 +93,15 @@ def main():
92
  article_text = scrape_article(url)
93
  if "Error:" in article_text:
94
  st.error(article_text)
95
- else:
96
- st.info("Original Article Content")
97
- st.write(article_text[:1000] + "..." if len(article_text) > 1000 else article_text)
98
-
99
- st.info("Summarized Content")
100
- summary = llm_pipeline(article_text)
101
- st.success(summary)
 
 
102
  else:
103
  st.warning("Please enter a valid URL.")
104
 
 
61
 
62
  # Streamlit App
63
  def main():
64
+ st.title('AI Content Summarizer')
65
 
66
  # PDF Upload Section
67
+ st.header("PDF content Summarizer")
68
  uploaded_file = st.file_uploader("Upload your PDF file", type=['pdf'])
69
  if uploaded_file is not None:
70
  if st.button("Summarize PDF"):
 
93
  article_text = scrape_article(url)
94
  if "Error:" in article_text:
95
  st.error(article_text)
96
+ else:
97
+ col1, col2 = st.columns(2)
98
+ with col1:
99
+ st.info("Original Article Content")
100
+ st.write(article_text[:1000] + "..." if len(article_text) > 1000 else article_text)
101
+ with col2:
102
+ st.info("Summarized Content")
103
+ summary = llm_pipeline(article_text)
104
+ st.success(summary)
105
  else:
106
  st.warning("Please enter a valid URL.")
107