I want to create a chatbot using streamlit, this should accept the user response and depending on user choice or response, it should answer the next question or just answer based on the response, for example, the typical customer service chat bot where customer asks a question, agent advise something, if user says something affirmative, agent will suggest one thing , else if user says no , that is not the case , agent will advise something else. i have been struggling , i know i can use a bot framework like microsoft bot framework etc but wondering , can we do this using streamlit.
Steps to reproduce
Code snippet:
add code here
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
Explain what you expect to happen when you run the code above.
Actual behavior:
Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.
Debug info
Streamlit version: (get it with $ streamlit version)
Python version: (get it with $ python --version)
Using Conda? PipEnv? PyEnv? Pex?
OS version:
Browser version:
Requirements file
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
Links
Link to your GitHub repo:
Link to your deployed app:
Additional information
If needed, add any other context about the problem here.
So this is definitely possible with Streamlit. One thing to keep in mind is that Streamlit is just the front-end that your user will interact with. From your explanation, it sounds like you’re looking for a backend solution. You can use a pre-trained model or a fine-tuned model on the customer care dataset which you can then plug into a Streamlit front-end and let customers chat with it. Let me know if this is the direction you’re thinking.
@tonykip , First of all, than you for your response. very insightful. Here is what I am struggling with ( and please excuse my ignorance i am very new to streamlit and looking for help).
I am trying to develop a customer support chat bot, where user tells an issue with his/her product and customer support bot will then advise one or more things in a sequential fashion ( basically they can ask question - is the ligh on, do you see a x mark and so on) and this conversation goes on based on the users response , if user says yes, then probably bot will ask something else, if says no - question will change. i hope i am clear, my data and model is in place, I know how to handle that part , i think. I just need to use streamlit the way we use microsoft bot framework or rasa or any other similar thing at much simpler level. any code which you can show to demonstrate this, will be great help.
Hello @tonykip this code worked greta, how can I update it to handle the small talk , like if we input Hi , bot should say, Hello how can I help you, if user say bye bot should say bye etc
I think this would depend on your model. Typically your model should intelligently handle this small talk out of the box if it is a chat based model. What responses are you getting back when you say hi and bye?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.