Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def engsum(output):
|
|
58 |
|
59 |
out = query({
|
60 |
"inputs": output,
|
61 |
-
"min_length":
|
62 |
})
|
63 |
if isinstance(out, list) and out[0].get("generated_text"):
|
64 |
text_output = out[0]["generated_text"]
|
@@ -67,7 +67,7 @@ def bansum(text):
|
|
67 |
def query(payload):
|
68 |
response = requests.post(API_URL0, headers=headers0, json=payload)
|
69 |
return response.json()
|
70 |
-
out = query({"inputs": text, "min_length":
|
71 |
if isinstance(out, list) and out[0].get("summary_text"):
|
72 |
text_output = out[0]["summary_text"]
|
73 |
st.success(text_output)
|
@@ -93,10 +93,10 @@ def main():
|
|
93 |
tet = read_pdf(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("
|
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("
|
100 |
engsum(text)
|
101 |
if uploaded_photo and uploaded_photo.type !='application/pdf':
|
102 |
text=None
|
|
|
58 |
|
59 |
out = query({
|
60 |
"inputs": output,
|
61 |
+
"min_length":300
|
62 |
})
|
63 |
if isinstance(out, list) and out[0].get("generated_text"):
|
64 |
text_output = out[0]["generated_text"]
|
|
|
67 |
def query(payload):
|
68 |
response = requests.post(API_URL0, headers=headers0, json=payload)
|
69 |
return response.json()
|
70 |
+
out = query({"inputs": text, "min_length":300})
|
71 |
if isinstance(out, list) and out[0].get("summary_text"):
|
72 |
text_output = out[0]["summary_text"]
|
73 |
st.success(text_output)
|
|
|
93 |
tet = read_pdf(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 |
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 |
if uploaded_photo and uploaded_photo.type !='application/pdf':
|
102 |
text=None
|