Soumen commited on
Commit
3390c89
·
1 Parent(s): c745dc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -94,10 +94,17 @@ def main():
94
  #tet = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
95
  values = st.slider('Select a approximate number of lines to see and summarize',value=[0, len(tet)//(7*100)])
96
  st.text("Selected text for summarize: ")
97
- text = tet[values[0]*7*10:values[1]*7*10] if values[0]!=len(tet)//(7*10) else tet[len(tet)//(7*100):]
98
- st.success(text)
99
- st.text("Summarized text: ")
100
- engsum(text)
 
 
 
 
 
 
 
101
  elif uploaded_photo and uploaded_photo.type !='application/pdf':
102
  text=None
103
  img = Image.open(uploaded_photo)
 
94
  #tet = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
95
  values = st.slider('Select a approximate number of lines to see and summarize',value=[0, len(tet)//(7*100)])
96
  st.text("Selected text for summarize: ")
97
+ if st.button("BENGALI"):
98
+ text = tet[values[0]*7*10:values[1]*7*100] if values[0]!=len(tet)//(7*100) else tet[len(tet)//(7*100):]
99
+ st.success(text)
100
+ st.text("Summarized text: ")
101
+ bansum(text)
102
+ if st.button("ENGLISH"):
103
+ text = tet[values[0]*7*10:values[1]*7*100] if values[0]!=len(tet)//(7*100) else tet[len(tet)//(7*100):]
104
+ st.success(text)
105
+ st.text("Summarized text: ")
106
+ engsum(text)
107
+
108
  elif uploaded_photo and uploaded_photo.type !='application/pdf':
109
  text=None
110
  img = Image.open(uploaded_photo)