Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ import pdf2image
|
|
42 |
# NLP Pkgs
|
43 |
from textblob import TextBlob
|
44 |
import spacy
|
45 |
-
from gensim.
|
46 |
import requests
|
47 |
import cv2
|
48 |
import numpy as np
|
@@ -114,14 +114,14 @@ def main():
|
|
114 |
+ Tokenization(POS tagging) & Lemmatization(root mean) using Spacy
|
115 |
+ Named Entity Recognition(NER)/Trigger word detection using SpaCy
|
116 |
+ Sentiment Analysis using TextBlob
|
117 |
-
+ Document/Text Summarization using
|
118 |
""")
|
119 |
def change_photo_state():
|
120 |
st.session_state["photo"]="done"
|
121 |
st.subheader("Please, feed your image/text, features/services will appear automatically!")
|
122 |
message = st.text_input("Type your text here!")
|
123 |
-
camera_photo = st.camera_input("Take a photo, Containing English
|
124 |
-
uploaded_photo = st.file_uploader("Upload
|
125 |
if "photo" not in st.session_state:
|
126 |
st.session_state["photo"]="not done"
|
127 |
if st.session_state["photo"]=="done" or message:
|
@@ -178,13 +178,13 @@ def main():
|
|
178 |
st.text("Using Hugging Face Transformer, Contrastive Search ..")
|
179 |
output = model.generate(input_ids, max_length=128)
|
180 |
st.success(tokenizer.decode(output[0], skip_special_tokens=True))
|
181 |
-
if st.checkbox("Mark here, Text Summarization for English or Bangla!"):
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
if st.checkbox("Mark to better English Text Summarization!"):
|
189 |
#st.title("Summarize Your Text for English only!")
|
190 |
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
|
|
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
|
|
|
114 |
+ Tokenization(POS tagging) & Lemmatization(root mean) using Spacy
|
115 |
+ Named Entity Recognition(NER)/Trigger word detection using SpaCy
|
116 |
+ Sentiment Analysis using TextBlob
|
117 |
+
+ Document/Text Summarization using T5 for English Abstractive.
|
118 |
""")
|
119 |
def change_photo_state():
|
120 |
st.session_state["photo"]="done"
|
121 |
st.subheader("Please, feed your image/text, features/services will appear automatically!")
|
122 |
message = st.text_input("Type your text here!")
|
123 |
+
camera_photo = st.camera_input("Take a photo, Containing English texts", on_change=change_photo_state)
|
124 |
+
uploaded_photo = st.file_uploader("Upload your PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
|
125 |
if "photo" not in st.session_state:
|
126 |
st.session_state["photo"]="not done"
|
127 |
if st.session_state["photo"]=="done" or message:
|
|
|
178 |
st.text("Using Hugging Face Transformer, Contrastive Search ..")
|
179 |
output = model.generate(input_ids, max_length=128)
|
180 |
st.success(tokenizer.decode(output[0], skip_special_tokens=True))
|
181 |
+
# if st.checkbox("Mark here, Text Summarization for English or Bangla!"):
|
182 |
+
# st.subheader("Summarize Your Text for English and Bangla Texts!")
|
183 |
+
# message = st.text_area("Enter the Text","Type please ..")
|
184 |
+
# st.text("Using Gensim Summarizer ..")
|
185 |
+
# st.success(message)
|
186 |
+
# summary_result = summarize(text)
|
187 |
+
# st.success(summary_result)
|
188 |
if st.checkbox("Mark to better English Text Summarization!"):
|
189 |
#st.title("Summarize Your Text for English only!")
|
190 |
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|