facebook's Graph Search

 

Querying for relationships between objects

What is a Graph?

A graph is a way of representing connections between entities. In the picture here, each user is a node connected by edges to other nodes.

Facebook contains not just people, but things, such as businesses, musicians, politicians, etc. that can all be related to one another in various ways.

Triple Stores

The underlying principle behind graph search is the idea that a user is not searching just for entities and if entities are connected, but also how these entities are related

Graph Searching

facebook provides a few ways to query among nodes to discover things you are already connected to or new things you may be interested in

Under the Hood

  • Graph Search needed to be designed toward understanding the user intent precisely and serving structured objects

Query Interface

  • Initial issues with Keyword Queries
  • Keywords, in general, are good for matching objects in the graph but not for matching connections between the objects.

Solution: Natural Language Interface

Natural Language Interface: Components

  • Entity Recognition and Resolution
  • Lexical Analysis
  • Semantic Parsing

Entity Recognition and Resolution

“People who live in san francisco”

The segment “san francisco” is likely to be an entity of the {city} category

Lexical Analysis

  • Synonyms: "where to eat sushi” => Sushi restaurants
  • Fillers: "all my friends photos” => "My friends’ photos"
  • Related forms: used WordNet to extract related word forms
  • Inflections
    • ​"photo" vs "photos"
    • "people who work at facebook" vs "people who worked at facebook"

Grammar

[start] => [users]                               $1   

[users] => my friend                         friends(me)

[users] => friends of [users]              friends($1) 

[users] => {user}                               $1

[start] => [photos]                            $1

[photos] => photos of [users]           photos($1) 

Structure:  Weighted Context-Free Grammar (WCFG) to represent the Graph Search query language

Test Queries

Facebook's Graph Search

By Srihari Rao

Facebook's Graph Search

Facebook's Implementation of Graph Search

  • 1,221