CN114492413A - Text proofreading method and device and electronic equipment - Google Patents
Text proofreading method and device and electronic equipment Download PDFInfo
- Publication number
- CN114492413A CN114492413A CN202111617863.XA CN202111617863A CN114492413A CN 114492413 A CN114492413 A CN 114492413A CN 202111617863 A CN202111617863 A CN 202111617863A CN 114492413 A CN114492413 A CN 114492413A
- Authority
- CN
- China
- Prior art keywords
- entity word
- name
- corrected
- entity
- organ
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 230000001915 proofreading effect Effects 0.000 title abstract description 18
- 210000000056 organ Anatomy 0.000 claims abstract description 129
- 238000012216 screening Methods 0.000 claims abstract description 21
- 238000004590 computer program Methods 0.000 claims description 9
- 230000004044 response Effects 0.000 claims description 9
- 238000012163 sequencing technique Methods 0.000 claims description 2
- 238000011161 development Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 10
- 230000006872 improvement Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000008520 organization Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000001174 ascending effect Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000001737 promoting effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90344—Query processing by using string matching techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Abstract
The embodiment of the application discloses a text proofreading method and device and electronic equipment. One embodiment of the method comprises: inputting the target text into a pre-trained entity word recognition model to obtain entity words in the target text; screening entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ; aiming at each entity word to be modified in at least one entity word to be modified, comparing the entity word to be modified with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be modified; and in the target text, correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text. The embodiment enables the organ names in the corrected article to be more standard and to be more consistent with language logic.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a text proofreading method and device and electronic equipment.
Background
In the official document exchange, except for special examples and format requirements, it is usually required to use the normalized names of the respective organs. Because the organ standardized names are more and the examination is dependent on the experience of the official, the difficulty of examining the whole document is higher and the examination efficiency is lower when the organ names are wrongly written or the names are not standardized.
The relevant official document proofreading mode usually solves the problem of proofreading of the whole name or short name of the party government by an editing distance mode, namely, the character string of the party government to be matched is equal to the character string of the correct institution after being added, deleted and changed within a certain quantity limit, and then the character string is regarded as being matched. The method has the problem of language logic inconsistency, which causes a great amount of false alarms.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a text proofreading method and device and electronic equipment, so that organ names in corrected articles are more standard and more accord with language logic.
In a first aspect, an embodiment of the present disclosure provides a text proofreading method, including: inputting the target text into a pre-trained entity word recognition model to obtain entity words in the target text; screening entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ; aiming at each entity word to be corrected in at least one entity word to be corrected, comparing the entity word to be corrected with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be corrected; and in the target text, correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text.
In a second aspect, an embodiment of the present disclosure provides a text proofreading apparatus, including: the input unit is used for inputting the target text into a pre-trained entity word recognition model to obtain entity words in the target text; the screening unit is used for screening out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ; the comparison unit is used for comparing the entity word to be corrected with the organ name in the preset organ name set aiming at each entity word to be corrected in at least one entity word to be corrected, and determining the organ name matched with the entity word to be corrected; and the correcting unit is used for correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected in the target text to obtain a corrected text.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the text proofing method according to the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the text proofreading method according to the first aspect.
According to the text proofreading method and device and the electronic equipment provided by the embodiment of the disclosure, the target text is input into a pre-trained entity word recognition model to obtain the entity words in the target text; then, screening out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word comprises a organ; then, aiming at each entity word to be modified in the at least one entity word to be modified, comparing the entity word to be modified with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be modified; and finally, in the target text, correcting the at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text. In this way, the organ names in the corrected article are more standard and more consistent with language logic.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is an exemplary system architecture diagram in which various embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a text proofing method according to the present disclosure;
FIG. 3 is a flow diagram of yet another embodiment of a text proofing method according to the present disclosure;
FIG. 4 is a schematic block diagram of one embodiment of a document proofing apparatus according to the present disclosure;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the text proofing method of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 1011, 1012, 1013, a network 102, and a server 103. Network 102 is the medium used to provide communication links between terminal devices 1011, 1012, 1013 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may interact with the server 103 via the network 102 using the terminal devices 1011, 1012, 1013 to send or receive messages or the like, e.g. the user may send target text to the server 103 using the terminal devices 1011, 1012, 1013. Various communication client applications, such as a browser application, a news application, an instant messenger, etc., may be installed on the terminal devices 1011, 1012, 1013.
The terminal devices 1011, 1012, 1013 may first input the target text into a pre-trained entity word recognition model to obtain entity words in the target text; then, screening entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected; then, for each entity word to be modified in the at least one entity word to be modified, comparing the entity word to be modified with the authority name in the preset authority name set, and determining the authority name matched with the entity word to be modified; finally, the at least one entity word to be corrected may be corrected by using the authority name matched with the entity word to be corrected in the target text, so as to obtain a corrected text.
The terminal devices 1011, 1012, 1013 may be hardware or software. When the terminal devices 1011, 1012, 1013 are hardware, they may be various electronic devices having a display screen and supporting information interaction, including but not limited to smart phones, tablet computers, laptop computers, and the like. When the terminal devices 1011, 1012, 1013 are software, they may be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 103 may be a server that provides various services. For example, it may be a background server that collates entity words in the target text. The server 103 may first input the target text into a pre-trained entity word recognition model to obtain entity words in the target text; then, screening entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected; then, for each entity word to be modified in the at least one entity word to be modified, comparing the entity word to be modified with the authority name in the preset authority name set, and determining the authority name matched with the entity word to be modified; finally, the at least one entity word to be corrected may be corrected by using the authority name matched with the entity word to be corrected in the target text, so as to obtain a corrected text.
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the text proofing method provided by the embodiment of the present disclosure may be executed by the server 103, or may be executed by the terminal devices 1011, 1012, 1013. If the text collation method is executed by the server 103, the text collation means may be provided in the server 103. If the text proofing method is executed by the terminal equipment 1011, 1012, 1013, the text proofing means may be provided in the terminal equipment 1011, 1012, 1013.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a text proofing method according to the present disclosure is shown. The text proofreading method comprises the following steps:
In this embodiment, an execution subject of the text proofreading method (for example, the server or the terminal device shown in fig. 1) may input the target text into a pre-trained entity word recognition model, so as to obtain the entity words in the target text. The target text may be a text to be collated, including a document type text of a party institution. The entity word recognition model can be used for representing the corresponding relation between the text and the entity words in the text. The entity word recognition model may be a model obtained by training a pre-training language Representation model based on BERT (Bidirectional Encoder Representation based on a converter) by using Deep Neural Networks (DNNs).
Here, the entity word recognition model may output a category to which each entity word belongs while outputting the entity words in the target text, and the category may include, but is not limited to: name, region, institution and job.
In this embodiment, the executing entity may screen out entity words that meet a preset first condition from the entity words in the target text obtained in step 201, so as to obtain at least one entity word to be modified. The category of the entity word to be modified in the at least one entity word to be modified may include a organ. Here, the first condition may include that the category of the entity word is a organ, so that the entity word with the category of the organ can be screened from the entity words in the target text.
In this embodiment, for each entity word to be modified in the at least one entity word to be modified, the execution main body may compare the entity word to be modified with a authority name in a preset authority name set, and determine an authority name matched with the entity word to be modified. The name of the organization in the organization name set may be a preset normalized name of the organization.
Specifically, the execution main body may sort the characters in the entity word to be corrected according to a uniform code (Unicode), so as to obtain a target character string. Unicode, which may also be referred to as ten thousand or unicode, is a character code used on computers that sets a uniform and unique binary code for each character in each language. Here, the characters in the physical word to be modified may be sorted in the ascending order of unicode, or may be sorted in the ascending order of unicode.
Then, the execution subject may search for a character string that is the same as the target character string in the sorted character strings corresponding to the organ names in the organ name set, and determine the organ name corresponding to the searched character string as the organ name matched with the entity word to be corrected. The sorted character string corresponding to the organ name may be obtained by sorting the organ names according to a unicode. It should be noted that, if the characters in the entity word to be corrected are sorted in the descending order of the unicode, the sorted character strings corresponding to the organ names are also sorted in the descending order of the unicode. If the characters in the entity word to be corrected are sorted according to the sequence of the uniform codes from small to large, the sorted character strings corresponding to the organ names are also sorted according to the sequence of the uniform codes from small to large. The office name thus matched can be used to correct the case where the order of characters is reversed.
And 204, correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected in the target text to obtain a corrected text.
In this embodiment, the execution main body may correct the at least one entity word to be corrected by using a name of a organ matching the entity word to be corrected in the target text, so as to obtain a corrected text. Specifically, the execution subject may replace the entity word to be modified in the target text with a name of a government organ matching the entity word to be modified.
As an example, if the target text is "national reform committee actively explores effective measures for promoting industry growth sustainable development under new situation", the entity word to be modified is "national reform committee", and the organ name matching "national reform committee" is "national development and reform committee", the executing body may replace "national reform committee" in the target text with "national development and reform committee", and obtain the modified text "national development and reform committee actively explores effective measures for promoting industry growth sustainable development under new situation".
The method provided by the embodiment of the disclosure obtains the entity words in the target text by inputting the target text into a pre-trained entity word recognition model; then, screening out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word comprises a organ; then, aiming at each entity word to be modified in the at least one entity word to be modified, comparing the entity word to be modified with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be modified; and finally, in the target text, correcting the at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text. In this way, the organ names in the corrected article are more standard and more consistent with language logic.
In some alternative implementations, the first condition may include at least one of: the character length of the entity word is larger than a preset character length threshold value, the character of the entity word is a Chinese character, and the position where the entity word is located is not a target position, wherein the target position can include a text-sending character number and a book name number. For example, if the character length threshold is 2, in this case, the execution main body may screen out entity words with a character length greater than 2 from the entity words in the target text, so as to filter out entity words with character lengths of 1 and 2. The execution main body can screen out entity words with characters as Chinese characters from the entity words in the target text, so that entity words with non-Chinese characters are filtered out. Because the official short names which do not accord with the regulation often appear in the text-sending character number and the book name number, but the official short names do not need to be revised usually, the execution main body can screen out the entity words in the position which are not in the text-sending character number and the book name number from the entity words in the target text, so that the entity words in the text-sending character number and the book name number are filtered out. Here, the execution subject may input the target text into a pre-trained text type number recognition model to obtain a text type number in the target text, and then, the execution subject may filter out entity words in the text type number.
It should be noted that, the execution main body may screen out the entity words whose character length is greater than a preset character length threshold, or whose characters are chinese characters, or whose positions are not the target positions, to obtain at least one entity word to be corrected; or screening the entity words of which the character length is greater than the preset character length threshold, the characters of the entity words are Chinese characters, and the positions of the entity words are not the target positions to obtain at least one entity word to be corrected. The first condition may be set based on actual conditions.
In some optional implementations, before comparing the entity word to be modified with the authority name in the preset authority name set, the executing entity may determine whether the target text contains a region name. The executing body may use a region identification method, for example, to search the target text for whether a region name in a preset region name set exists, or to input the target text into a pre-trained region name identification model to obtain the region name in the target text. If the target text is an article, the execution subject may identify a region name from a title of the article; if the article title includes a region name, the region name can be determined as the region name of the target text. If the article title does not have the region name, the region name can be identified from the article text, and if the region names of at least two regions are identified from the article text, the region completion of the entity word to be corrected can be avoided.
If the target text contains a region name, the execution main body may determine whether the last character of the region name is the first character of the entity word to be corrected. If the last character of the region name is the first character of the entity word to be corrected, the execution main body can perform region completion on the entity word to be corrected by using the region name, and take the entity word after the region completion as the entity word to be corrected. As an example, if the domain name is referred to as "beijing city" and the entity word to be modified is "city government", the execution main body may determine that the last character of "beijing city" is the first character of "city government". At this time, the executive body can perform regional completion on the city government to obtain the regional completed entity word "beijing city government".
With further reference to FIG. 3, a flow 300 of yet another embodiment of a text proofing method is shown. The process 300 of the text proofing method includes the following steps:
In the present embodiment, the steps 301-302 can be performed in a similar manner to the steps 201-202, and will not be described herein again.
In this embodiment, for each entity word to be corrected in at least one entity word to be corrected, an execution subject (for example, a server or a terminal device shown in fig. 1) of the text proofreading method may split the entity word to be corrected, so as to obtain a split result. Here, the above-mentioned split result may include at least one of the following components: prefix, region, vector name, and lattice-level name. The territory generally indicates a geographic location or a management scope, the vector name generally indicates a management content, and the grid-level name generally indicates a specification level.
Here, the execution body may first find the region. The prefix may then be found before the zone. Then, it can be looked up after the zone whether a lattice-level name exists, for example, it can be determined whether a lattice-level name exists after the zone by using a preset lattice-level name set. Typically, the lattice names are at the end of the custom entity word. Finally, the vector name can be found in the middle of the region and grid-level names.
In some cases, the split result may further include a second vector name and/or a second lattice-level name. The second lattice level name may be present intermediate the vector name and the lattice level name. The second vector name may exist between the grid-level name and the region, or may exist before the grid-level name if the region does not exist.
As an example, the entity word to be corrected "zhong beijing city discipline examination committee office" may be split into zhong (prefix) beijing city (territorial) discipline examination (vector name) committee (second grid-level name) office (grid-level name).
In this embodiment, for each office name in the preset office name set, the execution body may detect whether the entity word to be modified and the office name satisfy a preset second condition. The second condition may include: the entity word to be corrected and the organ name both contain the same region or do not contain the region, the contained components of the split result are the same, and the organ name contains each character in the entity word to be corrected. The fact that all the words contain the same region or do not contain the region generally means that one of the word of the entity to be corrected and the name of the organization does not contain the region, and the other does not contain the region, and if one of the word of the entity to be corrected and the name of the organization contains the region, the other needs to contain the same region. The component parts of the contained split result are the same, which generally means that if one of the entity word to be modified and the organ name only contains the region, the vector name and the lattice-level name, the other one also only contains the region, the vector name and the lattice-level name. The fact that the organ name contains the individual characters in the entity word to be modified generally means that each character in the entity word to be modified is contained in the organ name and the order cannot be reversed.
If it is detected that the entity word to be modified and the authority name satisfy the second condition, the execution subject may determine the authority name as the authority name matched with the entity word to be modified.
As an example, if the entity word to be modified is "national committee for development and improvement", the entity word to be modified is split to obtain the national committee for development and improvement (a grid-level name), if it is determined that "national committee for development and improvement" and "national committee for development and improvement" do not include a region, and that "national committee for development and improvement" and "national committee for development and improvement" include the same split result and only include the grid-level name, and that "national committee for development and improvement" includes each character in "national committee for development and improvement" and the order is not reversed, it may be determined that "national committee for development and improvement" matches "national committee for development and improvement".
And 305, correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected in the target text to obtain a corrected text.
In this embodiment, step 305 may be performed in a similar manner as step 204, and is not described herein again.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the process 300 of the text proofreading method in this embodiment embodies the step of splitting the entity word to be corrected, and if it is detected that the entity word to be corrected and the authority name satisfy the preset second condition, determining the authority name as the authority name matched with the entity word to be corrected. Therefore, the scheme described in the embodiment can improve the accuracy of organ name matching, so that the organ names in the corrected article are more standardized.
In some optional implementation manners, after the to-be-corrected entity word is split to obtain the split result, if it is detected in step 304 that the to-be-corrected entity word and each organ name in the preset organ name set do not satisfy the second condition, the execution main body may sort the characters in the to-be-corrected entity word according to a unicode to obtain a target character string. Unicode, which may also be referred to as ten thousand or unicode, is a character code used on computers that sets a uniform and unique binary code for each character in each language. Here, the characters in the physical word to be modified may be sorted in the ascending order of unicode, or may be sorted in the ascending order of unicode.
Then, the execution subject may search a character string that is the same as the target character string in the sorted character string corresponding to each office name in the office name set, and determine the office name corresponding to the searched character string as the office name matching the entity word to be modified. The sorted character string corresponding to the organ name may be obtained by sorting the organ names according to a unicode. It should be noted that, if the characters in the entity word to be corrected are sorted in the descending order of the unicode, the sorted character strings corresponding to the organ names are also sorted in the descending order of the unicode. If the characters in the entity word to be corrected are sorted according to the sequence of the uniform codes from small to large, the sorted character strings corresponding to the organ names are also sorted according to the sequence of the uniform codes from small to large.
With further reference to fig. 4, as an implementation of the method shown in the above figures, the present application provides an embodiment of a text proofreading apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 4, the text proofing apparatus 400 of the present embodiment includes: input section 401, screening section 402, comparing section 403, and correcting section 404. The input unit 401 is configured to input a target text into a pre-trained entity word recognition model to obtain entity words in the target text; the screening unit 402 is configured to screen out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, where a category of the entity word to be corrected includes a organ; the comparison unit 403 is configured to compare, for each entity word to be modified in the at least one entity word to be modified, the entity word to be modified with a department name in a preset department name set, and determine a department name matched with the entity word to be modified; the correcting unit 404 is configured to correct at least one entity word to be corrected in the target text by using the authority name matched with the entity word to be corrected, so as to obtain a corrected text.
In this embodiment, the specific processing of the input unit 401, the filtering unit 402, the comparing unit 403 and the correcting unit 404 of the text proofreading apparatus 400 may refer to step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2.
In some alternative implementations, the first condition includes at least one of: the character length of the entity word is larger than a preset character length threshold value; the characters of the entity words are Chinese characters; the position of the entity word is not the target position, wherein the target position comprises the inside of the letter number and the inside of the book name number.
In some optional implementations, the text proofing apparatus 400 further includes: a first determining unit (not shown), a second determining unit (not shown), and a complementing unit (not shown). The first determining unit is used for determining whether the target text contains a region name; the second determining unit is used for determining whether the last character of the region name is the first character of the entity word to be corrected or not if the target text contains the region name; and the completion unit is used for performing region completion on the entity word to be corrected by using the region name if the last character of the region name is the first character of the entity word to be corrected, and taking the entity word after the region completion as the entity word to be corrected.
In some optional implementations, the comparing unit 403 may be further configured to compare the entity word to be modified with the authority name in the preset authority name set, and determine the authority name matching the entity word to be modified by: the comparing unit 403 may split the entity word to be modified to obtain a split result, where the split result includes at least one of the following components: prefix, region, vector name and grid-level name; for each organ name in a preset organ name set, in response to detecting that the entity word to be modified and the organ name satisfy a preset second condition, determining the organ name as the organ name matched with the entity word to be modified, wherein the second condition includes: the entity word to be corrected and the organ name both contain the same region or do not contain the region, the contained components of the split result are the same, and the organ name contains each character in the entity word to be corrected.
In some optional implementation manners, the comparing unit 403 may be further configured to, in response to detecting that the entity word to be modified and each authority name in the preset authority name set do not satisfy the second condition, sort the characters in the entity word to be modified according to the unicode to obtain the target character string; and searching the character strings which are the same as the target character strings in the sorted character strings corresponding to the organ names in the organ name set, and determining the organ names corresponding to the searched character strings as the organ names matched with the entity word to be corrected, wherein the sorted character strings corresponding to the organ names are obtained by sorting the organ names according to the uniform code.
Referring now to fig. 5, a schematic diagram of an electronic device (e.g., the server or terminal device of fig. 1) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 5 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: inputting the target text into a pre-trained entity word recognition model to obtain entity words in the target text; screening entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ; aiming at each entity word to be modified in at least one entity word to be modified, comparing the entity word to be modified with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be modified; and in the target text, correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
According to one or more embodiments of the present disclosure, there is provided a text proofreading method including: inputting the target text into a pre-trained entity word recognition model to obtain entity words in the target text; screening entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ; aiming at each entity word to be modified in at least one entity word to be modified, comparing the entity word to be modified with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be modified; and in the target text, correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text.
According to one or more embodiments of the present disclosure, the first condition includes at least one of: the character length of the entity word is larger than a preset character length threshold value; the characters of the entity words are Chinese characters; the position of the entity word is not the target position, wherein the target position comprises the inside of the letter number and the inside of the book name number.
According to one or more embodiments of the present disclosure, before comparing the entity word to be modified with the authority name in the preset authority name set, the method further includes: determining whether the target text contains a region name; if yes, determining whether the last character of the region name is the first character of the entity word to be corrected; if so, the region name is utilized to perform region completion on the entity word to be corrected, and the entity word after the region completion is used as the entity word to be corrected.
According to one or more embodiments of the present disclosure, comparing the entity word to be modified with the authority name in the preset authority name set, and determining the authority name matched with the entity word to be modified includes: splitting the entity word to be modified to obtain a splitting result, wherein the splitting result comprises at least one of the following components: prefix, region, vector name and grid-level name; aiming at each organ name in a preset organ name set, in response to the fact that the detected entity word to be corrected and the organ name meet a preset second condition, determining the organ name as the organ name matched with the entity word to be corrected, wherein the second condition comprises the following steps: the entity word to be corrected and the organ name both contain the same region or do not contain the region, the contained components of the split result are the same, and the organ name contains each character in the entity word to be corrected.
According to one or more embodiments of the present disclosure, after splitting the entity word to be modified to obtain a splitting result, the method further includes: in response to the fact that the entity word to be modified and all organ names in the preset organ name set do not meet the second condition, sequencing the characters in the entity word to be modified according to the uniform code to obtain a target character string; and searching the character strings which are the same as the target character strings in the sorted character strings corresponding to the organ names in the organ name set, and determining the organ names corresponding to the searched character strings as the organ names matched with the entity word to be corrected, wherein the sorted character strings corresponding to the organ names are obtained by sorting the organ names according to the uniform code.
According to one or more embodiments of the present disclosure, there is provided a text proofing apparatus including: the input unit is used for inputting the target text into a pre-trained entity word recognition model to obtain entity words in the target text; the screening unit is used for screening out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ; the comparison unit is used for comparing the entity word to be corrected with the organ name in the preset organ name set aiming at each entity word to be corrected in at least one entity word to be corrected, and determining the organ name matched with the entity word to be corrected; and the correcting unit is used for correcting at least one entity word to be corrected by using the organ name matched with the entity word to be corrected in the target text to obtain a corrected text.
According to one or more embodiments of the present disclosure, the first condition includes at least one of: the character length of the entity word is larger than a preset character length threshold value; the characters of the entity words are Chinese characters; the position of the entity word is not the target position, wherein the target position comprises the inside of the letter number and the inside of the book name number.
According to one or more embodiments of the present disclosure, the apparatus further comprises: the first determining unit is used for determining whether the target text contains the region name; the second determining unit is used for determining whether the last character of the region name is the first character of the entity word to be corrected or not if the target text contains the region name; and the completion unit is used for performing region completion on the entity word to be corrected by using the region name if the last character of the region name is the first character of the entity word to be corrected, and taking the entity word after the region completion as the entity word to be corrected.
According to one or more embodiments of the present disclosure, the comparing unit is further configured to compare the entity word to be corrected with the authority name in the preset authority name set, and determine the authority name matched with the entity word to be corrected by: splitting the entity word to be modified to obtain a splitting result, wherein the splitting result comprises at least one of the following components: prefix, region, vector name and grid-level name; for each organ name in a preset organ name set, in response to detecting that the entity word to be modified and the organ name satisfy a preset second condition, determining the organ name as the organ name matched with the entity word to be modified, wherein the second condition includes: the entity word to be corrected and the organ name both contain the same region or do not contain the region, the contained components of the split result are the same, and the organ name contains each character in the entity word to be corrected.
According to one or more embodiments of the present disclosure, the comparison unit is further configured to, in response to detecting that the entity word to be modified and each organ name in the preset organ name set do not satisfy the second condition, sort the characters in the entity word to be modified according to the unicode to obtain the target character string; and searching the character strings which are the same as the target character strings in the sorted character strings corresponding to the organ names in the organ name set, and determining the organ names corresponding to the searched character strings as the organ names matched with the entity word to be corrected, wherein the sorted character strings corresponding to the organ names are obtained by sorting the organ names according to the uniform code.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an input unit, a screening unit, a comparison unit, and a correction unit. The names of these units do not form a limitation on the unit itself in some cases, for example, the input unit may also be described as "a unit that inputs a target text into a pre-trained entity word recognition model to obtain an entity word in the target text".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.
Claims (10)
1. A text proofing method, comprising:
inputting a target text into a pre-trained entity word recognition model to obtain entity words in the target text;
screening out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ;
aiming at each entity word to be modified in the at least one entity word to be modified, comparing the entity word to be modified with the authority name in a preset authority name set, and determining the authority name matched with the entity word to be modified;
and in the target text, correcting the at least one entity word to be corrected by using the organ name matched with the entity word to be corrected to obtain a corrected text.
2. The method of claim 1, wherein the first condition comprises at least one of:
the character length of the entity word is larger than a preset character length threshold value;
the characters of the entity words are Chinese characters;
the position of the entity word is not a target position, wherein the target position comprises a text number and a book title number.
3. The method of claim 1, wherein before comparing the entity word to be modified with the authority name in the preset authority name set, the method further comprises:
determining whether the target text contains a region name;
if yes, determining whether the last character of the region name is the first character of the entity word to be corrected;
if so, carrying out region completion on the entity word to be corrected by using the region name, and taking the entity word after the region completion as the entity word to be corrected.
4. The method as claimed in any one of claims 1 to 3, wherein the comparing the entity word to be modified with the authority name in the preset authority name set to determine the authority name matching the entity word to be modified comprises:
splitting the entity word to be modified to obtain a splitting result, wherein the splitting result comprises at least one of the following components: prefix, region, vector name and grid-level name;
for each organ name in a preset organ name set, in response to detecting that the entity word to be modified and the organ name satisfy a preset second condition, determining the organ name as the organ name matched with the entity word to be modified, wherein the second condition includes: the entity word to be corrected and the organ name both contain the same region or do not contain the region, the contained components of the split result are the same, and the organ name contains each character in the entity word to be corrected.
5. The method according to claim 4, wherein after the splitting the entity word to be modified to obtain a splitting result, the method further comprises:
in response to the fact that the entity word to be modified and all organ names in the preset organ name set do not meet the second condition, sequencing the characters in the entity word to be modified according to the uniform code to obtain a target character string;
and searching the character strings which are the same as the target character strings in the sorted character strings corresponding to the organ names in the organ name set, and determining the organ names corresponding to the searched character strings as the organ names matched with the entity words to be corrected, wherein the sorted character strings corresponding to the organ names are obtained by sorting the organ names according to the uniform codes.
6. A text proofing apparatus, comprising:
the input unit is used for inputting a target text into a pre-trained entity word recognition model to obtain entity words in the target text;
the screening unit is used for screening out entity words meeting a preset first condition from the entity words in the target text to obtain at least one entity word to be corrected, wherein the category of the entity word to be corrected comprises a organ;
the comparison unit is used for comparing the entity word to be corrected with the organ name in the preset organ name set aiming at each entity word to be corrected in the at least one entity word to be corrected, and determining the organ name matched with the entity word to be corrected;
and the correcting unit is used for correcting the at least one entity word to be corrected by using the organ name matched with the entity word to be corrected in the target text to obtain a corrected text.
7. The apparatus of claim 6, wherein the first condition comprises at least one of:
the character length of the entity word is larger than a preset character length threshold value;
the characters of the entity words are Chinese characters;
the position of the entity word is not a target position, wherein the target position comprises a text number and a book name number.
8. The apparatus of claim 6, further comprising:
a first determination unit, configured to determine whether a region name is included in the target text;
a second determining unit, configured to determine whether a last character of the region name is a first character of the entity word to be corrected, if the target text includes the region name;
and the completion unit is used for performing region completion on the entity word to be corrected by using the region name if the last character of the region name is the first character of the entity word to be corrected, and taking the entity word after the region completion as the entity word to be corrected.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111617863.XA CN114492413A (en) | 2021-12-27 | 2021-12-27 | Text proofreading method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111617863.XA CN114492413A (en) | 2021-12-27 | 2021-12-27 | Text proofreading method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114492413A true CN114492413A (en) | 2022-05-13 |
Family
ID=81496854
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111617863.XA Pending CN114492413A (en) | 2021-12-27 | 2021-12-27 | Text proofreading method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114492413A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170133010A1 (en) * | 2013-05-30 | 2017-05-11 | Promptu Systems Corporation | Systems and methods for adaptive proper name entity recognition and understanding |
CN107357779A (en) * | 2017-06-27 | 2017-11-17 | 北京神州泰岳软件股份有限公司 | A kind of method and device for obtaining organization names |
CN111079434A (en) * | 2019-12-05 | 2020-04-28 | 苏州朗动网络科技有限公司 | Method, equipment and storage medium for automatic company name mapping |
CN111694823A (en) * | 2020-05-15 | 2020-09-22 | 平安科技(深圳)有限公司 | Organization standardization method and device, electronic equipment and storage medium |
CN111723575A (en) * | 2020-06-12 | 2020-09-29 | 杭州未名信科科技有限公司 | Method, device, electronic equipment and medium for recognizing text |
-
2021
- 2021-12-27 CN CN202111617863.XA patent/CN114492413A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170133010A1 (en) * | 2013-05-30 | 2017-05-11 | Promptu Systems Corporation | Systems and methods for adaptive proper name entity recognition and understanding |
CN107357779A (en) * | 2017-06-27 | 2017-11-17 | 北京神州泰岳软件股份有限公司 | A kind of method and device for obtaining organization names |
CN111079434A (en) * | 2019-12-05 | 2020-04-28 | 苏州朗动网络科技有限公司 | Method, equipment and storage medium for automatic company name mapping |
CN111694823A (en) * | 2020-05-15 | 2020-09-22 | 平安科技(深圳)有限公司 | Organization standardization method and device, electronic equipment and storage medium |
CN111723575A (en) * | 2020-06-12 | 2020-09-29 | 杭州未名信科科技有限公司 | Method, device, electronic equipment and medium for recognizing text |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20240078386A1 (en) | Methods and systems for language-agnostic machine learning in natural language processing using feature extraction | |
CN110969012B (en) | Text error correction method and device, storage medium and electronic equipment | |
CN110413742B (en) | Resume information duplication checking method, device, equipment and storage medium | |
CN113470619B (en) | Speech recognition method, device, medium and equipment | |
US20210110111A1 (en) | Methods and systems for providing universal portability in machine learning | |
CN109933217B (en) | Method and device for pushing sentences | |
CN114385780B (en) | Program interface information recommendation method and device, electronic equipment and readable medium | |
CN111767740A (en) | Sound effect adding method and device, storage medium and electronic equipment | |
CN111680761B (en) | Information feedback method and device and electronic equipment | |
CN115270717A (en) | Method, device, equipment and medium for detecting vertical position | |
US11482211B2 (en) | Method and apparatus for outputting analysis abnormality information in spoken language understanding | |
CN114036921A (en) | Policy information matching method and device | |
CN109726398B (en) | Entity identification and attribute judgment method, system, equipment and medium | |
CN110659208A (en) | Test data set updating method and device | |
CN111555960A (en) | Method for generating information | |
CN114840634B (en) | Information storage method and device, electronic equipment and computer readable medium | |
CN107656627B (en) | Information input method and device | |
CN113393288B (en) | Order processing information generation method, device, equipment and computer readable medium | |
CN113868538B (en) | Information processing method, device, equipment and medium | |
CN115618808A (en) | Document typesetting method and device, electronic equipment and storage medium | |
CN114492413A (en) | Text proofreading method and device and electronic equipment | |
CN112509581B (en) | Error correction method and device for text after voice recognition, readable medium and electronic equipment | |
CN111339776B (en) | Resume parsing method and device, electronic equipment and computer-readable storage medium | |
CN114020896A (en) | Intelligent question and answer method, system, electronic equipment and storage medium | |
CN112115720A (en) | Method, device, terminal equipment and medium for determining association relation between entities |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |