From the course: Applied AI: Building NLP Apps with Hugging Face Transformers

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Chatbot conversation example

Chatbot conversation example

- We will use the conversational pipeline available in Hugging Face for simulating chatbot-like conversations. We first create a pipeline using the conversational task. We choose a specific model checkpoint, called Facebook/blenderbot_Small_90M. This is a relatively small model that can respond to general questions, and can ask follow-up questions. Let's run this code to download the model, and print its architecture. As seen in the config, this checkpoint is based on the Blenderbot Small For Conditional Generation architecture. The pipeline can also store the context of the conversation, and use it for follow-up questions and answers. To simulate the conversation, we have the first question and two follow-up questions. The first question being, "do you have any hobbies?" And second input being, "I like to watch movies." The third input being, "action movies." We first need to create a conversation context with the…

Contents