Spaces:
Configuration error
Configuration error
checkbox and disabled inputs
Browse files
app.py
CHANGED
|
@@ -6,16 +6,21 @@ import matplotlib.pyplot as plt
|
|
| 6 |
# DEBUG st.write(f'streamlit version: {st.__version__}')
|
| 7 |
|
| 8 |
|
| 9 |
-
model_name = st.text_input('
|
|
|
|
|
|
|
| 10 |
|
| 11 |
model = Word2Vec.load(f'models/{model_name}.pkl')
|
| 12 |
|
|
|
|
|
|
|
| 13 |
positive_samples = st.multiselect('Positive samples', options=model.wv.index_to_key, default=[])
|
| 14 |
negative_samples = st.multiselect('Negative samples', options=model.wv.index_to_key, default=[])
|
|
|
|
| 15 |
n_recomms = 5
|
| 16 |
|
| 17 |
if len(positive_samples) + len(negative_samples) > 0:
|
| 18 |
-
st.
|
| 19 |
recomms = model.wv.most_similar(positive=positive_samples,
|
| 20 |
negative=negative_samples,
|
| 21 |
topn=n_recomms)
|
|
|
|
| 6 |
# DEBUG st.write(f'streamlit version: {st.__version__}')
|
| 7 |
|
| 8 |
|
| 9 |
+
model_name = st.text_input('Model: ',
|
| 10 |
+
'metapath2vec_v1.202112011',
|
| 11 |
+
enabled=False)
|
| 12 |
|
| 13 |
model = Word2Vec.load(f'models/{model_name}.pkl')
|
| 14 |
|
| 15 |
+
c_recommend_constructs = st.checkbox('Recommend constructs along with tasks', enabled=False)
|
| 16 |
+
|
| 17 |
positive_samples = st.multiselect('Positive samples', options=model.wv.index_to_key, default=[])
|
| 18 |
negative_samples = st.multiselect('Negative samples', options=model.wv.index_to_key, default=[])
|
| 19 |
+
|
| 20 |
n_recomms = 5
|
| 21 |
|
| 22 |
if len(positive_samples) + len(negative_samples) > 0:
|
| 23 |
+
st.subheader('Recommended tasks or constructs:')
|
| 24 |
recomms = model.wv.most_similar(positive=positive_samples,
|
| 25 |
negative=negative_samples,
|
| 26 |
topn=n_recomms)
|