# US 10,956,522 B1 · Regular expression generation and screening of textual items

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

- Number: US 10,956,522 B1
- Document ID: US10956522B1
- Status: Granted
- Kind: B1
- Application number: 16/003,770
- Filed: 2018-06-08
- Granted: 2021-03-23
- Earliest claimed: 2018-06-08
- Assignees: Facebook, Inc.
- Applicants: Facebook, Inc.
- Inventors: Abhay Kumar Jha; Emanuel Alexandre Strauss
- Web page: https://patentgrep.com/patent/US10956522B1

## CPC

- G06F 16/9535: Search customisation based on user profiles and personalisation
- G06N 20/00: Machine learning
- G06F 16/334: Query execution (filtering based on additional data G06F16/335)
- G06F 16/355: Creation or modification of classes or clusters
- G06N 3/0499: Feedforward networks
- G06N 3/09: Supervised learning
- G06N 3/08: Learning methods
- G06Q 30/0277: {Online advertisement}
- H04L 63/20: {for managing network security; network security policies in general (filtering policies H04L63/0227)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

An online system enforces policies to content items that are distributed on its platform and blocks content items that violate one or more of those policies. To identify content items that are slightly varied from each other, the online system generates an embedding for each of the known content items that have already been determined to be noncompliant with one or more policies. The online system then groups the known noncompliant content items that are clustered together in the embedding space. The texts of the group of known noncompliant content items are converted to finite state automata and are merged to generate a common automaton. The common automaton is used to generate a common regular expression that is used to screen new content items. When a new content item matches the textual pattern defined by the common regular expression, the system may block the new content item.

## Claims

### Claim 1

A method comprising:
accessing a data store containing a plurality of content items determined to be noncompliant with one or more policies of an online system;
generating an embedding for each of the plurality of content items using text of the content item, each embedding generated being a mathematical vector that represents semantic characteristics of textual content of the content item relative to other content items in an embedding space, the semantic characteristics determined from word-to-word co-occurrence statistics of the text;
grouping two or more of the content items into a cluster based on distances among the embeddings corresponding to the two or more content items in the embedding space, the distances determined from the semantic characteristics of each of the content items according to the word-to-word co-occurrence statistics of the text of each of the content items;
extracting one or more strings of words from the textual content of one or more of the content items in the cluster;
creating a common regular expression that represents the one or more strings of words;
receiving a new content item for distribution by the online system;
screening the new content item by applying the common regular expression to determine whether the new content item matches the common regular expression; and
responsive to determining that the new content item matches the common regular expression, withholding the content item from users of the online system.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
further responsive to determining that the new content item matches the common regular expression, adding the new content item to the data store that contains the plurality of content items determined to be noncompliant.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
applying the common regular expression to a plurality of known compliant content items that are determined to be compliant with the one or more policies of the online system;
determining a match rate of the common regular expression with respect to the known compliant content items; and
responsive to the match rate being higher than a predetermined threshold, removing the common expression from screening the new content item.

### Claim 4 (depends on 1)

The method of claim 1, wherein generating the embedding for each of the plurality of content items comprises taking an average of word vectors corresponding to the textual content of each of the content item, the average being the mathematical vector.

### Claim 5 (depends on 1)

The method of claim 1, wherein generating the embedding for each of the plurality of content items comprises:
providing the textual content as input to a deep neural network; and
determining the embedding representing the textual content based on an output of the deep neural network.

### Claim 6 (depends on 1)

The method of claim 1, wherein the one or more strings of words of each of the content items comprises the entire textual content of the content item.

### Claim 7 (depends on 1)

The method of claim 1, wherein creating the common regular expression comprises:
determining a regular expression for the one or more strings of words for each of the content items;
generating a plurality of automata, each of the plurality of automata corresponding to each of the regular expression;
merging the plurality of automata into a common automaton; and
generating the common regular expression based on the common automaton.

### Claim 8 (depends on 1)

The method of claim 1, wherein the new content item comprises a landing page of a third party web site.

### Claim 9 (depends on 1)

The method of claim 1, wherein the new content item comprises an advertisement.

### Claim 10

A non-transitory computer readable storage medium configured to store program code, the program code comprising instructions that, when executed by a processor, cause the processor to:
access a data store containing a plurality of content items determined to be noncompliant with one or more policies of an online system;
generate an embedding for each of the plurality of content items using text of the content item, each embedding generated being a mathematical vector that represents semantic characteristics of textual content of the content item relative to other content items in an embedding space, the semantic characteristics determined from word-to-word co-occurrence statistics of the text;
group two or more of the content items into a cluster based on distances among the embeddings corresponding to the two or more content items in the embedding space, the distances determined from the semantic characteristics of each of the content items according to the word-to-word co-occurrence statistics of the text of each of the content items;
extract one or more strings of words from the textual content of one or more of the content items in the cluster;
create a common regular expression that represents the one or more strings of words;
receive a new content item for distribution by the online system;
screen the new content item by applying the common regular expression to determine whether the new content item matches the common regular expression; and
responsive to determining that the new content item matches the common regular expression, withhold the content item from users of the online system.

### Claim 11 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein the program code further causes the processor to, further responsive to determining that the new content item matches the common regular expression, add the new content item to the data store that contains the plurality of content items determined to be noncompliant.

### Claim 12 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein the program code further causes the processor to:
apply the common regular expression to a plurality of known compliant content items that are determined to be compliant with the one or more policies of the online system;
determine a match rate of the common regular expression with respect to the known compliant content items; and
responsive to the match rate being higher than a predetermined threshold, remove the common expression from screening the new content item.

### Claim 13 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein generating the embedding for each of the plurality of content items comprises taking an average of word vectors corresponding to the textual content of each of the content item, the average being the mathematical vector.

### Claim 14 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein generating the embedding for each of the plurality of content items comprises:
providing the textual content as input to a deep neural network; and
determining the embedding representing the textual content based on an output of the deep neural network.

### Claim 15 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein the one or more strings of words of each of the content items comprises the entire textual content of the content item.

### Claim 16 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein creating the common regular expression comprises:
determining a regular expression for the one or more strings of words for each of the content items;
generating a plurality of automata, each of the plurality of automata corresponding to each of the regular expression;
merging the plurality of automata into a common automaton; and
generating the common regular expression based on the common automaton.

### Claim 17 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein the new content item comprises a landing page of a third party website.

### Claim 18 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein the new content item comprises an advertisement.
