Spaces:
Running
Running
Demosthene-OR
commited on
Commit
β’
da18950
1
Parent(s):
fd398d9
....
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ if st.session_state.Cloud == 0:
|
|
43 |
os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python'
|
44 |
|
45 |
# Tabs in the ./tabs folder, imported here.
|
46 |
-
from tabs import intro,
|
47 |
|
48 |
|
49 |
with open("style.css", "r") as f:
|
@@ -58,8 +58,8 @@ st.markdown(f"<style>{style}</style>", unsafe_allow_html=True)
|
|
58 |
TABS = OrderedDict(
|
59 |
[
|
60 |
(tr(intro.sidebar_name), intro),
|
61 |
-
(tr(text2speech_tab.sidebar_name), text2speech_tab),
|
62 |
(tr(sentence_similarity_tab.sidebar_name), sentence_similarity_tab),
|
|
|
63 |
]
|
64 |
)
|
65 |
|
|
|
43 |
os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python'
|
44 |
|
45 |
# Tabs in the ./tabs folder, imported here.
|
46 |
+
from tabs import intro, sentence_similarity_tab, speech2text_tab
|
47 |
|
48 |
|
49 |
with open("style.css", "r") as f:
|
|
|
58 |
TABS = OrderedDict(
|
59 |
[
|
60 |
(tr(intro.sidebar_name), intro),
|
|
|
61 |
(tr(sentence_similarity_tab.sidebar_name), sentence_similarity_tab),
|
62 |
+
(tr(speech2text_tab.sidebar_name), speech2text_tab),
|
63 |
]
|
64 |
)
|
65 |
|
tabs/sentence_similarity_tab.py
CHANGED
@@ -380,12 +380,12 @@ def run():
|
|
380 |
|
381 |
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
382 |
embeddings = model.encode(sentences)
|
383 |
-
st.write("Transformation de chaque phrase en vecteur (dimension = 384 ):")
|
384 |
st.write(embeddings)
|
385 |
st.write("")
|
386 |
# Calculate cosine similarity between the two sentences
|
387 |
similarity = cosine_similarity([embeddings[0]], [embeddings[1]])
|
388 |
-
st.write(f"Cosine similarity comprise entre 0 et 1: {similarity[0][0]}")
|
389 |
st.write("")
|
390 |
st.write("")
|
391 |
st.write("")
|
|
|
380 |
|
381 |
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
382 |
embeddings = model.encode(sentences)
|
383 |
+
st.write(tr("Transformation de chaque phrase en vecteur (dimension = 384 ):"))
|
384 |
st.write(embeddings)
|
385 |
st.write("")
|
386 |
# Calculate cosine similarity between the two sentences
|
387 |
similarity = cosine_similarity([embeddings[0]], [embeddings[1]])
|
388 |
+
st.write(f"**Cosine similarity** comprise entre 0 et 1: {similarity[0][0]}")
|
389 |
st.write("")
|
390 |
st.write("")
|
391 |
st.write("")
|
tabs/{text2speech_tab.py β speech2text_tab.py}
RENAMED
@@ -17,8 +17,8 @@ if st.session_state.Cloud == 0:
|
|
17 |
# import time
|
18 |
# import random
|
19 |
|
20 |
-
title = "
|
21 |
-
sidebar_name = "
|
22 |
dataPath = st.session_state.DataPath
|
23 |
'''
|
24 |
# Indiquer si l'on veut enlever les stop words. C'est un processus long
|
|
|
17 |
# import time
|
18 |
# import random
|
19 |
|
20 |
+
title = "Speech 2 Text"
|
21 |
+
sidebar_name = "Speech 2 Speech"
|
22 |
dataPath = st.session_state.DataPath
|
23 |
'''
|
24 |
# Indiquer si l'on veut enlever les stop words. C'est un processus long
|