CN113553834A - Text error correction method and device, electronic equipment and storage medium - Google Patents

Text error correction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113553834A
CN113553834A CN202110740864.7A CN202110740864A CN113553834A CN 113553834 A CN113553834 A CN 113553834A CN 202110740864 A CN202110740864 A CN 202110740864A CN 113553834 A CN113553834 A CN 113553834A
Authority
CN
China
Prior art keywords
semantic representation
text
corrected
named entities
key information
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.)
Granted
Application number
CN202110740864.7A
Other languages
Chinese (zh)
Other versions
CN113553834B (en
Inventor
张睿卿
何中军
李芝
吴华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110740864.7A priority Critical patent/CN113553834B/en
Publication of CN113553834A publication Critical patent/CN113553834A/en
Application granted granted Critical
Publication of CN113553834B publication Critical patent/CN113553834B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The disclosure discloses a text error correction method and device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the technical field of artificial intelligence such as natural language processing and deep learning. The specific implementation scheme is as follows: acquiring a text to be corrected, and encoding the text to be corrected to acquire a first semantic representation of the text to be corrected; acquiring context information of a document where a text to be corrected is located, and generating a key information map of the document according to the context information; modifying the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected; and generating the corrected target text of the text to be corrected according to the target semantic representation. The text error correction method and the text error correction device can improve the text error correction efficiency and accuracy, and further improve the text error correction effect.

Description

Text error correction method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of artificial intelligence techniques such as natural language processing and deep learning.
Background
Text error correction is a fundamental problem in natural language processing, and can be usually preceded by other natural language processing tasks such as text retrieval, text classification or machine translation to improve the effectiveness of input text and prevent adverse effects caused by misspelling. In the related technology, the error correction work is mainly performed on a single sentence text, and the related content which can assist the current sentence in error correction is not utilized in the text, so that some errors cannot be recalled, and the effect of text error correction is influenced.
Disclosure of Invention
The disclosure provides a text error correction method, a text error correction device, an electronic device and a storage medium.
According to an aspect of the present disclosure, there is provided a text error correction method including:
acquiring a text to be corrected, and encoding the text to be corrected to acquire a first semantic representation of the text to be corrected;
acquiring context information of a document where a text to be corrected is located, and generating a key information map of the document according to the context information;
modifying the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected;
and generating the corrected target text of the text to be corrected according to the target semantic representation.
The text error correction method and the text error correction device can improve the text error correction efficiency and accuracy, and further improve the text error correction effect.
According to another aspect of the present disclosure, there is provided a text error correction apparatus including:
the acquisition module is used for acquiring a text to be corrected and encoding the text to be corrected so as to acquire a first semantic representation of the text to be corrected;
the generating module is used for acquiring the context information of the document where the text to be corrected is located and generating a key information map of the document according to the context information;
the processing module is used for correcting the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected;
and the error correction module is used for generating a target text after error correction of the text to be corrected according to the target semantic representation.
According to another aspect of the present disclosure, there is provided an electronic device comprising at least one processor, and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the text correction method of the first aspect of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the text error correction method of the first aspect of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the text correction method of an embodiment of the first aspect of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow diagram of a text correction method according to one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a text correction method according to one embodiment of the present disclosure;
FIG. 3 is a flow diagram of a text correction method according to another embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a text correction method according to another embodiment of the present disclosure;
FIG. 5 is a flow diagram of a text correction method according to another embodiment of the present disclosure;
FIG. 6 is a flow diagram of a text correction method according to another embodiment of the present disclosure;
FIG. 7 is a block diagram of a text correction device according to one embodiment of the present disclosure;
FIG. 8 is a block diagram of an electronic device for implementing a text correction method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The following briefly describes the technical field to which the disclosed solution relates:
the computer technology is very extensive, and can be roughly divided into several aspects of computer system technology, computer machine component technology, computer component technology and computer assembly technology. The computer technology comprises the following steps: the basic principle of the operation method, the design of an arithmetic unit, an instruction system, the design of a Central Processing Unit (CPU), the pipeline principle and the application thereof in the CPU design, a storage system, a bus and input and output.
The computer technology refers to technical methods and technical means applied in the field of computers, or refers to hardware technology, software technology and application technology thereof. The computer technology has obvious comprehensive characteristics, is closely combined with electronic engineering, applied physics, mechanical engineering, modern communication technology, mathematics and the like, and develops quickly.
Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will relate to natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics, but has important difference. Natural language processing is not a general study of natural language but is directed to the development of computer systems, and particularly software systems therein, that can efficiently implement natural language communications. It is thus part of computer science.
The natural language processing is mainly applied to the aspects of machine translation, public opinion monitoring, automatic summarization, viewpoint extraction, text classification, question answering, text semantic comparison, voice recognition and the like.
Fig. 1 is a flowchart of a text error correction method according to an embodiment of the present disclosure, as shown in fig. 1, the method includes the following steps:
s101, acquiring a text to be corrected, and encoding the text to be corrected to acquire a first semantic representation of the text to be corrected.
Firstly, a text to be corrected is obtained, optionally, the text to be corrected may be text information input by a user, text information obtained by recognition according to voice information of the user, or text information recognized from an image input by the user.
In some implementations, taking the simultaneous interpretation scenario as an example, when a user speaks, the user performs speech recognition on the content of his speech through the speech recognition model, and the speech recognition model outputs recognized words.
Further, the encoding process of the error correction text is as follows:
hx=Encode(x),hx∈RT×d
wherein x is a text to be corrected, namely a sentence fused with key information; t is the sentence length. That is, h to be generated after encoding the error correction textxAs a first semantic representation of the error corrected text.
S102, obtaining context information of a document where the text to be corrected is located, and generating a key information map of the document according to the context information.
Generally, the semantics of the text to be corrected existing in the document are not independent, and the actual semantics of the text to be corrected often have close relation with the context of the text to be corrected, that is, the semantics of the text to be corrected depends on the context. In the embodiment of the disclosure, the context information of the text to be corrected can be extracted from the document, and the extracted context information can influence some semantics or all semantics of the text to be corrected. Alternatively, the context information may be text information of the entire document excluding the text to be corrected, or may be text information that is closer to the text to be corrected.
The key information is an important item in text analysis, and is extracted from the redundant text information, which is helpful for the subsequent text error correction processing. In the embodiment of the disclosure, the key information in the context information is extracted, the incidence relation between the key information is obtained, and then the key information is used as a node, the path (edge) between the nodes is determined according to the incidence relation, and a key information map is constructed.
Fig. 2 is a schematic diagram of a key information graph provided in an embodiment of the present disclosure, as shown in fig. 2, the key information graph is a directed connected graph and may be represented by G ═ V, E, where V represents a node and E represents an edge. Explaining by taking the key information 'Face + +' as an example, if the key information is 'Face + +' in response, then taking 'Face + +' as a node, and further confirming the association relationship between the key information 'Face + +' and each piece of other key information, in the embodiment of the disclosure, the key information 'Face + +' associates the key information 'Face recognition', so that the key information map has one edge of the node 'Face + +' pointing to the node 'Face recognition'; the key information "company a" is associated with the key information "Face + +", so there is an edge in the key information graph where the node "company a" points to the node "Face + +".
S103, modifying the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected.
In practice, the error is mainly caused by the similarity between the wrong word and the correct word, such as pronunciation, font, etc., which is likely to cause confusion. Because the semantics of the text to be corrected depends on the context information, the semantics of the text to be corrected in the context information are often key information rather than non-key information in the uplink text information.
In the embodiment of the disclosure, the key information map is generated based on the context information, that is, the key information, which is the essential content affecting the text to be corrected, is extracted from the context information, and further, the key information map may show the correlation between the key information and the key information, so that the first semantic representation of the text to be corrected may be corrected by using the key information map to obtain the target semantic representation of the text to be corrected.
Optionally, semantics represented by the key information in the key information map are extracted, and the first semantic information of the text to be corrected is corrected according to the semantics represented by the key information, for example, the represented semantic information and the first semantic information may be spliced or fused to obtain a target speech representation of the text to be corrected.
And S104, generating the corrected target text of the text to be corrected according to the target semantic representation.
And processing the target semantic representation input mapping (Softmax) layer, further correcting wrong words in the text to be corrected, and generating the corrected target text.
The following illustrates a process of generating a target text after error correction of a text to be corrected. In some implementations, if the text to be corrected is "it includes a series of problems such as joint recognition", the target text "it includes a series of problems such as key recognition" is generated after correcting the text to be corrected "it includes a series of problems such as joint recognition" based on the key information map shown in fig. 2.
In the embodiment of the disclosure, a text to be corrected is obtained and encoded to obtain a first semantic representation of the text to be corrected; acquiring context information of a document where a text to be corrected is located, and generating a key information map of the document according to the context information; modifying the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected; and generating the corrected target text of the text to be corrected according to the target semantic representation. The text error correction method and the text error correction device can improve the text error correction efficiency and accuracy, and further improve the text error correction effect.
Fig. 3 is a flowchart of a text error correction method according to another embodiment of the present disclosure, and as shown in fig. 3, on the basis of the above embodiment, the method corrects the first semantic representation based on the key information map to obtain a target semantic representation of the text to be error corrected, and further includes the following steps:
s301, acquiring a second semantic representation of the key information map.
In the embodiment of the disclosure, an adjacency matrix and a degree matrix between nodes in the key information map are determined, and are processed by an encoder, so that a second semantic representation of the key information map is determined.
Firstly, an adjacency matrix and a degree matrix between nodes in the key information map are obtained so as to facilitate subsequent processing and obtain a second semantic representation of the key information map.
In the embodiment of the present disclosure, by taking fig. 2 as an example, the association relationship between each node in fig. 2 may be obtained, as shown in fig. 4, if an association relationship exists between one node and another node, an element corresponding to the position is 1; if one node does not have an association relationship with another node, the element corresponding to the position is 0. In the embodiment of the present disclosure, based on fig. 4, an adjacency matrix may be formed, where the adjacency matrix is a directed graph adjacency matrix, and may be represented as:
Figure BDA0003142382730000061
the degree matrix is a diagonal matrix, and the elements on the diagonal are degrees of each node. The degree of a node represents the number of edges associated with the node. In the embodiment of the present disclosure, the degree of a node is divided into the out degree and the in degree of the node, that is, the number of directed edges going out from the node and the number of directed edges entering the node.
In some implementations, to improve the accuracy of text error correction, a connection matrix and a degree matrix are encoded by L encoding layers connected in sequence to obtain a second semantic representation, where L is a positive integer and L ∈ [2,6 ].
In the embodiment of the disclosure, the initial semantic representation of the node in the key information graph at the first coding layer is H0,H0∈R|V|×dAnd the adjacent matrix and the degree matrix are coded to generate semantic representation of the first coding layer.
By analogy, in the ith coding layer, coding is performed according to the semantic representation, the connection matrix and the degree matrix acquired by the previous coding layer to generate the semantic representation of the ith coding layer:
Hi+1=σ(D-1/2AD-1/2(Wi+1Hi+Bi+1))
wherein A represents an adjacency matrix, D represents a degree matrix, and W and B are parameters to be trained.
In the embodiment of the disclosure, the semantic representation generated by the L-th coding layer is represented as a second semantic representation, namely HL=σ(D-1/2AD-1/2(WLHL-1+BL)),HL∈R|V|×d
S302, acquiring target semantic representation according to the first semantic representation and the second semantic representation.
In the embodiment of the present disclosure, in order to modify the content of the text to be corrected in connection with the context information, it is necessary to jointly encode the first semantic representation of the text to be corrected and the second semantic representation of the key information map. Before joint coding, correlation characteristic representation between the first semantic representation and the second semantic representation needs to be obtained.
The encoding process is implemented based on Cross-Attention mechanism. In this embodiment of the present disclosure, the second semantic representation is embedded into the original encoding process, and then the encoding process of the lth encoding layer is:
hx,G=Encode(hx,HL),hx,G∈RT×d
and further acquiring a correlation characteristic representation between the first semantic representation and the second semantic representation:
att=f((hxWx)·(HLWG)T),att∈RT×|V|
wherein, WxAnd WGRepresents Rd, f denotes the activation function. The correlation characteristic representation is used for indicating the correlation between each word in the corrected text and each semantic unit in the key information map.
Performing joint coding on the first semantic representation, the second semantic representation and the correlation characteristic representation to obtain a target semantic representation:
hx,G=g(att·HL·W'G+hx·W'x)
wherein, W'GAnd W'xRespectively, a matrix of d x d, W'GFor encoding a semantic representation of key information based on cross-attention mechanism, W'xEncoding a first semantic representation based on a cross attention mechanism; g is the activation function.
In the embodiment of the disclosure, a second semantic representation of the key information map is obtained, and a target semantic representation is obtained according to the first semantic representation and the second semantic representation. The method and the device for modifying the content of the text to be corrected based on the contact context information can modify the content of the text to be corrected based on the contact context information, and can improve the efficiency and accuracy of text correction, thereby improving the effect of text correction.
Fig. 5 is a flowchart of a text error correction method according to another embodiment of the present disclosure, and as shown in fig. 5, on the basis of the above embodiment, a key information map of a document is generated according to context information, further including the following steps:
s501, conducting named entity extraction on the context information, and taking the extracted named entity as a node of the key information map.
Named Entities (NEs) are names of people, names of organizations, names of places, and all other entities identified by names. The broader entities also include numbers, dates, currencies, addresses, and the like. In the embodiment of the disclosure, named entity identification is performed on context information, and object names or symbols of specific types are extracted from the context information and are used as nodes of a key information graph.
S502, determining the association relationship among the named entities.
And acquiring the position and the semantics of the named entity in the document, and determining the incidence relation between the named entities according to the position and/or the semantics.
In some implementations, the associative relationships between named entities are determined based on the locations of the named entities in the document. Alternatively, the first named entities belonging to the same text segment can be determined according to the positions, and the association relationship between the first named entities is determined as the interconnection relationship.
In some implementations, the associative relationships between named entities are determined in connection with the locations and semantics of the named entities in the document. Optionally, it is also possible to determine, from the first named entities, second named entities in which dependency relationships exist, determine association relationships between the second named entities as one-way relationships, and determine association relationships between remaining third named entities in the first named entities as interconnection relationships.
In some implementations, the associative relationships between named entities are determined according to the semantics of the named entities in the document. Optionally, fourth named entities with similar or consistent semantics can be determined, and the association relationship between the fourth named entities is determined as an interconnection relationship.
And S503, connecting the nodes corresponding to the named entities according to the association relation, and generating a key information map of the document.
In some implementations, if the association relationship between the named entities is unidirectional, the connection lines of the nodes corresponding to the named entities are also directional, that is, according to the association relationship, the nodes corresponding to the named entities are connected in a unidirectional manner, and a key information map of the document is generated, wherein the key information map is a directed graph.
In some implementations, the association relationship between the named entities is bidirectional, and the connection between the nodes corresponding to the named entities is undirected, that is, the nodes corresponding to the named entities are connected according to the association relationship to generate a key information map of the document, where the key information map is an undirected map.
In the embodiment of the disclosure, named entity extraction is carried out on context information, and the extracted named entity is used as a node of a key information map; determining an incidence relation between named entities; and connecting the nodes corresponding to the named entities according to the association relationship to generate a key information map of the document. The text error correction method and the text error correction device can improve the text error correction efficiency and accuracy, and further improve the text error correction effect.
Fig. 6 is a flowchart of a text error correction method according to another embodiment of the present disclosure, as shown in fig. 6, after a document is input, an Encoding layer encodes a text to be error corrected, obtains a first semantic representation of the text to be error corrected, and then obtains a second semantic representation of a key information map through a cross attention transformer encoder, where the cross attention transformer encoder includes L Encoding layers; and then inputting the first semantic representation and the second semantic representation into a joint coding layer to obtain a target semantic representation, and finally obtaining an error-corrected target text through a softmax mapping layer.
The text error correction method and the text error correction device can improve the text error correction efficiency and accuracy, and further improve the text error correction effect.
Fig. 7 is a block diagram of a text correction apparatus according to an embodiment of the present disclosure, and as shown in fig. 7, the text correction apparatus 700 includes:
the acquiring module 710 is configured to acquire a text to be corrected and encode the text to be corrected to acquire a first semantic representation of the text to be corrected;
the generating module 720 is configured to obtain context information of a document where the text to be corrected is located, and generate a key information map of the document according to the context information;
the processing module 730 is configured to modify the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected;
and the error correction module 740 is configured to generate a target text after error correction of the text to be corrected according to the target semantic representation.
In the embodiment of the disclosure, a text to be corrected is obtained and encoded to obtain a first semantic representation of the text to be corrected; acquiring context information of a document where a text to be corrected is located, and generating a key information map of the document according to the context information; modifying the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected; and generating the corrected target text of the text to be corrected according to the target semantic representation. The text error correction method and the text error correction device can improve the text error correction efficiency and accuracy, and further improve the text error correction effect.
It should be noted that the foregoing explanation of the embodiment of the text error correction method is also applicable to the text error correction apparatus of the embodiment, and is not repeated herein.
Further, in a possible implementation manner of the embodiment of the present disclosure, the processing module 730 is further configured to: acquiring a second semantic representation of the key information map; and acquiring the target semantic representation according to the first semantic representation and the second semantic representation.
Further, in a possible implementation manner of the embodiment of the present disclosure, the processing module 730 is further configured to: acquiring a correlation characteristic representation between the first semantic representation and the second semantic representation based on a cross attention mechanism; and performing joint coding on the first semantic representation, the second semantic representation and the correlation characteristic representation to generate a target semantic representation.
Further, in a possible implementation manner of the embodiment of the present disclosure, the processing module 730 is further configured to: acquiring an adjacency matrix and a degree matrix between nodes in a key information map; and acquiring a second semantic representation according to the adjacency matrix and the degree matrix.
Further, in a possible implementation manner of the embodiment of the present disclosure, the processing module 730 is further configured to: coding the connection matrix and the degree matrix through L coding layers which are connected in sequence to obtain a second semantic representation, wherein L is a positive integer; in the first coding layer, coding is carried out according to the initial semantic representation of the nodes in the key information map, the connection matrix and the degree matrix, and the semantic representation of the first coding layer is generated; and in the ith coding layer, coding according to the semantic representation, the connection matrix and the degree matrix acquired by the previous coding layer to generate the semantic representation of the ith coding layer, wherein the semantic representation generated by the Lth coding layer is the second semantic representation.
Further, in a possible implementation manner of the embodiment of the present disclosure, the generating module 720 is further configured to: carrying out named entity extraction on the context information, and taking the extracted named entity as a node of a key information map; determining an incidence relation between named entities; and connecting the nodes corresponding to the named entities according to the association relationship to generate a key information map of the document.
Further, in a possible implementation manner of the embodiment of the present disclosure, the generating module 720 is further configured to: acquiring the position and the semantics of a named entity in a document; determining associations between named entities based on location and/or semantics.
Further, in a possible implementation manner of the embodiment of the present disclosure, the generating module 720 is further configured to: determining first named entities belonging to the same text segment according to the position, and determining the incidence relation between the first named entities as an interconnection relation; or determining second named entities with dependency relationship from the first named entities, determining the incidence relationship between the second named entities as a one-way relationship, and determining the incidence relationship between the remaining third named entities in the first named entities as an interconnection relationship; or determining fourth named entities with similar or consistent semantics, and determining the association relationship between the fourth named entities as the interconnection relationship.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above, such as the text error correction method. For example, in some embodiments, the text correction method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM803 and executed by computing unit 801, a computer program may perform one or more of the steps of the text error correction method described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the text correction method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (19)

1. A text error correction method comprising:
acquiring a text to be corrected, and encoding the text to be corrected to acquire a first semantic representation of the text to be corrected;
acquiring context information of a document where the text to be corrected is located, and generating a key information map of the document according to the context information;
modifying the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected;
and generating the corrected target text of the text to be corrected according to the target semantic representation.
2. The method according to claim 1, wherein the modifying the first semantic representation based on the key information map to obtain the target semantic representation of the text to be corrected comprises:
obtaining a second semantic representation of the key information map;
and acquiring the target semantic representation according to the first semantic representation and the second semantic representation.
3. The method of claim 2, wherein the obtaining the target semantic representation from the first semantic representation and the second semantic representation comprises:
obtaining a correlation feature representation between the first semantic representation and the second semantic representation based on a cross attention mechanism;
and jointly encoding the first semantic representation, the second semantic representation and the correlation characteristic representation to generate the target semantic representation.
4. The method of claim 2 or 3, wherein said obtaining a second semantic representation of the key information graph comprises:
acquiring an adjacency matrix and a degree matrix between nodes in the key information map;
and acquiring the second semantic representation according to the adjacency matrix and the degree matrix.
5. The method of claim 4, wherein the obtaining the second semantic representation from the adjacency matrix and the degree matrix comprises:
coding the connection matrix and the degree matrix through L coding layers which are connected in sequence to obtain the second semantic representation, wherein L is a positive integer;
in a first coding layer, coding is carried out according to the initial semantic representation of the nodes in the key information map, the connection matrix and the degree matrix, and the semantic representation of the first coding layer is generated;
and in the ith coding layer, coding according to the semantic representation, the connection matrix and the degree matrix acquired by the previous coding layer to generate the semantic representation of the ith coding layer, wherein the semantic representation generated by the Lth coding layer is the second semantic representation.
6. The method of any of claims 1-3, wherein the generating a key information graph of the document from the contextual information comprises:
conducting named entity extraction on the context information, and taking the extracted named entities as nodes of the key information graph;
determining an incidence relation between the named entities;
and connecting the nodes corresponding to the named entities according to the incidence relation to generate a key information map of the document.
7. The method of claim 6, wherein the determining an associative relationship between the named entities comprises:
acquiring the position and the semantics of the named entity in the document;
and determining the association relation between the named entities according to the positions and/or the semantics.
8. The method of claim 7, wherein said determining an associative relationship between said named entities according to said location and/or said semantics comprises:
determining first named entities belonging to the same text segment according to the position, and determining the incidence relation between the first named entities as an interconnection relation; or,
determining second named entities with dependency relationships from the first named entities, determining incidence relationships among the second named entities as one-way relationships, and determining incidence relationships among the remaining third named entities in the first named entities as interconnection relationships; or,
and determining fourth named entities with similar or consistent semantics, and determining the association relationship between the fourth named entities as an interconnection relationship.
9. A text correction apparatus comprising:
the system comprises an acquisition module, a correction module and a correction module, wherein the acquisition module is used for acquiring a text to be corrected and encoding the text to be corrected so as to acquire a first semantic representation of the text to be corrected;
the generating module is used for acquiring the context information of the document where the text to be corrected is located and generating a key information map of the document according to the context information;
the processing module is used for correcting the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected;
and the error correction module is used for generating the corrected target text of the text to be corrected according to the target semantic representation.
10. The apparatus of claim 9, wherein the processing module is further configured to:
obtaining a second semantic representation of the key information map;
and acquiring the target semantic representation according to the first semantic representation and the second semantic representation.
11. The apparatus of claim 10, wherein the processing module is further configured to:
obtaining a correlation feature representation between the first semantic representation and the second semantic representation based on a cross attention mechanism;
and jointly encoding the first semantic representation, the second semantic representation and the correlation characteristic representation to generate the target semantic representation.
12. The apparatus of claim 10 or 11, wherein the processing module is further configured to:
acquiring an adjacency matrix and a degree matrix between nodes in the key information map;
and acquiring the second semantic representation according to the adjacency matrix and the degree matrix.
13. The apparatus of claim 12, wherein the processing module is further configured to:
coding the connection matrix and the degree matrix through L coding layers which are connected in sequence to obtain the second semantic representation, wherein L is a positive integer;
in a first coding layer, coding is carried out according to the initial semantic representation of the nodes in the key information map, the connection matrix and the degree matrix, and the semantic representation of the first coding layer is generated;
and in the ith coding layer, coding according to the semantic representation, the connection matrix and the degree matrix acquired by the previous coding layer to generate the semantic representation of the ith coding layer, wherein the semantic representation generated by the Lth coding layer is the second semantic representation.
14. The apparatus of any of claims 9-11, wherein the means for generating is further configured to:
conducting named entity extraction on the context information, and taking the extracted named entities as nodes of the key information graph;
determining an incidence relation between the named entities;
and connecting the nodes corresponding to the named entities according to the incidence relation to generate a key information map of the document.
15. The apparatus of claim 14, wherein the generating means is further configured to:
acquiring the position and the semantics of the named entity in the document;
and determining the association relation between the named entities according to the positions and/or the semantics.
16. The apparatus of claim 15, wherein the generating means is further configured to:
determining first named entities belonging to the same text segment according to the position, and determining the incidence relation between the first named entities as an interconnection relation; or,
determining second named entities with dependency relationships from the first named entities, determining incidence relationships among the second named entities as one-way relationships, and determining incidence relationships among the remaining third named entities in the first named entities as interconnection relationships; or,
and determining fourth named entities with similar or consistent semantics, and determining the association relationship between the fourth named entities as an interconnection relationship.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
CN202110740864.7A 2021-06-30 2021-06-30 Text error correction method and device, electronic equipment and storage medium Active CN113553834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110740864.7A CN113553834B (en) 2021-06-30 2021-06-30 Text error correction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110740864.7A CN113553834B (en) 2021-06-30 2021-06-30 Text error correction method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113553834A true CN113553834A (en) 2021-10-26
CN113553834B CN113553834B (en) 2023-09-22

Family

ID=78102625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110740864.7A Active CN113553834B (en) 2021-06-30 2021-06-30 Text error correction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113553834B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114970554A (en) * 2022-08-02 2022-08-30 国网浙江省电力有限公司宁波供电公司 Document checking method based on natural language processing

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011000046A1 (en) * 2009-07-01 2011-01-06 Ozmota Inc. Systems and methods for determining information and knowledge relevancy, relevant knowledge discovery and interactions, and knowledge creation
CN111160041A (en) * 2019-12-30 2020-05-15 科大讯飞股份有限公司 Semantic understanding method and device, electronic equipment and storage medium
CN111339255A (en) * 2020-02-26 2020-06-26 腾讯科技(深圳)有限公司 Target emotion analysis method, model training method, medium, and device
CN111428044A (en) * 2020-03-06 2020-07-17 中国平安人寿保险股份有限公司 Method, device, equipment and storage medium for obtaining supervision identification result in multiple modes
CN112001169A (en) * 2020-07-17 2020-11-27 北京百度网讯科技有限公司 Text error correction method and device, electronic equipment and readable storage medium
CN112084301A (en) * 2020-08-11 2020-12-15 网易有道信息技术(北京)有限公司 Training method and device of text correction model and text correction method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011000046A1 (en) * 2009-07-01 2011-01-06 Ozmota Inc. Systems and methods for determining information and knowledge relevancy, relevant knowledge discovery and interactions, and knowledge creation
CN111160041A (en) * 2019-12-30 2020-05-15 科大讯飞股份有限公司 Semantic understanding method and device, electronic equipment and storage medium
CN111339255A (en) * 2020-02-26 2020-06-26 腾讯科技(深圳)有限公司 Target emotion analysis method, model training method, medium, and device
CN111428044A (en) * 2020-03-06 2020-07-17 中国平安人寿保险股份有限公司 Method, device, equipment and storage medium for obtaining supervision identification result in multiple modes
CN112001169A (en) * 2020-07-17 2020-11-27 北京百度网讯科技有限公司 Text error correction method and device, electronic equipment and readable storage medium
CN112084301A (en) * 2020-08-11 2020-12-15 网易有道信息技术(北京)有限公司 Training method and device of text correction model and text correction method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘东;孙明;周明天;: "基于图论的文本数字水印技术", 计算机研究与发展, no. 10 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114970554A (en) * 2022-08-02 2022-08-30 国网浙江省电力有限公司宁波供电公司 Document checking method based on natural language processing
CN114970554B (en) * 2022-08-02 2022-10-21 国网浙江省电力有限公司宁波供电公司 Document checking method based on natural language processing

Also Published As

Publication number Publication date
CN113553834B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN113705187B (en) Method and device for generating pre-training language model, electronic equipment and storage medium
CN112926306B (en) Text error correction method, device, equipment and storage medium
WO2022174496A1 (en) Data annotation method and apparatus based on generative model, and device and storage medium
CN116152833B (en) Training method of form restoration model based on image and form restoration method
CN115565177B (en) Character recognition model training, character recognition method, device, equipment and medium
CN113407610A (en) Information extraction method and device, electronic equipment and readable storage medium
CN113743101A (en) Text error correction method and device, electronic equipment and computer storage medium
CN114912450B (en) Information generation method and device, training method, electronic device and storage medium
CN114863439B (en) Information extraction method, information extraction device, electronic equipment and medium
CN113361523A (en) Text determination method and device, electronic equipment and computer readable storage medium
CN114218940B (en) Text information processing and model training method, device, equipment and storage medium
JP2023036753A (en) Text recognition method, training method of text recognition model, and apparatus
CN113011155B (en) Method, apparatus, device and storage medium for text matching
CN112906368B (en) Industry text increment method, related device and computer program product
CN114048733A (en) Training method of text error correction model, and text error correction method and device
CN113553834A (en) Text error correction method and device, electronic equipment and storage medium
CN113553411A (en) Query statement generation method and device, electronic equipment and storage medium
CN113051896A (en) Method and device for correcting text, electronic equipment and storage medium
CN112507705A (en) Position code generation method and device and electronic equipment
CN114429106B (en) Page information processing method and device, electronic equipment and storage medium
CN115357710A (en) Training method and device for table description text generation model and electronic equipment
CN113361522B (en) Method and device for determining character sequence and electronic equipment
CN114841175A (en) Machine translation method, device, equipment and storage medium
CN114781386A (en) Method and device for acquiring text error correction training corpus and electronic equipment
CN114444472A (en) Text processing method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant