paraphraser_ai / app.py
ULMER Louis (T0240644)
pushing the app
05e69cc
raw
history blame
994 Bytes
import os
import streamlit as st
from backend.data_augmenter import BackTranslatorAugmenter
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")
model_selection = st.sidebar.selectbox(
'Select a paraphraser:',
['Vladimir 🧑🏼','Maria 👩🏽'],
)
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 input_text:
st.header(f"Paraphrased text :")
st.write("".join(model.back_translate(input_text)))