/Quora-Question-Pairs

🍕 A Binary Classification Problem where we have to predict the similarity between two questions on Quora.

Primary LanguageJupyter Notebook

Quora Question Pairs

1. Business Problem

Quora is a place to gain and share knowledge—about anything. It’s a platform to ask questions and connect with people who contribute unique insights and quality answers. This empowers people to learn from each other and to better understand the world.

Over 100 million people visit Quora every month, so it's no surprise that many people ask similarly worded questions. Multiple questions with the same intent can cause seekers to spend more time finding the best answer to their question, and make writers feel they need to answer multiple versions of the same question. Quora values canonical questions because they provide a better experience to active seekers and writers, and offer more value to both of these groups in the long term.


*** Credits: Kaggle ***

Problem Statement

  • Identify which questions asked on Quora are duplicates of questions that have already been asked.

  • This could be useful to instantly provide answers to questions that have already been answered.

  • We are tasked with predicting whether a pair of questions are duplicates or not.

1.2 Sources/Useful Links

1.3 Real world/Business Objectives and Constraints

  1. The cost of a mis-classification can be very high. Imagine a scenario if we declare two questions to be duplicate but they are not duplicate , then all the answers that were referred to question1 will be referred to question2 which can be extremely dangerous.

  2. You would want a probability of a pair of questions to be duplicates so that you can choose any threshold of choice.because if we predict only 1 or 0 then it would not tell us how confident we are with our prediction , but since we want misclassification to be very very less

  3. No strict latency concerns.even if it takes quora to identify that questions are duplicate a couple of seconds it would not matter much.

  4. Interpretability is partially important.

2. Machine Learning Probelm

2.1 Data

2.1.1 Data Overview

- Data will be in a file Train.csv
- Train.csv contains 5 columns : qid1, qid2, question1, question2, is_duplicate
- Size of Train.csv - 60MB
- Number of rows in Train.csv = 404,290

2.1.2 Example Data point

2.2 Mapping the real world problem to an ML problem

2.2.1 Type of Machine Leaning Problem

It is a binary classification problem, for a given pair of questions we need to predict if they are duplicate or not.

Source: https://www.kaggle.com/c/quora-question-pairs#evaluation

Metric(s):

  • log-loss : https://www.kaggle.com/wiki/LogarithmicLoss ,it makes sense to use log-loss as performance metric as we don't want to just classify question pair to be 0 or 1 rather we also want the probability , and whenever we need the probability values log-loss is the best metric to use.Log-Loss is a metric used to assess the model performance by taking the probabilities of a point belonging to a particular class, into consideration. Every time, the default threshold of 0.5 might not be appropriate. Sometimes the thresholds do vary. For example, if we want to predict whether a person is having a disease or not. By default, the threshold value used to decide the class label is 0.5. (ie., if P(yq=1|xq)>0.5, then the person is having the disease, or else no) So every time 0.5 is not the best threshold. Sometimes from the domain expertise and various factors, the threshold might go to 0.7 or 0.8 depending on the problem we are working on. In such a case, we need to go for the probabilistic estimates and assess the model performance, by taking these probabilistic estimates into consideration. In such a case, Log-Loss is the best metric to be used. Log-Loss is the best metric to be used when we are working on a multi-class classification problem.

  • Binary Confusion Matrix This is our secondary matrix. We will also use the Binary Matrix to understand what is happening. Using it we can use precision , recall , tpr , fpr , tnr and fnr .