Update app.py
Browse files
app.py
CHANGED
@@ -109,11 +109,11 @@ def main():
|
|
109 |
# text_chunks = text_splitter.split_documents(text)
|
110 |
values = st.slider('Select a approximate number of lines to see and summarize',value=[0, len(tet)//(7*100)])
|
111 |
text = tet[values[0]*7*10:values[1]*10*100] if values[0]!=len(tet)//(10*100) else tet[len(tet)//(10*100):]
|
112 |
-
#st.text("Selected text for summarize: ")
|
113 |
#st.success(type(text_chunks))
|
114 |
if st.button("English Pdf Summarize"):
|
|
|
115 |
st.success(text)
|
116 |
-
st.
|
117 |
engsum(text)
|
118 |
|
119 |
elif uploaded_photo and uploaded_photo.type !='application/pdf':
|
@@ -124,9 +124,11 @@ def main():
|
|
124 |
st.text("Select the summarization type:")
|
125 |
if st.button("BENGALI"):
|
126 |
text = pytesseract.image_to_string(img, lang="ben")
|
|
|
127 |
bansum(text)
|
128 |
if st.button("ENGLISH"):
|
129 |
text=pytesseract.image_to_string(img)
|
|
|
130 |
engsum(text)
|
131 |
#st.success(text)
|
132 |
elif camera_photo:
|
@@ -138,9 +140,11 @@ def main():
|
|
138 |
st.text("Select the summarization type:")
|
139 |
if st.button("Bangla"):
|
140 |
text = pytesseract.image_to_string(img, lang="ben")
|
|
|
141 |
bansum(text)
|
142 |
if st.button("English"):
|
143 |
text=pytesseract.image_to_string(img)
|
|
|
144 |
engsum(text)
|
145 |
else:
|
146 |
text=None
|
|
|
109 |
# text_chunks = text_splitter.split_documents(text)
|
110 |
values = st.slider('Select a approximate number of lines to see and summarize',value=[0, len(tet)//(7*100)])
|
111 |
text = tet[values[0]*7*10:values[1]*10*100] if values[0]!=len(tet)//(10*100) else tet[len(tet)//(10*100):]
|
|
|
112 |
#st.success(type(text_chunks))
|
113 |
if st.button("English Pdf Summarize"):
|
114 |
+
st.subheader("Selected text for summarize: ")
|
115 |
st.success(text)
|
116 |
+
st.subheader("Summarized Text: ")
|
117 |
engsum(text)
|
118 |
|
119 |
elif uploaded_photo and uploaded_photo.type !='application/pdf':
|
|
|
124 |
st.text("Select the summarization type:")
|
125 |
if st.button("BENGALI"):
|
126 |
text = pytesseract.image_to_string(img, lang="ben")
|
127 |
+
st.subheader("সারাংশ/সারমর্ম")
|
128 |
bansum(text)
|
129 |
if st.button("ENGLISH"):
|
130 |
text=pytesseract.image_to_string(img)
|
131 |
+
st.subheader("Summarized Text")
|
132 |
engsum(text)
|
133 |
#st.success(text)
|
134 |
elif camera_photo:
|
|
|
140 |
st.text("Select the summarization type:")
|
141 |
if st.button("Bangla"):
|
142 |
text = pytesseract.image_to_string(img, lang="ben")
|
143 |
+
st.subheader("সারাংশ/সারমর্ম")
|
144 |
bansum(text)
|
145 |
if st.button("English"):
|
146 |
text=pytesseract.image_to_string(img)
|
147 |
+
st.subheader("Summarized Text")
|
148 |
engsum(text)
|
149 |
else:
|
150 |
text=None
|