Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,15 +8,13 @@ st.subheader("Data Augmentation with Generative Models")
|
|
8 |
st.write("There are cases where you will not be allowed to keep data, you will have to start from scratch or you will have very little amount of data. We'll go over two use cases and see how to tackle them.")
|
9 |
st.write("Imagine you're making a chatbot that will answer very general questions about emergency situations at home.")
|
10 |
st.write("If you have very little amount of data, you could actually augment it through language models. There are regex based tools you can use but they tend to create bias due to repetitive patterns, so it's better to use language models for this case. A good model to use is a generative model fine-tuned on Quora Question Pairs dataset. This dataset consists of question pairs that are paraphrase of one another, and T5 can generate a paraphrased question given a source question.")
|
11 |
-
|
12 |
generator = pipeline("text2text-generation", model = "mrm8488/t5-small-finetuned-quora-for-paraphrasing")
|
13 |
default_value = "How to put out a grease fire?"
|
14 |
-
num_return_sequences = st.number_input('Number of Sequences to be Generated', min_value=1, max_value=5, value=1, step=1)
|
15 |
sent = st.text_area("Input", default_value, height = 10)
|
16 |
-
outputs = generator(sent
|
17 |
-
st.write("
|
18 |
-
|
19 |
-
st.write(outputs[output]["generated_text"])
|
20 |
|
21 |
st.subheader("Add Personas to Your Conversational Agent using GPT-2")
|
22 |
st.subheader("Multilingual Models using Translation Models")
|
|
|
8 |
st.write("There are cases where you will not be allowed to keep data, you will have to start from scratch or you will have very little amount of data. We'll go over two use cases and see how to tackle them.")
|
9 |
st.write("Imagine you're making a chatbot that will answer very general questions about emergency situations at home.")
|
10 |
st.write("If you have very little amount of data, you could actually augment it through language models. There are regex based tools you can use but they tend to create bias due to repetitive patterns, so it's better to use language models for this case. A good model to use is a generative model fine-tuned on Quora Question Pairs dataset. This dataset consists of question pairs that are paraphrase of one another, and T5 can generate a paraphrased question given a source question.")
|
11 |
+
st.write("Try it yourself here 👇🏻")
|
12 |
generator = pipeline("text2text-generation", model = "mrm8488/t5-small-finetuned-quora-for-paraphrasing")
|
13 |
default_value = "How to put out a grease fire?"
|
|
|
14 |
sent = st.text_area("Input", default_value, height = 10)
|
15 |
+
outputs = generator(sent)
|
16 |
+
st.write("Paraphrased Example:")
|
17 |
+
st.write(outputs[0]["generated_text"])
|
|
|
18 |
|
19 |
st.subheader("Add Personas to Your Conversational Agent using GPT-2")
|
20 |
st.subheader("Multilingual Models using Translation Models")
|