# US 2019/0057154 A1 · Token Metadata for Forward Indexes on Online Social Networks

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0057154 A1
- Document ID: US20190057154A1
- Status: Published application
- Kind: A1
- Application number: 15/680,096
- Filed: 2017-08-17
- Published: 2019-02-21
- Earliest claimed: 2017-08-17
- Assignees: Facebook, Inc.
- Applicants: Facebook, Inc.
- Inventors: Rose Marie Philip; Giuseppe Ottaviano; Daniel Bernhardt
- Web page: https://patentgrep.com/patent/US20190057154A1

## CPC

- G06F 16/9535: Search customisation based on user profiles and personalisation
- G06F 16/316: {Indexing structures}
- G06F 16/3344: {using natural language analysis}
- G06F 16/338: Presentation of query results
- G06F 40/232: Orthographic correction, e.g. spell checking or vowelisation
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 16/953: Querying, e.g. by the use of web search engines
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one embodiment, a method includes receiving a search query, searching a reverse index to identify one or more objects having one or more tokens that match the search query, and accessing a forward index that has several records that each correspond to an object posted to an online social network. Each record may comprise a first field of tokens, and one or more second fields corresponding to metadata associated with each of the tokens. The method may further include scoring each identified object based on its respective record. The score for each identified object may be calculated based on the metadata associated with each of the tokens. The method may also include sending, to the client system in response to the received search query, instructions for presenting one or more search results corresponding to the identified objects having a score greater than a threshold score.

## Claims

### Claim 1

A method comprising, by one or more computing devices of an online social network:
receiving, from a client system associated with a user of the online social network, a search query comprising one or more n-grams;
searching a reverse index to identify one or more objects having one or more tokens that match one or more of the n-grams of the search query;
accessing a forward index having a plurality of records, wherein each record of the forward index corresponds to an object posted to the online social network, and wherein each record comprises:
a first field corresponding to one or more tokens of user-inputted content of the object corresponding to the record; and
one or more second fields corresponding to one or more types of metadata associated with each of the tokens in the first field;
scoring each identified object based at least in part on the record from the forward index corresponding to the identified object, wherein the score for each identified object is calculated based on the metadata associated with each of the tokens in the first field that match an n-gram of the search query; and
sending, to the client system in response to the received search query, instructions for presenting one or more search results corresponding to one or more of the identified objects, respectively, wherein each search result corresponds to an identified object having a score greater than a threshold score.

### Claim 2 (depends on 1)

The method of claim 1, wherein, for each record of the forward index, the first field comprises n positions corresponding to n tokens extracted from the user-inputted content of the object corresponding to the record, the n tokens being positioned in positions 1 through n based on an order that n-grams in the content corresponding to the tokens are ordered in the object.

### Claim 3 (depends on 2)

The method of claim 2, wherein the one or more second fields each comprise n positions corresponding to the n tokens, respectively.

### Claim 4 (depends on 1)

The method of claim 1, wherein the user-inputted content comprises a plurality of n-grams, and wherein the first field comprises a plurality of tokens that match the plurality of n-grams.

### Claim 5 (depends on 4)

The method of claim 4, wherein the first field further comprises a modified token that is based on at least one of the plurality of n-grams, wherein the modified token:
is an alternative spelling of the at least one of the plurality of n-grams;
refers to an entity that is associated with the at least one of the plurality of n-grams; or
substantially matches the at least one of the plurality of n-grams but does not comprise punctuation marks.

### Claim 6 (depends on 1)

The method of claim 1, wherein the one or more types of metadata comprise one or more of:
an indication that a token in the first field has been modified with respect to a n-gram in the content corresponding to the token in the object corresponding to the record;
an indication, for each token in the first field, that a modified version of the token has already been listed in the first field; or
an indication that a first token is a part of an n-gram that terminates with a second token.

### Claim 7 (depends on 1)

The method of claim 1, wherein:
the one or more types of metadata comprise an indication that a token in the first field has been modified with respect to a n-gram in the content corresponding to the token in the object corresponding to the record; and
scoring each identified object comprises, for each of the tokens in the first field that match an n-gram of the search query, increasing the score of the identified object if the token has not been modified and decreasing the score of the identified object if the token has been modified.

### Claim 8 (depends on 1)

The method of claim 1, wherein:
the one or more types of metadata comprise an indication, for each token in the first field, that a modified version of the token has already been listed in the first field; and
scoring each identified object comprises, for each of the tokens in the first field that match an n-gram of the search query, increasing the score of the identified object if a modified version of the token has not already been listed in the first field, and decreasing the score of the identified object if a modified version of the token has already been listed in the first field.

### Claim 9 (depends on 1)

The method of claim 1, wherein:
the one or more types of metadata comprise an indication that a first token is a part of an n-gram that terminates with a second token; and
scoring each identified object comprises, for each of the tokens in the first field that match an n-gram of the search query, increasing the score of the identified object if the token is not a first token that is a part of an n-gram that terminates with a second token and decreasing the score if the token is a first token that is a part of an n-gram that terminates with a second token.

### Claim 10 (depends on 1)

The method of claim 1, further comprising reconstructing the content of the object corresponding to a particular record using the tokens from the first field of the record and one or more types of metadata associated with each of the tokens from one or more of the second fields.

### Claim 11 (depends on 1)

The method of claim 1, wherein the one or more types of metadata associated with each of the tokens comprises a plurality of zero-valued elements and a plurality of non-zero-valued elements, wherein consecutive zero-valued elements are stored as a single gap element in association with an adjacent non-zero-valued element.

### Claim 12 (depends on 1)

The method of claim 1, wherein the search query comprises a misspelled word and one of the tokens in the first field is a modified token that comprises a correct spelling of the misspelled word.

### Claim 13 (depends on 1)

The method of claim 1, wherein:
for each record of the forward index, the first field comprises n positions corresponding to n tokens extracted from the user-inputted content of the object corresponding to the record; and
scoring each identified object is further based on a number of intervening positions between tokens in the first field that match an n-gram of the search query.

### Claim 14 (depends on 13)

The method of claim 13, wherein the score decreases as the number of intervening positions increases.

### Claim 15 (depends on 13)

The method of claim 13, further comprising increasing the score based on a determination, from the one or more types of metadata, that at least some of the tokens in intervening positions in the first field are a part of an n-gram that comprises a plurality of tokens in the first field.

### Claim 16 (depends on 1)

The method of claim 1, wherein the one or more types of metadata comprise one or more of:
an indication that the token in the first field is associated with an entity of the online social network;
an indication that the token in the first field has been spell-corrected with respect to a n-gram in the content corresponding to the token in the object corresponding to the record; or
an indication that the token is associated with a hashtag.

### Claim 17 (depends on 1)

The method of claim 1, wherein the instructions for presenting one or more search results corresponding to one or more of the identified objects comprises instructions for presenting the one or more search results in ranked order based on the score of each of the one or more identified objects.

### Claim 18 (depends on 1)

The method of claim 1, further comprising:
accessing a social graph comprising a plurality of nodes and a plurality of edges connecting the nodes, each of the edges between two of the nodes representing a single degree of separation between them, the nodes comprising:
a first node corresponding to the user; and
a plurality of second nodes corresponding to a plurality of objects posted to the online social network and wherein:
scoring each identified object is further based on a degree of separation between the first node and the second node corresponding to the object.

### Claim 19

One or more computer-readable non-transitory storage media embodying software that is operable when executed to:
receive, from a client system associated with a user of the online social network, a search query comprising one or more n-grams;
search a reverse index to identify one or more objects having one or more tokens that match one or more of the n-grams of the search query;
access a forward index having a plurality of records, wherein each record of the forward index corresponds to an object posted to the online social network, and wherein each record comprises:
a first field corresponding to one or more tokens of user-inputted content of the object corresponding to the record; and
one or more second fields corresponding to one or more types of metadata associated with each of the tokens in the first field;
score each identified object based at least in part on the record from the forward index corresponding to the identified object, wherein the score for each identified object is calculated based on the metadata associated with each of the tokens in the first field that match an n-gram of the search query; and
send, to the client system in response to the received search query, instructions for presenting one or more search results corresponding to one or more of the identified objects, respectively, wherein each search result corresponds to an identified object having a score greater than a threshold score.

### Claim 20

A system comprising: one or more processors; and a non-transitory memory coupled to the processors comprising instructions executable by the processors, the processors operable when executing the instructions to:
receive, from a client system associated with a user of the online social network, a search query comprising one or more n-grams;
search a reverse index to identify one or more objects having one or more tokens that match one or more of the n-grams of the search query;
access a forward index having a plurality of records, wherein each record of the forward index corresponds to an object posted to the online social network, and wherein each record comprises:
a first field corresponding to one or more tokens of user-inputted content of the object corresponding to the record; and
one or more second fields corresponding to one or more types of metadata associated with each of the tokens in the first field;
score each identified object based at least in part on the record from the forward index corresponding to the identified object, wherein the score for each identified object is calculated based on the metadata associated with each of the tokens in the first field that match an n-gram of the search query; and
send, to the client system in response to the received search query, instructions for presenting one or more search results corresponding to one or more of the identified objects, respectively, wherein each search result corresponds to an identified object having a score greater than a threshold score.
