import streamlit as st from textsummarizer.pipeline.predict import PredictionPipeline def main(): # Set page config st.set_page_config(page_title="Dialogue Summarizer", page_icon="💬", layout="wide") # Custom CSS to improve the appearance st.markdown(""" """, unsafe_allow_html=True) # App title and description st.title("🤖 AI Dialogue Summarizer") st.markdown("Transform your lengthy conversations into concise summaries with our cutting-edge AI technology.") # Create two columns col1, col2 = st.columns([2, 1]) with col1: st.markdown('
Input Dialogue
', unsafe_allow_html=True) user_input = st.text_area("", height=300, placeholder="Paste your dialogue here...") with col2: st.markdown('Summary
', unsafe_allow_html=True) summary_placeholder = st.empty() # Create an instance of PredictionPipeline predictor = PredictionPipeline() if st.button("📝 Generate Summary"): if user_input: with st.spinner('Generating summary...'): # Get the summary summary = predictor.predict(user_input) # Display the summary summary_placeholder.markdown(f'{summary}
', unsafe_allow_html=True) else: st.warning("⚠️ Please enter some text to summarize.") # Add some spacing st.markdown("