File size: 1,166 Bytes
bc4670d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import streamlit as st
import time
from src.utils import paraphrase_english, paraphrase_indonesian
from src.st_style import apply_prod_style


# apply_prod_style(st)  # NOTE: Uncomment this for production!

st.title("AI Text Paraphraser")
st.image(open("assets/demo.png", "rb").read())
st.write(
    """
    Stop plagiarism! Do not carelessly copy and paste text materials from the internet.
    **This AI tool will make your text unique and free from plagiarism.**
    """
)

language = st.selectbox("Language", ["English", "Bahasa Indonesia"])
input_text = st.text_area("Input your text (Max 1000 characters)", height=250, max_chars=1000)

if st.button("Submit") and len(input_text) > 0:
    
    with st.spinner("AI is doing the magic!") as p:
        input_text = input_text.replace("\n\n", "\n").replace("\n", " ").strip()
        
        if language == "English":
            paraphrased = paraphrase_english(input_text)
        else:
            paraphrased = paraphrase_indonesian(input_text)
    
    st.write("**Your text is ready!**")
    st.write(paraphrased)
    st.info("**TIP:** You can submit the same text multiple times to get different results.")