<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Muhammad Shahzaib</title>
    <description>The latest articles on Forem by Muhammad Shahzaib (@mshahzaib101).</description>
    <link>https://forem.com/mshahzaib101</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F262770%2F719911eb-6b58-4dbf-bc8d-3599f1bc4a40.jpg</url>
      <title>Forem: Muhammad Shahzaib</title>
      <link>https://forem.com/mshahzaib101</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mshahzaib101"/>
    <language>en</language>
    <item>
      <title>Which is Your Best React UI Component Library / Framework for 2020 ?</title>
      <dc:creator>Muhammad Shahzaib</dc:creator>
      <pubDate>Tue, 07 Jan 2020 14:41:02 +0000</pubDate>
      <link>https://forem.com/mshahzaib101/which-is-your-best-react-ui-component-library-framework-for-2020-3eoa</link>
      <guid>https://forem.com/mshahzaib101/which-is-your-best-react-ui-component-library-framework-for-2020-3eoa</guid>
      <description>&lt;p&gt;Mention them in comment Section Below 😜 ⬇️⬇️⬇️⬇️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v8e8Z0zH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kzdhora9dzo7fweyqw3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v8e8Z0zH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kzdhora9dzo7fweyqw3v.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>javascript</category>
      <category>design</category>
    </item>
    <item>
      <title>Add a ChatBot to your JavaScript app in 10 mins!!</title>
      <dc:creator>Muhammad Shahzaib</dc:creator>
      <pubDate>Wed, 01 Jan 2020 15:47:20 +0000</pubDate>
      <link>https://forem.com/mshahzaib101/add-a-chatbot-to-your-javascript-app-in-10-mins-3mdm</link>
      <guid>https://forem.com/mshahzaib101/add-a-chatbot-to-your-javascript-app-in-10-mins-3mdm</guid>
      <description>&lt;p&gt;ChatBots are everywhere, they are changing world everyday. Latest bots are built in such a way that it is difficult to tell wether you were talking to a human or a bot.&lt;/p&gt;

&lt;p&gt;There are many tools which we can use without any knowledege of machine Learning and deep learning. Yes you heard that right, all you need to do is just get known to that tool environment and you can build a bot which can take jobs of all the selling staff at any pizza-shop. You only need a supervisor to whom bot will transfer the calls whenever it is unable to solve customer queries.&lt;/p&gt;

&lt;p&gt;We will be using Dialogflow in this tutorial because It is the most easiest one to get started and have a huge community behind it. Also it is the most powerfull one by the fact that it uses the same algorithms that Google Assistant uses. There are many other tool powered by Amazon and Microsoft which you can explore.&lt;/p&gt;

&lt;h3&gt;
  
  
  lets dive in to topic:
&lt;/h3&gt;

&lt;p&gt;How can i add a chatbot in my web app. Here we go..&lt;/p&gt;

&lt;p&gt;Lets take an Example of a Coffee Shop named Coffee-Mart&lt;/p&gt;

&lt;p&gt;Here is the demo :&lt;br&gt;
&lt;a href="https://bot.dialogflow.com/6196e2cc-9cea-4056-ba68-bc6860b8391e" rel="noopener noreferrer"&gt;VIEW demo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/mshahzaib101/coffee-mart-chatBot-demo/tree/master" rel="noopener noreferrer"&gt;CODE Github&lt;/a&gt;&lt;br&gt;
you can import .zip file in Dialogflow UI console under settings&amp;gt;Export and Import&lt;/p&gt;

&lt;p&gt;Coffee-Mart provides only 5 flavors of coffee:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;French Vanilla &lt;/li&gt;
&lt;li&gt;Caramel Macchiato &lt;/li&gt;
&lt;li&gt;Mocha &lt;/li&gt;
&lt;li&gt;Hazelnut &lt;/li&gt;
&lt;li&gt;Chocolate&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;with 3 different cup sizes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;small &lt;/li&gt;
&lt;li&gt;medium &lt;/li&gt;
&lt;li&gt;large&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now we want to add a bot in side of the web app through which customers can easily placed there orders without navigating around your website.&lt;br&gt;
just like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa153nf3y6rejyr6zcl52.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa153nf3y6rejyr6zcl52.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here we go:
&lt;/h2&gt;

&lt;p&gt;There are some terms to which you have to get familar with, I will be discussing them under the example in detail&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;intents&lt;/li&gt;
&lt;li&gt;entities&lt;/li&gt;
&lt;li&gt;contexts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go to &lt;a href="https://dialogflow.com/" rel="noopener noreferrer"&gt;https://dialogflow.com/&lt;/a&gt; and sign in. Then go to Console and click on create a new agent. Name your agent as you want then click CREATE.&lt;br&gt;
If you want you can attach your GCP(Google Cloud Project) to it, GCP is usually preferred for data handling between chatbot and database, but we can use other options too to store our data like AWS using Firebase Cloud Functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhr936nuuj0bg9s0yf7bq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhr936nuuj0bg9s0yf7bq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Intents:
&lt;/h4&gt;

&lt;p&gt;these are the actions performed by the user. a bot contains number of intents. Whenever a user says anything, an intent is targeted. &lt;br&gt;
we create intents for every specific tasks which are to be performed by our bot. Every intent have 2 major components. &lt;br&gt;
Main one is Training Phrases where we add all example texts that user can says.&lt;br&gt;
Second one is Responses where we define the response shown to the user whenever an intent is matched. &lt;/p&gt;

&lt;p&gt;For our coffee-Mart example, we will be creating our first intent as shop-hours which will be called whenever a user asks about shop timings.&lt;br&gt;
Click on create intents and enter intent name. Under Training phrases add sample dialogues which user can say when he will be asking about shop timings like these:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fp5o3qwnlxbc5pk5cst5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fp5o3qwnlxbc5pk5cst5e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will be adding a response under response section:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpc6u2nwd5ip34wkfhyut.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpc6u2nwd5ip34wkfhyut.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then click SAVE. We have just created our first intent. You can test it by asking about shop timings on the right side. Note that if you ask shop timings in a different way our agent will reply it accurately. This is because of the deep learning and machine learning algorithms used by Dialogflow . Sounds crazy lets create a second intent.&lt;/p&gt;

&lt;p&gt;If you click on Intents from left bar, you will be seeing list of all intents. There is a Default Welcome Intent which we will be modifying now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6086vqo556wvikgdszvc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6086vqo556wvikgdszvc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome intent is used whenever user greets or try to start conversation by saying 'hi' , 'hello'. There is a range of training phrases examples which you can see. We dont need to modify it but we need to modify it's response as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fh46oi91jckq2hpnuleat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fh46oi91jckq2hpnuleat.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try to add more than one responses so that our agent don't sound like a machine. Then click SAVE and test..&lt;/p&gt;

&lt;p&gt;Now we will be creating our second(main) Intent named as "coffee-order". This will be used to place orders by user. For now it is a simple intent which will be fired whenever a user sounds like that he want to place order. User can say that 'I want a cup of coffee', but wait which type of coffee and cup size. This is where Entities comes in action..&lt;/p&gt;

&lt;h4&gt;
  
  
  Entities:
&lt;/h4&gt;

&lt;p&gt;these are used to extract important data from what user says. For example user can say "can i have a cup of Vanilla coffee", in this sentense Vanilla is a seperate entity which provides usefull information for our intent. There are 2 types of entities &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;System Entities: these are built in entities provided by Dialogflow, they usually cover quantity, numbers, time, date and many others.&lt;/li&gt;
&lt;li&gt;Developer Entities: these are custom built entities which are created for getting specific data.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  putting entities in our coffee-order intent
&lt;/h4&gt;

&lt;p&gt;first of all we will be listing all types of entities that will be required for coffee-order&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;coffee-cup-size&lt;/li&gt;
&lt;li&gt;coffee-flavor&lt;/li&gt;
&lt;li&gt;delivery-date and delivery-time [system entity]&lt;/li&gt;
&lt;li&gt;number of cups [system entity]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click on create Entity , named it as 'coffee-cup-size'. Make sure to check on 'Define Synonyms' because user can enter alternatives keywords.&lt;br&gt;
Now we will be adding our cup sizes and there Synonyms one by one in the list. Make sure to add all possible synonyms . Then click SAVE&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0h47f9epgqvz5q4b87g4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0h47f9epgqvz5q4b87g4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Similar way we create our second entity named 'coffee-flavor'. Passed them our 5 available flavors and there synonyms as follows&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbu48uymnuvn91bkedisz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbu48uymnuvn91bkedisz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now its time to connect our intent with these 2 entities. System Entities are connected by default so no need to connect them.&lt;br&gt;
Custom Entities are added through training phrases portion under intent declartion.&lt;br&gt;
After creating an intent named as 'coffee-order', we will be adding training phrases of ordering coffee. To connect intents we have to double click on keywords and assign a particular entity to it from the prompted list. Each sentence can have any number of entities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw08b0oin1xkvi728s8ap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw08b0oin1xkvi728s8ap.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this way entities are connected to our intent. But what if user didn't provide any detail about coffee, what if he just says 'i want a coffee'. In such situations agent should prompt for details that were not provided.&lt;br&gt;
To do this we have to check all entities as required under 'Action and parameters' section. now we also have to pass prompt text for each of it under prompt column..&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw2q2u0evp8ayumuhlmhc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw2q2u0evp8ayumuhlmhc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A menu will be opened after clicking on Define Prompts. Here we can input the prompt message for each of the entity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqy7rj5m4pj4qqnrh03i5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqy7rj5m4pj4qqnrh03i5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this way we have entered prompt message for all 5 entities. Also not that system entities are connected by default but we have to make them required.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8ig7yc2frrvioqjx1sbz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8ig7yc2frrvioqjx1sbz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it's time to provide a response for our order-coffee intent, but this time we want to repeat what user have ordered, this can be done using $keywords from value column under 'Action and parameters'. Using these in response, will be replaced by original data that user provided.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg6k9h0blrencn89akbfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg6k9h0blrencn89akbfi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;click SAVE and test&lt;br&gt;
Working , if not please provide your issues in comments section.&lt;/p&gt;

&lt;p&gt;Now we will be deploying it on web so that we can add it in our javascript app. Go to  Integrations and enable web demo, a link will be provided which you can use as a i-frame in your website. There are also other options which you can use easily not covered in this post.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8xxrupn3upi57pxlffz6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8xxrupn3upi57pxlffz6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's a lot more stuff left like &lt;br&gt;
-the contexts which are used to continue our intents&lt;br&gt;
-placing orders in database&lt;br&gt;
-receiving entities from database. &lt;br&gt;
i will be covering them in other posts,&lt;/p&gt;

&lt;p&gt;These are some resources from where you can become master in chatbots development:&lt;br&gt;
&lt;a href="https://www.coursera.org/learn/conversational-experiences-dialogflow?" rel="noopener noreferrer"&gt;Official free Dialogflow course&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.udemy.com/course/making-chatbot/" rel="noopener noreferrer"&gt;free course on Udemy&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cloud.google.com/dialogflow/docs/" rel="noopener noreferrer"&gt;Dialogflow Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See you on the next post.&lt;br&gt;
Thanks Alot.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>angular</category>
      <category>ux</category>
    </item>
    <item>
      <title>Hi, I'm Shahzaib from Pakistan..</title>
      <dc:creator>Muhammad Shahzaib</dc:creator>
      <pubDate>Wed, 11 Dec 2019 06:21:24 +0000</pubDate>
      <link>https://forem.com/mshahzaib101/hi-i-m-shahzaib-from-pakistan-4pkf</link>
      <guid>https://forem.com/mshahzaib101/hi-i-m-shahzaib-from-pakistan-4pkf</guid>
      <description>&lt;p&gt;This is my first post so I will be introducing myself as a custom. Here we go. My name is Muhammad Shahzaib, born in Karachi, Pakistan.&lt;/p&gt;

&lt;p&gt;Right now Iam 19 years old and a Full Stack Developer with Cloud Native experience. When I was of about 14 I started learning Adobe Photoshop and from there dive in to Web and Mobile Development.&lt;/p&gt;

&lt;p&gt;I mostly program in JavaScript and Python.&lt;br&gt;
React and React-Native are my favourite .&lt;br&gt;
Always stucked between GCP and AWS .&lt;br&gt;
I am currently learning AI (machine learning &amp;amp; deep learning) and ChatBots.&lt;/p&gt;

&lt;p&gt;that's it&lt;/p&gt;

&lt;h3&gt;
  
  
  ASK ME ANYTHING
&lt;/h3&gt;

&lt;p&gt;See you on the next post.&lt;br&gt;
Thanks Alot.&lt;/p&gt;

</description>
      <category>introduction</category>
      <category>askmeanything</category>
    </item>
  </channel>
</rss>
