# US 12,762,192 B2 · System and method for combining language models with natural language processing for summarization

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

- Number: US 12,762,192 B2
- Document ID: US12762192B2
- Status: Granted
- Kind: B2
- Application number: 19/202,283
- Filed: 2025-05-08
- Published: 2026-01-08
- Granted: 2026-10-13
- Earliest claimed: 2024-07-03
- Assignees: SAS Institute Inc.
- Applicants: SAS Institute Inc.
- Inventors: Teresa S. Jade; Thomas William Sabo; Meilan Ji; Fruzsina Veress; Wei-Shan Chiang
- Web page: https://patentgrep.com/patent/US12762192B2

## CPC

- G06F 16/345: {Summarisation for human users}
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/289: Phrasal analysis, e.g. finite state techniques or chunking
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data processing system and method include receiving a set of documents to summarize a trend across the set of documents, inputting the set of documents into an information extraction model, executing the information extraction model to extract a first plurality of text segments, determining a second plurality of text segments based on the first plurality of text segments, determining a third plurality of text segments from the second plurality of text segments, generating a compressed representation of the set of documents from the third plurality of text segments to include in a prompt for a language model, inputting the prompt into the language model, and executing the language model to generate the summary based on the prompt for the set of documents.

## Claims

### Claim 1

A non-transitory computer-readable medium comprising computer-readable instructions stored thereon that when executed by a processor cause the processor to:
receive a set of documents for a prompt being input to a language model having a context window having a token limit, wherein a token count of the set of documents requires a first amount of computer memory;
reducing the token count of the set of documents to fit within the context window of the language model by:
input the set of documents into at least one information extraction model;
execute each of the at least one information extraction model to extract a first plurality of text segments from the set of documents, wherein the first plurality of text segments reduces a number of tokens from a total number of tokens in each document of the set of documents to a first token count, and wherein the first plurality of text segments are usable as inputs to determine a trend across the set of documents;
determine a second plurality of text segments based on the first plurality of text segments, wherein the second plurality of text segments correspond to documents selected from the set of documents based on one or more of at least one keyword, metadata, or a topic of interest, and wherein a number of the second plurality of text segments is less than or equal to a number of the first plurality of text segments;
determine a third plurality of text segments from the second plurality of text segments based on at least one of a frequency of occurrence, a priority score, or a location of a text segment in a document of the set of documents, wherein a number of the third plurality of text segments is less than or equal to the number of the second plurality of text segments, and wherein the third plurality of text segments reduces the number of tokens to a second token count that is less than the first token count;
in response to reducing the token count, generate a compressed representation of the set of documents from the third plurality of text segments to include in a compressed prompt for the language model, wherein the compressed prompt comprises the second token count stored in a second amount of computer memory that is less than the first amount of computer memory associated with the token count of the set of documents, and wherein the compressed representation being generated by concatenating the third plurality of text segments from the second plurality of text second and excluding unselected text segments from the set of documents that are associated with the trend;
input the prompt into the language model; and
execute the language model to generate the summary based on the compressed prompt for the set of documents.

### Claim 2 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the at least one information extraction model comprises at least one of a Machine Learning (ML) model, a rule-based model, or a hybrid model.

### Claim 3 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the language model comprises a Large Language Model (LLM).

### Claim 4 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the computer-readable instructions further cause the processor to:
for each text segment of the first plurality of text segments, identify which documents from the set of documents the text segment belongs to; and
store the text segment together with the identified documents in a database.

### Claim 5 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the computer-readable instructions further cause the processor to:
determine that a document of the set of documents comprises non-textual information;
convert the non-textual information into textual information; and
add the converted textual information as a new document to the set of documents.

### Claim 6 (depends on 5)

The non-transitory computer-readable medium of claim 5, wherein the non-textual information comprises one or more of audio, video, or image.

### Claim 7 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the computer-readable instructions further cause the processor to:
identify a subset of the set of documents based on one or more of the at least one keyword, the metadata, or the topic of interest to obtain a set of relevant documents; and
determine a subset of the first plurality of text segments that belong to the set of relevant documents to obtain the second plurality of text segments.

### Claim 8 (depends on 7)

The non-transitory computer-readable medium of claim 7, wherein the computer-readable instructions further cause the processor to:
subdivide the set of documents based on a user defined parameter to obtain a plurality of documents; and
identify the subset of the set of documents from the plurality of documents.

### Claim 9 (depends on 7)

The non-transitory computer-readable medium of claim 7, wherein to identify the subset of the set of documents based on one or more of the at least one keyword, the metadata, or the topic of interest, the computer-readable instructions further cause the processor to:
receive the at least one keyword, the metadata, or the topic of interest as user input; and
identify each document from the set of documents that matches the at least one keyword, the metadata, or the topic of interest.

### Claim 10 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein to extract the third plurality of text segments from the second plurality of text segments based on the priority score, the computer-readable instructions further cause the processor to:
compute the priority score for each of the second plurality of text segments; and
select at least a subset of the text segments from the second plurality of text segments whose priority score is greater than a predetermined threshold.

### Claim 11 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the computer-readable instructions further cause the processor to compute the priority score of a text segment using: Priority Score=Frequency×Term Frequency-Inverse Document Frequency Score, where Priority Score is the computed priority score for the text segment, Frequency is a number of times the text segment occurs across the second plurality of text segments, and Term Frequency-Inverse Document Frequency Score is a score indicating a relevance of the text segment in the set of documents.

### Claim 12 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the computer-readable instructions further cause the processor to compute the priority score of a text segment using: Priority Score=Frequency×Domain-Specific Term Count, where Priority Score is the computed priority score for the text segment, Frequency is a number of times the text segment occurs across the second plurality of text segments, and Domain-Specific term Count is a number of domain-specific terms in the text segment.

### Claim 13 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein to extract the third plurality of text segments from the second plurality of text segments based on the frequency of occurrence, the computer-readable instructions further cause the processor to:
rank each text segment in the second plurality of text segments based on the frequency of occurrence; and
select a predetermined number of highest ranked text segments.

### Claim 14 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the compressed prompt is a second prompt, the language model is a second language model, and the at least one information extraction model is a first information extraction model, and wherein the computer-readable instructions further cause the processor to:
generate a first prompt based on the first plurality of text segments and input the first prompt into a first language model;
execute the first language model to generate a plurality of initial summaries, wherein each initial summary of the plurality of initial summaries corresponds to a document of the set of documents and is generated from the first plurality of text segments that belong to the document;
input the plurality of initial summaries into a second information extraction model; and
execute the second information extraction model to extract the second plurality of text segments from the plurality of initial summaries.

### Claim 15 (depends on 14)

The non-transitory computer-readable medium of claim 14, wherein the second information extraction model comprises at least one of an Information Extraction (IE) model, a Machine Learning (ML) model, a rule-based model, or a hybrid model, and wherein the first language model comprises a Large Language Model (LLM).

### Claim 16 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the computer-readable instructions further cause the processor to:
receive an input identifying a keyword or phrase from the summary;
identify which of the first plurality of text segments comprise the keyword or phrase to obtain a fourth plurality of text segments;
rank each of the fourth plurality of text segments; and
output a ranked list of the fourth plurality of text segments.

### Claim 17 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein to generate the compressed representation of the set of documents from the third plurality of text segments, the computer-readable instructions further cause the processor to concatenate the third plurality of text segments to generate a string.

### Claim 18 (depends on 17)

The non-transitory computer-readable medium of claim 17, wherein the compressed prompt further comprises the string and one or more constraints, wherein the one or more constraints include a system role and a user role to provide a framework for how to generate the summary and a description of what to include in the summary.

### Claim 19 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein multiple text segments are extracted from each document of the set of documents to extract the first plurality of text segments.

### Claim 20

A system comprising:
a memory having computer-readable instructions stored thereon; and
a processor that executes the computer-readable instructions to:
receive a set of documents for a prompt being input to a language model having a context window having a token limit, wherein a token count of the set of documents requires a first amount of computer memory;
reduce the token count of the set of documents to fit within the context window of the language model by:
inputting the set of documents into at least one information extraction model;
executing each of the at least one information extraction model to extract a first plurality of text segments from the set of documents, wherein the first plurality of text segments reduces a number of tokens from a total number of tokens in each document of the set of documents to a first token count, and wherein the first plurality of text segments are usable as inputs to determine a trend across the set of documents;
determining a second plurality of text segments based on the first plurality of text segments, wherein the second plurality of text segments correspond to documents selected from the set of documents based on one or more of at least one keyword, metadata, or a topic of interest, and wherein a number of the second plurality of text segments is less than or equal to a number of the first plurality of text segments;
determining a third plurality of text segments from the second plurality of text segments based on at least one of a frequency of occurrence, a priority score, or a location of a text segment in a document of the set of documents, wherein a number of the third plurality of text segments is less than or equal to the number of the second plurality of text segments, and wherein the third plurality of text segments reduces the number of tokens to a second token count that is less than the first token count;
in response to reducing the token count, generate a compressed representation of the set of documents from the third plurality of text segments to include in a compressed prompt for the language model, wherein
the compressed prompt comprises the second token count stored in a second amount of computer memory that is less than the first amount of computer memory associated with the token count of the set of documents, and wherein the compressed representation being generated by concatenating the third plurality of text segments from the second plurality of text second and excluding unselected text segments from the set of documents that are associated with the trend;
input the compressed prompt into the language model; and
execute the language model to generate the summary based on the compressed prompt for the set of documents.

### Claim 21 (depends on 20)

The system of claim 20, wherein the at least one information extraction model comprises at least one of a Machine Learning (ML) model, a rule-based model, or a hybrid model, and wherein the language model comprises a Large Language Model (LLM).

### Claim 22 (depends on 20)

The system of claim 20, wherein the computer-readable instructions further cause the processor to:
determine that a document of the set of documents comprises non-textual information;
convert the non-textual information into textual information; and
add the converted textual information as a new document to the set of documents, wherein the non-textual information comprises one or more of audio, video, or image.

### Claim 23 (depends on 20)

The system of claim 20, wherein to extract the third plurality of text segments from the second plurality of text segments based on the priority score, the computer-readable instructions further cause the processor to:
compute the priority score for each of the second plurality of text segments using:
(a) Priority Score=Frequency×Term Frequency-Inverse Document Frequency Score, where Priority Score is the computed priority score for the text segment, Frequency is a number of times the text segment occurs across the second plurality of text segments, and Term Frequency-Inverse Document Frequency Score is a score indicating a relevance of the text segment in the set of documents; or
(b) Priority Score=Frequency×Domain-Specific Term Count, where Priority Score is the computed priority score for the text segment, Frequency is the number of times the text segment occurs across the second plurality of text segments, and Domain-Specific term Count is a number of domain-specific terms in the text segment; and
select at least a subset of the text segments from the second plurality of text segments whose priority score is greater than a predetermined threshold.

### Claim 24 (depends on 20)

The system of claim 20, wherein the compressed prompt is a second prompt, the language model is a second language model, and the at least one information extraction model is a first information extraction model, and wherein the computer-readable instructions further cause the processor to:
generate a first prompt based on the first plurality of text segments and input the first prompt into a first language model;
execute the first language model to generate a plurality of initial summaries, wherein each initial summary of the plurality of initial summaries corresponds to a document of the set of documents and is generated from the first plurality of text segments that belong to the document;
input the plurality of initial summaries into a second information extraction model; and
execute the second information extraction model to extract the second plurality of text segments from the plurality of initial summaries, wherein the second information extraction model comprises at least one of a Machine Learning (ML) model, a rule-based model, or a hybrid model, and wherein the first language model comprises a Large Language Model (LLM).

### Claim 25 (depends on 20)

The system of claim 20, wherein to generate the compressed representation of the set of documents from the third plurality of text segments, the computer-readable instructions further cause the processor to concatenate the third plurality of text segments to generate a string, wherein the compressed prompt further comprises the string and one or more constraints, and wherein the one or more constraints include a system role and a user role to provide a framework for how to generate the summary and a description of what to include in the summary.

### Claim 26

A method comprising:
receiving, by a processor executing computer-readable instructions stored on a memory, a set of documents for a prompt being input to a language model having a context window having a token limit, wherein a token count of the set of documents requires a first amount of computer memory;
reducing the token count of the set of documents to fit within the context window of the language model by:
inputting, by the processor, the set of documents into at least one information extraction model;
executing, by the processor, each of the at least one information extraction model to extract a first plurality of text segments from the set of documents, wherein the first plurality of text segments reduces a number of tokens from a total number of tokens in each document of the set of documents to a first token count, and wherein the first plurality of text segments are usable as inputs to determine a trend across the set of documents;
determining, by the processor, a second plurality of text segments based on the first plurality of text segments, wherein the second plurality of text segments correspond to documents selected from the set of documents based on one or more of at least one keyword, metadata, or a topic of interest, and wherein a number of the second plurality of text segments is less than or equal to a number of the first plurality of text segments;
determining, by the processor, a third plurality of text segments from the second plurality of text segments based on at least one of a frequency of occurrence, a priority score, or a location of a text segment in a document of the set of documents, wherein a number of the third plurality of text segments is less than or equal to the number of the second plurality of text segments, and wherein the third plurality of text segments reduces the number of tokens to a second token count that is less than the first token count;
in response to reducing the token count, generating, by the processor, a compressed representation of the set of documents from the third plurality of text segments to include in a compressed prompt for the language model, wherein the compressed prompt comprises the second token count stored in a second amount of computer memory that is less than the first amount of computer memory associated with the token count of the set of documents, and wherein the compressed representation being generated by concatenating the third plurality of text segments from the second plurality of text second and excluding unselected text segments from the set of documents that are associated with the trend;
inputting, by the processor, the compressed prompt into the language model; and
executing, by the processor, the language model to generate the summary based on the compressed prompt for the set of documents.

### Claim 27 (depends on 26)

The method of claim 26, wherein the at least one information extraction model comprises at least one of a Machine Learning (ML) model, a rule-based model, or a hybrid model, wherein the language model comprises a Large Language Model (LLM), wherein to generate the compressed representation of the set of documents from the third plurality of text segments, the computer-readable instructions further cause the processor to concatenate the third plurality of text segments to generate a string, wherein the compressed further comprises the string and one or more constraints, and wherein the one or more constraints include a system role and a user role to provide a framework for how to generate the summary and a description of what to include in the summary.

### Claim 28 (depends on 26)

The method of claim 26, further comprising:
determining, by the processor, that a document of the set of documents comprises non-textual information;
converting, by the processor, the non-textual information into textual information; and
adding, by the processor, the converted textual information as a new document to the set of documents, wherein the non-textual information comprises one or more of audio, video, or image.

### Claim 29 (depends on 26)

The method of claim 26, wherein to extract the third plurality of text segments from the second plurality of text segments based on the priority score, the method further comprises:
computing, by the processor, the priority score for each of the second plurality of text segments using:
(a) Priority Score=Frequency×Term Frequency-Inverse Document Frequency Score, where Priority Score is the computed priority score for the text segment, Frequency is a number of times the text segment occurs across the second plurality of text segments, and Term Frequency-Inverse Document Frequency Score is a score indicating a relevance of the text segment in the set of documents; or
(b) Priority Score=Frequency×Domain-Specific Term Count, where Priority Score is the computed priority score for the text segment, Frequency is the number of times the text segment occurs across the second plurality of text segments, and Domain-Specific term Count is a number of domain-specific terms in the text segment; and
selecting, by the processor, at least a subset of the text segments from the second plurality of text segments whose priority score is greater than a predetermined threshold.

### Claim 30 (depends on 26)

The method of claim 26, wherein the compressed prompt is a second prompt, the language model is a second language model, and the at least one information extraction model is a first information extraction model, and wherein the method further comprises:
generating, by the processor, a first prompt based on the first plurality of text segments and input the first prompt into a first language model;
executing, by the processor, the first language model to generate a plurality of initial summaries, wherein each initial summary of the plurality of initial summaries corresponds to a document of the set of documents and is generated from the first plurality of text segments that belong to the document;
inputting, by the processor, the plurality of initial summaries into a second information extraction model; and
executing, by the processor, the second information extraction model to extract the second plurality of text segments from the plurality of initial summaries, wherein the second information extraction model comprises at least one of a Machine Learning (ML) model, a rule-based model, or a hybrid model, and wherein the first language model comprises a Large Language Model (LLM).

### Claim 31

A non-transitory computer-readable medium comprising computer-readable instructions stored thereon that when executed by a processor cause the processor to:
receive a set of documents to generate a summary summarizing a trend across the set of documents;
input the set of documents into at least one information extraction model;
execute each of the at least one information extraction model to extract a first plurality of text segments from the set of documents, wherein the first plurality of text segments reduces a number of tokens from a total number of tokens in each document of the set of documents to a first token count, and wherein the first plurality of text segments are usable as inputs to determine a trend across the set of documents;
determine a second plurality of text segments based on the first plurality of text segments, wherein the second plurality of text segments correspond to documents selected from the set of documents based on one or more of at least one keyword, metadata, or a topic of interest, and wherein a number of the second plurality of text segments is less than or equal to a number of the first plurality of text segments;
determine a third plurality of text segments from the second plurality of text segments based on at least one of a frequency of occurrence, a priority score, or a location of a text segment in a document of the set of documents, wherein a number of the third plurality of text segments is less than or equal to the number of the second plurality of text segments, and wherein the third plurality of text segments reduces the number of tokens to a second token count that is less than the first token count;
compute the priority score for each of the second plurality of text segments, wherein computing the priority score includes using Priority Score=Frequency×Term Frequency-Inverse Document Frequency Score, where Priority Score is the computed priority score for the text segment, Frequency is a number of times the text segment occurs across the second plurality of text segments, and Term Frequency-Inverse Document Frequency Score is a score indicating a relevance of the text segment in the set of documents;
select at least a subset of the text segments from the second plurality of text segments whose priority score is greater than a predetermined threshold;
generate a compressed representation of the set of documents from the third plurality of text segments to include in a prompt for a language model, wherein the prompt comprises the second token count;
input the prompt into the language model; and
execute the language model to generate the summary based on the compressed prompt for the set of documents.

### Claim 32

A non-transitory computer-readable medium comprising computer-readable instructions stored thereon that when executed by a processor cause the processor to:
receive a set of documents to generate a summary summarizing a trend across the set of documents;
input the set of documents into at least one information extraction model;
execute each of the at least one information extraction model to extract a first plurality of text segments from the set of documents, wherein the first plurality of text segments reduces a number of tokens from a total number of tokens in each document of the set of documents to a first token count, and wherein the first plurality of text segments are usable as inputs to determine a trend across the set of documents;
determine a second plurality of text segments based on the first plurality of text segments, wherein the second plurality of text segments correspond to documents selected from the set of documents based on one or more of at least one keyword, metadata, or a topic of interest, and wherein a number of the second plurality of text segments is less than or equal to a number of the first plurality of text segments;
determine a third plurality of text segments from the second plurality of text segments based on at least one of a frequency of occurrence, a priority score, or a location of a text segment in a document of the set of documents, wherein a number of the third plurality of text segments is less than or equal to the number of the second plurality of text segments, and wherein the third plurality of text segments reduces the number of tokens to a second token count that is less than the first token count;
compute the priority score for each of the second plurality of text segments, wherein computing the priority score includes using Priority Score=Frequency×Domain-Specific Term Count, where Priority Score is the computed priority score for the text segment, Frequency is a number of times the text segment occurs across the second plurality of text segments, and Domain-Specific term Count is a number of domain-specific terms in the text segment;
select at least a subset of the text segments from the second plurality of text segments whose priority score is greater than a predetermined threshold;
generate a compressed representation of the set of documents from the third plurality of text segments to include in a prompt for a language model, wherein the prompt comprises the second token count;
input the prompt into the language model; and
execute the language model to generate the summary based on the compressed prompt for the set of documents.
