chatbot-blog / app.py
merve's picture
merve HF staff
Update app.py
ff6984b
raw
history blame
1.75 kB
import streamlit as st
from transformers import pipeline
st.header("Ways to Improve Your Conversational Agents using πŸ€— Hugging Face")
st.write("There are many ways to improve your conversational agents using language models. In this blog post, I want to go through couple of know-hows I've learnt during my time as a machine learning engineer making chatbots for living.")
st.subheader("Data Augmentation with Generative Models ✨")
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.")
st.write("Imagine you're making a chatbot that will answer very general questions about emergency situations at home.")
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.")
st.write("Try it yourself here πŸ‘‡πŸ»")
generator = pipeline("text2text-generation", model = "mrm8488/t5-small-finetuned-quora-for-paraphrasing")
default_value = "My basement is in flood, what can I do?"
sent = st.text_area("Input", default_value, height = 10)
outputs = generator(sent)
st.write("Paraphrased Example:")
st.write(outputs[0]["generated_text"])
st.subheader("Add Personas to Your Conversational Agent using GPT-2")
st.subheader("Multilingual Models using Translation Models")