Spaces:
Sleeping
Sleeping
sample paragraph added
Browse files
app.py
CHANGED
@@ -3,6 +3,17 @@ from PIL import Image
|
|
3 |
from fast_text_summarizer import FastTextSummarizer
|
4 |
# Streamlit UI
|
5 |
# Left column: Text input and summary
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
st.title("Amharic Text Summarizer")
|
7 |
st.write("This app uses a trained FastText model to summarize your input text.")
|
8 |
st.markdown(
|
@@ -29,7 +40,11 @@ summarizer = FastTextSummarizer(model_file)
|
|
29 |
# Layout with two columns
|
30 |
# with col1:
|
31 |
# Text input area
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
num_sentences = st.slider("Number of Sentences in Summary", min_value=1, max_value=10, value=3)
|
34 |
# summarized_text=""
|
35 |
# Summarize button
|
|
|
3 |
from fast_text_summarizer import FastTextSummarizer
|
4 |
# Streamlit UI
|
5 |
# Left column: Text input and summary
|
6 |
+
sample_paragraphs = [
|
7 |
+
"""በውይይቱ የመስኖና ቆላማ አካባቢ ሚኒስትር አብርሃም በላይ (ዶ/ር) በውይይቱ ላይ ተሳትፈዋል።
|
8 |
+
አብርሃም በላይ (ዶ/ር) በማህበራዊ ትስስር ገጻቸው ባሰፈሩት መልዕክት፤ ከፋውንዴሽኑ ፕሬዚዳንት ጋር በተለያዩ ጉዳዮች ላይ ውይይት መደረጉን ገልጸዋል።
|
9 |
+
በዚህም ነባር ፕሮግራሞች ላይ እንዲሁም ወደፊት ሊኖሩ ስለሚችሉት የአየር ንብረት መቋቋም ኢንሼቲቮች፣ የግሉ ዘርፍ ተሳትፎ እና የመስኖ ልማት የፋይናንስ እድሎች መዳሰሳቸውን ገልጸዋል፡፡
|
10 |
+
የሮክፌለር ፋውንዴሽን በኢትዮጵያ እንደ ኢነርጂ፣ ግብርና እና ጤና ባሉ ፕሮጀክቶች ላይ ድጋፍ የሚያደርግ ዓለም አቀፍ ተቋም ነው፡፡""",
|
11 |
+
"""ታንዛኒያ ዳሬሰላም ይህን አስመልክቶ የአፍሪካ ሀገራት መሪዎችና የዓለም አቀፍ ተቋማት የሥራ ሃላፊዎች መክረዋል፡፡
|
12 |
+
ከገንዘቡ ውስጥ ግማሽ ያህሉ የኤሌክትሪክ አቅርቦት ለሌላቸው ማህበረሰቦች አስተማማኝ የኃይል አቅርቦት ለሚያቀርቡ ታዳሽ የኃይል ምንጭ (የፀሃይ ሃይል ሚኒግሪድ) እንደሚሆንም ተጠቁሟል፡፡
|
13 |
+
ለዚህ የሚሆን ብድርም በአነስተኛ የወለድ መጠን ይገኛልም ነው የተባለው፡፡
|
14 |
+
የዓለም ባንክ ፕሬዚዳንት አጃይ ባንጋ፥ ኤሌክትሪክ ከሌለን ሥራ፣ የጤና እንክብካቤና ሌሎች እድሎችን ለማግኘት ከባድ ነው ሲሉ ተናግረዋል፡፡
|
15 |
+
የመሪዎች ጉባኤው በስድስት ዓመታት ውስጥ ብቻ ከ600 ሚሊየን የአፍሪካ ዜጎች መካከል ግማሹን የኤሌክትሪክ አገልግሎት ተጠቃሚ የሚያደርግ ኃይል ለማመንጨት ቃል መግባቱን የዘገበው ኒው ዮርክ ታይምስ ነው፡፡"""
|
16 |
+
]
|
17 |
st.title("Amharic Text Summarizer")
|
18 |
st.write("This app uses a trained FastText model to summarize your input text.")
|
19 |
st.markdown(
|
|
|
40 |
# Layout with two columns
|
41 |
# with col1:
|
42 |
# Text input area
|
43 |
+
selected_paragraph = st.selectbox(
|
44 |
+
"Choose a sample paragraph (or type your own below):",
|
45 |
+
["Type your own paragraph"] + sample_paragraphs
|
46 |
+
)
|
47 |
+
input_text = st.text_area("Input Text",value=selected_paragraph if selected_paragraph != "Type your own paragraph" else "", placeholder="Paste your Amharic text here and select number of sentence summary.then click summarize button,then wait .result will be displayed below ...",height=200)
|
48 |
num_sentences = st.slider("Number of Sentences in Summary", min_value=1, max_value=10, value=3)
|
49 |
# summarized_text=""
|
50 |
# Summarize button
|