# US 2026/0093922 A1 · Method and apparatus for named entity recognition, and non-transitory computer-readable recording medium

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

- Number: US 2026/0093922 A1
- Document ID: US20260093922A1
- Status: Published application
- Kind: A1
- Application number: 19/332,733
- Filed: 2025-09-18
- Published: 2026-04-02
- Earliest claimed: 2024-09-27
- Assignees: Ricoh Company, Ltd.
- Inventors: Yongwei ZHANG; Bin DONG; Shanshan JIANG; Yuming ZHANG; Hongyu LI
- Web page: https://patentgrep.com/patent/US20260093922A1

## CPC

- G06F 40/295: Named entity recognition
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06N 3/096: Transfer learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method and an apparatus for named entity recognition, and a non-transitory computer-readable recording medium are provided. In the method, a span in a sequence to be predicted is determined, a vector representation of the sequence is generated using a pre-trained recognition model, and a vector representation of the span is obtained. Then, the vector representation of the span is compared with final representations of entity type identifiers obtained to determine an entity type of the span. The recognition model is obtained by performing fine-tuning training on a pre-trained language model based on an objective function of contrastive learning, the objective function is constructed based on vector representations of spans in training samples, so that distances between the vector representations of the spans belonging to the same class are minimized and distances between the vector representations of the spans belonging to different classes are maximized.

## Claims

### Claim 1

A method for named entity recognition, the method comprising:
determining at least one span in a sequence to be predicted, generating a vector representation of the sequence to be predicted using a pre-trained recognition model, and obtaining a vector representation of the span in the sequence to be predicted, the number of tokens in the span being less than or equal to a preset threshold; and
comparing the vector representation of a first span in the sequence to be predicted with final representations of one or more entity type identifiers obtained in advance to determine an entity type of the first span, the first span being a span among the at least one span,
wherein the recognition model is obtained by performing fine-tuning training on a pre-trained language model based on an objective function of contrastive learning, the objective function is constructed based on vector representations of spans in training samples, so that distances between the vector representations of the spans belonging to the same class are minimized and distances between the vector representations of the spans belonging to different classes are maximized, the training samples include a plurality of original samples and a plurality of enhanced samples, the original samples are samples with labeled entity types, the enhanced samples are obtained by replacing one or more entities in the original samples with respective entity type identifiers, and the final representations of the entity type identifiers are obtained by performing average pooling on the vector representations of the same entity type identifier among the vector representations of the plurality of enhanced samples generated by the recognition model.

### Claim 2 (depends on 1)

The method for named entity recognition as claimed in claim 1,
wherein the spans belonging to the same class include a span corresponding to a first entity in a first original sample and a span corresponding to a first entity type identifier in a first enhanced sample, the first original sample is an original sample among the plurality of original samples, the first entity is an entity in the first original sample, the first enhanced sample is an enhanced sample corresponding to the first original sample, and the first entity type identifier is an entity type identifier for replacing the first entity in the first enhanced sample, and
the spans belonging to the different classes include the span corresponding to the first entity in the first original sample and a span corresponding to a non-entity in a training sample, and include the span corresponding to the first entity type identifier in the first enhanced sample and a span corresponding to a non-entity in a training sample.

### Claim 3 (depends on 1)

The method for named entity recognition as claimed in claim 1,
wherein the vector representation of the span is generated based on a vector representation of a start token of the span, a vector representation of an end token of the span, and a vector representation of a length of the span.

### Claim 4 (depends on 1)

The method for named entity recognition as claimed in claim 1,
wherein the comparing the vector representation of the first span with the final representations includes
calculating similarities between the vector representation of the first span and the final representations of the entity type identifiers, and
determining the entity type of the first span based on the entity type identifier with the highest similarity.

### Claim 5 (depends on 4)

The method for named entity recognition as claimed in claim 4,
wherein the determining the entity type of the first span based on the entity type identifier with the highest similarity includes
determining that the entity type of the first span is a non-entity, in a case where the highest similarity is lower than a reference similarity; and
determining that the entity type of the first span is the entity type corresponding to the entity type identifier with the highest similarity, in a case where the highest similarity is higher than or equal to the reference similarity, and
the reference similarity is a similarity between the vector representation of the first span and a vector representation of a preset token.

### Claim 6 (depends on 1)

The method for named entity recognition as claimed in claim 1, further comprising:
obtaining the recognition model by pre-training, and
the pre-training includes
obtaining the training samples;
determining spans in the training samples, generating vector representations of the training samples using the pre-trained language model, and obtaining the vector representations of the spans in the training samples;
constructing the objective function of the contrastive learning based on the vector representations of the spans in the training samples, and performing the fine-tuning training on the pre-trained language model based on the objective function to obtain the recognition model; and
generating the vector representations of the plurality of enhanced samples using the recognition model, and performing the average pooling on the vector representations of the same entity type identifier among the vector representations of the plurality of enhanced samples, so as to generate the final representations of the respective entity type identifiers.

### Claim 7

An apparatus for named entity recognition, the apparatus comprising:
a memory storing computer-executable instructions; and
one or more processors configured to execute the computer-executable instructions such that the one or more processors are configured to
determine at least one span in a sequence to be predicted, generate a vector representation of the sequence to be predicted using a pre-trained recognition model, and obtain a vector representation of the span in the sequence to be predicted, the number of tokens in the span being less than or equal to a preset threshold; and
compare the vector representation of a first span in the sequence to be predicted with final representations of one or more entity type identifiers obtained in advance to determine an entity type of the first span, the first span being a span among the at least one span,
wherein the recognition model is obtained by performing fine-tuning training on a pre-trained language model based on an objective function of contrastive learning, the objective function is constructed based on vector representations of spans in training samples, so that distances between the vector representations of the spans belonging to the same class are minimized and distances between the vector representations of the spans belonging to different classes are maximized, the training samples include a plurality of original samples and a plurality of enhanced samples, the original samples are samples with labeled entity types, the enhanced samples are obtained by replacing one or more entities in the original samples with respective entity type identifiers, and the final representations of the entity type identifiers are obtained by performing average pooling on the vector representations of the same entity type identifier among the vector representations of the plurality of enhanced samples generated by the recognition model.

### Claim 8 (depends on 7)

The apparatus for named entity recognition as claimed in claim 7,
wherein the spans belonging to the same class include a span corresponding to a first entity in a first original sample and a span corresponding to a first entity type identifier in a first enhanced sample, the first original sample is an original sample among the plurality of original samples, the first entity is an entity in the first original sample, the first enhanced sample is an enhanced sample corresponding to the first original sample, and the first entity type identifier is an entity type identifier for replacing the first entity in the first enhanced sample, and
the spans belonging to the different classes include the span corresponding to the first entity in the first original sample and a span corresponding to a non-entity in a training sample, and include the span corresponding to the first entity type identifier in the first enhanced sample and a span corresponding to a non-entity in a training sample.

### Claim 9 (depends on 7)

The apparatus for named entity recognition as claimed in claim 7,
wherein the vector representation of the span is generated based on a vector representation of a start token of the span, a vector representation of an end token of the span, and a vector representation of a length of the span.

### Claim 10 (depends on 7)

The apparatus for named entity recognition as claimed in claim 7,
wherein the one or more processors are configured to
calculate similarities between the vector representation of the first span and the final representations of the entity type identifiers, and
determine the entity type of the first span based on the entity type identifier with the highest similarity.

### Claim 11 (depends on 10)

The apparatus for named entity recognition as claimed in claim 10,
wherein the or more processors are configured to
determine that the entity type of the first span is a non-entity, in a case where the highest similarity is lower than a reference similarity; and
determine that the entity type of the first span is the entity type corresponding to the entity type identifier with the highest similarity, in a case where the highest similarity is higher than or equal to the reference similarity, and
the reference similarity is a similarity between the vector representation of the first span and a vector representation of a preset token.

### Claim 12 (depends on 7)

The apparatus for named entity recognition as claimed in claim 7,
wherein the one or more processors are configured to
obtain the recognition model by pre-training, and
the pre-training includes
obtaining the training samples;
determining spans in the training samples, generating vector representations of the training samples using the pre-trained language model, and obtaining the vector representations of the spans in the training samples;
constructing the objective function of the contrastive learning based on the vector representations of the spans in the training samples, and performing the fine-tuning training on the pre-trained language model based on the objective function to obtain the recognition model; and
generating the vector representations of the plurality of enhanced samples using the recognition model, and performing the average pooling on the vector representations of the same entity type identifier among the vector representations of the plurality of enhanced samples, so as to generate the final representations of the respective entity type identifiers.

### Claim 13

A non-transitory computer-readable recording medium having computer-executable instructions for execution by one or more processors, wherein, the computer-executable instructions, when executed, cause the one or more processors to carry out a method for named entity recognition, the method comprising:
determining at least one span in a sequence to be predicted, generating a vector representation of the sequence to be predicted using a pre-trained recognition model, and obtaining a vector representation of the span in the sequence to be predicted, the number of tokens in the span being less than or equal to a preset threshold; and
comparing the vector representation of a first span in the sequence to be predicted with final representations of one or more entity type identifiers obtained in advance to determine an entity type of the first span, the first span being a span among the at least one span,
wherein the recognition model is obtained by performing fine-tuning training on a pre-trained language model based on an objective function of contrastive learning, the objective function is constructed based on vector representations of spans in training samples, so that distances between the vector representations of the spans belonging to the same class are minimized and distances between the vector representations of the spans belonging to different classes are maximized, the training samples include a plurality of original samples and a plurality of enhanced samples, the original samples are samples with labeled entity types, the enhanced samples are obtained by replacing one or more entities in the original samples with respective entity type identifiers, and the final representations of the entity type identifiers are obtained by performing average pooling on the vector representations of the same entity type identifier among the vector representations of the plurality of enhanced samples generated by the recognition model.

### Claim 14 (depends on 13)

The non-transitory computer-readable recording medium as claimed in claim 13,
wherein the spans belonging to the same class include a span corresponding to a first entity in a first original sample and a span corresponding to a first entity type identifier in a first enhanced sample, the first original sample is an original sample among the plurality of original samples, the first entity is an entity in the first original sample, the first enhanced sample is an enhanced sample corresponding to the first t original sample, and the first entity type identifier is an entity type identifier for replacing the first entity in the first enhanced sample, and
the spans belonging to the different classes include the span corresponding to the first entity in the first original sample and a span corresponding to a non-entity in a training sample, and include the span to corresponding the first entity type identifier in the first enhanced sample and a span corresponding to a non-entity in a training sample.

### Claim 15 (depends on 13)

The non-transitory computer-readable recording medium as claimed in claim 13,
wherein the vector representation of the span is generated based on a vector representation of a start token of the span, a vector representation of an end token of the span, and a vector representation of a length of the span.

### Claim 16 (depends on 13)

The non-transitory computer-readable recording medium as claimed in claim 13,
wherein the comparing the vector representation of the first span with the final representations includes
calculating similarities between the vector representation of the first span and the final representations of the entity type identifiers, and
determining the entity type of the first span based on the entity type identifier with the highest similarity.

### Claim 17 (depends on 16)

The non-transitory computer-readable recording medium as claimed in claim 16,
wherein the determining the entity type of the first span based on the entity type identifier with the highest similarity includes
determining that the entity type of the first span is a non-entity, in a case where the highest similarity is lower than a reference similarity; and
determining that the entity type of the first span is the entity type corresponding to the entity type identifier with the highest similarity, in a case where the highest similarity is higher than or equal to the reference similarity, and
wherein the reference similarity is a similarity between the vector representation of the first span and a vector representation of a preset token.

### Claim 18 (depends on 13)

The non-transitory computer-readable recording medium as claimed in claim 13, the method comprising:
obtaining the recognition model by pre-training, and
the pre-training includes
obtaining the training samples;
determining spans in the training samples, generating representations of the training samples using the pre-trained language model, and obtaining the vector representations of the spans in the training samples;
constructing the objective function of the contrastive learning based on the vector representations of the spans in the training samples, and performing the fine-tuning training on the pre-trained language model based on the objective function to obtain the recognition model; and
generating the vector representations of the plurality of enhanced samples using the recognition model, and performing the average pooling on the vector representations of the same entity type identifier among the vector representations of the plurality of enhanced samples, so as to generate the final representations of the respective entity type identifiers.
