import os import streamlit as st from backend.data_augmenter import BackTranslatorAugmenter from footer import footer os.environ['NO_PROXY'] = '127.0.0.1' st.set_page_config(layout="wide", page_title="Paraphraser.AI", page_icon="🤖✍️") st.title('Paraphraser.AI 🤖✍️') st.header("An intelligent sentence paraphraser") st.markdown('''This is a demo of a system that can rewrite some given paragraphs with slight differences.''') model_selection = st.sidebar.selectbox( 'Select a paraphraser:', ['Vladimir 🧑🏼','Maria 👩🏽','Jacques 👨'], ) input_text = st.text_area('Please type the text to paraphrase') class DummyAugmenter: def __init__(self, in_lang="en", out_lang="ru") -> None: pass def back_translate(self,text): return "La marche des vertueux est seumée d'obstacles" if model_selection == 'Vladimir 🧑🏼': model = BackTranslatorAugmenter(in_lang="en", out_lang="ru") if model_selection == 'Maria 👩🏽': model = BackTranslatorAugmenter(in_lang="en", out_lang="es") if model_selection == 'Jacques 👨': model = BackTranslatorAugmenter(in_lang="en", out_lang="fr") if input_text: st.header(f"Paraphrased text :") st.write("".join(model.back_translate(input_text))) footer()