Update app.py
Browse files
app.py
CHANGED
@@ -134,9 +134,15 @@ def main():
|
|
134 |
tet = read_pdf(uploaded_photo)
|
135 |
#tet = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
136 |
values = st.slider('Select a approximate number of words to view and summarize', 0, 500,1000)
|
|
|
137 |
if values:
|
138 |
text = tet[:values*5]
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
elif uploaded_photo.type != "application/image":
|
142 |
img = Image.open(uploaded_photo)
|
|
|
134 |
tet = read_pdf(uploaded_photo)
|
135 |
#tet = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
136 |
values = st.slider('Select a approximate number of words to view and summarize', 0, 500,1000)
|
137 |
+
tl = len(tet)
|
138 |
if values:
|
139 |
text = tet[:values*5]
|
140 |
+
i=0
|
141 |
+
if st.button("Next"):
|
142 |
+
while(i<tl//values*5):
|
143 |
+
text=tet[i*values*5:(i+1)values*5]
|
144 |
+
i+=1
|
145 |
+
st.success(text)
|
146 |
|
147 |
elif uploaded_photo.type != "application/image":
|
148 |
img = Image.open(uploaded_photo)
|