32
Search, Discovery and the Question namespace Nikhil Dandekar (@nikhilbd) Sandeep Goyal 5/10/2016

Search, Discovery and Questions at Quora

Embed Size (px)

Citation preview

Page 1: Search, Discovery and Questions at Quora

Search, Discovery and the Question namespace

Nikhil Dandekar (@nikhilbd) Sandeep Goyal

5/10/2016

Page 2: Search, Discovery and Questions at Quora

About us

Nikhil Dandekar

● Engineering Manager: Search, Questions and Growth at Quora

● Previously: Foursquare, Bing

● Background in Search, Data, Machine Learning

Sandeep Goyal

● Software Engineer: Search, Questions and Growth at Quora.

● Previously: Playdom, Yahoo

● Background in Growth, Systems

Page 3: Search, Discovery and Questions at Quora

Quora’s Mission

“To share and grow the world’s

knowledge”

● Millions of questions & answers

● Millions of users

● Over a million topics

● ...

Page 4: Search, Discovery and Questions at Quora

● The core data

● Search & the question namespace

● Discovery - Feed ranking

● Duplicate Questions deep dive

Agenda

Page 5: Search, Discovery and Questions at Quora

The Core Data

Page 6: Search, Discovery and Questions at Quora

Lots of data relations

Page 7: Search, Discovery and Questions at Quora

Complex network propagation effects

Page 8: Search, Discovery and Questions at Quora

Importance of topics & semantics

Page 9: Search, Discovery and Questions at Quora

Search & the Question namespace

Page 10: Search, Discovery and Questions at Quora

How we think of search

Page 11: Search, Discovery and Questions at Quora

Ranking - Search ranking

● Match user queries to Quora entities

● Corpus: Quora questions, answers,

topics, users, blogs etc.

● Ranking: Traditional IR scores (e.g.

BM25), hand-tuned or ML-ranking

● Focus on long-term satisfaction

○ If a question exists, but the answer

is unsatisfactory, let the user

“Request Answers” for the question

Page 12: Search, Discovery and Questions at Quora

Question Asking

Goal: Find the best people to answer a

question

● Understand the question

● Find people who can best answer the

question

● “Ask to Answer”: Route the question

to these people

● Either manual or automated A2A

Page 13: Search, Discovery and Questions at Quora

Related Questions

• Given interest in question A (source) what other

questions will be interesting?

• Not only about similarity, but also “interestingness”

• Features such as:

• Textual

• Co-visit

• Topics

• …

• Important for logged-out use case

Page 14: Search, Discovery and Questions at Quora

Duplicate Questions• Important issue for Quora

• Want to make sure we don’t disperse

knowledge to the same question

• Solution: binary classifier trained with

labelled data

• Features

• Textual vector space models

• Usage-based features

• etc.

• More on this later...

Page 15: Search, Discovery and Questions at Quora

Discovery - Feed ranking

Page 16: Search, Discovery and Questions at Quora

Ranking - Feed• Goal: Present most interesting stories for

a user at a given time• Interesting = topical relevance +

social relevance + timeliness

• Stories = questions + answers

• Relevance-ordered vs time-ordered = big

gains in engagement

• Challenges:

• potentially many candidate stories

• real-time ranking

• optimize for relevance

• Use Machine Learning for feed ranking

Page 17: Search, Discovery and Questions at Quora

Feed dataset: impression logs

click

upvote

downvote

expand

share

click

answer pass

downvote

follow

Page 18: Search, Discovery and Questions at Quora

● Value of showing a story to a user, e.g. weighted sum of actions:

v = ∑a va 1{ya = 1}

● Goal: predict this value for new stories. 2 possible approaches:○ predict value directly

v_pred = f(x)

■ pros: single regression model

■ cons: can be ambiguous, coupled

○ predict probabilities for each action, then compute expected value:

v_pred = E[ V | x ] = ∑a va p(a | x)

■ pros: better use of supervised signal, decouples action models from action values

■ cons: more costly, one classifier per action

What is relevance?

Page 19: Search, Discovery and Questions at Quora

● Essential for getting good ranking

● Better if updated in real-time (more reactive)

● Main sets of features:○ user (e.g. age, country, recent activity)

○ story (e.g. popularity, trendiness, quality)

○ interactions between the two (e.g. topic or author affinity)

Feature engineering

Page 20: Search, Discovery and Questions at Quora

● Linear

○ simple, fast to train

○ manual, non-linear transforms for richer

representation (buckets, ngrams)

● Decision trees

○ learn non-linear representations

● Tree ensembles

○ Random forests

○ Gradient boosted decision trees

● In-house C++ training code, third-party

libraries for prototyping new models

Models

Page 21: Search, Discovery and Questions at Quora

Scalability: feed backend system

Aggregator 1 Aggregator 2 Aggregator 3

Leaf 1 Leaf 2 Leaf 3

Aggregator

Leaf

Requests from Web (python)

...

...

...

user_id

object_id

Page 22: Search, Discovery and Questions at Quora

Other ML systems

● Answer ranking

● Answer collapsing

● User expertise

● Topics to follow

● Users to follow

● Spam content detection

● Malicious user / troll detection

● Trending topics

● …...

Page 23: Search, Discovery and Questions at Quora

Duplicate Questions

Page 24: Search, Discovery and Questions at Quora

Duplicate Questions

• Duplicate questions are a problem because:

• good writers don't want to answer the same question over and over

• they result in poor user experience

• they dilute the quality of the pages and relevance

• As we grow faster, we will have more duplicate questions.

Page 25: Search, Discovery and Questions at Quora

Duplicate Questions: Product Challenges

• How to handle duplicate questions?

• Maybe delete them? Or Merge them?

• Which one should be the canonical question?

• Who should decide if the questions are duplicate?

• Should we trust the system?

• Should we empower users?

Page 26: Search, Discovery and Questions at Quora

Duplicate Questions: Solution

● Based on the classifier, merge the new

& existing duplicate questions.

● Users can also (un)merge questions.

● Review every request.

● Merging questions.

Page 27: Search, Discovery and Questions at Quora

Duplicate Questions:

Page 28: Search, Discovery and Questions at Quora

Duplicate Questions: Technical Challenges

• The classifier must have high precision.

• The merge operation must be very quick.

• Most of the product changes with the Question merges.

• Conflicts in the (Un)Merge operations

• Merge Cycles

• Merge Chains

• Conflicting Merge & Unmerge

Page 29: Search, Discovery and Questions at Quora

Duplicate Questions: Classifier

• Features for Question Pair:

• TF-IDF

• Word2vec

• Topic

• Binary classifier trained with labelled data

• Boosted decision tree

• Monitor the precision

• Periodically retrain the model to retain the high precision.

Page 30: Search, Discovery and Questions at Quora

Duplicate Questions: Question Merging

• Make the content move extremely quick.

• Faster merges mean fewer race conditions.

• Execute tasks in parallel using multiple workers.

• Finite State Machine (FSM) for state tracking.

• Lock the critical section.

• Identify the conflicts & fail early.

Page 31: Search, Discovery and Questions at Quora

Duplicate Questions: Solution

● Track state of the request.

● Review critical requests first.

● Block all the conflicts while

processing the request.

Page 32: Search, Discovery and Questions at Quora

Questions?