File size: 565 Bytes
074115a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st
from keybert import KeyBERT

# Create a KeyBERT instance
kw_model = KeyBERT()

# Define the Streamlit app
def main():
    st.title("Keyword Extraction")
    st.write("Enter your document below:")

    # Get user input
    doc = st.text_area("Document")

    # Extract keywords
    if st.button("Extract Keywords"):
        keywords = kw_model.extract_keywords(doc)
        st.write("Keywords:")
        for keyword, score in keywords:
            st.write(f"- {keyword} (Score: {score})")

# Run the app
if __name__ == "__main__":
    main()