Person gender recognition method and device, electronic equipment and storage medium

By pre-labeling the gender of people's names in the documents to be translated and using model prediction, the problem of gender recognition in machine translation has been solved, achieving automated gender recognition and improving translation accuracy.

CN115438655BActive Publication Date: 2026-06-05IOL WUHAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
IOL WUHAN INFORMATION TECH CO LTD
Filing Date
2022-10-12
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing machine translation engines cannot automatically identify the gender of characters when translating literary works, leading to confusion in the use of gender pronouns in the translation and increasing the workload of post-editing.

Method used

By pre-labeling the gender of the names of people in the document to be translated, a second target corpus is generated, which is then input into a trained gender recognition model to predict and determine the gender of the people.

Benefits of technology

It enables automated recognition of the gender of people in translated documents, reducing post-editing workload and improving the accuracy of machine translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115438655B_ABST
    Figure CN115438655B_ABST
Patent Text Reader

Abstract

The present application provides a kind of character gender identification method, device, electronic equipment and storage medium, it is related to data processing technical field, the method comprises: determining first target corpus, at least one character name is included in the first target corpus;Each character name included in the first target corpus is pre-labeled with character gender, to obtain second target corpus;The second target corpus is input to the character gender identification model that training is completed, and the prediction result output by the character gender identification model is obtained;Based on the prediction result, the character gender of each character name included in the first target corpus is determined respectively corresponding.The present application obtains second target corpus by pre-labeled with character gender to each character name included in first target corpus, and the second target corpus is input to character gender identification model to carry out character gender prediction, to realize the character gender identification of the character involved in the document to be translated automatically.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for identifying the gender of a person. Background Technology

[0002] Current machine translation engines are limited by technical factors and can only translate single sentences. When translating documents such as literary works (especially novels), which involve a large number of characters, single-sentence machine translation cannot infer the gender of characters from the current sentence, resulting in confusion in the use of gender pronouns in the translated text, which greatly increases the workload of correction during post-editing.

[0003] Therefore, how to automatically identify the gender of people involved in translated documents has become an urgent problem to be solved in the industry. Summary of the Invention

[0004] To address the problems existing in the prior art, the present invention provides a method, device, electronic device, and storage medium for identifying the gender of a person.

[0005] In a first aspect, the present invention provides a method for identifying the gender of a person, comprising:

[0006] A first target corpus is identified, which includes at least one person's name;

[0007] The gender of each person's name included in the first target corpus is pre-labeled to obtain the second target corpus;

[0008] The second target corpus is input into the trained character gender recognition model to obtain the prediction result output by the character gender recognition model;

[0009] Based on the prediction results, the gender of each person's name included in the first target corpus is determined.

[0010] Optionally, according to the method for gender recognition provided by the present invention, before inputting the second target corpus into the trained gender recognition model and obtaining the prediction result output by the gender recognition model, the method further includes:

[0011] Extract the gender classification features corresponding to the names of each person included in the first sample corpus;

[0012] Training corpus is generated based on the first sample corpus and the gender classification features, and the training corpus carries sample labels;

[0013] A person's gender recognition model is trained based on the training corpus to obtain the trained person's gender recognition model;

[0014] The gender classification features include male, female, and unknown gender.

[0015] Optionally, according to the method for identifying gender according to the present invention, the step of training a gender identification model based on the training corpus to obtain the trained gender identification model includes:

[0016] A gender recognition model is trained based on the training corpus and the logistic regression model to obtain the trained gender recognition model.

[0017] Optionally, according to the method for identifying the gender of individuals provided by the present invention, the step of extracting the gender classification features corresponding to the names of each individual included in the first sample corpus includes:

[0018] Based on the pre-trained language model, the gender classification features corresponding to the names of the individuals included in the first sample corpus were extracted.

[0019] Optionally, in the gender recognition method provided by the present invention, the pre-trained language model is a BERT model.

[0020] Optionally, according to the method for identifying the gender of individuals provided by the present invention, before extracting the gender classification features corresponding to the names of individuals included in the first sample corpus, the method further includes:

[0021] A second sample corpus is determined, which includes at least one person's name and the gender feature corresponding to the at least one person's name;

[0022] Obtain the first sample corpus after manually annotating the second sample corpus. The names of the people included in the first sample corpus have corresponding gender classification features.

[0023] The gender characteristics of the characters include terms of address or personal pronouns related to the characters.

[0024] Secondly, the present invention also provides a gender recognition device, comprising:

[0025] The first determining module is used to determine the first target corpus, which includes at least one person's name;

[0026] The annotation module is used to pre-annotate the gender of each person's name included in the first target corpus to obtain the second target corpus;

[0027] The recognition module is used to input the second target corpus into the trained human gender recognition model and obtain the prediction result output by the human gender recognition model;

[0028] The second determining module is used to determine the gender of each person's name included in the first target corpus based on the prediction results.

[0029] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the person gender recognition method as described in the first aspect.

[0030] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the gender recognition method as described in the first aspect.

[0031] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the person gender recognition method as described above.

[0032] The present invention provides a method, apparatus, electronic device and storage medium for identifying the gender of persons. By pre-labeling the gender of persons included in the first target corpus to obtain a second target corpus, and inputting the second target corpus into the gender identification model to predict the gender of persons, the invention achieves automated gender identification of persons involved in the document to be translated. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0034] Figure 1 This is one of the flowcharts illustrating the gender recognition method for individuals provided by this invention;

[0035] Figure 2 This is the second flowchart illustrating the gender recognition method for individuals provided by this invention;

[0036] Figure 3 This is a schematic diagram of the structure of the gender recognition device provided by the present invention;

[0037] Figure 4 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0039] The following is combined Figures 1-4 This invention describes the method, apparatus, electronic device, and storage medium for identifying human gender provided by the present invention.

[0040] Figure 1 This is one of the flowcharts illustrating the gender recognition method provided by this invention, such as... Figure 1 As shown, the method includes:

[0041] Step 100: Determine the first target corpus, which includes at least one person's name;

[0042] Step 110: Pre-label the gender of each person's name included in the first target corpus to obtain the second target corpus;

[0043] Step 120: Input the second target corpus into the trained character gender recognition model to obtain the prediction result output by the character gender recognition model;

[0044] Step 130: Based on the prediction results, determine the gender of each person's name included in the first target corpus.

[0045] Specifically, in this embodiment of the invention, in order to overcome the shortcomings of the prior art in automatically identifying the gender of people involved in the document to be translated, the present invention obtains a second target corpus by pre-labeling the gender of the names of people included in the first target corpus, and inputs the second target corpus into the gender identification model to predict the gender of people, thereby realizing the automatic identification of the gender of people involved in the document to be translated.

[0046] Optionally, a first target corpus can be extracted from the document to be translated, wherein the first target corpus includes at least one person's name.

[0047] For example, the first target corpus includes: A's father's name is B.

[0048] For example, the first target corpus includes: C found D and hurriedly said to her: "...".

[0049] Optionally, the gender of each person's name included in the first target corpus can be pre-labeled to obtain the second target corpus.

[0050] For example, the second target corpus includes: A's father's name is B, A is female, and B is male.

[0051] For example, the second target corpus includes: C finds D and hurriedly says to her: "...", where C is male and D is female.

[0052] It is understood that, in this embodiment of the invention, the gender of each person's name in the first target corpus can be determined based on the relational terms (father, mother, older brother, older sister, younger brother, younger sister, etc.) or personal pronouns (he, she) in the first target corpus, and the gender of the person can be pre-labeled. If the gender of any person's name in the first target corpus cannot be determined, the gender of that person's name can be pre-labeled arbitrarily. For example, if the gender of A in the first target corpus cannot be determined, A can be pre-labeled as: A is female, or A is male; if the gender of C in the first target corpus cannot be determined, C can be pre-labeled as: C is male, or C is female.

[0053] Optionally, the second target corpus can be input into the trained character gender recognition model to obtain the prediction results output by the character gender recognition model.

[0054] Optionally, in this embodiment of the invention, the gender recognition model can be built based on any neural network model, and this embodiment of the invention does not impose any specific limitations on it.

[0055] Optionally, the gender of each person's name in the first target corpus can be determined based on the prediction results output by the person gender recognition model.

[0056] For example, if the second target corpus (A's father's name is B, A is female, and B is male) is input into the person gender recognition model, and the prediction results output by the person gender recognition model are 0 and 1, it indicates that the gender prediction of A is wrong and the gender prediction of B is correct. Therefore, based on the prediction results, it can be determined that the gender of A is male and the gender of B is male.

[0057] The gender recognition method provided by this invention obtains a second target corpus by pre-labeling the gender of the names of people included in the first target corpus, and inputs the second target corpus into the gender recognition model to predict the gender of people, thereby realizing the automatic gender recognition of people involved in the document to be translated.

[0058] Optionally, before inputting the second target corpus into the trained gender recognition model and obtaining the prediction result output by the gender recognition model, the method further includes:

[0059] Extract the gender classification features corresponding to the names of each person included in the first sample corpus;

[0060] Training corpus is generated based on the first sample corpus and the gender classification features, and the training corpus carries sample labels;

[0061] A person's gender recognition model is trained based on the training corpus to obtain the trained person's gender recognition model;

[0062] The gender classification features include male, female, and unknown gender.

[0063] Specifically, in this embodiment of the invention, before applying the gender recognition model to predict gender, the gender recognition model is first trained to obtain a trained gender recognition model. The training steps of the gender recognition model include:

[0064] (1) Extract the gender classification features corresponding to each person's name in the first sample corpus. The gender classification features may include male, female and unknown gender.

[0065] (2) A training corpus is generated based on the first sample corpus and the extracted gender classification features, and the training corpus carries sample labels;

[0066] (3) Train a gender recognition model based on training corpus to obtain a trained gender recognition model.

[0067] For example, the first sample corpus is:

[0068] A's father's name is B, [A, gender unknown], [B, male].

[0069] The gender classification features corresponding to the names of the individuals included in the first sample corpus are [A, Unknown gender] and [B, Male]. Further training corpus can be generated based on the first sample corpus and the extracted gender classification features as follows:

[0070] Corpus 1: A's father's name is B, and A is male. (Label: 0)

[0071] Corpus 2: A's father's name is B, and A is female. (Label: 0)

[0072] Corpus 3: A's father's name is B, and B is male. (Label: 1)

[0073] Corpus 4: A's father's name is B, and B is female. (Label: 0)

[0074] The above training corpus construction idea is: add a short sentence describing the gender of a person after each sentence. If the gender description is correct, the sample label corresponding to the entire sentence is marked as 1; otherwise, it is marked as 0. Thus, the training of the gender recognition model can be transformed into a binary classification training problem.

[0075] The gender recognition method provided by this invention generates training data based on a first sample corpus and gender classification features extracted from the first sample corpus. Then, the gender recognition model is trained based on the training data, so that the trained gender recognition model can be used to automatically identify the gender of people involved in the document to be translated.

[0076] Optionally, training the character gender recognition model based on the training corpus to obtain the trained character gender recognition model includes:

[0077] A gender recognition model is trained based on the training corpus and the logistic regression model to obtain the trained gender recognition model.

[0078] Specifically, in this embodiment of the invention, after generating the training corpus, the gender recognition model can be trained based on the training corpus and the logistic regression model to obtain the trained gender recognition model.

[0079] Understandably, logistic regression models can be used to train classification models for gender recognition.

[0080] Optionally, the extraction of gender classification features corresponding to the names of individuals included in the first sample corpus includes:

[0081] Based on the pre-trained language model, the gender classification features corresponding to the names of the individuals included in the first sample corpus were extracted.

[0082] Specifically, in this embodiment of the invention, gender classification features corresponding to the names of individuals included in the first sample corpus can be extracted based on a pre-trained language model.

[0083] Optionally, the pre-trained language model is a BERT (Bidirectional Encoder Representation from Transformers) model.

[0084] Optionally, in this embodiment of the invention, a pre-trained language model BERT can be used to extract gender classification features from the first sample corpus. The vector at the first flag position after BERT encoding is used as the classification feature of the first sample corpus, and a logistic regression model is used to train the gender recognition model for classification.

[0085] Optionally, before extracting the gender classification features corresponding to the names of each person included in the first sample corpus, the method further includes:

[0086] A second sample corpus is determined, which includes at least one person's name and the gender feature corresponding to the at least one person's name;

[0087] Obtain the first sample corpus after manually annotating the second sample corpus. The names of the people included in the first sample corpus have corresponding gender classification features.

[0088] The gender characteristics of the characters include terms of address or personal pronouns related to the characters.

[0089] Specifically, in this embodiment of the invention, before extracting the gender classification features corresponding to each person's name included in the first sample corpus, a second sample corpus can be determined first. The second sample corpus includes at least one person's name and at least one person's gender feature corresponding to that name. Then, the second sample corpus is manually annotated to obtain the first sample corpus, in which each person's name includes a corresponding gender classification feature.

[0090] Optionally, in this embodiment of the invention, a second sample corpus containing person names and corresponding gender features can be selected from the corpus using a named entity recognition model.

[0091] Understandably, corpus screening aims to select sentences containing names of people and their corresponding gender characteristics, which will then be used as the corpus for further manual annotation. The screening process can be automated by a program searching the corpus. The basic process involves: first, using a named entity recognition model to filter sentences containing names from the corpus; then, determining whether the sentence contains gender characteristics, which can be one of the following categories: relational terms or personal pronouns, etc.

[0092] Optionally, the terms of address for the relationships between people may include father, mother, older brother, older sister, younger brother, and younger sister, etc.

[0093] Alternatively, personal pronouns may include he and she, etc.

[0094] It is understandable that after selecting the second sample corpus, the second sample corpus can be manually annotated to obtain the manually annotated first sample corpus.

[0095] For example, if the second sample corpus includes the statement: "A's father's name is B," then the first sample corpus obtained after manually annotating the second sample corpus would include:

[0096] A's father's name is B, [A, gender unknown], [B, male].

[0097] In the first sample corpus mentioned above, [A, Unknown gender] and [B, Male] are manually labeled gender classification features.

[0098] The gender recognition method provided by this invention obtains a first sample corpus after manually annotating the gender classification features, which facilitates the subsequent generation of training corpus based on the first sample corpus and the gender classification features in the first sample corpus, thereby enabling the training of a gender recognition model based on the training corpus.

[0099] Figure 2 This is the second flowchart illustrating the gender recognition method provided by the present invention, as shown below. Figure 2 As shown, the method includes:

[0100] Step 200: Annotate the corpus.

[0101] Specifically, after selecting sample data from the corpus, the selected sample data can be manually annotated to obtain manually annotated sample data.

[0102] Step 210: Train the human gender recognition model.

[0103] Specifically, after obtaining manually annotated sample corpus, training corpus can be generated based on the manually annotated sample corpus, and then a person gender recognition model can be trained based on the training corpus to obtain a trained person gender recognition model.

[0104] Step 220: Add gender information to the machine translation.

[0105] Specifically, a trained human gender recognition model can be used to identify the gender of people involved in the document to be translated. After the gender recognition is completed, the identified gender information is added to the machine-translated document information.

[0106] Optionally, when performing machine translation, for sentences containing names, gender information corresponding to those names can be added in two ways to improve the accuracy of machine translation. One method is knowledge injection, which involves directly appending the gender information corresponding to the name to the original sentence. This method requires the support of a machine translation engine and is suitable for proprietary machine translation engines that have training data in the appropriate format during engine training. The other method is post-processing, which is suitable for third-party machine translation engines that are not independently controllable. This method requires performing referential resolution analysis on the machine-translated document to determine the correspondence between the name and the corresponding gender pronoun, and then judging whether the corresponding gender pronoun is correct based on the gender information of the name. If incorrect, it is automatically corrected.

[0107] Understandably, due to the limitations of the accuracy of the gender recognition model, it is difficult to guarantee 100% accuracy in the gender output based on a single sentence. However, in general, a person's name will appear in multiple sentences in the document to be translated. By outputting the gender corresponding to each person's name through the gender recognition model and then performing statistical processing, the accurate gender corresponding to each person's name can be obtained.

[0108] It is understood that the gender recognition method provided in this embodiment of the invention can, to a certain extent, overcome the defect that single-sentence translation cannot utilize global document information and optimize machine translation effect by pre-extracting global document information that may affect the quality of single-sentence translation, using a gender recognition model to predict gender, and then adding or supplementing the obtained gender recognition result to single-sentence translation.

[0109] The gender recognition method provided by this invention obtains a second target corpus by pre-labeling the gender of the names of people included in the first target corpus, and inputs the second target corpus into the gender recognition model to predict the gender of people, thereby realizing the automatic gender recognition of people involved in the document to be translated.

[0110] The following describes the gender recognition device provided by the present invention. The gender recognition device described below can be referred to in correspondence with the gender recognition method described above.

[0111] Figure 3 This is a schematic diagram of the structure of the gender recognition device provided by the present invention, as shown below. Figure 3 As shown, the device includes: a first determining module 310, a labeling module 320, an identification module 330, and a second determining module 340; wherein:

[0112] The first determining module 310 is used to determine the first target corpus, which includes at least one person's name;

[0113] The annotation module 320 is used to pre-annotate the gender of each person's name included in the first target corpus to obtain the second target corpus;

[0114] The recognition module 330 is used to input the second target corpus into the trained human gender recognition model and obtain the prediction result output by the human gender recognition model;

[0115] The second determining module 340 is used to determine the gender of each person's name included in the first target corpus based on the prediction results.

[0116] The gender recognition device provided by the present invention obtains a second target corpus by pre-labeling the gender of the names of people included in the first target corpus, and inputs the second target corpus into the gender recognition model to predict the gender of people, thereby realizing the automatic gender recognition of people involved in the document to be translated.

[0117] Optionally, the device further includes an extraction module, a generation module, and a training module; wherein:

[0118] The extraction module is used to extract the gender classification features corresponding to the names of each person included in the first sample corpus;

[0119] The generation module is used to generate training corpus based on the first sample corpus and the gender classification features, wherein the training corpus carries sample labels;

[0120] The training module is used to train a person's gender recognition model based on the training corpus, and obtain the trained person's gender recognition model.

[0121] The gender classification features include male, female, and unknown gender.

[0122] Optionally, the training module is further configured to:

[0123] A gender recognition model is trained based on the training corpus and the logistic regression model to obtain the trained gender recognition model.

[0124] Optionally, the extraction module is further configured to:

[0125] Based on the pre-trained language model, the gender classification features corresponding to the names of the individuals included in the first sample corpus were extracted.

[0126] Optionally, the pre-trained language model is a BERT model.

[0127] Optionally, the device further includes a third determining module and an acquiring module; wherein:

[0128] The third determining module is used to determine the second sample corpus, which includes at least one person's name and the gender feature of the person corresponding to the at least one person's name;

[0129] The acquisition module is used to acquire the first sample corpus after the second sample corpus has been manually annotated, and the names of the people included in the first sample corpus have corresponding gender classification features;

[0130] The gender characteristics of the characters include terms of address or personal pronouns related to the characters.

[0131] The gender recognition device provided by the present invention obtains a second target corpus by pre-labeling the gender of the names of people included in the first target corpus, and inputs the second target corpus into the gender recognition model to predict the gender of people, thereby realizing the automatic gender recognition of people involved in the document to be translated.

[0132] It should be noted that the above-mentioned human gender recognition device provided in the embodiments of the present invention can implement all the method steps implemented in the above-mentioned human gender recognition method embodiments and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.

[0133] Figure 4 This is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute the gender recognition method provided by the above methods, which includes:

[0134] A first target corpus is identified, which includes at least one person's name;

[0135] The gender of each person's name included in the first target corpus is pre-labeled to obtain the second target corpus;

[0136] The second target corpus is input into the trained character gender recognition model to obtain the prediction result output by the character gender recognition model;

[0137] Based on the prediction results, the gender of each person's name included in the first target corpus is determined.

[0138] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0139] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the person gender recognition method provided by the above methods, the method comprising:

[0140] A first target corpus is identified, which includes at least one person's name;

[0141] The gender of each person's name included in the first target corpus is pre-labeled to obtain the second target corpus;

[0142] The second target corpus is input into the trained character gender recognition model to obtain the prediction result output by the character gender recognition model;

[0143] Based on the prediction results, the gender of each person's name included in the first target corpus is determined.

[0144] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the aforementioned methods for identifying the gender of persons, the method comprising:

[0145] A first target corpus is identified, which includes at least one person's name;

[0146] The gender of each person's name included in the first target corpus is pre-labeled to obtain the second target corpus;

[0147] The second target corpus is input into the trained character gender recognition model to obtain the prediction result output by the character gender recognition model;

[0148] Based on the prediction results, the gender of each person's name included in the first target corpus is determined.

[0149] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying the gender of a person, characterized in that, include: A first target corpus is identified, which includes at least one person's name; The gender of each character's name in the first target corpus is pre-labeled to obtain the second target corpus. The pre-labeling of gender of each character's name in the first target corpus includes: determining the gender of each character's name in the first target corpus based on the relationship terms or personal pronouns in the first target corpus, and pre-labeling the gender; if the gender of any character's name in the first target corpus cannot be determined, an arbitrary gender is assigned to any character's name. The second target corpus is input into the trained character gender recognition model to obtain the prediction result output by the character gender recognition model. The training process of the character gender recognition model includes: determining a second sample corpus, which includes at least one character name and the corresponding character gender features of the at least one character name; obtaining a first sample corpus after manually annotating the second sample corpus, wherein each character name included in the first sample corpus has a corresponding gender classification feature; wherein the character gender features include character relationship terms or personal pronouns; extracting the gender classification features corresponding to each character name included in the first sample corpus; generating training corpus based on the first sample corpus and the gender classification features, wherein the training corpus carries sample labels; training the character gender recognition model based on the training corpus to obtain the trained character gender recognition model; wherein the gender classification features include male, female, and unknown gender. Based on the prediction results, the gender of each person's name included in the first target corpus is determined.

2. The method for identifying the gender of a person according to claim 1, characterized in that, The process of training a gender recognition model based on the training corpus to obtain the trained gender recognition model includes: A gender recognition model is trained based on the training corpus and the logistic regression model to obtain the trained gender recognition model.

3. The method for identifying the gender of a person according to claim 1, characterized in that, The extraction of gender classification features corresponding to the names of individuals included in the first sample corpus includes: Based on the pre-trained language model, the gender classification features corresponding to the names of the individuals included in the first sample corpus were extracted.

4. The method for identifying the gender of a person according to claim 3, characterized in that, The pre-trained language model is the BERT model.

5. A gender recognition device, characterized in that, include: The first determining module is used to determine the first target corpus, which includes at least one person's name; The annotation module is used to pre-annotate the gender of each character's name included in the first target corpus to obtain the second target corpus. The pre-annotation of gender for each character's name included in the first target corpus includes: determining the gender of each character's name in the first target corpus based on the character relationship terms or personal pronouns in the first target corpus, and performing gender pre-annotation; if the gender of any character's name in the first target corpus cannot be determined, arbitrarily assigning a gender to any character's name. A recognition module is used to input the second target corpus into a trained character gender recognition model to obtain the prediction result output by the character gender recognition model. The training process of the character gender recognition model includes: determining a second sample corpus, which includes at least one character name and the corresponding character gender features of the at least one character name; obtaining a first sample corpus after manually annotating the second sample corpus, wherein each character name included in the first sample corpus has a corresponding gender classification feature; wherein the character gender features include character relationship terms or personal pronouns; extracting the gender classification features corresponding to each character name included in the first sample corpus; generating training corpus based on the first sample corpus and the gender classification features, wherein the training corpus carries sample labels; training the character gender recognition model based on the training corpus to obtain the trained character gender recognition model; wherein the gender classification features include male, female, and unknown gender. The second determining module is used to determine the gender of each person's name included in the first target corpus based on the prediction results.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the gender recognition method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the gender recognition method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the gender recognition method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Information prediction method and device, storage medium and electronic equipment

    CN113312905A

  • Personal name sexuality determination program, machine translation program, personal name sexuality determination device, machine translation device, personal name sexuality determination processing method and machine translation processing method

    JP2007264858A