am_text_summary / app.py
berito's picture
model added
5a17a45
raw
history blame
1.22 kB
import streamlit as st
from PIL import Image
# Streamlit UI
# Left column: Text input and summary
st.title("Amharic Text Summarizer")
st.write("Paste your Amharic text below and click 'Summarize' to generate a concise summary.")
st.write("This app uses a trained FastText model to summarize your input text.")
col1, col2 = st.columns([6, 1]) # Wider column on the left
# Layout with two columns
# with col1:
# Text input area
input_text = st.text_area("Input Text", placeholder="Paste your Amharic text here...",height=200)
summarized_text=""
# Summarize button
if st.button("Summarize"):
if input_text.strip():
with st.spinner("Summarizing..."):
summarized_text = "summarize_text(input_text, model)"
st.success("Summarization complete!")
else:
summarized_text = "Please enter text to summarize."
# Output text area for summary
st.text_area("Summarized Text", value=summarized_text, height=200)
# Right column: Display the image
# with col2:
st.write("### Average Loss by Epoch")
# Load and display the image
image = Image.open("avgllose_epoch.png") # Replace with the actual path to your image
st.image(image, caption="Epoch vs Average Loss", use_container_width=True)