Imane Momayiz
commited on
Commit
·
1b7e918
1
Parent(s):
0bb6477
chore
Browse files- app.py +2 -6
- src/components.py +1 -0
app.py
CHANGED
|
@@ -69,23 +69,19 @@ st.session_state.display_new = st.button("Generate a new sentence",
|
|
| 69 |
|
| 70 |
# Input field for translation
|
| 71 |
translation_input = st.text_input(
|
| 72 |
-
"
|
| 73 |
st.session_state.translation_input
|
| 74 |
)
|
| 75 |
|
| 76 |
# Input field for translation in latin characters
|
| 77 |
translation_input_fr = st.text_input(
|
| 78 |
-
"
|
| 79 |
st.session_state.translation_input_fr
|
| 80 |
)
|
| 81 |
|
| 82 |
st.session_state.translation_input = translation_input
|
| 83 |
st.session_state.translation_input_fr = translation_input_fr
|
| 84 |
|
| 85 |
-
print(st.session_state.sentence)
|
| 86 |
-
print(st.session_state.translation_input)
|
| 87 |
-
print(st.session_state.translation_input_fr)
|
| 88 |
-
|
| 89 |
# Save states before refreshing the page
|
| 90 |
submit_button = st.button("Submit Translation")
|
| 91 |
if submit_button:
|
|
|
|
| 69 |
|
| 70 |
# Input field for translation
|
| 71 |
translation_input = st.text_input(
|
| 72 |
+
"Translate to english: ",
|
| 73 |
st.session_state.translation_input
|
| 74 |
)
|
| 75 |
|
| 76 |
# Input field for translation in latin characters
|
| 77 |
translation_input_fr = st.text_input(
|
| 78 |
+
"Transcribe to darija in latin characters: ",
|
| 79 |
st.session_state.translation_input_fr
|
| 80 |
)
|
| 81 |
|
| 82 |
st.session_state.translation_input = translation_input
|
| 83 |
st.session_state.translation_input_fr = translation_input_fr
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
# Save states before refreshing the page
|
| 86 |
submit_button = st.button("Submit Translation")
|
| 87 |
if submit_button:
|
src/components.py
CHANGED
|
@@ -32,6 +32,7 @@ def fetch_sentence(dataset, column_name="darija_ar"):
|
|
| 32 |
st.session_state.sentence = random_sentence
|
| 33 |
st.session_state.translation_input = ""
|
| 34 |
st.session_state.translation_input_fr = ""
|
|
|
|
| 35 |
return random_sentence
|
| 36 |
|
| 37 |
def store_submission(
|
|
|
|
| 32 |
st.session_state.sentence = random_sentence
|
| 33 |
st.session_state.translation_input = ""
|
| 34 |
st.session_state.translation_input_fr = ""
|
| 35 |
+
|
| 36 |
return random_sentence
|
| 37 |
|
| 38 |
def store_submission(
|