import streamlit as st from transformers import AutoTokenizer from fastT5 import OnnxT5,get_onnx_runtime_sessions from keywords import tokenize_sentence, get_multipartiterank_topics,get_topicrank_topics,get_yake_topics 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 import string import subprocess import logging import multiprocessing total_threads=multiprocessing.cpu_count() import onnxruntime as ort # from bertopic import BERTopic from sklearn.feature_extraction.text import CountVectorizer 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 session_options_ort = ort.SessionOptions() session_options_ort.intra_op_num_threads=1 session_options_ort.inter_op_num_threads=1 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"""