# import streamlit as st # from keybert import KeyBERT # # KeyBERT model # keybert_model = KeyBERT(model='all-MiniLM-L6-v2') # def get_bert_keywords(text, num_keywords): # result = keybert_model.extract_keywords(text, keyphrase_ngram_range=(1, 1), top_n=num_keywords) # keyberts = [keyword for keyword, score in result] # return keyberts # # Streamlit app # st.title("Keyword Extraction with KeyBERT") # text = st.text_area("Enter your text here:", value='', height=200) num_keywords = st.slider("Number of keywords:", min_value=1, max_value=10, value=5, step=1) # if st.button("Extract Keywords"): # if text: # keywords = get_bert_keywords(text, num_keywords) # st.write("Keywords:") # st.write(", ".join(keywords)) # else: # st.error("Please enter some text.") import streamlit as st st.write(x, 'num_keywords', num_keywords)