import streamlit as st from transformers import AutoTokenizer from fastT5 import OnnxT5,get_onnx_runtime_sessions from annotated_text import annotated_text import nltk nltk.download('stopwords') nltk.download('wordnet') nltk.download('punkt') from nltk.corpus import stopwords,wordnet from nltk.tokenize import sent_tokenize from flashtext import KeywordProcessor import regex as re import string import subprocess from PIL import Image import logging import multiprocessing total_threads=multiprocessing.cpu_count() try: import pke logging.error("importing pke info") except: logging.error("installing pke info") subprocess.run(['pip3', 'install','git+https://github.com/boudinfl/pke.git']) subprocess.run(['python3' ,'-m' ,'spacy' ,'download' ,'en']) import pke st.set_page_config( # Alternate names: setup_page, page, layout layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc. initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed" page_title='None', # String or None. Strings get appended with "• Streamlit". ) def set_page_title(title): st.sidebar.markdown(unsafe_allow_html=True, body=f"""