Commit
•
cfeeb53
1
Parent(s):
9479474
Update modelisation_seq2seq_tab.py
Browse files
tabs/modelisation_seq2seq_tab.py
CHANGED
@@ -98,9 +98,9 @@ def display_translation(n1, Lang, model_type):
|
|
98 |
|
99 |
placeholder = st.empty()
|
100 |
with st.status(":sunglasses:", expanded=True):
|
101 |
-
s = df_data_src.iloc[n1:n1+
|
102 |
s_trad = []
|
103 |
-
s_trad_ref = df_data_tgt.iloc[n1:n1+
|
104 |
source = Lang[:2]
|
105 |
target = Lang[-2:]
|
106 |
params = []
|
@@ -117,12 +117,10 @@ def display_translation(n1, Lang, model_type):
|
|
117 |
# Appels parallèles à fetch_translation avec les URLs
|
118 |
responses = p.map(fetch_translation, params)
|
119 |
|
120 |
-
for response, s_text in zip(responses, s):
|
121 |
-
# Récupération des résultats
|
122 |
-
s_trad.append(response.json())
|
123 |
st.write(f"**{source} :** :blue[{s_text}]")
|
124 |
-
st.write(f"**{target} :** {
|
125 |
-
st.write(f"**ref. :** {
|
126 |
st.write("")
|
127 |
with placeholder:
|
128 |
st.write("<p style='text-align:center;background-color:red; color:white')>Score Bleu = "+str(int(round(corpus_bleu(s_trad,[s_trad_ref]).score,0)))+"%</p>", \
|
|
|
98 |
|
99 |
placeholder = st.empty()
|
100 |
with st.status(":sunglasses:", expanded=True):
|
101 |
+
s = df_data_src.iloc[n1:n1+3][0].tolist()
|
102 |
s_trad = []
|
103 |
+
s_trad_ref = df_data_tgt.iloc[n1:n1+3][0].tolist()
|
104 |
source = Lang[:2]
|
105 |
target = Lang[-2:]
|
106 |
params = []
|
|
|
117 |
# Appels parallèles à fetch_translation avec les URLs
|
118 |
responses = p.map(fetch_translation, params)
|
119 |
|
120 |
+
for response, s_text, s_ref in zip(responses, s, s_trad_ref):
|
|
|
|
|
121 |
st.write(f"**{source} :** :blue[{s_text}]")
|
122 |
+
st.write(f"**{target} :** {response.json()}")
|
123 |
+
st.write(f"**ref. :** {s_ref}")
|
124 |
st.write("")
|
125 |
with placeholder:
|
126 |
st.write("<p style='text-align:center;background-color:red; color:white')>Score Bleu = "+str(int(round(corpus_bleu(s_trad,[s_trad_ref]).score,0)))+"%</p>", \
|