Update app.py
Browse files
app.py
CHANGED
|
@@ -109,28 +109,28 @@ def main():
|
|
| 109 |
img = Image.open(uploaded_photo)
|
| 110 |
img = img.save("img.png")
|
| 111 |
img = cv2.imread("img.png")
|
| 112 |
-
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("
|
| 113 |
st.success(text)
|
| 114 |
if camera_photo:
|
| 115 |
img = Image.open(camera_photo)
|
| 116 |
img = img.save("img.png")
|
| 117 |
img = cv2.imread("img.png")
|
| 118 |
-
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("
|
| 119 |
st.success(text)
|
| 120 |
if uploaded_photo==None and camera_photo==None:
|
| 121 |
#our_image=load_image("image.jpg")
|
| 122 |
#img = cv2.imread("scholarly_text.jpg")
|
| 123 |
text = message
|
| 124 |
# Summarization
|
| 125 |
-
if st.checkbox("Show Text Summarization Genism"):
|
| 126 |
-
st.subheader("Summarize Your Text")
|
| 127 |
#message = st.text_area("Enter the Text","Type please ..")
|
| 128 |
st.text("Using Gensim Summarizer ..")
|
| 129 |
#st.success(mess)
|
| 130 |
summary_result = summarize(text)
|
| 131 |
st.success(summary_result)
|
| 132 |
-
elif st.checkbox("Show Text Summarization T5"):
|
| 133 |
-
st.subheader("Summarize Your Text")
|
| 134 |
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
| 135 |
model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
|
| 136 |
st.text("Using Google T5 Transformer ..")
|
|
|
|
| 109 |
img = Image.open(uploaded_photo)
|
| 110 |
img = img.save("img.png")
|
| 111 |
img = cv2.imread("img.png")
|
| 112 |
+
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark here to see in Bangla") else pytesseract.image_to_string(img)
|
| 113 |
st.success(text)
|
| 114 |
if camera_photo:
|
| 115 |
img = Image.open(camera_photo)
|
| 116 |
img = img.save("img.png")
|
| 117 |
img = cv2.imread("img.png")
|
| 118 |
+
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark here to see Bangla") else pytesseract.image_to_string(img)
|
| 119 |
st.success(text)
|
| 120 |
if uploaded_photo==None and camera_photo==None:
|
| 121 |
#our_image=load_image("image.jpg")
|
| 122 |
#img = cv2.imread("scholarly_text.jpg")
|
| 123 |
text = message
|
| 124 |
# Summarization
|
| 125 |
+
if st.checkbox("Show Text Summarization Genism for English and Bangla!"):
|
| 126 |
+
st.subheader("Summarize Your Text for English and Bangla Texts!")
|
| 127 |
#message = st.text_area("Enter the Text","Type please ..")
|
| 128 |
st.text("Using Gensim Summarizer ..")
|
| 129 |
#st.success(mess)
|
| 130 |
summary_result = summarize(text)
|
| 131 |
st.success(summary_result)
|
| 132 |
+
elif st.checkbox("Show Text Summarization T5 for English only!"):
|
| 133 |
+
st.subheader("Summarize Your Text for English only!")
|
| 134 |
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
| 135 |
model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
|
| 136 |
st.text("Using Google T5 Transformer ..")
|