Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,41 +1,14 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
# src_lang = st.selectbox('Translate from:', (language_list), format_func = decode_iso)
|
15 |
-
# with trans_col2:
|
16 |
-
# target_lang = st.selectbox('Translate to:', (language_list), format_func = decode_iso, index=1)
|
17 |
-
|
18 |
-
|
19 |
-
# if st.button("Translate"):
|
20 |
-
# st.divider()
|
21 |
-
# with st.spinner(":rainbow[Translating from " + decode_iso(src_lang) + " into " + decode_iso(target_lang) + ", please wait...]"):
|
22 |
-
# translation = translator(trans_text, src_lang, target_lang)
|
23 |
-
# translation
|
24 |
-
|
25 |
-
|
26 |
-
# app.py
|
27 |
-
|
28 |
-
import streamlit as st
|
29 |
-
from translation_model import translator
|
30 |
-
|
31 |
-
st.title("Medical Translation (en/zh)")
|
32 |
-
|
33 |
-
text_input = st.text_area("Enter your text:")
|
34 |
-
|
35 |
-
translation_direction = st.selectbox("Translate to", ["English -> Chinese", "Chinese -> English"])
|
36 |
-
|
37 |
-
if st.button("Translate"):
|
38 |
-
translated_text = translator.translate(text_input, translation_direction)
|
39 |
-
|
40 |
-
st.subheader("Output:")
|
41 |
st.write(translated_text)
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from translation_model import translator
|
3 |
+
|
4 |
+
st.title("Medical Translation (en/zh)")
|
5 |
+
|
6 |
+
text_input = st.text_area("Enter your text:")
|
7 |
+
|
8 |
+
translation_direction = st.selectbox("Translate to", ["English -> Chinese", "Chinese -> English"])
|
9 |
+
|
10 |
+
if st.button("Translate"):
|
11 |
+
translated_text = translator.translate(text_input, translation_direction)
|
12 |
+
|
13 |
+
st.subheader("Output:")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
st.write(translated_text)
|