Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from transformers import FSMTForConditionalGeneration, FSMTTokenizer
|
|
7 |
|
8 |
st.title("Paraphraser Three -- Back Translation")
|
9 |
st.write("Paraphrase means to express meaning using different words. Back Translation refers to the method by which the computer paraphrases.")
|
10 |
-
st.write("Write or paste English language
|
11 |
|
12 |
user_input = st.text_area("Input sentence.")
|
13 |
|
@@ -29,8 +29,8 @@ translated_text = en_to_de_output[0]['translation_text']
|
|
29 |
|
30 |
input_ids = tokenizer_de2en.encode(translated_text, return_tensors="pt")
|
31 |
output_ids = de2en.generate(input_ids)[0]
|
32 |
-
augmented_text = tokenizer_de2en.decode(output_ids, skip_special_tokens=
|
33 |
|
34 |
-
st.write("Paraphrased
|
35 |
|
36 |
|
|
|
7 |
|
8 |
st.title("Paraphraser Three -- Back Translation")
|
9 |
st.write("Paraphrase means to express meaning using different words. Back Translation refers to the method by which the computer paraphrases.")
|
10 |
+
st.write("Write or paste an English language sentence below, and enter. The machine will translate your sentence into another language using one language model. The machine will then translate that sentence into English using another language model.")
|
11 |
|
12 |
user_input = st.text_area("Input sentence.")
|
13 |
|
|
|
29 |
|
30 |
input_ids = tokenizer_de2en.encode(translated_text, return_tensors="pt")
|
31 |
output_ids = de2en.generate(input_ids)[0]
|
32 |
+
augmented_text = tokenizer_de2en.decode(output_ids, skip_special_tokens=True)
|
33 |
|
34 |
+
st.write("Paraphrased sentence: ", augmented_text)
|
35 |
|
36 |
|