Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Search pairwise ranking implementation #198

Closed
wants to merge 1 commit into from

Conversation

kmalik22
Copy link

@kmalik22 kmalik22 commented Jan 9, 2019

Summary:
Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 9, 2019
@hikushalhere
Copy link
Contributor

hikushalhere commented Jan 9, 2019

@kmalik22 Thanks a lot for the PR. It looks like you want a two-tower model that can represent a query and a document and learns by using pairwise ranking loss. Have you checked out PairClassificationTask: https://github.com/facebookresearch/pytext/blob/master/pytext/task/tasks.py#L162? I wonder if you can just add a new output layer that implements the pairwise loss (that you have provided a link to) and then add it to PairClassificationTask as an option for its output_layer. Pls let me know what you think.

@hikushalhere hikushalhere self-assigned this Jan 9, 2019
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 9, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: f9ec4bc62dfab969089dbfb089e490b6721e4d4d
@kmalik22
Copy link
Author

kmalik22 commented Jan 9, 2019

@hikushalhere, thanks for your comment.
I did look at PairClassification, it solves a different problem. For PairClassification, the inputs are {label, doc1, doc2}. The goal is to classify the two documents as a 'pair'. Eg: the documents "agree", or "contradict", or neither agree nor contradict.

For SearchPairwiseRanking, the input is three documents: {query, response1, response2}. We want to find which response is better for the query in question. In this case (unlike PairClassification), the query is a document and needs to go through an embedding-->representation(LSTM, eg)-->MLP layers.

Fundamentally, PairClassification is solving a classification problem, computing something like similarity(doc1, doc2) and mapping that to a label (eg., via a Softmax layer)
SearchPairwiseRanking is solving a relevance ranking problem, computing s1=similarity(query, doc1); s2=similarity(query, doc2), and then using f(s1, s2) as a loss function.

Hope this makes sense!

kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 10, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: f3e3db849ae57da4bb675c7ed6790e0d98fb2a34
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 10, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: 0fe0cfc44ab58fa3737c96d43b8e0e176140d657
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 10, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: bab8a626e63b9259126f034cba49e353b106500c
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 11, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: a9a146cab03e97b44354f8e5d3fc6bb509978e11
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 11, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: 0d5c2562f5e72e13493ddf139dac9e1783ce4640
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 22, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: a52a813e112d1b19690dcfdd3cfcd38d8cfb80d7
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 22, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: e632904a2ed50d2d056eec3e3f1eda3bbc5146f7
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 22, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: cdff270177d13ab6fb6bb49a6255744ecac00978
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 23, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: ea4d9633e29c7fc17f600db2de290fac09d835c3
kmalik22 pushed a commit to kmalik22/pytext that referenced this pull request Jan 28, 2019
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Differential Revision: D13166103

fbshipit-source-id: b269de4cb6f7de04be0bd3549ab4e065a4097cae
Summary:
Pull Request resolved: facebookresearch#198

Implements a pairwise ranking model for search.

Training Datum: {search query, positive response, negative response}
Loss function: pairwise ranking hinge loss: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/35662.pdf

Reviewed By: hikushalhere

Differential Revision: D13166103

fbshipit-source-id: cb46c44d8633cdc8690493f8131c9dedf70468b1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants