<?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>DEV Community: Jaydeep Borkar</title>
    <description>The latest articles on DEV Community by Jaydeep Borkar (@jaydeepborkar).</description>
    <link>https://dev.to/jaydeepborkar</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%2F71091%2Fc784b47f-914c-41ec-abd4-5562e176b5fb.jpg</url>
      <title>DEV Community: Jaydeep Borkar</title>
      <link>https://dev.to/jaydeepborkar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaydeepborkar"/>
    <language>en</language>
    <item>
      <title>COVID Letters: Spreading positivity in the age of COVID</title>
      <dc:creator>Jaydeep Borkar</dc:creator>
      <pubDate>Mon, 11 May 2020 16:56:21 +0000</pubDate>
      <link>https://dev.to/jaydeepborkar/covid-letters-spreading-positivity-in-the-age-of-covid-3lkm</link>
      <guid>https://dev.to/jaydeepborkar/covid-letters-spreading-positivity-in-the-age-of-covid-3lkm</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ImCiCGd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/twgkyty573tivdlmjsbo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ImCiCGd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/twgkyty573tivdlmjsbo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My friend &lt;a class="comment-mentioned-user" href="https://dev.to/santoshvijapure"&gt;@santoshvijapure&lt;/a&gt;
 and I very recently built a platform called &lt;a href="http://covidletters.herokuapp.com/"&gt;COVID Letters&lt;/a&gt; where every one of us can write anonymous letters to spread positivity and help others combat anxiety and loneliness during this pandemic. A lot of people around were struggling with their mental health due to social isolation. This inspired us to build something to spread love and hope amidst this challenging time. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;: Bootstrap, Nodejs, MongoDB. &lt;/p&gt;

&lt;p&gt;We have just open-sourced the platform. &lt;a href="https://github.com/santoshvijapure/COVID19Letters"&gt;Here&lt;/a&gt; is the GitHub repository. Would love to know everyone's thoughts and feedback on this.  &lt;/p&gt;

</description>
      <category>node</category>
      <category>bootstrap</category>
      <category>mongodb</category>
      <category>html</category>
    </item>
    <item>
      <title>Building a Chatbot using Dialogflow on Google Assistant for Beginners </title>
      <dc:creator>Jaydeep Borkar</dc:creator>
      <pubDate>Thu, 30 May 2019 22:31:09 +0000</pubDate>
      <link>https://dev.to/jaydeepborkar/building-a-chatbot-using-dialogflow-on-google-assistant-for-beginners-433l</link>
      <guid>https://dev.to/jaydeepborkar/building-a-chatbot-using-dialogflow-on-google-assistant-for-beginners-433l</guid>
      <description>&lt;p&gt;In this tutorial, we will learn to build a chatbot (a virtual assistant) using Dialogflow which will work on Google Assistant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But what is Dialogflow in the first place?&lt;/strong&gt;&lt;br&gt;
It’s a tool by Google to build conversational chatbots.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEPS&lt;/strong&gt;&lt;br&gt;
1) Go to the &lt;a href="https://dialogflow.com/"&gt;Dialogflow Console&lt;/a&gt; -- you will see a Dialogflow home page.&lt;br&gt;
2) Sign in using your Google account.&lt;br&gt;
3) After you sign in, click on &lt;em&gt;Go to console&lt;/em&gt;.&lt;br&gt;
You will be directed to the main console of Dialogflow. Now click on the drop-down icon next to the settings icon in the left-most column, and then click on create new agent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, what is an agent over here?&lt;/strong&gt;&lt;br&gt;
Agent is an interface in Dialogflow which contains different sections called intents which further contain all the responses to the user’s queries. We will learn more about intents as we proceed ahead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a new agent&lt;/strong&gt;&lt;br&gt;
After you click on create new agent, give an agent name, default language, time zone,  and click on create. Keep &lt;em&gt;create a new Google project&lt;/em&gt; as it is in the Google project section. It will create a new Google project for Actions on Google and Google Cloud. We will be integrating Dialogflow with Actions on Google console which would help us to deploy it on Google Assistant.&lt;br&gt;
Now, you can see your created agent in the console. We will be creating different intents now for our agent. You can create as many intents as you want. Two default intents -- Fallback and Welcome are already created.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s understand the Default Fallback and Welcome intent&lt;/strong&gt;&lt;br&gt;
Fallback intent comes into picture when the bot won’t understand the query triggered/asked by the user. It means there is no intent that matches the query asked by the user. It will give a response like &lt;em&gt;sorry, I didn’t get it&lt;/em&gt;. Talking practically -- whenever you say something very unusual to Google Assistant, it will say &lt;em&gt;sorry, didn’t get you&lt;/em&gt;. Here, after you said something strange that’s not a natural language, the Fallback intent got triggered and gave this response.&lt;/p&gt;

&lt;p&gt;Default Welcome intent will greet the user once your bot is called. You can customize both the default intents with the responses that you want.&lt;/p&gt;

&lt;p&gt;Now click on the + sign to create more intents. You can make as many intents as you want, depending on your use-case. Let’s say you are building a chatbot for an ice cream parlor, and the user wants to know all the flavors that you serve. Here, you will create an intent let’s say &lt;em&gt;flavors&lt;/em&gt;. Then you will add the training phases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Training Phrases&lt;/strong&gt;&lt;br&gt;
Training phases are the queries that the user will ask to your chatbot. You can add as many similar training phrases as you want. These are the queries that you think the user would most likely ask. For the flavor intent, you can add training phrases like -- &lt;em&gt;What flavors do you have?&lt;/em&gt;, &lt;em&gt;Show me the flavors&lt;/em&gt;, &lt;em&gt;Flavours&lt;/em&gt;, &lt;em&gt;I want to have a look at the flavors&lt;/em&gt;, and the list is endless. These training phrases are used to train a natural language understanding model internally. This is the best part about&lt;br&gt;
Dialogflow, you don’t have to write any code to train the model. In circumstances, where you want real-time results, you can write some Node.js code which we will talk later about!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Response section in the Intent&lt;/strong&gt;&lt;br&gt;
Now, in the Responses section, you can add the responses that you would like to show to the users. For instance, a simple response to a question in the training phrase -- &lt;em&gt;Show me the flavors&lt;/em&gt; could be &lt;em&gt;Mango, Vanilla, Chocolate&lt;/em&gt;. Make sure you append every response for every intent that you create with the sentence &lt;em&gt;would you like to know anything else?&lt;/em&gt;, because for every intent except the exit intent (the intent that you would use when the user exits) it’s necessary that your response has a user prompt, else it would be against the guidelines published by Google and your app might not get published.&lt;/p&gt;

&lt;p&gt;In a similar fashion, you can have as many intents as you like, as per your need.&lt;/p&gt;

&lt;p&gt;Don’t forget to save every time you make an intent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Making an Exit Intent&lt;/strong&gt;&lt;br&gt;
You also need to make an intent that would get triggered while the user leaves your app, which we would call as exit intent. For instance, if the user says, &lt;em&gt;bye&lt;/em&gt;, you can have a separate intent for this with the training phrases related to &lt;em&gt;bye&lt;/em&gt;, and in the response section, you can add anything that you like or something like &lt;em&gt;feel free to visit again&lt;/em&gt;. Don't forget to toggle on &lt;em&gt;set this intent as the end of the conversation&lt;/em&gt; at the bottom of this intent, as this intent will mark the end of the conversation with the user.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Node.js Code&lt;/strong&gt;&lt;br&gt;
Now, if you want to give some real-time output to your users, then you can write some Node.js code for the same. Go to the Fulfillment section at the left of the console, there you will see an option for Inline editor, toggle it on to enable it. You can write your code in index.js part. Let’s say, you’re making an app for a restaurant. The restaurant’s working hours are from 10:00 am - 10:00 pm, now if someone wants to check at 11:00 pm if the restaurant is open or not, instead of giving the static response like “Our timings are from 10:00 am - 10:00 pm”, the code will take the real-time parameters and will tell if the restaurant is open at that specific time or not. You can use Node.js code for different use cases, this is just an example. After you’re done, click on deploy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrations&lt;/strong&gt;&lt;br&gt;
You can have your chatbot integrated with different platforms like -- Slack, Facebook Messenger, Alexa, Cortana, Twitter, Viber, Skype, Telegram, and many others. Make sure to toggle on the platforms that you like. We will be sticking to the Google Assistant, which is the default one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;br&gt;
In the History section on the console, you can check how the users are interacting with your app and what all are they saying. You can use this as a tool to check what specific questions is your app unable to answer so that you can work on them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analytics&lt;/strong&gt;&lt;br&gt;
In the Analytics section, you would see the analysis of how your app is performing. &lt;br&gt;
Now it’s time to test the app. Let’s see how it works.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing the App&lt;/strong&gt;&lt;br&gt;
On the Dialogflow console, at the right side, you would see &lt;em&gt;See how it works on Google Assistant&lt;/em&gt;, click on that. Once you click it, you will see the test simulator. Let’s say that our app name is &lt;em&gt;test app&lt;/em&gt;, then you will see the invocation phrase something along the line &lt;em&gt;Talk to my test app&lt;/em&gt; on the simulator. You can test your app with all the training phrases/questions that you have used to train the model. You will get a better intuition about how your app will actually perform once it gets deployed on the assistant.  &lt;br&gt;
Now, it’s time to deploy it.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploying&lt;/strong&gt;&lt;br&gt;
On the simulator page itself, you will see an overview section at the left. Click on that. In the Quick setup part, you can choose how your action should be invoked. In the &lt;em&gt;Get ready for deployment&lt;/em&gt; part, you can choose what countries would you like to provide your app over Assistant. By default, it’s all 215 countries. You can also choose what surfaces would you like to run your app over, it’s both phones and speakers by default.&lt;/p&gt;

&lt;p&gt;Now, go to the &lt;em&gt;Deploy&lt;/em&gt; section, go to &lt;em&gt;Directory information&lt;/em&gt; -- here you can add a short and long description for your app, sample invocations, background and profile image for your app, contact information, and privacy and consent. These all will be visible to your users. Feel free to click on &lt;em&gt;Need help creating a Privacy Policy?&lt;/em&gt; to know how to make a privacy policy, please follow all the steps over there. You can various free tools to make a privacy policy for your app. Then you can choose what category your app belongs to and some other related information about your app below it. After you’re done with all these, click SAVE at the top.&lt;/p&gt;

&lt;p&gt;Afterward, you can add Surface Capabilities and Company details in the Deploy section itself. After that, go to the &lt;em&gt;release&lt;/em&gt; section within the deploy section itself -- there you would see an option to submit for production in the production part. Click on that and your app will be submitted for the review by Google. If it meets all the guidelines, it will be soon deployed on Google Assistant within 24-48 hours (you will receive an email from Google once it gets deployed successfully; and if it doesn’t, you will get an email in this case as well with all the errors so that you can fix them and submit for the production again). You can also opt for the alpha and beta versions for your app.&lt;/p&gt;

&lt;p&gt;Once it’s deployed, your app will be available to over 500+ million devices without any installation, isn’t that cool?&lt;/p&gt;

&lt;p&gt;Feel free to post any doubts or suggestions!&lt;/p&gt;

</description>
      <category>dialogflow</category>
      <category>actionsongoogle</category>
      <category>chatbot</category>
    </item>
    <item>
      <title>Friendly Introduction to Machine Learning and Decision Trees</title>
      <dc:creator>Jaydeep Borkar</dc:creator>
      <pubDate>Fri, 03 May 2019 14:39:35 +0000</pubDate>
      <link>https://dev.to/jaydeepborkar/friendly-introduction-to-machine-learning-and-decision-trees-2l45</link>
      <guid>https://dev.to/jaydeepborkar/friendly-introduction-to-machine-learning-and-decision-trees-2l45</guid>
      <description>&lt;p&gt;At an atomic level, Machine Learning is about &lt;em&gt;predicting&lt;/em&gt; the future based on the past. For instance, you may wish to predict which team will win the upcoming Cricket World Cup. You will need to consider various factors for doing the prediction, like: type of pitch, weather conditions, number of spin bowlers, strike rate, the record of the team in the last five matches, etc. In a nutshell, a model will make predictions on unseen data by learning from the past data. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, what does learning actually means? What does it mean when we say that the model should learn well?&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Let’s take this example:&lt;/p&gt;

&lt;p&gt;John is taking a course on Linear Algebra, and at the end of the course, he is expected to take a exam to understand if he has “learned” the topic properly or not. If he scores well in the exam, it means that he has learned well. And if he fails, he hasn’t learned the topic properly. &lt;/p&gt;

&lt;p&gt;But what makes a &lt;em&gt;reasonable&lt;/em&gt; exam? If the questions in a linear algebra exam are based on Chemistry, then the exam won’t tell how well John has learned linear algebra, and if every question in the exam comes from the examples which John went through during his linear algebra classes, then it’s a bad test of John’s learning. Thus, in order to make a reasonable test, the questions should be new but related to the examples covered in the course. This tests if John has the ability to generalize. Generalization is perhaps a very important part of Machine Learning. &lt;/p&gt;

&lt;p&gt;Let’s take the example of a course recommendation system for computer science students. It will predict how much a specific student will like a particular course. A student has been given a subset of courses and has evaluated the previously taken courses from them by giving them a rating from -2 (worst) to +2 (excellent). The job of the recommender system is to predict how much a particular student (say, John) will like a particular course (say, Deep Learning). &lt;/p&gt;

&lt;p&gt;Now we can be unfair to this system: let’s say we ask the system to predict how much John will like a course on Energy Sciences. This is unfair because the system has no idea what Energy Sciences even is, and has no prior experience with this course. On the other hand, we could ask how much John liked the Natural Language Processing course which he took last year and rated +2 (excellent for it). In this case, the system will tell us that John will like this course, but it’s not the real test of the model’s learning since it’s just recalling it’s past experience. In the former case, we are expecting the system to generalize beyond its experiences, which is unfair. In the latter case, we are not expecting it to generalize at all. &lt;/p&gt;

&lt;p&gt;The objects that our model will be making predictions about are called &lt;em&gt;examples&lt;/em&gt;. In the recommender system, the example would be a Student/Course pair and the prediction would be the rating. We are given training data on which our algorithm is expected to learn. This training data is the historical rating data for the recommender system which it will use to make predictions for the test data. The system will create an inductive function f  from this training data that will map the new example to the corresponding prediction. The function will take two parameters (Student, Course). &lt;/p&gt;

&lt;p&gt;Function &lt;em&gt;f&lt;/em&gt; (John/Machine Learning) would predict that John will like Machine Learning since the model knows that he took Natural Language Processing course in the past, which he liked. This is the art of inducing intelligence in the model. Thus, the system shows generalization. The data on which the system will make predictions is called as a test set. The test set should always be a secret. If the model gets to peek at it ahead of the time, it’s going to cheat and do better than it should. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Decision Tree Model of Learning&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The Decision Tree is a very classic model of learning which works on the “divide and conquer” strategy. Decision Trees can be applied to various learning problems like regression, binary and multiclass classification, Ranking, etc. We would consider binary classification in our case. &lt;/p&gt;

&lt;p&gt;Suppose your goal is to predict if some unknown student will enjoy some unknown course. The output should be simply “yes” or “no”. You are allowed to ask as many binary questions as you can to get the output. &lt;/p&gt;

&lt;p&gt;Consider this example: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt;: Is the course under consideration in AI? &lt;br&gt;
&lt;strong&gt;Ans&lt;/strong&gt;: Yes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt;: Has the student previously taken any AI courses?&lt;br&gt;
&lt;strong&gt;Ans&lt;/strong&gt;: Yes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt;: Has the student liked previous courses in AI?&lt;br&gt;
&lt;strong&gt;Ans&lt;/strong&gt;: Yes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt;: Does the student wants to make a career in AI?&lt;br&gt;
&lt;strong&gt;Ans&lt;/strong&gt;: Yes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You&lt;/strong&gt;: I predict this student will like AI course. &lt;/p&gt;

&lt;p&gt;Based on these binary questions, we will generate a decision tree. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IPK7iOtY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ltdmzm2rm4ucql899tks.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IPK7iOtY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ltdmzm2rm4ucql899tks.jpeg" alt="Here's the decision tree"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to check how well a model has performed?&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;To check how accurate the model’s performance is, we make a function for it, which we usually refer to as a loss function &lt;em&gt;l&lt;/em&gt;(y, y’). Different learning problems have different forms of loss function. For regression, it’s a squared loss function (y-y’)^2 and for binary/multiclass classification, it’s zero/one loss function. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;zero/one loss&lt;/strong&gt;: &lt;em&gt;l&lt;/em&gt;(y, y’) = { 0, y=y’ } &lt;br&gt;
                                { 1, otherwise }&lt;/p&gt;

&lt;p&gt;Where y is the actual value and y’ is the predicted value. &lt;/p&gt;

&lt;p&gt;The lesser the error while predicting, the more generalized is the model. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do we have different loss functions for different learning problems? And why do we have different learning problems in the first place?&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Here are some of the learning problems: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Regression&lt;/strong&gt;: predicting discrete future values based on past data. Example: The amount of rainfall on next Sunday. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Binary Classification&lt;/strong&gt;: non-discrete binary values. Example:  would it rain on Sunday or not? It will give 0 for No and 1 for yes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiclass Classification&lt;/strong&gt;: putting an example into one of a number of classes. Example: if a particular course belongs to computer science or earth sciences or educational sciences. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ranking&lt;/strong&gt;: putting the objects in a set of relevance. Example:  arranging search results based on the user’s query. &lt;/p&gt;

&lt;p&gt;The main reason to break learning problems into different genres is for measuring the error. A good model is the one that makes “good predictions”. Now, what do good predictions mean? Different types of learning problems differ in the way they define goodness. For example: predicting a rainfall that is off by 0.5 cm is much better than off by 300 cm. The same does not hold for multiclass classification. There, predicting computer science instead of earth sciences would be horrifying. Here, we can’t even afford slightest of the error. This is the reason why we break the problems into different categories and hence they have different loss functions. Thus, a good model is one that can &lt;em&gt;generalize&lt;/em&gt; itself and can perform well on the unseen data. &lt;/p&gt;

&lt;p&gt;Please, feel free to provide me any feedback and corrections on this piece. In the next article, I’m planning to talk about implementing a decision tree classifier and introducing inductive bias in the learning. You can also check out my previous article on Natural Language Processing over &lt;a href="https://dev.to/jaydeepborkar/introduction-to-natural-language-processing-part-1--59gd"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>decisiontrees</category>
    </item>
    <item>
      <title>A Web Tracker to record HTTP/S requests and cookies. </title>
      <dc:creator>Jaydeep Borkar</dc:creator>
      <pubDate>Fri, 14 Sep 2018 17:56:42 +0000</pubDate>
      <link>https://dev.to/jaydeepborkar/a-web-tracker-to-record-https-requests-and-cookies--p1e</link>
      <guid>https://dev.to/jaydeepborkar/a-web-tracker-to-record-https-requests-and-cookies--p1e</guid>
      <description>&lt;p&gt;A few weeks ago, I was contributing for building a web tracker to record HTTP/S requests and cookies from the browser(restricted to Google Chrome). An extension that records user sessions on a click, a user can stop the recording on a click as per the wish, it would be then converted into JMeter script and can be used for load testing. All the extensions that are there in the market, they just record the user session of a single tab. Is it possible to integrate user sessions from multiple tabs and use them for testing? Does it make any sense?  &lt;/p&gt;

</description>
      <category>webtracker</category>
      <category>httpsrecorder</category>
      <category>socket</category>
      <category>testing</category>
    </item>
    <item>
      <title>Introduction to Natural Language Processing, Part 1. </title>
      <dc:creator>Jaydeep Borkar</dc:creator>
      <pubDate>Sun, 09 Sep 2018 17:40:28 +0000</pubDate>
      <link>https://dev.to/jaydeepborkar/introduction-to-natural-language-processing-part-1--59gd</link>
      <guid>https://dev.to/jaydeepborkar/introduction-to-natural-language-processing-part-1--59gd</guid>
      <description>&lt;p&gt;Hello folks, I’ve just started my NLP journey and will be happy to share my learning process with you. Here’s an article regarding Introduction to Natural Language Processing. &lt;/p&gt;

&lt;p&gt;The essence of Natural Language Processing lies in making computers understand our natural language. That’s not an easy task though. Computers can understand the structured form of data like spreadsheets and the tables in the database, but human languages, texts, and voices form an unstructured category of data, and it gets difficult for the computer to understand it, and there arises the need for Natural Language Processing. &lt;/p&gt;

&lt;p&gt;There’s a lot of natural language data out there in various forms and it would get very easy if computers can understand and process that data. We can train the models in accordance with our expected output in different ways. Humans have been writing for thousands of years, there are a lot of literature pieces available, and it would be great if we make computers understand that. But the task is never going to be easy. There are various challenges floating out there like understanding the correct meaning of the sentence, correct Named-Entity Recognition(NER), correct prediction of various parts of speech, coreference resolution(the most challenging thing in my opinion). &lt;/p&gt;

&lt;p&gt;Computers can’t truly understand the human language. If we feed enough data and train a model properly, it can distinguish and try categorizing various parts of speech(noun, verb, adjective, supporter, etc…) based on previously fed data and experiences. If it encounters a new word it tried making the nearest guess which can be embarrassingly wrong few times.&lt;/p&gt;

&lt;p&gt;It’s very difficult for a computer to extract the exact meaning from a sentence. For an example - The boy radiated fire like vibes. The boy had a very motivating personality or he actually radiated fire? As you see over here, parsing English with a computer is going to be complicated. &lt;/p&gt;

&lt;p&gt;There are various stages involved in training a model. Solving a complex problem in Machine Learning means building a pipeline. In simple terms, it means breaking a complex problem into a number of small problems, making models for each of them and then integrating these models. A similar thing is done in NLP. We can break down the process of understanding English for a model into a number of small pieces. &lt;/p&gt;

&lt;p&gt;My friend recently went for diving at San Pedro island, so I’ll love to take that example. Have a look at this paragraph -  San Pedro is a town on the southern part of the island of Ambergris Caye in the Belize District of the nation of Belize, in Central America. According to 2015 mid-year estimates, the town has a population of about 16,444. It is the second-largest town in the Belize District and largest in the Belize Rural South constituency. &lt;/p&gt;

&lt;p&gt;(source-Wikipedia) &lt;/p&gt;

&lt;p&gt;It would be really great if a computer could understand that San Pedro is an island in Belize district in Central America with a population of 16,444 and it is the second largest town in Belize. But to make the computer understand this, we need to teach computer very basic concepts of written language. &lt;/p&gt;

&lt;p&gt;So let’s start by creating an NLP pipeline. It has various steps which will give us the desired output(maybe not in a few rare cases) at the end. &lt;/p&gt;

&lt;p&gt;STEP 1: Sentence Segmentation &lt;/p&gt;

&lt;p&gt;Breaking the piece of text in various sentences. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;San Pedro is a town on the southern part of the island of Ambergris Caye in the 2.Belize District of the nation of Belize, in Central America.&lt;/li&gt;
&lt;li&gt;According to 2015 mid-year estimates, the town has a population of about 16,444.&lt;/li&gt;
&lt;li&gt;It is the second-largest town in the Belize District and largest in the Belize Rural South constituency. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For coding a sentence segmentation model, we can consider splitting a sentence when it encounters any punctuation mark. But modern NLP pipelines have techniques to split even if the document isn’t formatted properly. &lt;/p&gt;

&lt;p&gt;STEP 2: Word Tokenization&lt;/p&gt;

&lt;p&gt;Breaking the sentence into individual words called as tokens. We can tokenize them whenever we encounter a space, we can train a model in that way. Even punctuations are considered as individual tokens as they have some meaning. &lt;br&gt;
‘San Pedro’,’ is’, ’a’, ’town’ and so. &lt;/p&gt;

&lt;p&gt;STEP 3: Predicting Parts of Speech for each token&lt;/p&gt;

&lt;p&gt;Predicting whether the word is a noun, verb, adjective, adverb, pronoun, etc. This will help to understand what the sentence is talking about. This can be achieved by feeding the tokens( and the words around it) to a pre-trained part-of-speech classification model. This model was fed a lot of English words with various parts of speech tagged to them so that it classifies the similar words it encounters in future in various parts of speech. Again, the models don’t really understand the ‘sense’ of the words, it just classifies them on the basis of its previous experience. It’s pure statistics. &lt;/p&gt;

&lt;p&gt;The process will look like this: &lt;br&gt;
Input                            ---&amp;gt;Part of speech classification model→             Output&lt;br&gt;
Town                                                                                                            common noun&lt;br&gt;
Is                                                                                                                    verb &lt;br&gt;
The                                                                                                                  determiner&lt;/p&gt;

&lt;p&gt;And similarly, it will classify various tokens. &lt;/p&gt;

&lt;p&gt;STEP 4: Lemmatization&lt;br&gt;
Feeding the model with the root word. &lt;br&gt;
For an example -  There’s a Buffalo grazing in the field. &lt;br&gt;
                              There are Buffaloes grazing in the field. &lt;br&gt;
Here, both Buffalo and Buffaloes mean the same. But, the computer can confuse it as two different terms as it doesn’t know anything. So we have to teach the computer that both terms mean the same. We have to tell a computer that both sentences are talking about the same concept. So we need to find out the most basic form or root form or lemma of the word and feed it to the model accordingly. &lt;/p&gt;

&lt;p&gt;In the similar fashion, we can use it for verbs too. ‘Play’ and ‘Playing’ should be considered as same. &lt;/p&gt;

&lt;p&gt;STEP 5: Identifying stop words&lt;/p&gt;

&lt;p&gt;There are various words in the English language that are used very frequently like ‘a’, ‘and’, ‘the’ etc. These words make a lot of noise while doing statistical analysis. We can take these words out. Some NLP pipelines will categorize these words as stop words, they will be filtered out while doing some statistical analysis. Definitely, they are needed to understand the dependency between various tokens to get the exact sense of the sentence. The list of stop words varies and depends on what kind of output are you expecting. &lt;/p&gt;

&lt;p&gt;STEP 6.1: Dependency Parsing&lt;/p&gt;

&lt;p&gt;This means finding out the relationship between the words in the sentence and how they are related to each other. We create a parse tree in dependency parsing, with root as the main verb in the sentence. If we talk about the first sentence in our example, then ‘is’ is the main verb and it will be the root of the parse tree. We can construct a parse tree of every sentence with one root word(main verb) associated with it. We can also identify the kind of relationship that exists between the two words. In our example, ‘San Pedro’ is the subject and ‘island’ is the attribute. Thus, the relationship between ‘San Pedro’ and ‘is’, and ‘island’ and ‘is’ can be established. &lt;/p&gt;

&lt;p&gt;Just like we trained a Machine Learning model to identify various parts of speech, we can train a model to identify the dependency between words by feeding many words. It’s a complex task though. In 2016, Google released a new dependency parser Parsey McParseface which used a deep learning approach. &lt;/p&gt;

&lt;p&gt;STEP 6.2: Finding Noun Phrases&lt;/p&gt;

&lt;p&gt;We can group the words that represent the same idea. For example -  It is the second-largest town in the Belize District and largest in the Belize Rural South constituency. Here, tokens ‘second’, ‘largest’ and ‘town’ can be grouped together as they together represent the same thing ‘Belize’. We can use the output of dependency parsing to combine such words. Whether to do this step or not completely depends on the end goal, but it’s always quick to do this if we don’t want much information about which words are adjective, rather focus on other important details. &lt;/p&gt;

&lt;p&gt;STEP 7: Named Entity Recognition(NER)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;San Pedro is a town on the southern part of the island of Ambergris Caye in the 2. Belize District of the nation of Belize, in Central America.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here, the NER maps the words with the real world places. The places that actually exist in the physical world. We can automatically extract the real world places present in the document using NLP. &lt;/p&gt;

&lt;p&gt;If the above sentence is the input, NER will map it like this way: &lt;br&gt;
San Pedro - Geographic Entity&lt;br&gt;
Ambergris Caye - Geographic Entity&lt;br&gt;
Belize - Geographic Entity&lt;br&gt;
Central America - Geographic Entity&lt;/p&gt;

&lt;p&gt;NER systems look for how a word is placed in a sentence and make use of other statistical models to identify what kind of word actually it is. For example - ‘Washington’ can be a geographical location as well as the last name of any person. A good NER system can identify this. &lt;/p&gt;

&lt;p&gt;Kinds of objects that a typical NER system can tag: &lt;br&gt;
People’s names. &lt;br&gt;
Company names. &lt;br&gt;
Geographical locations&lt;br&gt;
Product names. &lt;br&gt;
Date and time. &lt;br&gt;
Amount of money. &lt;br&gt;
Events. &lt;/p&gt;

&lt;p&gt;STEP 8: Coreference Resolution: &lt;/p&gt;

&lt;p&gt;San Pedro is a town on the southern part of the island of Ambergris Caye in the Belize District of the nation of Belize, in Central America.&lt;br&gt;
According to 2015 mid-year estimates, the town has a population of about 16,444.&lt;br&gt;
It is the second-largest town in the Belize District and largest in the Belize Rural South constituency. &lt;/p&gt;

&lt;p&gt;Here, we know that ‘it’ in the sentence 6 stands for San Pedro, but for a computer, it isn’t possible to understand that both the tokens are same because it treats both the sentences as two different things while it’s processing them. Pronouns are used with a high frequency in English literature and it becomes difficult for a computer to understand that both things are same. Hence, this step is used. This step is indeed the most difficult step&lt;/p&gt;

&lt;p&gt;In the upcoming articles, I’ll try sharing about the history of NLP, how it evolved, various past models and why they failed, NLP Libraries and coding NLP pipeline in Python. I’d love discussing various papers as well. &lt;/p&gt;

&lt;p&gt;Please, feel free to correct me on any topic if I went wrong somewhere and do let me know about improvements. &lt;/p&gt;

&lt;p&gt;Note - I will be soon publishing this article on Geeksforgeeks as well, so that we all can get into getting the knowledge together. &lt;/p&gt;

</description>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>nlppipeline</category>
    </item>
    <item>
      <title>How to embed graph in Django for the users</title>
      <dc:creator>Jaydeep Borkar</dc:creator>
      <pubDate>Wed, 05 Sep 2018 14:48:03 +0000</pubDate>
      <link>https://dev.to/jaydeepborkar/how-to-embed-graph-in-django-for-the-users-4djl</link>
      <guid>https://dev.to/jaydeepborkar/how-to-embed-graph-in-django-for-the-users-4djl</guid>
      <description>&lt;p&gt;I want to show a graph(using matplotlib) to the user. In which Django directory should I place my code? &lt;/p&gt;

&lt;p&gt;mysite/&lt;/p&gt;

&lt;p&gt;graph/&lt;br&gt;
     my_matplotlib/&lt;br&gt;
     &lt;strong&gt;init&lt;/strong&gt;.py&lt;br&gt;
      my_matplotlib.py&lt;br&gt;
      graphcode.py (basically, the code for the graph)&lt;/p&gt;

&lt;p&gt;app/&lt;br&gt;
  views.py&lt;br&gt;
  from my_matplotlib.my_matplotlib import my_func&lt;/p&gt;

&lt;p&gt;my_matplotlib.py&lt;/p&gt;

&lt;p&gt;def my_func():&lt;br&gt;
    foo = 'bar'&lt;br&gt;
    return foo&lt;/p&gt;

&lt;p&gt;I tried this but it's not working. &lt;/p&gt;

</description>
      <category>django</category>
      <category>python3</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
