How to provide selection options as response in ChatterBot - python

I am creating a chat bot using python chatter bot library. I am able to train the chat bot in the English language. Next thing I want to accomplish is to build a chat bot to provide selection options to the user for filtering the data.
Example:
Request from user is Book a movie ticket.
I want to display the response as 3 buttons
In which time slot you want to book a movie ticket ?
a. Morning
b. Afternoon
c. Evening.
Is there any feature in Python ChatterBot to send back selection options as response to the user.

You can't get that type of response using GuntherCox's chatterbot Library considering the last stable version.
Read the following documentation to know more: Documentation Link
Else you can raise a issue and also here is their code base for your consideration to look deep down into it: Github Link

If you want intent and entity based chatbot you can look into Snips-nlu and Rasa.
https://github.com/snipsco/snips-nlu
https://github.com/RasaHQ/rasa
So far what I have seen is that chatterbot can only provide static responses. Snips has module for generating json dataset from yaml file where you can define intents, entities, multiple slots etc.
https://snips-nlu.readthedocs.io/en/latest/dataset.html
Rasa can provide what you are looking for. Provide response options based question. Provides easy training, HTTP API, python SDK etc.
https://rasa.com/docs/rasa/user-guide/rasa-tutorial/
Finally, this is a tool for generating training data for snips, rasa and others.
https://rasa.com/docs/rasa/user-guide/rasa-tutorial/

Related

How to add python code to Nodejs Express API?

I am creating a Express.js API that offers json data when request is received by an end-point.
for example- like this one, jokes api, weather api, etc
But I have some logics that I want to implement in python as there are some very good libraries like requests in python.
I have seen in many places that many softwares can be written in multiple languages, here
Demonstration (what I want to achieve):
I have an api called example.com
Someone made a get request to example.com/api/v1/category/json-data?quantity=4
Now, the app.get(example.com/api/v1/category/json-data?quantity=4) route in my code will be triggered and from there I want to call my python code that will do some job and finally what user wants will be sent back.
How can I achieve this?
What should my folder structure look like?
How to manage both python and npm dependencies together?
Please share any article, documentation or video I can refer.

Column Tagging in GCP Data Catalog using DLP results and Python

I've been dealing with this issue for weeks. Does anyone know how to create column tags in Data Catalog from DLP results? I wanted to run inspection job on DLP and then tag the inspected tables with the infoTypes that I've inspected. I only found Java codes regarding this problem but I appreciate if anyone can help me with Python.
I was unable to find a sample Python code that would implement column level tags. This Tag() function from the Python Client Library could be useful. The complete Data Catalog Python Client Library documentation can be found here.
Feature Request
However, you can let Google know that this is a feature that is important for access through their client libraries, and that you would like to request they provide a sample code for it.
Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services. I'd suggest you make a feature request there. The best component to file this under would be the Big Data, with the Feature Request template.

Intregrating Rasa Webchat with custom python functions

I want to give custom responses to the user on the webchat platform based on external python code. Also I want to retrieve all the user responses and process them to construct said custom responses. How do i connect rasa-webchat with my python code?
Whenever the user says something to the chatbot, i want to trigger a function that uses the intent classification results from rasa and also a few other functions to construct custom bot response.
i bumped into this when i was looking for some Rasa reference. This might help you on crafting your own custom responses.
For integration with webchat, this
forum might be useful. The video tutorial will guide you step by step on how to integrate the webchat with your Rasa model.
Have fun exploring !

How to integrate an external NLP technique to Dialogflow?

I would like to use Dialogflow interface to create a voice assisted chatbot.
Still, I would like to be able to add my own components to it.
How can this be done ? If I have a python script with an NLP technique I'd want to add to my chatbot.
Dialogflow is mainly about NER and let's say I want to add TFIDF and text simplification to what's retrieved in my document.
I looked at the documentation and couldn't find anything on the subject.
you can use a Webhook: each intent is 'forwarded' to your webhook (ie custom app or script) and you have full access to the text provided by the user as well as the DialogFlow contexts/entities.
In your webhook you can can do what you want, including modifying the response to the user.
Hope it helps.
Beppe

IRC bot functionalities

I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usually included in the bots? Thanks for your ideas.
Unless it's solely for the educational experience, you should really just use a framework for the core functionality.
That said, here's some of the things the bot in my home IRC channel does:
Choose one item from a list of options
Display a random entry from the Linux fortunes file
Display a random set of words from the Emacs spook file
Check every line from a user and display a quote from The Big Lebowski if it's sufficiently similar (this is probably a bit my-channel specific :) )
Check if a link has been mentioned before and say who/when (we all read the same RSS feeds and tend to duplicate links a lot)
Conduct a poll
Pull a given quote from our internal QDB
Check if a given link has been posted to Reddit, and give the corresponding Reddit thread link if so. If a Reddit link is posted, give the direct link instead
Track the last time a given nick was in the channel, and the last time they spoke
Queue a message for an offline nick that's automatically sent in-channel when they join
Use Google Translate to translate a given phrase
Post a given line to our channel's Twitter feed
Choose a random user and kick them (not the best idea depending on how unruly your channel is)
Pull the summary of a given term from Wikipedia and display it along with a link to the full article
Display information about any posted Youtube link (video title, length, submitter, votes, comments, etc.)
I'm also in the process of writing a bot in node.js. Here are some of my goals/functions:
map '#' command so the bot detects the last URI in message history and uses the w3 html validation service
setup a trivia game by invoking !ask, asks a question with 3 hints, have the ability to load custom questions based on category
get the weather with weather [zip/name]
hook up jseval command to evaluate javascript, same for python and perl and haskell
seen command that reports the last time the bot has "seen" a person online
translate command to translate X language string to Y language string
map dict to a dictionary service
map wik to wiki service
Again, this is an utterly personal suggestion, but I would really like to see eggdrop rewritten in Python.
Such a project could use Twisted to provide the base IRC interaction, but would then need to support add-on scripts.
This would be great for allowing easy IRC bot functionality to be built upon using python, instead of TCL, scripts.
That is very subjective and totally depends upon where the bot will be used. I'm sure others will have nice suggestions. But whatever you do, please do not query users arbitrarily. And do not spam the main chat periodically.
Make a google search to get a library that implements IRC protocol for you. That way you only need to add the features, those are already something enough to bother you.
Common functions:
Conduct a search from a wiki or google
Notify people on project/issue updates
Leave a message
Toy for spamming the channel
Pick a topic
Categorize messages
Search from channel logs

Categories

Resources