Update pages/type_text.py
Browse files- pages/type_text.py +6 -5
pages/type_text.py
CHANGED
|
@@ -116,14 +116,15 @@ model = load_model()
|
|
| 116 |
|
| 117 |
INTdesc_embedding = model.encode(INTdesc_input)
|
| 118 |
|
| 119 |
-
# Semantic search, Compute cosine similarity between
|
| 120 |
|
| 121 |
SBScorpus_embeddings = model.encode(SBScorpus)
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
| 127 |
|
| 128 |
@st.cache_resource
|
| 129 |
def load_pipe():
|
|
|
|
| 116 |
|
| 117 |
INTdesc_embedding = model.encode(INTdesc_input)
|
| 118 |
|
| 119 |
+
# Semantic search, Compute cosine similarity between INTdesc_embedding and SBS descriptions
|
| 120 |
|
| 121 |
SBScorpus_embeddings = model.encode(SBScorpus)
|
| 122 |
|
| 123 |
+
if len(chapter_rows_indexes_list) >1:
|
| 124 |
+
#my_model_results = pipeline("ner", model= "checkpoint-92")
|
| 125 |
+
HF_model_results = util.semantic_search(INTdesc_embedding, SBScorpus_embeddings)
|
| 126 |
+
HF_model_results_sorted = sorted(HF_model_results, key=lambda x: x[1], reverse=True)
|
| 127 |
+
HF_model_results_displayed = HF_model_results_sorted[0:numMAPPINGS_input]
|
| 128 |
|
| 129 |
@st.cache_resource
|
| 130 |
def load_pipe():
|