Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
|
| 17 |
#os.system('conda install -c conda-forge poppler')
|
| 18 |
import streamlit as st
|
| 19 |
st.set_page_config(page_title="Summarization Tool", layout="wide", initial_sidebar_state="expanded")
|
|
|
|
| 20 |
import torch
|
| 21 |
import docx2txt
|
| 22 |
from PIL import Image
|
|
@@ -33,7 +34,6 @@ import line_cor
|
|
| 33 |
import altair as alt
|
| 34 |
#pytesseract.pytesseract.tesseract_cmd = r"./Tesseract-OCR/tesseract.exe"
|
| 35 |
from PIL import Image
|
| 36 |
-
st.title("Bangla and English Summarizer: Upload Images/Pdf or input texts to summarize!")
|
| 37 |
API_URL0 = "https://api-inference.huggingface.co/models/csebuetnlp/mT5_multilingual_XLSum"
|
| 38 |
headers0 = {"Authorization": "Bearer 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"}
|
| 39 |
API_URL1 = "https://api-inference.huggingface.co/models/Michael-Vptn/text-summarization-t5-base"
|
|
@@ -83,7 +83,6 @@ def bansum(text):
|
|
| 83 |
text_output = out[0]["summary_text"]
|
| 84 |
st.success(text_output)
|
| 85 |
|
| 86 |
-
""" NLP Based Application with Streamlit """
|
| 87 |
if "photo" not in st.session_state:
|
| 88 |
st.session_state["photo"]="not done"
|
| 89 |
c2, c3 = st.columns([2.5,1])
|
|
|
|
| 17 |
#os.system('conda install -c conda-forge poppler')
|
| 18 |
import streamlit as st
|
| 19 |
st.set_page_config(page_title="Summarization Tool", layout="wide", initial_sidebar_state="expanded")
|
| 20 |
+
st.title("Bangla and English Summarizer: Upload Images/Pdf or input texts to summarize!")
|
| 21 |
import torch
|
| 22 |
import docx2txt
|
| 23 |
from PIL import Image
|
|
|
|
| 34 |
import altair as alt
|
| 35 |
#pytesseract.pytesseract.tesseract_cmd = r"./Tesseract-OCR/tesseract.exe"
|
| 36 |
from PIL import Image
|
|
|
|
| 37 |
API_URL0 = "https://api-inference.huggingface.co/models/csebuetnlp/mT5_multilingual_XLSum"
|
| 38 |
headers0 = {"Authorization": "Bearer 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"}
|
| 39 |
API_URL1 = "https://api-inference.huggingface.co/models/Michael-Vptn/text-summarization-t5-base"
|
|
|
|
| 83 |
text_output = out[0]["summary_text"]
|
| 84 |
st.success(text_output)
|
| 85 |
|
|
|
|
| 86 |
if "photo" not in st.session_state:
|
| 87 |
st.session_state["photo"]="not done"
|
| 88 |
c2, c3 = st.columns([2.5,1])
|