Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from keybert import KeyBERT
|
3 |
+
|
4 |
+
# Create a KeyBERT instance
|
5 |
+
kw_model = KeyBERT()
|
6 |
+
|
7 |
+
# Define the Streamlit app
|
8 |
+
def main():
|
9 |
+
st.title("Keyword Extraction")
|
10 |
+
st.write("Enter your document below:")
|
11 |
+
|
12 |
+
# Get user input
|
13 |
+
doc = st.text_area("Document")
|
14 |
+
|
15 |
+
# Extract keywords
|
16 |
+
if st.button("Extract Keywords"):
|
17 |
+
keywords = kw_model.extract_keywords(doc)
|
18 |
+
st.write("Keywords:")
|
19 |
+
for keyword, score in keywords:
|
20 |
+
st.write(f"- {keyword} (Score: {score})")
|
21 |
+
|
22 |
+
# Run the app
|
23 |
+
if __name__ == "__main__":
|
24 |
+
main()
|