keybert / app.py
varun500's picture
Create app.py
074115a
raw
history blame
565 Bytes
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()