Soumen commited on
Commit
f719925
·
1 Parent(s): 0ea61c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -35,14 +35,15 @@ from PIL import Image
35
  from PyPDF2 import PdfFileReader
36
  from pdf2image import convert_from_bytes
37
  import pdfplumber
38
- #from line_cor import mark_region
39
  import pdf2image
40
 
41
 
42
  # NLP Pkgs
43
  from textblob import TextBlob
44
  import spacy
45
- #from gensim.summarization import summarize
 
46
  import requests
47
  import cv2
48
  import numpy as np
@@ -180,13 +181,13 @@ def main():
180
  st.text("Using Hugging Face Transformer, Contrastive Search ..")
181
  output = model.generate(input_ids, max_length=128)
182
  st.success(tokenizer.decode(output[0], skip_special_tokens=True))
183
- #if st.checkbox("Mark here, Text Summarization for English or Bangla!"):
184
- #st.subheader("Summarize Your Text for English and Bangla Texts!")
185
- #message = st.text_area("Enter the Text","Type please ..")
186
- #st.text("Using Gensim Summarizer ..")
187
- #st.success(mess)
188
- #summary_result = summarize(text)
189
- #st.success(summary_result)
190
  if st.checkbox("Mark to better English Text Summarization!"):
191
  #st.title("Summarize Your Text for English only!")
192
  tokenizer = AutoTokenizer.from_pretrained('t5-base')
 
35
  from PyPDF2 import PdfFileReader
36
  from pdf2image import convert_from_bytes
37
  import pdfplumber
38
+ from line_cor import mark_region
39
  import pdf2image
40
 
41
 
42
  # NLP Pkgs
43
  from textblob import TextBlob
44
  import spacy
45
+ import gensim
46
+ from gensim.summarization import summarize
47
  import requests
48
  import cv2
49
  import numpy as np
 
181
  st.text("Using Hugging Face Transformer, Contrastive Search ..")
182
  output = model.generate(input_ids, max_length=128)
183
  st.success(tokenizer.decode(output[0], skip_special_tokens=True))
184
+ if st.checkbox("Mark here, Text Summarization for English or Bangla!"):
185
+ st.subheader("Summarize Your Text for English and Bangla Texts!")
186
+ message = st.text_area("Enter the Text","Type please ..")
187
+ st.text("Using Gensim Summarizer ..")
188
+ st.success(mess)
189
+ summary_result = summarize(text)
190
+ st.success(summary_result)
191
  if st.checkbox("Mark to better English Text Summarization!"):
192
  #st.title("Summarize Your Text for English only!")
193
  tokenizer = AutoTokenizer.from_pretrained('t5-base')