# US 2025/0094727 A1 · System and method for determining topics based on selective topic models

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

- Number: US 2025/0094727 A1
- Document ID: US20250094727A1
- Status: Published application
- Kind: A1
- Application number: 18/466,940
- Filed: 2023-09-14
- Published: 2025-03-20
- Earliest claimed: 2023-09-14
- Assignees: Walmart Apollo, LLC
- Applicants: Walmart Apollo, LLC
- Inventors: Tolgahan Cakaloglu; Karthik Ravichandran
- Web page: https://patentgrep.com/patent/US20250094727A1

## CPC

- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F 16/355: Creation or modification of classes or clusters
- G06F 40/205: Parsing
- G06F 40/30: Semantic analysis
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for determining topics for a document based on selective topic models are disclosed. In some embodiments, a disclosed method includes: obtaining at least one document; applying a plurality of topic models to the at least one document to identify at least one topic associated with the at least one document; selecting a topic model from the plurality of topic models based on the at least one topic; generating topic related data comprising data associated with a topic identified based on the selected topic model; and storing the topic related data in a database.

## Claims

### Claim 1

A system, comprising:
a non-transitory memory having instructions stored thereon; and
at least one processor operatively coupled to the non-transitory memory, and configured to read the instructions to:
obtain at least one document,
apply a plurality of topic models to the at least one document to identify at least one topic associated with the at least one document,
select a topic model from the plurality of topic models based on the at least one topic,
generate topic related data comprising data associated with a topic identified based on the selected topic model, and
store the topic related data in a database.

### Claim 2 (depends on 1)

The system of claim 1, wherein the at least one processor is configured to read the instructions to:
pre-process the at least one document to split the at least one document into a plurality of sentences;
compute at least embedding for each of the plurality of sentences to generate a plurality of embeddings; and
generate a document-term matrix based on the at least one document.

### Claim 3 (depends on 2)

The system of claim 2, wherein the plurality of topic models comprises:
at least one topic model configured to identify a topic associated with the at least one document based on the plurality of embeddings; and
at least one topic model configured to identify a topic associated with the at least one document based on the document-term matrix.

### Claim 4 (depends on 1)

The system of claim 1, wherein the selected topic model is selected based on:
computing, for each respective topic model of the plurality of topic models, an overlapping score indicating a level of overlap between topics identified based on the respective topic model and topics identified based on the remaining topic models of the plurality of topic models;
ranking the plurality of topic models based on their respective overlapping scores; and
selecting the topic model as a primary topic model that has the highest overlapping score among the plurality of topic models, wherein the plurality of topic models comprises the primary topic model and at least one secondary topic model.

### Claim 5 (depends on 4)

The system of claim 4, wherein for each respective topic model of the plurality of topic models, computing the overlapping score comprises:
computing a first score based on (a) a quantity of topics identified based on the respective topic model and (b) a sum of quantities of topics identified based on the plurality of topic models;
computing a second score based on a topic name or a topic description generated for each topic identified based on the respective topic model;
computing a third score based on at least one sample sentence generated for each topic identified based on the respective topic model; and
computing the overlapping score based on a weighted summation of the first score, the second score and the third score.

### Claim 6 (depends on 5)

The system of claim 5, wherein computing the second score comprises:
for each remaining topic model of the plurality of topic models,
determining a plurality of topic pairs based on each topic identified based on the respective topic model and each topic identified based on the remaining topic model, wherein each topic pair includes a first respective topic identified based on the respective topic model and a second respective topic identified based on the remaining topic model,
computing, for each topic pair, a first similarity score indicating a similarity between (a) an embedding for a topic name or a topic description generated for the first respective topic identified based on the respective topic model and (b) an embedding for a topic name or a topic description generated for the second respective topic identified based on the remaining topic model, and
computing, for the respective topic model with respect to the remaining topic model, a second similarity score based on a combination of all first similarity scores computed for the plurality of topic pairs; and
computing, for the respective topic model, the second score based on a combination of all second similarity scores computed with respect to all remaining topic models of the plurality of topic models.

### Claim 7 (depends on 5)

The system of claim 5, wherein computing the third score comprises:
for each remaining topic model of the plurality of topic models,
determining a plurality of topic pairs based on each topic identified based on the respective topic model and each topic identified based on the remaining topic model, wherein each topic pair includes a third respective topic identified based on the respective topic model and a fourth respective topic identified based on the remaining topic model,
computing, for each topic pair, a third similarity score indicating a similarity between (a) a centroid of embeddings of sample sentences generated for the third respective topic identified based on the respective topic model and (b) a centroid of embeddings of sample sentences generated for the fourth respective topic identified based on the remaining topic model, and
computing, for the respective topic model with respect to the remaining topic model, a fourth similarity score based on a combination of all third similarity scores computed for the plurality of topic pairs; and
computing, for the respective topic model, the third score based on a combination of all fourth similarity scores computed with respect to all remaining topic models of the plurality of topic models.

### Claim 8 (depends on 5)

The system of claim 5, wherein the at least one processor is configured to read the instructions to:
generate a first ranking of the plurality of topic models based on their respective second scores;
generate a second ranking of the plurality of topic models based on their respective third scores; and
determine a topic confidence score based on a comparison of the first ranking and the second ranking.

### Claim 9 (depends on 8)

The system of claim 8, wherein the at least one processor is configured to read the instructions to:
generate, for each respective topic model of the plurality of topic models, a first cluster including embedding points each representing a topic description generated for a respective topic identified based on the respective topic model;
generate, for each respective topic model of the plurality of topic models, a second cluster including embedding points each being a centroid of embeddings of sample sentences generated for a respective topic identified based on the respective topic model;
apply a plurality of cluster comparison models to the first clusters corresponding to the plurality of topic models to generate a first plurality of cluster supported scores; and
apply the plurality of cluster comparison models to the second clusters corresponding to the plurality of topic models to generate a second plurality of cluster supported scores.

### Claim 10 (depends on 9)

The system of claim 9, wherein the at least one processor is configured to read the instructions to:
determine whether the topic confidence score is larger than a predetermined threshold;
when the topic confidence score is larger than the predetermined threshold,
compare each of the first plurality of cluster supported scores to a respective first threshold to determine whether a first condition is met,
compare each of the second plurality of cluster supported scores to a respective second threshold to determine whether a second condition is met, and
determine whether a secondary topic finding process is triggered based on whether each of the first conditions and the second conditions is met;
when the topic confidence score is not larger than the predetermined threshold,
compare each of the second plurality of cluster supported scores to the respective second threshold to determine whether the second condition is met, and
determine whether the secondary topic finding process is triggered based on whether each of the second conditions is met; and
determine at least one secondary topic that is identified by the at least one secondary topic model and is non-overlapping with any primary topic identified by the primary topic model, when it is determined the secondary topic finding process is triggered.

### Claim 11 (depends on 10)

The system of claim 10, wherein the at least one secondary topic is determined based on:
generating, for each respective topic identified based on each respective topic model of the plurality of topic models, a third cluster including sentence-level embeddings representing every sample sentence generated for the respective topic associated with the at least one document;
comparing primary topics identified based on the primary topic model to secondary topics identified based on the at least one secondary topic model by applying the plurality of cluster comparison models to the third clusters to generate a topic score for each secondary topic; and
determining the at least one secondary topic based on one or more secondary topics whose topic scores are higher than a threshold.

### Claim 12 (depends on 11)

The system of claim 11, wherein the at least one processor is configured to read the instructions to:
remove, from the topic related data, each secondary topic whose topic score is lower than the threshold; and
add, to the topic related data, the at least one secondary topic whose topic score is higher than the threshold, wherein the topic related data includes:
the primary topics,
the at least one secondary topic, and
sample sentences generated for each of the primary topics and the at least one secondary topic.

### Claim 13 (depends on 12)

The system of claim 12, wherein the at least one processor is configured to read the instructions to:
obtain an inference document;
retrieve the topic related data from the database;
generate first sentence embeddings for sentences in the inference document;
generate second sentence embeddings for sample sentences in the topic related data; and
apply a few-shot classifier to the first sentence embeddings and the second sentence embeddings to identify at least one predicted topic for the inference document.

### Claim 14

A computer-implemented method, comprising:
obtaining at least one document;
applying a plurality of topic models to the at least one document to identify at least one topic associated with the at least one document;
selecting a topic model from the plurality of topic models based on the at least one topic;
generating topic related data comprising data associated with a topic identified based on the selected topic model; and
storing the topic related data in a database.

### Claim 15 (depends on 14)

The computer-implemented method of claim 14, selecting the topic model comprises:
computing, for each respective topic model of the plurality of topic models, an overlapping score indicating a level of overlap between topics identified based on the respective topic model and topics identified based on the remaining topic models of the plurality of topic models;
ranking the plurality of topic models based on their respective overlapping scores; and
selecting the topic model as a primary topic model that has the highest overlapping score among the plurality of topic models, wherein the plurality of topic models comprises the primary topic model and at least one secondary topic model.

### Claim 16 (depends on 15)

The computer-implemented method of claim 15, further comprising:
generating a first ranking of the plurality of topic models based on their respective second scores;
generating a second ranking of the plurality of topic models based on their respective third scores;
determining a topic confidence score based on a comparison of the first ranking and the second ranking;
generating, for each respective topic model of the plurality of topic models, a first cluster including embedding points each representing a topic description generated for a respective topic identified based on the respective topic model;
generating, for each respective topic model of the plurality of topic models, a second cluster including embedding points each being a centroid of embeddings of sample sentences generated for a respective topic identified based on the respective topic model;
applying a plurality of cluster comparison models to the first clusters corresponding to the plurality of topic models to generate a first plurality of cluster supported scores; and
applying the plurality of cluster comparison models to the second clusters corresponding to the plurality of topic models to generate a second plurality of cluster supported scores.

### Claim 17 (depends on 16)

The computer-implemented method of claim 16, further comprising:
determining whether the topic confidence score is larger than a predetermined threshold;
when the topic confidence score is larger than the predetermined threshold,
comparing each of the first plurality of cluster supported scores to a respective first threshold to determine whether a first condition is met,
comparing each of the second plurality of cluster supported scores to a respective second threshold to determine whether a second condition is met, and
determining whether a secondary topic finding process is triggered based on whether each of the first conditions and the second conditions is met;
when the topic confidence score is not larger than the predetermined threshold,
comparing each of the second plurality of cluster supported scores to the respective second threshold to determine whether the second condition is met, and
determining whether the secondary topic finding process is triggered based on whether each of the second conditions is met; and
determining at least one secondary topic that is identified by the at least one secondary topic model and is non-overlapping with any primary topic identified by the primary topic model, when it is determined the secondary topic finding process is triggered.

### Claim 18 (depends on 17)

The computer-implemented method of claim 17, determining the at least one secondary topic comprises:
generating, for each respective topic identified based on each respective topic model of the plurality of topic models, a third cluster including sentence-level embeddings representing every sample sentence generated for the respective topic associated with the at least one document;
comparing primary topics identified based on the primary topic model to secondary topics identified based on the at least one secondary topic model by applying the plurality of cluster comparison models to the third clusters to generate a topic score for each secondary topic; and
determining the at least one secondary topic based on one or more secondary topics whose topic scores are higher than a threshold,
wherein each secondary topic, whose topic score is lower than the threshold, is removed from the topic related data, and the topic related data includes:
the primary topics,
the at least one secondary topic, and
sample sentences generated for each of the primary topics and the at least one secondary topic.

### Claim 19 (depends on 18)

The computer-implemented method of claim 18, further comprising:
obtaining an inference document;
retrieving the topic related data from the database;
generating first sentence embeddings for sentences in the inference document;
generating second sentence embeddings for sample sentences in the topic related data; and
applying a few-shot classifier to the first sentence embeddings and the second sentence embeddings to identify at least one predicted topic for the inference document.

### Claim 20

A non-transitory computer readable medium having instructions stored thereon, wherein the instructions, when executed by at least one processor, cause at least one device to perform operations comprising:
obtaining at least one document;
applying a plurality of topic models to the at least one document to identify at least one topic associated with the at least one document;
selecting a topic model from the plurality of topic models based on the at least one topic;
generating topic related data comprising data associated with a topic identified based on the selected topic model; and
storing the topic related data in a database.
