Spaces:
Running
Running
Demosthene-OR
commited on
Commit
•
d183fc7
1
Parent(s):
fb9bcf1
....
Browse files- style.css +4 -0
- tabs/sentence_similarity_tab.py +14 -11
style.css
CHANGED
@@ -127,3 +127,7 @@ section[tabindex="0"] .block-container {
|
|
127 |
padding-top: 0px;
|
128 |
padding-bottom: 0px;
|
129 |
}
|
|
|
|
|
|
|
|
|
|
127 |
padding-top: 0px;
|
128 |
padding-bottom: 0px;
|
129 |
}
|
130 |
+
|
131 |
+
.st-emotion-cache-12fmjuu {
|
132 |
+
height: 0rem;
|
133 |
+
}
|
tabs/sentence_similarity_tab.py
CHANGED
@@ -22,15 +22,6 @@ sidebar_name = "Sentence Similarity"
|
|
22 |
dataPath = st.session_state.DataPath
|
23 |
|
24 |
|
25 |
-
from sentence_transformers import SentenceTransformer
|
26 |
-
sentences = ["This is an example sentence", "Each sentence is converted"]
|
27 |
-
|
28 |
-
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
29 |
-
embeddings = model.encode(sentences)
|
30 |
-
st.write(embeddings)
|
31 |
-
st.write("")
|
32 |
-
st.write("")
|
33 |
-
st.write("")
|
34 |
|
35 |
'''
|
36 |
with contextlib.redirect_stdout(open(os.devnull, "w")):
|
@@ -257,10 +248,11 @@ def proximite():
|
|
257 |
plt.title(tr("Proximité des mots anglais avec leur traduction"), fontsize=30, color="green")
|
258 |
plt.legend(loc='best');
|
259 |
st.pyplot(fig)
|
260 |
-
|
261 |
|
262 |
def run():
|
263 |
|
|
|
264 |
global max_lines, first_line, Langue
|
265 |
global full_txt_en, full_corpus_en, full_txt_split_en, full_df_count_word_en,full_sent_len_en, vec_model_en
|
266 |
global full_txt_fr, full_corpus_fr, full_txt_split_fr, full_df_count_word_fr,full_sent_len_fr, vec_model_fr
|
@@ -377,4 +369,15 @@ def run():
|
|
377 |
)
|
378 |
st.write("")
|
379 |
proximite()
|
380 |
-
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
dataPath = st.session_state.DataPath
|
23 |
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
'''
|
27 |
with contextlib.redirect_stdout(open(os.devnull, "w")):
|
|
|
248 |
plt.title(tr("Proximité des mots anglais avec leur traduction"), fontsize=30, color="green")
|
249 |
plt.legend(loc='best');
|
250 |
st.pyplot(fig)
|
251 |
+
'''
|
252 |
|
253 |
def run():
|
254 |
|
255 |
+
'''
|
256 |
global max_lines, first_line, Langue
|
257 |
global full_txt_en, full_corpus_en, full_txt_split_en, full_df_count_word_en,full_sent_len_en, vec_model_en
|
258 |
global full_txt_fr, full_corpus_fr, full_txt_split_fr, full_df_count_word_fr,full_sent_len_fr, vec_model_fr
|
|
|
369 |
)
|
370 |
st.write("")
|
371 |
proximite()
|
372 |
+
'''
|
373 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
374 |
+
sentences[0] = st.text_area(label=tr("Saisir le texte à traduire"), value="This is an example sentence")
|
375 |
+
sentences[1] = st.text_area(label=tr("Saisir le texte à traduire"), value="Each sentence is converted")
|
376 |
+
|
377 |
+
|
378 |
+
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
379 |
+
embeddings = model.encode(sentences)
|
380 |
+
st.write(embeddings)
|
381 |
+
st.write("")
|
382 |
+
st.write("")
|
383 |
+
st.write("")
|