Update pages/type_text.py
Browse files- pages/type_text.py +28 -0
pages/type_text.py
CHANGED
@@ -103,6 +103,22 @@ numMAPPINGS_input = 5
|
|
103 |
#numMAPPINGS_input = st.text_input("Type number of mappings and hit Enter", key="user_input_numMAPPINGS")
|
104 |
#st.button("Clear text", on_click=on_click)
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
@st.cache_resource
|
107 |
def load_model():
|
108 |
model = SentenceTransformer('all-MiniLM-L6-v2') # fastest
|
@@ -115,6 +131,18 @@ model = load_model()
|
|
115 |
#model = SentenceTransformer('sentence-transformers/msmarco-bert-base-dot-v5')
|
116 |
#model = SentenceTransformer('clips/mfaq')
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
INTdesc_embedding = model.encode(INTdesc_input)
|
119 |
|
120 |
# Semantic search, Compute cosine similarity between INTdesc_embedding and SBS descriptions
|
|
|
103 |
#numMAPPINGS_input = st.text_input("Type number of mappings and hit Enter", key="user_input_numMAPPINGS")
|
104 |
#st.button("Clear text", on_click=on_click)
|
105 |
|
106 |
+
SentenceTransformer = st.selectbox(
|
107 |
+
"Select the Sentence Transformer model",
|
108 |
+
("all-MiniLM-L6-v2 (original, general domain)", "all-MiniLM-L6-v2 (fine-tuned, medical domain)", "all-mpnet-base-v2 (original, general domain)", "all-mpnet-base-v2 (fine-tuned, medical domain)"]
|
109 |
+
)
|
110 |
+
st.write("You selected:", SentenceTransformer)
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
@st.cache_resource
|
123 |
def load_model():
|
124 |
model = SentenceTransformer('all-MiniLM-L6-v2') # fastest
|
|
|
131 |
#model = SentenceTransformer('sentence-transformers/msmarco-bert-base-dot-v5')
|
132 |
#model = SentenceTransformer('clips/mfaq')
|
133 |
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
INTdesc_embedding = model.encode(INTdesc_input)
|
147 |
|
148 |
# Semantic search, Compute cosine similarity between INTdesc_embedding and SBS descriptions
|