Alex Quiranza
  • Inicio
  • MLSA
  • Categorías

My Facebook feed

Facebook
@2019 - All Right Reserved. Designed and Developed by Anthony Quiranza
Top Posts
Detección de objetos usando Custom Vision SDK y...
Building a chat bot with Microsoft Azure
Custom Vision – Microsoft Azure (1/2)
Conectando un FAQ bot con Azure Bot Service...
Creando un chatbot con Azure
Categoría

Bot Services

AzureBot Services

Building a chat bot with Microsoft Azure

por Anthony 9 de febrero de 2021
Escrito por Anthony

Hi! I’m starting to improve my English and a way to do it is translating my old Spanish posts to English. I also hope that these publications can reach many more people on different places of the world.

In this chance we will learn how build a chatbot with Microsoft Azure. For this we need learn some concepts:

Microsoft Azure subscription: For use the Microsoft Azure Services we need have a Azure subscription as for example: payed subscription or students subscription (if you are a student, you can access to free Azure Account with 100$ annuals and other free benefits).
Qna Maker: QnA Maker is an API Service based in the cloud Azure service for create a conversational layer of questions and answers using information of web sites or documents (.pdf, .docx, xlsx, etc.).
Azure Bot Service: Azure Bot Service is a bot developer service to communicate our Azure Bot with another channels as Messenger, Telegram, Microsoft Teams, etc.
Azure App Service: Azure App Service serves to create, implement and scale quickly web applications in the cloud.

Ok! We are going to learn

First we log into Qna Maker with our Azure credentials, then we selected «Create a knowledge base«.

In the second step we will have a page with steps to follow. First we click on «Create a QnA Service» and we will be redirected to Azure portal, in this place we will create a new resources group called «MiPrimerChatBot» using the premium pricing tier. Finally we click on «Review and Create».

After that, we will return to QnA Maker portal and refresh the page. Now, we will have our new resource called «MiPrimerChatBot».

For the next step, we will give a name to our Knowledge base, I will name it as «MiPrimeraBaseDelConocimiento».

As I explained in the first part of this post, we can use documents to create our knowledge base, in this case we will use a document .docx with basic questions and answers about COVID-19. You can download it with a click on the next button:

Knowledge baseDownload

In the next part, we will go to select the type of bot that we will present in the chat, in QnA Maker we have some types of bot but in this case we’ll use the friendly bot and finally we’ll click on «Create your KB».

¡Good! Once our knowledge base is loaded in QnA Maker, We’ll be redirected to our knowledge base dashboard and We’ll click on «Save and Train» and next click on «Publish».

Click again on «Publish» and we have our knowledge base prepared to be implemented on a chat bot. Click on «Create Bot» button.

Now, we’ll be redirected to Azure Portal and we’ll create a Azure Bot, we’ll leave the predefined fields and click on «Create» button.

Now, we need implement our bot using a channel, for this case we’ll go to use the app service created in the group resource of our bot for insert a html code with the bot connection, for this We’ll go to save the End Point Key generated in the last step.

We’ll go to our app service:

Now, We’ll copy the FTP credentials for create the connection FTP with our computer and our app service.

The password of our FTP hostname is in the implementation center of the app service.

For this example, I’ll use the FTP service that I can use in Windows 10 but you can use another FTP client as for example: Filezilla.

Now, we have a connection with our app service and can edit and replace the content.
Azure Bot Service has a default code that we can use in our html code for implement it on our web pages, we can search it in the Azure resource: Web App Bot > Channels.

In the next step, We’ll go to create a html code and insert the html code and replace the text «TU_SECRETO_AQUI» with the secret key of our bot.

Finally, we’ll go to rename the file as index.html and insert it in our app service.

If we’ll visit the url of our app service we can interact with out bot.

Thank you for visit this post, as I explain in the introduction, this is my first post in English, if you have recommendations they are welcome.

If you want to read the Spanish post you can click on https://www.alexquiranza.com/creando-un-chatbot-con-azure/

9 de febrero de 2021 0 Comentario
0 FacebookTwitterPinterestEmail
AzureBot Services

Conectando un FAQ bot con Azure Bot Service y Telegram

por Anthony 18 de noviembre de 2020
Escrito por Anthony

En la actualidad, los chatbots son diseñados para mantener una conversación con humanos a través de sistemas de diálogo. Pueden ser diseñados de forma sofisticada con sistemas de procesamiento de lenguaje natural o simplemente con un diseño de respuestas basadas en reglas.

En una entrada anterior creamos un chatbot usando QnA Maker, Bot Services y App Services de Azure, con una base de conocimiento basada en preguntas y respuestas frecuentes sobre la COVID-19. Con ese antecedente, hoy aprenderemos a conectar ese chatbot a Telegram.

Un Bot Service en Azure puede ser configurado para funcionar por distintos canales como: Facebook, Cortana, Microsoft Teams, Web, Telegram, etc. La posibilidad de implementar nuestro servicio de bot por distintos canales nos facilita su uso sin necesidad de crear código complejo o realizar algún tipo de compatibilización para los distintos canales que existen ya que Azure lo hace por nosotros.

Creando un bot en Telegram

Para empezar, debemos tener un bot creado en Telegram, para lo cual usaremos BOT FATHER.

En mi caso me conectaré a Telegram por su versión web, aunque también lo podríamos hacer desde la aplicación móvil.

  1. Buscamos “BotFather” dentro de Telegram y damos clic en “Start”
  • Escribiremos /newbot e ingresaremos los siguientes datos según nos solicite en el chat como: El nombre de nuestro bot y un nombre de usuario único.
  • Finalmente, nos arrojará un mensaje con un token de acceso. El cual usaremos en nuestro portal de Azure.

Implementando en Azure

  • Ingresaremos a nuestro portal de Azure, específicamente donde se encuentra nuestro bot service en su sección de canales.
  • Al seleccionar Telegram nos pedirá un “Token de acceso” el cual obtuvimos previamente en Telegram. Simplemente lo pegamos en el campo de ingreso y clic en “Guardar”
  • Nos aseguramos de que se encuentre habilitado.

Probando nuestro chatbot

  • Finalmente, regresamos a Telegram y buscaremos nuestro bot con el nombre de usuario que le habíamos asignado.
  • Comprobamos que nuestro bot funcione correctamente.
18 de noviembre de 2020 0 Comentario
0 FacebookTwitterPinterestEmail
AzureBot ServicesWeb Services

Creando un chatbot con Azure

por Anthony 11 de noviembre de 2020
Escrito por Anthony

¡Hola! En esta ocasión vamos a aprender a crear un chatbot de preguntas y respuestas usando 4 puntos esenciales que repasaremos a lo largo de esta entrada.

  • Suscripción de Azure: Para usar los servicios en la nube de Azure es necesario contar con una suscripción de paga o estudiantil. Si no tienes una puedes obtener una cuenta gratuita o si eres estudiante puedes acceder al crédito anual de 100$ que ofrece Azure a estudiantes.
  • Qna Maker: QnA Maker es un servicio de API basado en la nube de Microsoft Azure que nos permitirá crear una capa de conversación de preguntas y respuestas usando datos que podemos generar nosotros o extraer de algún sitio web o documento de Excel.
  • Azure Bot Service: Azure Bot Service es un servicio de desarrollo de bots que nos permitirá lograr la comunicación de nuestro bot con otros canales, en este caso nuestro canal serán los App Services.
  • App Service de Azure: Azure App Service es un servicio que sirve para crear, implementar y escalar rápidamente aplicaciones web en la nube de una forma totalmente administrada.

¡Empecemos!

1.- Iniciamos sesión en Qna Maker con nuestras credenciales de Azure, luego seleccionamos Create a knowledge base (Crear una base de conocimiento).

2.- Se nos presentará una página con una serie de pasos a seguir. Como primer paso daremos clic en Create a QnA Service y nos rediregirá a nuestro portal de Azure donde crearemos un grupo de recursos llamado MiPrimerChatBot, Además usaremos los planes de tarifa gratuitos que serán más que suficientes para realizar este ejemplo. Finalmente nos quedaría así y damos clic en Revisar y crear:

3.- Una vez implementada nuesta base del conocimiento volvemos al portal de QnA Maker y refrescamos la página y nos aparecerán los recursos que acabamos de crear:

4.- Ahora, daremos un nombre a nuestra base del conocimiento, la llamaremos MiPrimeraBaseDeConocimiento

5.- Como había explicado al inicio, en QnA Maker podemos crear nuestra base de conocimiento de forma manual, usando archivos (.pdf, excel, .docx, etc) o inclusive URLs de sitios web. Para este ejemplo usaremos un documento que previamente he llenado de preguntas y respuestas sobre el Covid-19.

Base de conocimientoDescarga

6.- Seleccionaremos el tipo de bot que queremos presentar en nuestro chat, existen algunos tipos pero en este caso usaremos el bot friendly (amigable) y finalmente daremos clic en Create your KB (Crear tu base de conocimiento).

7.- Una vez cargada nuestra base de conocimiento nos aparecerá una ventana similar a la siguiente y daremos clic en Save and Train (Guardar y entrenar) y Publish (Publicar)

8.- Nuevamente daremos clic en Publish y tendremos nuestra base de conocimiento lista, pero aún no terminamos pues tenemos que crear nuestro bot. Para eso daremos clic en Create Bot

9.- Se definirá un bot automáticamente con los datos de nuestra base de conocimiento, lo único que cambiaremos será el plan de tarifa, pues nosotros usaremos el plan tarifa F0 y daremos clic en Crear

10.- A continuación implementaremos nuestro bot, para eso necesitaremos obtener 2 cosas: El EndPointKey de nuestra base de conocimiento y el código de nuestro chat bot. El EndPointKey lo encontraremos en QnA Maker al momento de publicar nuestro bot.

11.- Iremos a nuestro app service que se creó en nuestro portal de Azure en el grupo de recursos MiPrimerBot

12.- Seleccionaremos la opción Configuración > Configuración General y verificaremos que en el apartado de Configuración de plataforma se encuentre configurado el Estado de FTP como: Se permite todo y las opciones de Web Sockets y Siempre activado también se encuenten activas.

13.-Ahora regresaremos a la opción de introducción en el menú del lado izquierdo y copiaremos el Nombre de host de FTP el cual nos servirá para subir un archivo con el código de nuestro bot.

13.- Buscaremos las credenciales de conexión FTP de nuestro app service, para eso iremos al Centro de implementación y buscaremos FTP.

14.- Usaremos esas credenciales para conectarnos mediante FTP a nuestro app service, podríamos usar clientes FTP como Filezilla pero en este caso usaremos la característica de Windows Explorer que nos permite hacer esta conexión. Abrimos nuestro Explorador de Archivos y damos clic en agregar ubicación de red.

15.- Ingresaremos los datos de conexión que obtuvimos de Azure

16.- Para obtener el código de nuestro bot regresaremos a nuestro grupo de recursos en Azure y seleccionaremos nuestro recurso de Bot de aplicación web

17.- Ahora en el menú escogeremos la opción Canales donde entre algunas opciones encontraremos el código <frame> de nuestro bot

18.- Perfecto, ahora tenemos conexión a nuestro App Service, lo único que resta es crear un documento .html con nuestro bot, para eso usaremos nuestro editor de texto favorito. En mi caso usaré Visual Studio Code y pegaré el código del bot

19.- Reemplazaremos el texto que dice «TU_SECRETO_AQUÍ» por nuestra clave secreta.

Finalmente lo único que resta es guardar nuestro archivo index.html y subirlo a nuestro sitio a través de FTP.

Ahora si vamos al link de nuestro app service nos aparecerá nuestro chatbot funcional, en mi caso mi enlace es: https://miprimerchatbot.azurewebsites.net

11 de noviembre de 2020 0 Comentario
0 FacebookTwitterPinterestEmail

Buscar

  • Facebook
  • Twitter
  • Instagram
  • Linkedin
  • Youtube
  • Email
  • Github
  • Whatsapp

@2019 - All Right Reserved. Designed and Developed by Anthony Quiranza