Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,12 +22,9 @@ st.write("There are cases where you will not be allowed to keep data, you will h
|
|
22 |
st.write("Imagine you're making a chatbot that will answer very general questions about emergency situations at home.")
|
23 |
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 (namely, [T5](https://huggingface.co/docs/transformers/model_doc/t5) here) fine-tuned on [Quora Question Pairs dataset](https://www.tensorflow.org/datasets/catalog/glue?hl=en#glueqqp). This dataset consists of question pairs that are paraphrase of one another, and T5 can generate a paraphrased question given a source question. There's a similar dataset called [MRPC](https://www.tensorflow.org/datasets/catalog/glue?hl=en#gluemrpc) that assesses if one sentence is a paraphrase of another, you can choose between one of them.")
|
24 |
st.write("Try it yourself here ππ»")
|
25 |
-
|
26 |
-
generator = pipeline("text2text-generation", model = "mrm8488/t5-small-finetuned-quora-for-paraphrasing")
|
27 |
-
|
28 |
default_value_gen = "How can I put out grease fire?"
|
29 |
sent = st.text_area(label = "Input", value = default_value_gen, height = 10)
|
30 |
-
outputs =
|
31 |
st.write("Paraphrased Example:")
|
32 |
st.write(outputs[0]["generated_text"])
|
33 |
|
|
|
22 |
st.write("Imagine you're making a chatbot that will answer very general questions about emergency situations at home.")
|
23 |
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 (namely, [T5](https://huggingface.co/docs/transformers/model_doc/t5) here) fine-tuned on [Quora Question Pairs dataset](https://www.tensorflow.org/datasets/catalog/glue?hl=en#glueqqp). This dataset consists of question pairs that are paraphrase of one another, and T5 can generate a paraphrased question given a source question. There's a similar dataset called [MRPC](https://www.tensorflow.org/datasets/catalog/glue?hl=en#gluemrpc) that assesses if one sentence is a paraphrase of another, you can choose between one of them.")
|
24 |
st.write("Try it yourself here ππ»")
|
|
|
|
|
|
|
25 |
default_value_gen = "How can I put out grease fire?"
|
26 |
sent = st.text_area(label = "Input", value = default_value_gen, height = 10)
|
27 |
+
outputs = query(payload = sent, model_id = "mrm8488/t5-small-finetuned-quora-for-paraphrasing", api_token = api_token)
|
28 |
st.write("Paraphrased Example:")
|
29 |
st.write(outputs[0]["generated_text"])
|
30 |
|