Spaces:
Runtime error
Runtime error
songhai2022
commited on
Commit
·
73357bc
1
Parent(s):
0d66495
Update app.py
Browse files
app.py
CHANGED
@@ -1,28 +1,33 @@
|
|
1 |
-
# import streamlit as st
|
2 |
-
# from keybert import KeyBERT
|
|
|
|
|
|
|
3 |
|
4 |
-
# #
|
5 |
-
#
|
|
|
|
|
6 |
|
7 |
-
#
|
8 |
-
#
|
9 |
-
#
|
10 |
-
#
|
11 |
|
12 |
-
# #
|
13 |
-
#
|
14 |
-
#
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
#
|
18 |
-
# if text:
|
19 |
-
# keywords = get_bert_keywords(text, num_keywords)
|
20 |
-
# st.write("Keywords:")
|
21 |
-
# st.write(", ".join(keywords))
|
22 |
-
# else:
|
23 |
-
# st.error("Please enter some text.")
|
24 |
|
25 |
import streamlit as st
|
26 |
|
27 |
-
st.
|
|
|
28 |
|
|
|
1 |
+
# # import streamlit as st
|
2 |
+
# # from keybert import KeyBERT
|
3 |
+
|
4 |
+
# # # KeyBERT model
|
5 |
+
# # keybert_model = KeyBERT(model='all-MiniLM-L6-v2')
|
6 |
|
7 |
+
# # def get_bert_keywords(text, num_keywords):
|
8 |
+
# # result = keybert_model.extract_keywords(text, keyphrase_ngram_range=(1, 1), top_n=num_keywords)
|
9 |
+
# # keyberts = [keyword for keyword, score in result]
|
10 |
+
# # return keyberts
|
11 |
|
12 |
+
# # # Streamlit app
|
13 |
+
# # st.title("Keyword Extraction with KeyBERT")
|
14 |
+
# # text = st.text_area("Enter your text here:", value='', height=200)
|
15 |
+
# num_keywords = st.slider("Number of keywords:", min_value=1, max_value=10, value=5, step=1)
|
16 |
|
17 |
+
# # if st.button("Extract Keywords"):
|
18 |
+
# # if text:
|
19 |
+
# # keywords = get_bert_keywords(text, num_keywords)
|
20 |
+
# # st.write("Keywords:")
|
21 |
+
# # st.write(", ".join(keywords))
|
22 |
+
# # else:
|
23 |
+
# # st.error("Please enter some text.")
|
24 |
+
|
25 |
+
# import streamlit as st
|
26 |
|
27 |
+
# st.write(x, 'num_keywords', num_keywords)
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
import streamlit as st
|
30 |
|
31 |
+
x = st.slider('Select a value')
|
32 |
+
st.write(x, 'squared is', x * x)
|
33 |
|