# US 2022/0019836 A1 · Method and System for Detecting Drift in Text Streams

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

- Number: US 2022/0019836 A1
- Document ID: US20220019836A1
- Status: Published application
- Kind: A1
- Application number: 17/463,734
- Filed: 2021-09-01
- Published: 2022-01-20
- Earliest claimed: 2019-07-17
- Assignees: Capital One Services, LLC
- Applicants: Capital One Services, LLC
- Inventors: Keegan Hines; Christopher Bayan Bruss
- Web page: https://patentgrep.com/patent/US20220019836A1

## CPC

- G06V 30/153: {using recognition of characters or words}
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/2321: using statistics or function optimisation, e.g. modelling of probability density functions
- G06F 18/295: {Markov models or related models, e.g. semi-Markov models; Markov random fields; Networks embedding Markov models}
- G06V 30/19107: {Clustering techniques}
- G06V 30/10: Character recognition
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems disclosed herein may quantify the content and nature of first streaming data to detect when the typical composition of the first streaming data changes. Quantifying the content and nature of the first streaming data may begin by generating a baseline representation of the content of the first streaming data as represented by a first matrix. Once generated, the first matrix may be used as a control against subsequently received data streams. In this regard, a second matrix may be generated from second streaming data and compared to the first matrix to determine the differences between the first streaming data and the second streaming data. Once a difference is determined, the difference may be compared to a threshold value and, when the difference exceeds the threshold value, an administrator may be notified and corrective action taken.

## Claims

### Claim 1

A computer-implemented method comprising:
generating, by a first device, a first transition probability matrix from first streaming data;
generating, by the first device, a second transition probability matrix from second streaming data;
comparing, by the first device, the first transition probability matrix and the second transition probability matrix to determine a difference between the first streaming data and the second streaming data; and
indicating, by the first device, that the second streaming data is different from the first streaming data based on the difference between the first transition probability matrix and the second transition probability matrix being greater than or equal to a threshold.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein each entry in the first transition probability matrix identifies a probability of transitioning from a first n-gram to a second n-gram.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein comparing the first transition probability matrix and the second transition probability matrix comprises:
estimating, using a matrix norm, the difference between the first transition probability matrix and the second transition probability matrix.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, comprising:
notifying, by the first device, an administrator based on the difference being greater than or equal to the threshold.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the first transition probability matrix is a Markov model.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein generating the first transition probability matrix comprises:
determining, by the first device, a plurality of pairs of characters in the first streaming data, wherein a pair of characters comprises a first character transitioning to one of a plurality of characters;
determining, by the first device, a number of times each of the plurality of pairs of characters appears in the first streaming data;
determining, by the first device, a probability for each of the plurality of pairs of characters, wherein the probability is determined according to the number of times each of the plurality of pairs of characters appears in the first streaming data; and
populating, by the first device, the first transition probability matrix with the probability determined for each of the pairs of characters.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the first streaming data comprises text.

### Claim 8

A system comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the one or more processors to:
generate a first transition probability matrix from first streaming data;
generate a second transition probability matrix from second streaming data;
compare the first transition probability matrix and the second transition probability matrix to determine a difference between the first streaming data and the second streaming data; and
indicate that the second streaming data is different from the first streaming data based on the difference between the first transition probability matrix and the second transition probability matrix being greater than or equal to a threshold.

### Claim 9 (depends on 8)

The system of claim 8, wherein the first transition probability matrix is a first Markov model that identifies a probability of transitioning from a first n-gram to a second n-gram.

### Claim 10 (depends on 8)

The system of claim 8, wherein the first streaming data comprises training data.

### Claim 11 (depends on 8)

The system of claim 8, wherein the instructions cause the one or more processors to:
notify an administrator based on the difference being greater than or equal to the threshold.

### Claim 12 (depends on 8)

The system of claim 8, wherein instructions cause the one or more processors to:
issue at least one command to an input source to correct a cause of the difference between the second streaming data and the first streaming data.

### Claim 13 (depends on 8)

The system of claim 8, wherein the instructions cause the one or more processors to:
determine a plurality of pairs of tokens in the first stream, wherein a pair of tokens comprises a first character transitioning to one of a plurality of characters;
determine a number of times each of the plurality of pairs of tokens appears in the first stream;
determine a probability for each of the plurality of pairs of tokens, wherein the probability is determined according to the number of times each of the plurality of pairs of tokens appears in the first stream; and
populate the first transition probability matrix with the probability determined for each of the pairs of tokens.

### Claim 14 (depends on 8)

The system of claim 8, wherein:
the first streaming data comprises a first stream of text; and
the second streaming data comprises a second stream of text different from the first stream.

### Claim 15

A non-transitory computer-readable medium storing instructions that, when executed, cause a computing device to:
generate a first transition probability matrix from first streaming data;
generate a second transition probability matrix from a second streaming data;
compare the first transition probability matrix and the second transition probability matrix to determine a difference between the first streaming data and the second streaming data; and
indicate that the second streaming data is different from the first streaming data based on the difference between the first transition probability matrix and the second transition probability matrix being greater than or equal to a threshold.

### Claim 16 (depends on 15)

The non-transitory computer-readable media of claim 15, wherein the instructions, when executed, cause the computing device to:
notify an administrator that the second streaming data is different from the first streaming data based on the difference being greater than or equal to the threshold.

### Claim 17 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the instructions, when executed, cause the computing device to:
issue at least one command to an input to correct a cause of the difference between the second streaming data and the first streaming data.

### Claim 18 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the instructions, when executed, cause the computing device to:
determine a plurality of pairs of tokens in the first streaming data, wherein a pair of tokens comprises a first character transitioning to one of a plurality of characters;
determine a number of times each of the plurality of pairs of tokens appears in the first streaming data;
determine a probability for each of the plurality of pairs of tokens, wherein the probability is determined according to the number of times each of the plurality of pairs of tokens appears in the first streaming data; and
populate the first transition probability matrix with the probability determined for each of the pairs of tokens.

### Claim 19 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein:
the first streaming data comprises a first stream of text; and
the second streaming data comprises a second stream of text different from the first stream.

### Claim 20 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the first streaming data comprises training data.
