├── requirements.txt ├── ss ├── 1.png ├── 2.png └── 3.png ├── README.md └── streamlit.py /requirements.txt: -------------------------------------------------------------------------------- 1 | nemo_toolkit 2 | streamlit 3 | 4 | -------------------------------------------------------------------------------- /ss/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somiljain7/nmt-app/main/ss/1.png -------------------------------------------------------------------------------- /ss/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somiljain7/nmt-app/main/ss/2.png -------------------------------------------------------------------------------- /ss/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somiljain7/nmt-app/main/ss/3.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nmt-app 2 | 3 | - **NMT En Hi Transformer12x2** 4 | ![](https://github.com/somiljain7/nmt-app/blob/main/ss/3.png). 5 | - **NMT En Es** 6 | ![](https://github.com/somiljain7/nmt-app/blob/main/ss/1.png) 7 | - **NMT En de** 8 | ![](https://github.com/somiljain7/nmt-app/blob/main/ss/2.png) 9 | -------------------------------------------------------------------------------- /streamlit.py: -------------------------------------------------------------------------------- 1 | import streamlit as st 2 | import os 3 | from nemo.collections.nlp.models import MTEncDecModel 4 | MTEncDecModel.list_available_models() 5 | 6 | def main(): 7 | """ NLP Based App with Streamlit """ 8 | 9 | # Title 10 | st.title("NeMo webapp") 11 | st.subheader("Neural Machine Translation (NMT) model to translate from One language to Another") 12 | 13 | 14 | 15 | if st.checkbox("translate from English to Hindi"): 16 | 17 | 18 | message1 = st.text_area("Enter Text","Type Here....") 19 | model1 = MTEncDecModel.from_pretrained("nmt_en_hi_transformer12x2") 20 | translations1 = model1.translate([message1], source_lang="en", target_lang="hi") 21 | st.success(translations1[0]) 22 | 23 | elif st.checkbox("translate from English to spanish"): 24 | 25 | 26 | message2 = st.text_area("Enter Text","Type Here....") 27 | model2 = MTEncDecModel.from_pretrained("nmt_en_es_transformer12x2") 28 | translations2 = model2.translate([message2], source_lang="en", target_lang="es") 29 | st.success(translations2[0]) 30 | 31 | elif st.checkbox("translate from English to german"): 32 | 33 | 34 | message3 = st.text_area("Enter Text","Type Here....") 35 | model3 = MTEncDecModel.from_pretrained("nmt_en_de_transformer12x2") 36 | translations3 = model3.translate([message3], source_lang="en", target_lang="de") 37 | st.success(translations3[0]) 38 | 39 | 40 | 41 | 42 | 43 | 44 | st.sidebar.subheader("About the App") 45 | st.sidebar.text("NeMo by NVIDIA (nmt inference tool") 46 | st.sidebar.info("Use this tool to get the translation from one language to other ") 47 | st.sidebar.subheader("Developed by") 48 | st.sidebar.text("Somil Jain") 49 | 50 | 51 | 52 | 53 | if __name__ == '__main__': 54 | main() 55 | --------------------------------------------------------------------------------