Date recognition method, device, readable medium and electronic device

By identifying the target date in the text to be identified by the preset date recognition model, the problem of low recognition rate in complex date text recognition scenarios is solved, and accurate recognition of multiple date scenarios is achieved, which improves the reliability of date recognition.

CN114444508BActive Publication Date: 2024-11-22BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210113138.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-29
Publication Date
2024-11-22
Estimated Expiration
2042-01-29

AI Technical Summary

Technical Problem

The existing date recognition methods have low recognition rate in complex date text recognition scenarios, poor accuracy of recognition results, and cannot effectively identify date information in multiple date scenarios.

Method used

Using the preset date recognition model, by obtaining the target entity category corresponding to each character in the text to be identified, determining the target date of the date text based on the character category and the date to be determined, and whether the character is a date number and its position information in the date is represented. , realize effective identification of multiple date scenarios.

Benefits of technology

It improves the accuracy and recognition rate of date recognition, improves the reliability of date recognition results, and can effectively identify date information in multiple date scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114444508B_ABST
    Figure CN114444508B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a date recognition method, device, readable medium and electronic device. The method recognizes a pending date corresponding to a date text through a preset date recognition model, obtains a target entity category corresponding to each character in the date text, and determines a target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to a date number, and when the character is a designated character related to a date number, the position information of the number corresponding to the character in the date. The method can effectively recognize dates in a variety of date recognition scenarios and can effectively ensure the accuracy of date recognition results, thereby effectively ensuring not only the date recognition rate but also the reliability of the date recognition results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a date recognition method, device, readable medium and electronic device. Background Art

[0002] With the development of science and technology, human beings have gradually applied computer vision technology. OCR (Optical Character Recognition) character recognition is an important branch of computer vision technology. After completing OCR character recognition, it is often accompanied by the extraction of key information in the recognized text, for example, the extraction of date information in the recognized text.

[0003] Current date recognition methods can usually only effectively recognize simple date text recognition scenarios (for example, date recognition scenarios such as invoices, train tickets, and certificates). However, for relatively complex date text recognition scenarios (for example, recognition of date text in OCR character recognition results), there are problems of low recognition rate and poor recognition result accuracy. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] The present disclosure provides a date recognition method, device, readable medium and electronic device.

[0006] In a first aspect, the present disclosure provides a date recognition method, the method comprising:

[0007] Acquire the text to be recognized, wherein the text to be recognized includes a date text;

[0008] Inputting the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model;

[0009] Among them, the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0010] In a second aspect, the present disclosure provides a date recognition device, the device comprising:

[0011] A first acquisition module is configured to acquire a text to be recognized, wherein the text to be recognized includes a date text;

[0012] A second acquisition module is configured to input the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model;

[0013] Among them, the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0014] In a third aspect, the present invention discloses a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect above.

[0015] In a fourth aspect, the present disclosure provides an electronic device, including:

[0016] a storage device having a computer program stored thereon;

[0017] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect above.

[0018] The above technical scheme identifies the pending date corresponding to the date text through the preset date recognition model, obtains the target entity category corresponding to each character in the date text, and determines the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date. In this way, by determining the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date, the target date in the text to be recognized can be effectively and accurately recognized, thereby effectively ensuring the recognition rate of the date in the text to be recognized, and also effectively improving the reliability of the date recognition result.

[0019] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0021] Figure 1 is a flow chart of a date recognition method shown in an exemplary embodiment of the present disclosure;

[0022] Figure 2 is a structural block diagram of a preset date recognition model shown in an exemplary embodiment of the present disclosure;

[0023] Figure 3 This disclosure is based on Figure 1 A flow chart of a date recognition method shown in the illustrated embodiment;

[0024] Figure 4 is a flow chart of a training method for a preset date recognition model shown in an exemplary embodiment of the present disclosure;

[0025] Figure 5 is a block diagram of a date recognition device shown in an exemplary embodiment of the present disclosure;

[0026] Figure 6 It is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0029] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] Before introducing the specific implementation methods of the present disclosure in detail, the application scenarios of the present disclosure are first described as follows. The present disclosure can be applied to the process of recognizing dates in images, documents (PDF documents, Word documents), or bills (for example, invoices, train tickets). Most of the current date recognition methods are based on training dedicated date recognition models for specific recognition scenarios. For example, in the related art, dedicated models are trained for the recognition of dates in train tickets or invoices. Since these dedicated models are usually designed for a single scenario, the generalization ability of the models is usually poor. Therefore, they cannot be used universally and cannot effectively recognize dates in other date recognition scenarios. The accuracy of the date recognition results cannot be guaranteed, and it is not conducive to improving the date recognition rate.

[0034] In order to solve the above technical problems, the present disclosure provides a date recognition method, device, readable medium and electronic device. The method identifies the pending date corresponding to the date text through the preset date recognition model, obtains the target entity category corresponding to each character in the date text, and determines the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date. The method can effectively identify the dates in various date recognition scenarios and effectively ensure the accuracy of the date recognition results, thereby not only effectively ensuring the date recognition rate, but also effectively improving the reliability of the date recognition results.

[0035] The technical solution of the present disclosure is described in detail below in conjunction with specific embodiments.

[0036] Figure 1 is a flow chart of a date recognition method shown in an exemplary embodiment of the present disclosure; Figure 1As shown, the method may include the following steps:

[0037] Step 101: Obtain text to be recognized, where the text to be recognized includes date text.

[0038] The text to be recognized may be the target text obtained after performing OCR character recognition on an image. For example, it may be the character text obtained after performing OCR recognition on a scan of a paper document, or it may be a text in a WORD file, or it may be the text corresponding to an electronic receipt.

[0039] Step 102: input the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model.

[0040] Among them, the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0041] For example, the target entity category can be "other", "year-starting", "year-mid", "year-end", "month-starting", "month-end", "month-alone", "day-starting", "day-end" or "day-alone", the "other" represents that the character is a specified character that is not related to the date number, the "year-starting" represents the first digit in the year data, the "year-end" represents the last digit in the year data, and the "year-mid" represents the other digits in the year data except the first digit and the last digit of the year. For example, if the year data is "2018", the first digit "2" (that is, the first digit from left to right in the year data) corresponds to the target entity category of "year-starting", the target entity category of "8" (that is, the last digit from left to right in the year data) is "year-end", and the target entity category of "0" and "1" is "year-mid". The “month-starting” represents the first digit in the month data when the month data is a two-digit number, the “month-ending” represents the second digit in the month data when the month data is a two-digit number, and the “month-single” represents that the month data is a single digit. For example, when the month data is “12”, the target entity category corresponding to the “1” is “month-starting”, and the target entity category corresponding to the “2” is “month-ending”. When the month data is “04”, the target entity category corresponding to the “0” is “month-starting”, and the target entity category corresponding to the “4” is “month-ending”. When the month data is “3”, the target entity category corresponding to the “3” is “month-single”. The “day-from” represents the first digit in the day data when the day data in the date is a two-digit number, the “day-to” represents the second digit in the day data when the day data in the date is a two-digit number, and the “day-single” represents that the day data is a single digit. For example, when the day data is “26”, the target entity category corresponding to the “2” is “day-from”, and the target entity category corresponding to the “6” is “day-to”. When the day data is “05”, the target entity category corresponding to the “0” is “day-from”, and the target entity category corresponding to the “5” is “day-to”. When the day data is “7”, the target entity category corresponding to the “7” is “day-single”.

[0042] The above-mentioned determining the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date may include:

[0043] Obtain a designated entity category corresponding to each number in the pending date; if the designated entity category corresponding to each number in the pending date is consistent with the target entity category of the character corresponding to the number in the date text, determine the pending date as the target date.

[0044] It should be noted that when obtaining the designated entity category corresponding to each number in the pending date, a possible implementation method is to determine the designated entity type corresponding to the number according to the position of each number in the pending date. For example, when the format of the pending date is "pending year-pending month-pending day", if the number is the data before the first "-", it is determined that the number belongs to the number in the pending year. When the number is the first digit in the pending year, the designated entity category corresponding to the number is determined to be "year-starting". When the number is the last digit in the pending year, the designated entity category corresponding to the number is determined to be "year-end". If it is determined that the number belongs to the pending year data, but is neither the first digit nor the last digit in the pending year, the designated entity category corresponding to the number is determined to be "year-mid". If the number is the data between two "-", it is determined that the number belongs to the number in the pending month. When it is determined that the pending month only includes one digit, the designated entity category corresponding to the pending month is determined to be The designated entity category of the number is "month-single". When it is determined that the pending month includes two digits, if the number is the first digit in the pending month, the designated entity category corresponding to the number is determined to be "month-from", and if the number is the second digit in the pending month, the designated entity category corresponding to the number is determined to be "month-end"; if the number is the data after the second "-", it is determined that the number belongs to the number corresponding to the pending day. When it is determined that the pending day only includes one digit, the designated entity category of the number corresponding to the pending day is determined to be "day-single". When it is determined that the pending month includes two digits, if the number is the first digit in the pending day, the designated entity category corresponding to the number is determined to be "day-from", and if the number is the second digit in the pending day, the designated entity category corresponding to the number is determined to be "day-end".

[0045] Another possible implementation is: input the pending date into a preset named entity type recognition model, so that the preset named entity recognition model outputs the designated named entity corresponding to each number in the pending date, and the designated named entity can be one of "other", "year-starting", "year-mid", "year-end", "month-starting", "month-end", "month-single", "day-starting", "day-end" and "day-single", and the preset named entity recognition model can be a neural network model or other machine learning models.

[0046] The above technical solution, since the text to be recognized can be the text obtained by OCR character recognition, or the text in other documents, or the text corresponding to the bill, can ensure the effective recognition of dates in various date recognition scenarios, and can also effectively ensure the accuracy of the date recognition results, thereby not only effectively ensuring the date recognition rate, but also effectively improving the reliability of the date recognition results.

[0047] Figure 2 is a structural block diagram of a preset date recognition model shown in an exemplary embodiment of the present disclosure, such as Figure 2 As shown, the preset date recognition model includes an encoder 201, and a year classification module 202, a month classification module 203, a day classification module 204 and a character entity category detection module 205 coupled to the encoder 201;

[0048] The year classification module 202 is used to identify the pending year in the date text. The year classification module includes a plurality of classifiers, and different classifiers are used to identify digits at different positions in the pending year;

[0049] The month classification module 203 is used to identify the undetermined month in the date text;

[0050] The day classification module 204 is used to identify the pending days in the date text;

[0051] The character entity category detection module 205 is used to obtain the target entity category corresponding to each character in the date text.

[0052] Wherein, the encoder 201 can be a BERT (Bidirectional Encoder Representation from Transformers, bidirectional encoder representation) encoder, and the preset date recognition model can also include a text preprocessing module 206, the output end of the text preprocessing module 206 is coupled with the input end of the encoder 201, and is used to perform word segmentation processing on the text to be recognized, so as to obtain an initial feature sequence suitable for the data input requirements of the encoder 201, wherein the initial feature sequence can be a feature sequence including [CLS] and [SEP], the [CLS] is used to represent the beginning of embedding, and [SEP] is used between sentences to separate two sentences. The encoder 201 can input the encoding vector corresponding to the [CLS] symbol as the target text feature corresponding to the text to be recognized to the year classification module 202, the month classification module 203, the day classification module 204 and the character entity category detection module 205, so that, since the encoding vector corresponding to the [CLS] symbol contains more complete semantic information in the text to be recognized, the encoding vector is used as the basis data for classification prediction, which can effectively improve the accuracy of the classification result.

[0053] Optionally, the year classification module 202 includes a first classifier 2021, a second classifier 2022, a third classifier 2023 and a fourth classifier 2024, the month classification module 203 includes a fifth classifier, the day classification module 204 includes a sixth classifier, the character entity category detection module 205 includes a seventh classifier, Figure 3 This disclosure is based on Figure 1 The embodiment shown is a flow chart of a date recognition method, such as Figure 3 As shown, the preset date recognition model determines the target date in the text to be recognized through the following steps:

[0054] Step 1021, obtaining target text features corresponding to the text to be recognized through the encoder.

[0055] The target text feature includes contextual semantic information of the date text.

[0056] For example, the initial feature sequence input to the encoder may be a feature sequence including [CLS] and [SEP], and the target text feature may be an encoding vector corresponding to the [CLS] symbol in the initial feature sequence output by the encoder.

[0057] Step 1022: using the first classifier to identify the first target digit in the year data corresponding to the date text according to the target text feature, using the second classifier to identify the second target digit in the year data corresponding to the date text according to the target text feature, using the third classifier to identify the third target digit in the year data corresponding to the date text according to the target text feature, and using the fourth classifier to identify the fourth target digit in the year data corresponding to the date text according to the target text feature.

[0058] Among them, the first classifier can output 1*10-dimensional feature data, which are used to characterize the probability that the first target digit in the year data is each digit from 0 to 9; the second classifier can output 1*10-dimensional feature data, which are used to characterize the probability that the second target digit in the year data is each digit from 0 to 9; the third classifier can output 1*10-dimensional feature data, which are used to characterize the probability that the third target digit in the year data is each digit from 0 to 9; the fourth classifier can output 1*10-dimensional feature data, which are used to characterize the probability that the fourth target digit in the year data is each digit from 0 to 9.

[0059] Step 1023, determining the pending year corresponding to the date text according to the first target number, the second target number, the third target number, and the fourth target number.

[0060] For example, if the first classifier recognizes that the first target data is "2", the second classifier recognizes that the second target number is "0", the third classifier recognizes that the third target number is "1", and the fourth classifier recognizes that the fourth target number is "8", then the pending year is "2018".

[0061] Step 1024: identifying the undetermined month corresponding to the month data in the date text according to the target text feature through the fifth classifier.

[0062] The fifth classifier can output 1*13-dimensional feature data, which are used to represent the probability of the month data being each number from 0 to 12 (13 numbers).

[0063] Step 1025: identifying the pending day corresponding to the day data in the date text according to the target text feature through the sixth classifier.

[0064] The fifth classifier can output 1*32-dimensional feature data, which are used to characterize the probability that the daily data is each number from 0 to 31 (32 numbers).

[0065] Step 1026, obtaining the probability of each character in the date text belonging to each preset entity category through the seventh classifier.

[0066] Among them, the preset entity categories can include "others", "year-starting", "mid-year", "year-end", "month-starting", "month-end", "month-only", "day-starting", "day-end" and "day-only", and the data output by the seventh classifier can be L*10 dimensional data, where L is the preset length of the encoder input data.

[0067] In this step, the seventh classifier is used to obtain, according to the target text feature, the first probability that each character in the text to be identified belongs to "year-start" (i.e., the first digit of the to-be-determined year), the second probability that each character in the text to be identified belongs to "year-middle" (for example, when the year is a four-digit number, it belongs to the second digit of the to-be-determined year or the third digit of the to-be-determined year), the third probability that each character belongs to "year-end" (for example, when the year is a four-digit number, it is the fourth digit of the to-be-determined year), the fourth probability that each character in the text to be identified belongs to "month-single", the fifth probability that each character belongs to "month-start", the sixth probability that each character belongs to "month-end", the seventh probability that each character in the text to be identified belongs to "day-single", the eighth probability that each character belongs to "day-start", the ninth probability that each character belongs to "day-end", and the tenth probability that each character in the text to be identified belongs to "others".

[0068] Step 1027: Determine the target entity category corresponding to each character in the date text according to the probability that the character belongs to each preset entity category.

[0069] In this step, the first probability to the tenth probability corresponding to each character can be obtained, and the preset entity category corresponding to the maximum value among the first probability to the tenth probability is used as the target entity category.

[0070] Exemplarily, if the first probability to the tenth probability corresponding to the character "2" are 0.1, 0.3, 0.13, 0.15, 0.22, 0.31, 0.5, 0.4, 0.90, 0.3 respectively, then it is determined that the target entity category corresponding to the character "2" is "Year - End".

[0071] Step 1028, obtain the specified entity category corresponding to each digit in the to - be - determined date.

[0072] In this step, a possible implementation manner is: determine the specified entity type corresponding to each digit according to the position of each digit in the to - be - determined date. For example, when the format of the to - be - determined date is "to - be - determined year - to - be - determined month - to - be - determined day", for the data before the first "-", it is determined that the digit belongs to the digits in the to - be - determined year. In the case where the digit is the first digit in the digits of the to - be - determined year, it is determined that the specified entity category corresponding to the digit is "Year - Start"; in the case where the digit is the last digit in the digits of the to - be - determined year, it is determined that the specified entity category corresponding to the digit is "Year - End"; if it is determined that the digit belongs to the data of the to - be - determined year but is neither the first digit nor the last digit in the digits of the to - be - determined year, it is determined that the specified entity category corresponding to the digit is "Year - Middle"; for the data between the two "-", it is determined that the digit belongs to the digits in the to - be - determined month. In the case where it is determined that the to - be - determined month only includes one digit, it is determined that the specified entity category corresponding to the digit of the to - be - determined month is "Month - Single"; in the case where it is determined that the to - be - determined month includes two digits, if the digit is the first digit in the to - be - determined month, it is determined that the specified entity category corresponding to the digit is "Month - Start", if the digit is the second digit in the to - be - determined month, it is determined that the specified entity category corresponding to the digit is "Month - End"; for the data after the second "-", it is determined that the digit belongs to the digits corresponding to the to - be - determined day. In the case where it is determined that the to - be - determined day only includes one digit, it is determined that the specified entity category corresponding to the digit of the to - be - determined day is "Day - Single"; in the case where it is determined that the to - be - determined month includes two digits, if the digit is the first digit in the to - be - determined day, it is determined that the specified entity category corresponding to the digit is "Day - Start", if the digit is the second digit in the to - be - determined day, it is determined that the specified entity category corresponding to the digit is "Day - End".

[0073] Another possible implementation is: input the pending date into a preset named entity type recognition model, so that the preset named entity recognition model outputs the designated named entity corresponding to each number in the pending date, and the designated named entity can be one of "other", "year-starting", "year-mid", "year-end", "month-starting", "month-end", "month-single", "day-starting", "day-end" and "day-single", and the preset named entity recognition model can be a neural network model or other machine learning models.

[0074] Step 1029, when the designated entity category corresponding to each number in the pending date is consistent with the target entity category of the character corresponding to the number in the date text, the pending date is determined as the target date.

[0075] For example, when the pending date obtained is "2018-7-4", the designated entity category corresponding to the "2" is "year-start", the designated entity category corresponding to the "0" is "year-mid", the designated entity category corresponding to the "1" is "year-mid", the designated entity category corresponding to the "8" is "year-end", the designated entity category corresponding to the "-" is "other", the designated entity category corresponding to the "7" is "month-single", and the designated entity category corresponding to the "4" is "day-single". Similarly, through the method shown in steps 1026 to 1027 above, the target entity category corresponding to each character in 2018-7-4 can be obtained. When the designated entity category corresponding to each character is consistent with the target entity category, the pending date is determined as the target date. When the designated entity category corresponding to a character is inconsistent with the target entity category, a preset prompt information is output, and the preset prompt information is used to characterize that the accuracy of the obtained pending date is low.

[0076] The above technical scheme can determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date, and can effectively and accurately identify the target date in the text to be recognized, thereby effectively ensuring the recognition rate of the date in the text to be recognized, and can also effectively improve the reliability of the date recognition result.

[0077] Figure 4 is a flow chart of a method for training a preset date recognition model shown in an exemplary embodiment of the present disclosure; Figure 4 As shown, the preset date recognition model can be trained in the following way:

[0078] Step 401: Generate multiple date text samples using target corpus text in a preset corpus.

[0079] The date text sample includes a date text label and a named entity label of each character in the date text sample.

[0080] In this step, the target corpus text can be obtained from the preset corpus; by performing a date update operation on the target corpus text, a plurality of pending text samples corresponding to the target corpus text are obtained, and the date update operation includes a date adding action and / or a date replacing action; and the date text sample is generated according to the pending text sample.

[0081] It should be noted that the date adding action includes a year adding action, a month adding action, and a day adding action, and the date replacing action includes a year replacing action, a month replacing action, and a day replacing action. The above-mentioned multiple pending text samples corresponding to the target corpus text obtained by performing a date updating operation on the target corpus text may include:

[0082] When it is determined that the target corpus text does not include year data, the year adding action is performed on the target corpus text, and the added year data is spliced ​​with the target corpus text to obtain multiple first text samples; when it is determined that the target corpus text includes year data, the year replacing action is performed on the target corpus text to obtain multiple first text samples; when it is determined that the first text sample includes month data and day data, the month replacing action is performed on the target corpus text, or the day replacing action is performed on the target corpus text to obtain the pending text sample; when it is determined that the first text sample does not include month data, the month adding action is performed on the target corpus text, and when it is determined that the first text sample does not include day data, the day adding action is performed on the target corpus text, and the added month data and day data are spliced ​​with the target corpus text to obtain the pending text sample.

[0083] In addition, this step also includes the step of automatically generating a date text label and a named entity label for each character in the date text sample, as follows:

[0084] When a date is added to the target corpus text, the first added date is used as the date text label; and / or, when a date is replaced to the target corpus text, the second replaced date is used as the date text label;

[0085] The target position information of each number in the date text label is obtained; and the named entity category label of each character in the date text sample is generated according to the target position information of each number in the date text label.

[0086] It should be noted that, when the format of the date text label is "year-month-day", the target location information may include the number of digits before the first "-", or the number of digits between two "-", or the number of digits after the second "-". If the number is the data before the first "-", it is determined that the number belongs to the number in the year. When the number is the first digit before the first "-", the named entity label corresponding to the number is determined to be "year-start". When the number is the last digit before the first "-", the named entity label corresponding to the number is determined to be "year-end". If it is determined that the number belongs to the middle number in the year, that is, the number belongs to the number before the first "-", but is neither the first digit before the first "-" nor the last digit before the first "-", the named entity label corresponding to the number is determined to be "year-middle"; when the number is the data between two "-", it is determined that the number belongs to the number in the month. When it is determined that the month includes only one digit, the named entity label corresponding to the number of the month is determined to be "month-single". When it is determined that the month includes two digits, If the number is the first digit between two “-”s, the named entity label corresponding to the number is determined to be “month-starting”; if the number is the second digit between the two “-”s, the named entity label corresponding to the number is determined to be “month-ending”; if the number is the data after the second “-”, the number is determined to belong to the number corresponding to the day. When it is determined that the day only includes one digit, the named entity label of the number corresponding to the day is determined to be “day-single”; when it is determined that the day data includes two digits, if the number is the first digit after the second “-”, the named entity label corresponding to the number is determined to be “day-starting”; if the number is the second digit after the second “-”, the named entity label corresponding to the number is determined to be “day-ending”. In addition, the named entity labels of other characters in the date text sample except the characters corresponding to the year digit, month digit, and day digit are determined to be “others”.

[0087] Step 402, using the multiple date text samples as training data, performs model training on a preset initial model to obtain the preset date recognition model, wherein the preset initial model includes an initial year classification module, an initial month classification module, an initial day classification module and an initial character entity category detection module.

[0088] Among them, the preset initial model can include an initial BERT encoder, and the initial year classification module, the initial month classification module, the initial day classification module and the initial character entity category detection module are all coupled with the initial BERT encoder. During the model training process, the model training can be performed using cross entropy as the loss function.

[0089] The above technical solution can automatically synthesize multiple date text samples as training data, which can effectively avoid the problems in related technologies such as difficulty in obtaining training data, low annotation efficiency, and time-consuming and labor-intensive annotation process. At the same time, since it includes an initial year classification module, an initial month classification module, an initial day classification module for date recognition, and an initial character entity category detection module, it can effectively improve the convergence speed of the preset date recognition model, improve the model training efficiency, and effectively ensure the generalization ability of the trained preset date recognition model and the accuracy of the date recognition results.

[0090] Figure 5 is a block diagram of a date recognition device shown in an exemplary embodiment of the present disclosure. Figure 5 As shown, the device may include:

[0091] The first acquisition module 501 is configured to acquire a text to be recognized, where the text to be recognized includes a date text;

[0092] The second acquisition module 502 is configured to input the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model;

[0093] Among them, the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0094] The above technical scheme can determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date, and can effectively and accurately identify the target date in the text to be recognized, thereby effectively ensuring the recognition rate of the date in the text to be recognized, and can also effectively improve the reliability of the date recognition result.

[0095] Optionally, the preset date recognition model is used to: obtain the designated entity category corresponding to each number in the pending date; and determine the pending date as the target date when the designated entity category corresponding to each number in the pending date is consistent with the target entity category of the character corresponding to the number in the date text.

[0096] Optionally, the pending date includes a pending year, a pending month, and a pending day, and the preset date recognition model includes an encoder, and a year classification module, a month classification module, a day classification module, and a character entity category detection module coupled to the encoder;

[0097] The year classification module is used to identify the pending year in the date text, and the year classification module includes multiple classifiers, and different classifiers are used to identify numbers in different positions in the pending year;

[0098] The month classification module is used to identify the undetermined month in the date text;

[0099] The day classification module is used to identify the pending days in the date text;

[0100] The character entity category detection module is used to obtain the target entity category corresponding to each character in the date text.

[0101] Optionally, the year classification module includes a first classifier, a second classifier, a third classifier and a fourth classifier, the month classification module includes a fifth classifier, the day classification module includes a sixth classifier, the character entity category detection module includes a seventh classifier, and the preset date recognition model is used for:

[0102] Acquire, by the encoder, a target text feature corresponding to the text to be recognized, the target text feature including contextual semantic information of the date text;

[0103] The first classifier identifies the first target digit in the year data corresponding to the date text according to the target text feature, the second classifier identifies the second target digit in the year data corresponding to the date text according to the target text feature, the third classifier identifies the third target digit in the year data corresponding to the date text according to the target text feature, and the fourth classifier identifies the fourth target digit in the year data corresponding to the date text according to the target text feature;

[0104] Determine the pending year corresponding to the date text according to the first target digit, the second target digit, the third target digit, and the fourth target digit;

[0105] Identify the pending month corresponding to the month data in the date text according to the target text feature by the fifth classifier;

[0106] Identify the pending day corresponding to the day data in the date text according to the target text feature by the sixth classifier;

[0107] Obtaining, by the seventh classifier, the probability that each character in the date text belongs to each preset entity category;

[0108] The target entity category corresponding to each character in the date text is determined according to the probability that each character in the date text belongs to each preset entity category.

[0109] Optionally, the device further includes a model training module 503, wherein the model training module 503 is configured to:

[0110] Generate multiple date text samples by using target corpus text in a preset corpus, wherein the date text samples include date text labels and named entity labels of each character in the date text samples;

[0111] The preset initial model is trained using the multiple date text samples as training data to obtain the preset date recognition model, wherein the preset initial model includes an initial year classification module, an initial month classification module, an initial day classification module and an initial character entity category detection module.

[0112] Optionally, the model training module 503 is used to: obtain the target corpus text from the preset corpus; obtain multiple pending text samples corresponding to the target corpus text by performing a date update operation on the target corpus text, the date update operation including a date addition action and / or a date replacement action; generate the date text sample based on the pending text sample.

[0113] Optionally, the model training module 503 is used to: obtain preset interference text; add the preset interference text to the pending text sample; and perform a simulated character adhesion operation on the pending text sample after the preset interference text is added to obtain the date text sample.

[0114] Optionally, the model training module 503 is also used to: when a date is added to the target corpus text, use the added first date as the date text label; and / or, when a date replacement is performed on the target corpus text, use the replaced second date as the date text label.

[0115] Optionally, the model training module 503 is further used to: obtain target position information of each number in the date text label; and generate a named entity category label for each character in the date text sample according to the target position information of each number in the date text label.

[0116] The above technical solution can automatically synthesize multiple date text samples as training data, which can effectively avoid the problems in related technologies such as difficulty in obtaining training data and time-consuming and labor-intensive labeling process. At the same time, since it includes an initial year classification module, an initial month classification module, an initial day classification module for date recognition, and an initial character entity category detection module, it can effectively improve the convergence speed of the preset date recognition model, improve the model training efficiency, and effectively ensure the generalization ability of the trained preset date recognition model and the accuracy of the date recognition results.

[0117] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0118] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0119] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0120] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0121] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0122] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with any form or medium of digital data communication (e.g., communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), internets (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.

[0123] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0124] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains the text to be recognized, and the text to be recognized includes a date text; inputs the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model; wherein the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date, wherein the target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0125] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the first acquisition module may also be described as a "module for acquiring text to be recognized, wherein the text to be recognized includes a date text".

[0128] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0129] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0130] According to one or more embodiments of the present disclosure, Example 1 provides a date recognition method, the method comprising:

[0131] Acquire the text to be recognized, wherein the text to be recognized includes a date text;

[0132] Inputting the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model;

[0133] Among them, the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0134] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein determining the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date includes:

[0135] Get the specified entity category corresponding to each number in the pending date;

[0136] In the case where the designated entity category corresponding to each number in the pending date is consistent with the target entity category of the character corresponding to the number in the date text, the pending date is determined as the target date.

[0137] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the pending date includes a pending year, a pending month, and a pending day, and the preset date recognition model includes an encoder, and a year classification module, a month classification module, a day classification module, and a character entity category detection module coupled to the encoder;

[0138] The year classification module is used to identify the pending year in the date text, and the year classification module includes a plurality of classifiers, and different classifiers are used to identify numbers in different positions in the pending year;

[0139] The month classification module is used to identify the undetermined month in the date text;

[0140] The day classification module is used to identify the pending days in the date text;

[0141] The character entity category detection module is used to obtain the target entity category corresponding to each character in the date text.

[0142] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein the year classification module includes a first classifier, a second classifier, a third classifier, and a fourth classifier, the month classification module includes a fifth classifier, the day classification module includes a sixth classifier, the character entity category detection module includes a seventh classifier, and the preset date recognition model is used to:

[0143] Acquiring, by means of the encoder, target text features corresponding to the text to be recognized, wherein the target text features include contextual semantic information of the date text;

[0144] identifying the first target digit in the year data corresponding to the date text according to the target text feature by the first classifier, identifying the second target digit in the year data corresponding to the date text according to the target text feature by the second classifier, identifying the third target digit in the year data corresponding to the date text according to the target text feature by the third classifier, and identifying the fourth target digit in the year data corresponding to the date text according to the target text feature by the fourth classifier;

[0145] Determine the undetermined year corresponding to the date text according to the first target number, the second target number, the third target number, and the fourth target number;

[0146] Identify the undetermined month corresponding to the month data in the date text according to the target text feature by the fifth classifier;

[0147] Identify the pending day corresponding to the day data in the date text according to the target text feature by the sixth classifier;

[0148] Obtaining, by the seventh classifier, the probability that each character in the date text belongs to each preset entity category;

[0149] The target entity category corresponding to each character in the date text is determined according to the probability that each character in the date text belongs to each preset entity category.

[0150] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein the preset date recognition model is trained in the following manner:

[0151] Generate multiple date text samples by using target corpus text in a preset corpus, wherein the date text samples include date text labels and named entity labels of each character in the date text samples;

[0152] The preset initial model is trained using the multiple date text samples as training data to obtain the preset date recognition model, wherein the preset initial model includes an initial year classification module, an initial month classification module, an initial day classification module and an initial character entity category detection module.

[0153] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the step of generating a plurality of date text samples according to a target corpus text in a preset corpus includes:

[0154] Acquire the target corpus text from the preset corpus;

[0155] By performing a date updating operation on the target corpus text, a plurality of pending text samples corresponding to the target corpus text are obtained, wherein the date updating operation includes a date adding action and / or a date replacing action;

[0156] The date text sample is generated according to the pending text sample.

[0157] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein generating the date text sample according to the pending text sample includes:

[0158] Get the preset interference text;

[0159] Adding the preset interference text to the pending text sample;

[0160] A simulated character adhesion operation is performed on the undetermined text sample after the preset interference text is added to obtain the date text sample.

[0161] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 6, wherein generating multiple date text samples according to the target corpus text in the preset corpus further includes:

[0162] When a date is added to the target corpus text, the first added date is used as the date text label; and / or,

[0163] When a date replacement operation is performed on the target corpus text, the second date after replacement is used as the date text label.

[0164] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 6, wherein generating multiple date text samples according to the target corpus text in the preset corpus further includes:

[0165] Get the target position information of each number in the date text label;

[0166] A named entity category label for each character in the date text sample is generated according to the target position information of each number in the date text label.

[0167] According to one or more embodiments of the present disclosure, Example 10 provides a date recognition device, the device comprising:

[0168] A first acquisition module is configured to acquire a text to be recognized, wherein the text to be recognized includes a date text;

[0169] A second acquisition module is configured to input the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model;

[0170] Among them, the preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date. The target entity category is used to characterize whether the character is a designated character related to the date number, and when the character is a designated character related to the date number, the position information of the number corresponding to the character in the date.

[0171] According to one or more embodiments of the present disclosure, Example 11 provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in any one of Examples 1-9 above.

[0172] According to one or more embodiments of the present disclosure, Example 12 provides an electronic device, including:

[0173] a storage device having a computer program stored thereon;

[0174] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-9 above.

[0175] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0176] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0177] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A method for date recognition, characterized in that, The method comprises: Acquire the text to be recognized, wherein the text to be recognized includes a date text; Inputting the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model; The preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date, wherein the target entity category is used to characterize whether the character is a designated character related to the date digit, and when the character is a designated character related to the date digit, the position information of the digit corresponding to the character in the date; The pending date includes a pending year, a pending month, and a pending day, and the preset date recognition model includes an encoder, and a year classification module, a month classification module, a day classification module and a character entity category detection module coupled to the encoder; The year classification module is used to identify the pending year in the date text, and the year classification module includes a plurality of classifiers, and different classifiers are used to identify numbers in different positions in the pending year; The month classification module is used to identify the undetermined month in the date text; The day classification module is used to identify the pending days in the date text; The character entity category detection module is used to obtain the target entity category corresponding to each character in the date text.

2. The method according to claim 1, characterized in that, The step of determining the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date includes: Get the specified entity category corresponding to each number in the pending date; In the case where the designated entity category corresponding to each number in the pending date is consistent with the target entity category of the character corresponding to the number in the date text, the pending date is determined as the target date.

3. The method according to claim 1, characterized in that, The year classification module includes a first classifier, a second classifier, a third classifier and a fourth classifier, the month classification module includes a fifth classifier, the day classification module includes a sixth classifier, the character entity category detection module includes a seventh classifier, and the preset date recognition model is used for: Acquiring, by means of the encoder, target text features corresponding to the text to be recognized, wherein the target text features include contextual semantic information of the date text; identifying the first target digit in the year data corresponding to the date text according to the target text feature by the first classifier, identifying the second target digit in the year data corresponding to the date text according to the target text feature by the second classifier, identifying the third target digit in the year data corresponding to the date text according to the target text feature by the third classifier, and identifying the fourth target digit in the year data corresponding to the date text according to the target text feature by the fourth classifier; Determine the undetermined year corresponding to the date text according to the first target number, the second target number, the third target number, and the fourth target number; Identify the undetermined month corresponding to the month data in the date text according to the target text feature by the fifth classifier; Identify the pending day corresponding to the day data in the date text according to the target text feature by the sixth classifier; Obtaining, by the seventh classifier, the probability that each character in the date text belongs to each preset entity category; The target entity category corresponding to each character in the date text is determined according to the probability that each character in the date text belongs to each preset entity category.

4. The method according to claim 1, characterized in that, The preset date recognition model is trained in the following way: Generate multiple date text samples by using target corpus text in a preset corpus, wherein the date text samples include date text labels and named entity labels of each character in the date text samples; The preset initial model is trained using the multiple date text samples as training data to obtain the preset date recognition model, wherein the preset initial model includes an initial year classification module, an initial month classification module, an initial day classification module and an initial character entity category detection module.

5. The method according to claim 4, characterized in that, The step of generating a plurality of date text samples according to the target corpus text in the preset corpus includes: Acquire the target corpus text from the preset corpus; By performing a date updating operation on the target corpus text, a plurality of pending text samples corresponding to the target corpus text are obtained, wherein the date updating operation includes a date adding action and / or a date replacing action; The date text sample is generated according to the pending text sample.

6. The method according to claim 5, characterized in that, The step of generating the date text sample according to the pending text sample comprises: Get the preset interference text; Adding the preset interference text to the pending text sample; A simulated character adhesion operation is performed on the undetermined text sample after the preset interference text is added to obtain the date text sample.

7. The method according to claim 5, characterized in that, The method of generating a plurality of date text samples according to the target corpus text in the preset corpus also includes: When a date is added to the target corpus text, the first added date is used as the date text label; and / or, When a date replacement operation is performed on the target corpus text, the second date after replacement is used as the date text label.

8. The method according to claim 5, characterized in that The method of generating a plurality of date text samples according to the target corpus text in the preset corpus also includes: Get the target position information of each number in the date text label; A named entity category label for each character in the date text sample is generated according to the target position information of each number in the date text label.

9. A date recognition device, characterized in that: The device comprises: A first acquisition module is configured to acquire a text to be recognized, wherein the text to be recognized includes a date text; A second acquisition module is configured to input the text to be recognized into a preset date recognition model to obtain a target date output by the preset date recognition model; The preset date recognition model is used to identify the pending date corresponding to the date text, obtain the target entity category corresponding to each character in the date text, and determine the target date corresponding to the date text according to the target entity category corresponding to each character in the date text and the pending date, wherein the target entity category is used to characterize whether the character is a designated character related to the date digit, and when the character is a designated character related to the date digit, the position information of the digit corresponding to the character in the date; The pending date includes a pending year, a pending month, and a pending day, and the preset date recognition model includes an encoder, and a year classification module, a month classification module, a day classification module and a character entity category detection module coupled to the encoder; The year classification module is used to identify the pending year in the date text, and the year classification module includes a plurality of classifiers, and different classifiers are used to identify numbers in different positions in the pending year; The month classification module is used to identify the undetermined month in the date text; The day classification module is used to identify the pending days in the date text; The character entity category detection module is used to obtain the target entity category corresponding to each character in the date text.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 8 are implemented.

11. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.