Commit
·
b7ff792
1
Parent(s):
bafef58
Update modelisation_seq2seq_tab.py
Browse files
tabs/modelisation_seq2seq_tab.py
CHANGED
|
@@ -4,7 +4,6 @@ import numpy as np
|
|
| 4 |
import os
|
| 5 |
from sacrebleu import corpus_bleu
|
| 6 |
from transformers import pipeline
|
| 7 |
-
# from translate import Translator
|
| 8 |
from deep_translator import GoogleTranslator
|
| 9 |
from audio_recorder_streamlit import audio_recorder
|
| 10 |
import speech_recognition as sr
|
|
@@ -19,11 +18,9 @@ from tensorflow import keras
|
|
| 19 |
from keras_nlp.layers import TransformerEncoder
|
| 20 |
from tensorflow.keras import layers
|
| 21 |
from tensorflow.keras.utils import plot_model
|
| 22 |
-
# from PIL import Image
|
| 23 |
from gtts import gTTS
|
| 24 |
from extra_streamlit_components import tab_bar, TabBarItemData
|
| 25 |
from translate_app import tr
|
| 26 |
-
import time
|
| 27 |
|
| 28 |
title = "Traduction Sequence à Sequence"
|
| 29 |
sidebar_name = "Traduction Seq2Seq"
|
|
@@ -397,15 +394,9 @@ def run():
|
|
| 397 |
|
| 398 |
st.write("## **"+tr("Résultats")+" :**\n")
|
| 399 |
if (chosen_id == "tab1"):
|
| 400 |
-
t0 = time.time()
|
| 401 |
display_translation(n1, Lang,1)
|
| 402 |
-
t1 = time.time()
|
| 403 |
-
st.write("Durée: "+str(t1-t0))
|
| 404 |
else:
|
| 405 |
-
t0 = time.time()
|
| 406 |
display_translation(n1, Lang,2)
|
| 407 |
-
t1 = time.time()
|
| 408 |
-
st.write("Durée: "+str(t1-t0))
|
| 409 |
|
| 410 |
st.write("## **"+tr("Details sur la méthode")+" :**\n")
|
| 411 |
if (chosen_id == "tab1"):
|
|
|
|
| 4 |
import os
|
| 5 |
from sacrebleu import corpus_bleu
|
| 6 |
from transformers import pipeline
|
|
|
|
| 7 |
from deep_translator import GoogleTranslator
|
| 8 |
from audio_recorder_streamlit import audio_recorder
|
| 9 |
import speech_recognition as sr
|
|
|
|
| 18 |
from keras_nlp.layers import TransformerEncoder
|
| 19 |
from tensorflow.keras import layers
|
| 20 |
from tensorflow.keras.utils import plot_model
|
|
|
|
| 21 |
from gtts import gTTS
|
| 22 |
from extra_streamlit_components import tab_bar, TabBarItemData
|
| 23 |
from translate_app import tr
|
|
|
|
| 24 |
|
| 25 |
title = "Traduction Sequence à Sequence"
|
| 26 |
sidebar_name = "Traduction Seq2Seq"
|
|
|
|
| 394 |
|
| 395 |
st.write("## **"+tr("Résultats")+" :**\n")
|
| 396 |
if (chosen_id == "tab1"):
|
|
|
|
| 397 |
display_translation(n1, Lang,1)
|
|
|
|
|
|
|
| 398 |
else:
|
|
|
|
| 399 |
display_translation(n1, Lang,2)
|
|
|
|
|
|
|
| 400 |
|
| 401 |
st.write("## **"+tr("Details sur la méthode")+" :**\n")
|
| 402 |
if (chosen_id == "tab1"):
|