CN113553834B - 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
CN113553834B
CN113553834B CN202110740864.7A CN202110740864A CN113553834B CN 113553834 B CN113553834 B CN 113553834B CN 202110740864 A CN202110740864 A CN 202110740864A CN 113553834 B CN113553834 B CN 113553834B
Authority
CN
China
Prior art keywords
text
semantic representation
corrected
key information
determining
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.)
Active
Application number
CN202110740864.7A
Other languages
Chinese (zh)
Other versions
CN113553834A (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

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, a device, electronic equipment and a storage medium, relates to the technical field of computers, and particularly relates 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; correcting 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 target text subjected to error correction of the text to be subjected to error correction according to the target semantic representation. The text error correction method and device can improve text error correction efficiency and accuracy, and further improve 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 in particular, to the field of artificial intelligence technology, such as natural language processing and deep learning.
Background
Text correction is a fundamental problem in natural language processing, and may be often preceded by other natural language processing tasks such as text retrieval, text classification, or machine translation, to improve the effectiveness of the input text and prevent adverse effects caused by misspellings. In the related technology, the error correction work is mainly performed on a single sentence text, and related content which can assist the error correction of the current sentence in the text is not utilized, so that some errors cannot be recalled, and the error correction effect of the text is affected.
Disclosure of Invention
The disclosure provides a text error correction method, a text error correction device, electronic equipment 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;
correcting 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 target text subjected to error correction of the text to be subjected to error correction according to the target semantic representation.
The text error correction method and device can improve text error correction efficiency and accuracy, and further improve 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 the 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 target text subjected to 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 including at least one processor, and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the text error correction method of the first aspect embodiment 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 a text error correction method of an embodiment 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 steps of a text error correction method according to an embodiment of the first aspect of the present disclosure.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a text error correction method according to one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a text error correction method according to one embodiment of the present disclosure;
FIG. 3 is a flow chart of a text error correction method according to another embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a text error correction method according to another embodiment of the present disclosure;
FIG. 5 is a flow chart of a text error correction method according to another embodiment of the present disclosure;
FIG. 6 is a flow chart of a text error correction method according to another embodiment of the present disclosure;
FIG. 7 is a block diagram of a text error correction apparatus according to one embodiment of the present disclosure;
fig. 8 is a block diagram of an electronic device for implementing a text error correction method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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 technical field to which the aspects of the present disclosure relate is briefly described below:
the content of computer technology is very broad and can be roughly divided into computer system technology, computer device technology, computer component technology, and computer assembly technology. The computer technology comprises: the basic principle of the operation method and the design of an arithmetic unit, an instruction system, a central processing unit (central processing unit, CPU), a pipeline principle and the application of the pipeline principle in the CPU design, a storage system, a bus and input and output.
Computer technology refers to technical methods and means employed in the computer arts, or to hardware, software and application techniques thereof. The computer technology has obvious comprehensive characteristics, and is tightly combined with electronic engineering, application physics, mechanical engineering, modern communication technology, mathematics and the like, and the development is rapid.
Natural language processing (Natural Language Processing, NLP) is an important direction in the fields of computer science and artificial intelligence. It is studying various theories and methods that enable effective communication between a person and a computer in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Thus, the research in this field will involve natural language, i.e. language that people use daily, so it has a close relation with the research in linguistics, but has important differences. Natural language processing is not a general study of natural language, but rather, is the development of computer systems, and in particular software systems therein, that can effectively 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 abstracting, viewpoint extraction, text classification, question answering, text semantic comparison, voice recognition and the like.
FIG. 1 is a flow chart of a text error correction method of one embodiment of the present disclosure, as shown in FIG. 1, comprising the steps of:
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, acquiring a text to be corrected, wherein the text to be corrected can 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 scene as an example, when a user speaks, the user performs voice recognition on the speaking content through a voice recognition model, and the voice recognition model outputs recognized text, and text information recognized in real time by the voice recognition model in the embodiment of the disclosure can be used as text to be corrected.
Further, the error correction text is encoded by an encoder, and the encoding process of the error correction text is as follows:
h x =Encode(x),h x ∈R T×d
wherein x is a text to be corrected, namely a sentence fused with key information; t is the sentence length. That is, after encoding the error correction text, h will be generated x As a first semantic representation of the error correction text.
S102, obtaining 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.
In general, the semantics of the text to be corrected that is present in the document are not independent, and the actual semantics of the text to be corrected often have a close relationship with the context of the text to be corrected, that is, the semantics of the text to be corrected depend 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 text information of some or all of the semantics of the text to be corrected. Alternatively, the context information may be text information of the entire document from which the text to be corrected is removed, or text information closer to the text to be corrected.
The key information is an important item in text analysis, and is extracted from the complicated text information, so that the text error correction processing is facilitated. In the embodiment of the disclosure, key information in context information is extracted, association relation between the key information is obtained, the key information is taken as nodes, paths (edges) between the nodes are determined according to the association 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, and as shown in fig. 2, the key information graph is a directed connectivity graph, and may be represented by g= (V, E), where V represents a node and E represents an edge. Taking the key information "face++" as an example for explanation, if the response key information is "face++", taking "face++" as a node, and further confirming the association relationship between the key information "face++" and each other key information, in the embodiment of the present disclosure, the key information "face++" is associated with 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++", and thus has an edge of the key information map where the node "company a" points to the node "face++".
And S103, correcting the first semantic representation based on the key information map to obtain the target semantic representation of the text to be corrected.
In practice, the reason for causing errors is mainly that there is similarity such as word sound, font and the like between the wrong word and the correct word, and confusion is easily caused. Since the semantics of the text to be corrected depend on the context information, the context information is often key information affecting the semantics of the text to be corrected, but not non-key information in the upstream text information.
In the embodiment of the disclosure, the key information map is generated based on the context information, that is, the key information is extracted from the context information, which affects the essential content of the text to be corrected, and further, the key information map may show the interconnection 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 perform correction processing, so as to obtain the target semantic representation of the text to be corrected.
Optionally, the semantic represented by the key information in the key information map is extracted, and the first semantic information of the text to be corrected is corrected by the semantic represented by the key information, for example, the represented semantic information and the first semantic information can be spliced or fused, so as to obtain the target voice representation of the text to be corrected.
S104, generating the target text after error correction of the text to be corrected according to the target semantic representation.
And processing a target semantic representation input mapping (Softmax) layer, and correcting the error words in the text to be corrected to generate the corrected target text.
The process of generating the target text after the correction of the text to be corrected is illustrated below. In some implementations, if the text to be corrected is "it includes a series of questions such as node identification", the text to be corrected "it includes a series of questions such as node identification" is corrected based on the key information map shown in fig. 2, and then a target text "it includes a series of questions such as node identification" is generated.
In the embodiment of the disclosure, a text to be corrected is obtained, and the text to be corrected is 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; correcting 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 target text subjected to error correction of the text to be subjected to error correction according to the target semantic representation. The text error correction method and device can improve text error correction efficiency and accuracy, and further improve text error correction effect.
Fig. 3 is a flowchart of a text correction method according to another embodiment of the present disclosure, as shown in fig. 3, on the basis of the above embodiment, correcting a first semantic representation based on a key information map, to obtain a target semantic representation of a text to be 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 the adjacency matrix and the degree matrix are processed through 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 a key information map are acquired so as to facilitate subsequent processing, and a second semantic representation of the key information map is acquired.
An Adjacency Matrix (Adjacency Matrix) is a Matrix representing an Adjacency relationship between nodes, where the Adjacency Matrix is an n-order square Matrix (n is the number of nodes), and in this embodiment of the disclosure, taking fig. 2 as an example, the Adjacency relationship between each node in fig. 2 may be obtained continuously, as shown in fig. 4, if an Adjacency relationship exists between one node and another node, an element corresponding to the position is 1; if there is no association between one node and 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 expressed as:
the degree matrix is a diagonal matrix, and the elements on the diagonal are the degrees of each node. The degree of a node represents the number of edges associated with that node. In the embodiment of the disclosure, the degree of the node is divided into the outbound degree and the inbound degree of the node, namely, 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, the connection matrix and the 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 e [2,6].
In the embodiment of the disclosure, the initial semantic representation of the node in the key information map at the first coding layer is denoted as H 0 ,H 0 ∈R |V|×d Wherein, |v| represents the number of nodes, d is the hidden layer vector dimension, and encodes its adjacency matrix and degree matrix to generate a semantic representation of the first encoding layer.
And so on, in the ith coding layer, coding is carried out according to the semantic representation, the connection matrix and the degree matrix obtained by the previous coding layer, so as to generate the semantic representation of the ith coding layer:
H i+1 =σ(D -1/2 AD -1/2 (W i+1 H i +B i+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 expressed as a second semantic representation, namely H L =σ(D -1/2 AD -1/2 (W L H L-1 +B L )),H L ∈R |V|×d
S302, acquiring a target semantic representation according to the first semantic representation and the second semantic representation.
In the embodiment of the disclosure, in order to modify the content of the text to be corrected by connecting the context information, the first semantic representation of the text to be corrected and the second semantic representation of the key information map need to be encoded in a joint way. Before joint coding, a correlation feature representation between the first semantic representation and the second semantic representation needs to be obtained.
The encoding process is implemented based on a Cross-Attention mechanism. In the embodiment of the present disclosure, the second semantic representation is embedded in the original encoding process, and then the encoding process of the L-th encoding layer is:
h x,G =Encode(h x ,H L ),h x,G ∈R T×d
and further obtaining a correlation feature representation between the first semantic representation and the second semantic representation:
att=f((h x W x )·(H L W G ) T ),att∈R T×|V|
wherein W is x And W is G R represents d×d F represents the activation function. The relevance feature representation is used to indicate the relevance between each semantic unit in the key information map corresponding to each word in the error correction text.
Performing joint coding on the first semantic representation, the second semantic representation and the correlation characteristic representation to obtain a target semantic representation:
h x,G =g(att·H L ·W' G +h x ·W' x )
wherein W' G And W' x D x d matrix, W' G For encoding critical information semantic representations based on cross-attention mechanisms, W' x Encoding 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 acquired, and a target semantic representation is acquired according to the first semantic representation and the second semantic representation. The method and the device realize the modification of the content of the text to be corrected by the contact context information, so that the text correction efficiency and accuracy can be improved, and the text correction effect is further improved.
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, a key information map of a document is generated according to context information on the basis of the above embodiment, and further includes the steps of:
s501, extracting the named entities from the context information, and taking the extracted named entities as nodes of the key information map.
Named Entities (NEs) are names of people, institutions, 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, the context information is named entity identified, and a specific type of object name or symbol is extracted from the context information as a node of the key information map.
S502, determining the association relation between named entities.
And acquiring the position and the semantics of the named entities in the document, and determining the association relation between the named entities according to the position and/or the semantics.
In some implementations, the association between named entities is determined based on the location of the named entities in the document. Alternatively, the first named entities belonging to the same text segment may be determined according to the location, and the association relationship between the first named entities may be determined as the interconnection relationship.
In some implementations, the association between named entities is determined in combination with the location of the named entities in the document and semantics. Alternatively, it is also possible to determine, from the first named entities, second named entities having a dependency relationship, determine an association relationship between the second named entities as a one-way relationship, and determine an association relationship between the remaining third named entities in the first named entities as an interconnection relationship.
In some implementations, the association between named entities is determined based on 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 to generate a key information map of the document.
In some implementations, the association relationship between named entities is unidirectional, and then the connection of the nodes corresponding to the named entities is also directional, that is, according to the association relationship, the unidirectional connection is performed on the nodes corresponding to the named entities, so as to generate a key information map of the document, wherein the key information map is a directed graph.
In some implementations, the association relationship between named entities is bidirectional, and the connection line of the nodes corresponding to the named entities is undirected, that is, according to the association relationship, the connection line of the nodes corresponding to the named entities is performed, so as to generate a key information map of the document, wherein the key information map is an undirected graph.
In the embodiment of the disclosure, extracting a named entity from the context information, wherein the extracted named entity is used as a node of a key information map; determining the association relation between named entities; and connecting the nodes corresponding to the named entities according to the association relation to generate a key information map of the document. The text error correction method and device can improve text error correction efficiency and accuracy, and further improve text error correction effect.
FIG. 6 is a flow chart of a text error correction method according to another embodiment of the present disclosure, as shown in FIG. 6, after a document is input, encoding text to be error corrected by an Encoding layer, obtaining a first semantic representation of the text to be error corrected, and then obtaining a second semantic representation of a key information map by a cross-attention transducer encoder, wherein the cross-attention transducer encoder comprises an L-layer Encoding layer; and inputting the first semantic representation and the second semantic representation into a joint coding layer to obtain a target semantic representation, and finally obtaining the corrected target text through a softmax mapping layer.
The text error correction method and device can improve text error correction efficiency and accuracy, and further improve text error correction effect.
Fig. 7 is a block diagram of a text error correction apparatus according to an embodiment of the present disclosure, and as shown in fig. 7, a text error correction apparatus 700 includes:
an obtaining module 710, configured to obtain a text to be corrected, and encode the text to be corrected to obtain 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, and obtain a target semantic representation of the text to be corrected;
and the error correction module 740 is used for generating the target text subjected to error correction according to the target semantic representation.
In the embodiment of the disclosure, a text to be corrected is obtained, and the text to be corrected is 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; correcting 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 target text subjected to error correction of the text to be subjected to error correction according to the target semantic representation. The text error correction method and device can improve text error correction efficiency and accuracy, and further improve text error correction effect.
It should be noted that the foregoing explanation of the text error correction method embodiment is also applicable to the text error correction apparatus of this embodiment, and will not be 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: based on a cross-attention mechanism, obtaining a correlation feature representation between the first semantic representation and the second semantic representation; 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, and a connection matrix and a degree matrix to generate semantic representation of the first coding layer; 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, and generating the semantic representation of the ith coding layer, wherein the semantic representation generated by the L-th coding layer is a second semantic representation.
Further, in a possible implementation manner of the embodiment of the present disclosure, the generating module 720 is further configured to: extracting a named entity from the context information, wherein the extracted named entity is used as a node of a key information map; determining the association relation between named entities; and connecting the nodes corresponding to the named entities according to the association relation 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; and determining the association relation between the named entities according to the position and/or the semantics.
Further, in a possible implementation manner of the embodiment of the present disclosure, the generating module 720 is further configured to: determining a first named entity belonging to the same text segment according to the position, and determining an association relationship between the first named entities as an interconnection relationship; or determining a second named entity with a dependency relationship from the first named entities, determining the association relationship between the second named entities as a one-way relationship, and determining the association relationship between the rest third named entities in the first named entities as an interconnection relationship; or determining the fourth named entities with similar or consistent semantics, and determining the association relationship between the fourth named entities as an interconnection relationship.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 8 illustrates a schematic block diagram of an example electronic device 800 that may 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 telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary 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 computing 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 the bus 804.
Various components in device 800 are connected to I/O interface 805, including: an input unit 806 such as a keyboard, mouse, etc.; 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, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, or the like. 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.
The computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as a text error correction method. For example, in some embodiments, the text error correction method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809. When a computer program is loaded into RAM803 and executed by computing unit 801, one or more steps of the text error correction method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the text error correction method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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 pointing device (e.g., a mouse or 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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 a client and a server. The client and server are typically 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. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates blockchains.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the text error correction method according to an embodiment of the present disclosure.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (14)

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;
correcting the first semantic representation based on the key information map to obtain a target semantic representation of the text to be corrected;
generating the target text after error correction of the text to be corrected according to the target semantic representation;
the correcting the first semantic representation based on the key information map to obtain the target semantic representation of the text to be corrected includes: acquiring a second semantic representation of the key information map; based on a cross-attention mechanism, obtaining a correlation feature representation between the first semantic representation and the second semantic representation; and carrying out joint coding on the first semantic representation, the second semantic representation and the correlation characteristic representation to generate the target semantic representation.
2. The method of claim 1, wherein the 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.
3. The method of claim 2, 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 the first coding layer, according to the initial semantic representation of the nodes in the key information map, the connection matrix and the degree matrix are coded to generate the semantic representation of the first coding layer;
and in the ith coding layer, coding according to the semantic representation acquired by the previous coding layer, the connection matrix and the degree matrix to generate semantic representation of the ith coding layer, wherein the semantic representation generated by the L-th coding layer is the second semantic representation.
4. The method of claim 1, wherein the generating a key information map of the document from the context information comprises:
extracting a named entity from the context information, wherein the extracted named entity is used as a node of the key information map;
determining the association relation between the named entities;
and connecting the nodes corresponding to the named entities according to the association relation to generate a key information map of the document.
5. The method of claim 4, wherein the determining the association 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.
6. The method of claim 5, wherein the determining the association between the named entities according to the location and/or the semantics comprises:
according to the position, determining a first named entity belonging to the same text segment, and determining an association relationship between the first named entities as an interconnection relationship; or alternatively, the process may be performed,
determining a second named entity with a dependency relationship from the first named entities, determining the association relationship between the second named entities as a one-way relationship, and determining the association relationship between the rest third named entities in the first named entities as an interconnection relationship; or alternatively, the process may be performed,
and determining the fourth named entities with similar or consistent semantics, and determining the association relationship between the fourth named entities as an interconnection relationship.
7. A text error correction apparatus comprising:
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 generation 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 the target semantic representation of the text to be corrected;
the error correction module is used for generating the target text after error correction of the text to be corrected according to the target semantic representation;
wherein, the processing module is further configured to: acquiring a second semantic representation of the key information map; based on a cross-attention mechanism, obtaining a correlation feature representation between the first semantic representation and the second semantic representation; and carrying out joint coding on the first semantic representation, the second semantic representation and the correlation characteristic representation to generate the target semantic representation.
8. The apparatus of claim 7, wherein the processing module is further 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.
9. The apparatus of claim 8, wherein the processing module is further 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 the first coding layer, according to the initial semantic representation of the nodes in the key information map, the connection matrix and the degree matrix are coded to generate the semantic representation of the first coding layer;
and in the ith coding layer, coding according to the semantic representation acquired by the previous coding layer, the connection matrix and the degree matrix to generate semantic representation of the ith coding layer, wherein the semantic representation generated by the L-th coding layer is the second semantic representation.
10. The apparatus of any of claims 7, wherein the generating module is further configured to:
extracting a named entity from the context information, wherein the extracted named entity is used as a node of the key information map;
determining the association relation between the named entities;
and connecting the nodes corresponding to the named entities according to the association relation to generate a key information map of the document.
11. The apparatus of claim 10, wherein the generating module 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.
12. The apparatus of claim 11, wherein the generating module is further configured to:
according to the position, determining a first named entity belonging to the same text segment, and determining an association relationship between the first named entities as an interconnection relationship; or alternatively, the process may be performed,
determining a second named entity with a dependency relationship from the first named entities, determining the association relationship between the second named entities as a one-way relationship, and determining the association relationship between the rest third named entities in the first named entities as an interconnection relationship; or alternatively, the process may be performed,
and determining the fourth named entities with similar or consistent semantics, and determining the association relationship between the fourth named entities as an interconnection relationship.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
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-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
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 CN113553834A (en) 2021-10-26
CN113553834B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114970554B (en) * 2022-08-02 2022-10-21 国网浙江省电力有限公司宁波供电公司 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
基于图论的文本数字水印技术;刘东;孙明;周明天;;计算机研究与发展(第10期);全文 *

Also Published As

Publication number Publication date
CN113553834A (en) 2021-10-26

Similar Documents

Publication Publication Date Title
CN112926306B (en) Text error correction method, device, equipment and storage medium
CN112560501A (en) Semantic feature generation method, model training method, device, equipment and medium
CN113011155B (en) Method, apparatus, device and storage medium for text matching
CN112507706A (en) Training method and device of knowledge pre-training model and electronic equipment
CN116152833B (en) Training method of form restoration model based on image and form restoration method
CN115309877A (en) Dialog generation method, dialog model training method and device
US20220358955A1 (en) Method for detecting voice, method for training, and electronic devices
CN113887615A (en) Image processing method, apparatus, device and medium
CN113553834B (en) Text error correction method and device, electronic equipment and storage medium
CN113407610B (en) Information extraction method, information extraction device, electronic equipment and readable storage medium
CN114020950B (en) Training method, device, equipment and storage medium for image retrieval model
CN112507705B (en) Position code generation method and device and electronic equipment
CN111475635B (en) Semantic completion method and device and electronic equipment
CN113361523A (en) Text determination method and device, electronic equipment and computer readable storage medium
CN115357710B (en) Training method and device for table description text generation model and electronic equipment
CN114239559B (en) Text error correction and text error correction model generation method, device, equipment and medium
CN113468857B (en) Training method and device for style conversion model, electronic equipment and storage medium
CN115565186A (en) Method and device for training character recognition model, electronic equipment and storage medium
CN113553411B (en) Query statement generation method and device, electronic equipment and storage medium
CN114756691A (en) Structure chart generation method, model training method, map generation method and device
CN112560466A (en) Link entity association method and device, electronic equipment and storage medium
CN114896993B (en) Translation model generation method and device, electronic equipment and storage medium
CN114495236B (en) Image segmentation method, apparatus, device, medium, and program product
CN116257611B (en) Question-answering model training method, question-answering processing device and storage medium
CN114444472B (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