# US 12,182,510 B2 · Unidirectional text comparison

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

- Number: US 12,182,510 B2
- Document ID: US12182510B2
- Status: Granted
- Kind: B2
- Application number: 17/653,912
- Filed: 2022-03-08
- Published: 2023-09-14
- Granted: 2024-12-31
- Earliest claimed: 2022-03-08
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Mehul Thukral; Raj Nagesh; Saksham Gandhi
- Web page: https://patentgrep.com/patent/US12182510B2

## CPC

- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 16/90344: {by using string matching techniques}
- G06F 40/205: Parsing
- G06F 40/216: using statistical methods
- G06F 40/30: Semantic analysis
- G06V 30/19093: {Proximity measures, i.e. similarity or distance measures}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A method, a structure, and a computer system for unidirectional text comparison. The exemplary embodiments may include determining a first similarity score between a first text string and a second text string, and computing an error term between the first text string and the second text string, wherein the error term incorporates a directionality of the first text string and the second text string. The exemplary embodiments may further include determining a second similarity score based on the first similarity score and the error term.

## Claims

### Claim 1

A computer-implemented method for unidirectional text comparison, the method comprising:
determining a first similarity score between a first text string and a second text string;
computing an error term between the first text string and the second text string, wherein the error term incorporates a directionality of the first text string and the second text string;
determining a second similarity score based on the first similarity score and the error term.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein determining the first similarity score further comprises:
training a word to vector model using a domain of interest;
tokenizing the first text string and the second text string; and
calculating a cosine difference between the first text string and the second text string based on the word to vector model.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein computing the error term further comprises:
tokenizing the first text string and the second text string;
determining an overlap and a symmetric difference of tokens within the first text string and the second text string;
computing an overlap error term for the overlap and a non-overlap error term for the symmetric difference; and
summing the overlap error term and the non-overlap error term.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein determining the second similarity score further incorporates a constant.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the second similarity score is not penalized based on the first text string having additional text over the second text string and vice versa.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, further comprising:
pre-processing the first text string and the second text string.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the first text string is parsed from a first document and the second text string is parsed from a second document.

### Claim 8

A computer program product for unidirectional text comparison, the computer program product comprising:
one or more non-transitory computer-readable storage media and program instructions stored on the one or more non-transitory computer-readable storage media capable of performing a method, the method comprising:
determining a first similarity score between a first text string and a second text string;
computing an error term between the first text string and the second text string, wherein the error term incorporates a directionality of the first text string and the second text string;
determining a second similarity score based on the first similarity score and the error term.

### Claim 9 (depends on 8)

The computer program product of claim 8, wherein determining the first similarity score further comprises:
training a word to vector model using a domain of interest;
tokenizing the first text string and the second text string; and
calculating a cosine difference between the first text string and the second text string based on the word to vector model.

### Claim 10 (depends on 9)

The computer program product of claim 9, wherein computing the error term further comprises:
tokenizing the first text string and the second text string;
determining an overlap and a symmetric difference of tokens within the first text string and the second text string;
computing an overlap error term for the overlap and a non-overlap error term for the symmetric difference; and
summing the overlap error term and the non-overlap error term.

### Claim 11 (depends on 8)

The computer program product of claim 8, wherein determining the second similarity score further incorporates a constant.

### Claim 12 (depends on 8)

The computer program product of claim 8, wherein the second similarity score is not penalized based on the first text string having additional text over the second text string and vice versa.

### Claim 13 (depends on 8)

The computer program product of claim 8, further comprising:
pre-processing the first text string and the second text string.

### Claim 14 (depends on 8)

The computer program product of claim 8, wherein the first text string is parsed from a first document and the second text string is parsed from a second document.

### Claim 15

A computer system for unidirectional text comparison, the system comprising:
one or more computer processors, one or more computer-readable storage media, and program instructions stored on the one or more of the computer-readable storage media for execution by at least one of the one or more processors capable of performing a method, the method comprising:
determining a first similarity score between a first text string and a second text string;
computing an error term between the first text string and the second text string, wherein the error term incorporates a directionality of the first text string and the second text string;
determining a second similarity score based on the first similarity score and the error term.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein determining the first similarity score further comprises:
training a word to vector model using a domain of interest;
tokenizing the first text string and the second text string; and
calculating a cosine difference between the first text string and the second text string based on the word to vector model.

### Claim 17 (depends on 16)

The computer system of claim 16, wherein computing the error term further comprises:
tokenizing the first text string and the second text string;
determining an overlap and a symmetric difference of tokens within the first text string and the second text string;
computing an overlap error term for the overlap and a non-overlap error term for the symmetric difference; and
summing the overlap error term and the non-overlap error term.

### Claim 18 (depends on 15)

The computer system of claim 15, wherein determining the second similarity score further incorporates a constant.

### Claim 19 (depends on 15)

The computer system of claim 15, wherein the second similarity score is not penalized based on the first text string having additional text over the second text string and vice versa.

### Claim 20 (depends on 15)

The computer system of claim 15, further comprising:
pre-processing the first text string and the second text string.
