Text extraction method, device and system
Patent Information
- Application Number
- CN202310391025.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-06
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-04-06
AI Technical Summary
上述两种方案均存在信息抽取速度慢的问题
[0051]本申请实施例提供一种文本抽取方法、设备及系统,涉及信息抽取领域,该方法包括:获取包含目标文本的文本抽取任务,将目标文本的第一序列、文本抽取任务预配置的抽取类型的第二序列以及预配置的多个向量的第三序列,输入预训练的文本抽取模型,经文本抽取模型中多个文本抽取模块的并行数据处理,得到目标文本的文本抽取结果,文本抽取结果用于指示所述抽取类型对应的文本元素。其中,抽取类型包括实体类型,关系类型,事件类型以及事件的论元类型,文本情感类型的至少一项。上述方案通过多个文本抽取模块的并行数据处理,不仅可以同时输出多种类型的抽取结果,如关系抽取结果、事件抽取结果、情感抽取结果等,还可提升文本抽取速度。
Smart Images

Figure CN116757206B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a text extraction method, device and system. Background Technology
[0002] Text information extraction is a crucial foundation for artificial intelligence applications such as information retrieval, intelligent question answering, and intelligent dialogue. It can overcome the problems of informality and uncertainty in natural language, discover and capture the valuable information contained within it, and then use it for intelligent document review, knowledge base and knowledge graph construction, process automation, etc., which has important practical significance for the industry.
[0003] Currently, common information extraction schemes include the following two types: One is based on Machine Reading Comprehension (MRC), which queries for relevant information in the form of prompts. When extracting complex information, it is necessary to construct prompts multiple times for repeated prediction. The second is based on text-to-text, generating structured information sequences using autoregressive decoding. Both of these schemes suffer from slow information extraction speed. Summary of the Invention
[0004] This application provides a text extraction method, device, and system to improve text extraction speed.
[0005] A first aspect of this application provides a text extraction method, the method comprising:
[0006] Obtain a text extraction task, wherein the text extraction task includes target text;
[0007] The first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors are input into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0008] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0009] In an optional embodiment of the first aspect of this application, the text extraction model further includes: an encoding module, a text detection module, and an extraction result fusion module;
[0010] The first sequence of the target text, the second sequence of the extraction type pre-configured for the text extraction task, and the third sequence of multiple pre-configured vectors are input into the pre-trained text extraction model, including:
[0011] The first sequence, the second sequence, and the third sequence are input into the encoding module of the text extraction model to obtain the first feature representation and the second feature representation;
[0012] The first feature representation is the encoded feature representation corresponding to the target text and the extraction type, and the second feature representation includes the encoded feature representation corresponding to the plurality of vectors.
[0013] In an optional embodiment of the first aspect of this application, the step of obtaining the text extraction result of the target text through parallel data processing of multiple text extraction modules in the text extraction model includes:
[0014] The first feature representation is input into the text detection module of the text extraction model to obtain the text detection result, which is used to indicate each text element in the target text and the position information of each text element.
[0015] The text detection result, the first feature representation, and the second feature representation are used as inputs to multiple text extraction modules of the text extraction model. After parallel data processing by the multiple text extraction modules, multiple text extraction results are obtained.
[0016] The extraction result fusion module of the text extraction model determines the text extraction result of the target text based on the multiple text extraction results.
[0017] In an optional embodiment of the first aspect of this application, the second feature representation includes a third feature representation and a fourth feature representation, wherein the third feature representation is the encoded feature representation corresponding to the first vector among the plurality of vectors, and the fourth feature representation is the encoded feature representation corresponding to the second vector among the plurality of vectors; the plurality of text extraction modules include a first text extraction module and a second text extraction module;
[0018] The text detection result, the first feature representation, and the second feature representation are used as inputs to multiple text extraction modules of the text extraction model. Through parallel data processing by these multiple text extraction modules, multiple text extraction results are obtained, including:
[0019] The text detection result, the first feature representation, and the third feature representation are input into the first text extraction module. After data processing by the first text extraction module, the first text extraction result of the first text element in the target text is obtained.
[0020] The text detection result, the first feature representation, and the fourth feature representation are input into the second text extraction module. After data processing by the second text extraction module, the second text extraction result of the second text element in the target text is obtained.
[0021] In an optional embodiment of the first aspect of this application, the first text extraction module includes a first multilayer perceptron (MLP) module and a second MLP module; the step of inputting the text detection result, the first feature representation, and the third feature representation into the first text extraction module, and obtaining the first text extraction result of the first text element in the target text after data processing by the first text extraction module, includes:
[0022] The text detection result, the first feature representation, and the third feature representation are input into the first MLP module. After processing by the first MLP module, an intermediate result of the first text extraction result is obtained. The intermediate result is used to indicate at least one text element that is related to the first text element.
[0023] The intermediate results and the first feature representation are input into the second MLP module. After processing by the second MLP module, the first text extraction result is obtained.
[0024] In an optional embodiment of the first aspect of this application, the second text extraction module includes a third MLP module and a fourth MLP module; the step of inputting the text detection result, the first feature representation, and the fourth feature representation into the second text extraction module, and obtaining the second text extraction result of the second text element in the target text after data processing by the second text extraction module, includes:
[0025] The text detection result, the first feature representation, and the fourth feature representation are input into the third MLP module. After processing by the third MLP module, an intermediate result of the second text extraction result is obtained. The intermediate result is used to indicate at least one text element that is related to the second text element.
[0026] The intermediate results and the first feature representation are input into the fourth MLP module. After processing by the fourth MLP module, the second text extraction result is obtained.
[0027] In an optional embodiment of the first aspect of this application, the text detection module includes a self-attention mechanism module.
[0028] A second aspect of this application provides a text extraction method applied to a cloud-side device, the method comprising:
[0029] Receive a text extraction task from an end-side device, wherein the text extraction task includes target text;
[0030] The first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors are input into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0031] Send the text extraction result to the terminal device;
[0032] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0033] A third aspect of this application provides an electronic device, including:
[0034] An acquisition unit is used to acquire a text extraction task, wherein the text extraction task includes target text;
[0035] The processing unit is used to input the first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0036] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0037] A fourth aspect of this application provides an electronic device, including:
[0038] A receiving unit is configured to receive a text extraction task from an end-side device, wherein the text extraction task includes target text;
[0039] The processing unit is used to input the first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0040] A sending unit is used to send the text extraction result to the terminal device;
[0041] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0042] A fifth aspect of this application provides a text processing system, including: an end-side device and a cloud-side device;
[0043] The edge device sends a text extraction task to the cloud device, and the text extraction task includes the target text;
[0044] The cloud-side device inputs the first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0045] The cloud-side device sends the text extraction result to the terminal-side device;
[0046] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0047] A sixth aspect of this application provides an electronic device, including: a memory, a processor, and a computer program; the computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any of the first aspects of this application, or the method as described in the second aspect of this application.
[0048] A seventh aspect of this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method as described in any of the first aspects of this application, or the method as described in the second aspect of this application.
[0049] An eighth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects of this application, or the method described in the second aspect of this application.
[0050] A ninth aspect of this application provides a chip, the chip including a processor, the processor being configured to invoke a computer program in memory to perform the method described in any of the first aspects of this application, or the method described in the second aspect of this application.
[0051] This application provides a text extraction method, device, and system, relating to the field of information extraction. The method includes: acquiring a text extraction task containing target text; inputting a first sequence of the target text, a second sequence of extraction types pre-configured for the text extraction task, and a third sequence of multiple pre-configured vectors into a pre-trained text extraction model; and performing parallel data processing by multiple text extraction modules within the text extraction model to obtain a text extraction result of the target text. The text extraction result is used to indicate the text elements corresponding to the extraction type. The extraction type includes at least one of entity type, relation type, event type, event argument type, and text sentiment type. This solution, through parallel data processing by multiple text extraction modules, can not only simultaneously output multiple types of extraction results, such as relation extraction results, event extraction results, and sentiment extraction results, but also improve the text extraction speed. Attached Figure Description
[0052] Figure 1 A schematic diagram of a text processing system provided in an embodiment of this application;
[0053] Figure 2 A flowchart illustrating a text extraction method provided in an embodiment of this application;
[0054] Figure 3 This is a schematic diagram of the structure of a text extraction model provided in an embodiment of this application;
[0055] Figure 4 This application provides a schematic diagram of the internal processing flow of a text extraction model according to an embodiment of the present application.
[0056] Figure 5 This is a schematic diagram of the data processing of the first text extraction module provided in an embodiment of this application;
[0057] Figure 6 This is a schematic diagram of the data processing of the second text extraction module provided in an embodiment of this application;
[0058] Figure 7 A flowchart illustrating a text extraction method provided in an embodiment of this application;
[0059] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0060] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0061] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. For example, the terms "first sequence," "second sequence," and "third sequence" are merely used to distinguish different sequences and do not limit their order. Similar descriptions include: "first feature representation" and "second feature representation," "first text extraction module," and "second text extraction module," etc. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" are not necessarily different.
[0064] In this application embodiment, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. "At least one of the following (kind / items)" or similar expressions refer to any combination of these items, including any combination of single (kind / items) or multiple (kind / items). For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0065] It should be noted that, in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0066] Before introducing the technical solutions provided in the embodiments of this application, a brief explanation of the relevant content and technical terms involved in the embodiments of this application will be given first.
[0067] First, the Multi-Layer Perceptron (MLP) is a generalization of the Perceptron Learning Algorithm (PLA). Its most prominent feature is that it has multiple layers of neurons, hence it is also called a Deep Neural Network (DNN). A Multi-Layer Perceptron has at least three layers, including an input layer, intermediate layers (hidden layers), and an output layer. Each node in each layer is connected to every node in the adjacent layers.
[0068] Second, trigger words are important information in event extraction. They generally appear in the event mentions and are the words that most clearly express that the event has occurred. They are usually verbs or nouns. For example, in the sentence "20 years ago, Zhang San graduated," "graduated" is the event trigger word in the event mention text, also known as the trigger word span.
[0069] Third, event type detection: This involves determining the type of an event through classification or other methods. Due to the criticality of trigger words in an event, this can also be considered as trigger word type detection.
[0070] Fourth, Event Argument: The participants in an event, consisting of data such as entities, time, values, and text. For example, in "Zhang San was successfully promoted in 2023", "Zhang San" and "2023" are both event arguments (also known as argument spans) of the "promotion" event.
[0071] Fifth, entity span: entities in the text.
[0072] Sixth, subject span: the subject of an event in the text, and object span: the object of an event in the text.
[0073] Seventh, emotional span: the emotional aspect in the text, usually expressed by adjectives or adverbs. Emotional polarity (or emotional type): an attribute that characterizes the emotional span. For example, the phrase "very beautiful" in "This dress is very beautiful" can be considered an emotional span, and the emotional polarity corresponding to this emotional span is "positive".
[0074] The system architecture of the technical solution in this application will be described first below.
[0075] For example, Figure 1 This is a schematic diagram of a text processing system provided in an embodiment of this application. Figure 1 As shown, this embodiment provides a text processing system including a client 110 and a server 120, wherein the client 110 is connected to the server 120 through a communication network.
[0076] Client 110 may include any one or more user devices suitable for receiving text data. In some embodiments, client 110 may include any suitable type of device. For example, in some embodiments, client 110 may include mobile devices, tablet computers, laptop computers, desktop computers, wearable computers, or any other suitable type of user device, and this application embodiment does not impose any limitation on this. As an example, client 110 sends a text extraction task including target text to server 120. After processing by server 120, client 110 receives the text extraction result returned by server. The text extraction result is used to indicate the entities extracted from the text, the entity types, the relationship types between entities, etc.
[0077] Server 120 can be any suitable server for storing information, data, programs, and / or any other suitable type of content. In some embodiments, server 120 can perform any suitable function. For example, in some embodiments, server 120 receives a text extraction task from a client, the text extraction task including target text, and the server performs various information extractions on the target text based on a text extraction model deployed on it, including, for example, entity recognition, relation extraction, event extraction, and text sentiment extraction. The text extraction model outputs extraction results such as the entity type of each text element in the target text, the relationship type between text elements, the event type of the target text, and the text sentiment type. Server 120 sends the text extraction results to client 110.
[0078] The communication network can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network can include any one or more of the following: the Internet, intranet, wide area network (WAN), local area network (LAN), wireless network, digital subscriber line (DSL) network, frame relay network, asynchronous transfer mode (ATM) network, virtual private network (VPN), and / or any other suitable communication network. Client 110 can connect to the communication network via one or more communication links, which can be linked to server 120 via one or more communication links. The communication link can be any communication link suitable for transmitting data between client 110 and server 120, such as a network link, dial-up link, wireless link, hardwired link, any other suitable communication link, or any suitable combination of such links.
[0079] Although server 120 is illustrated as a single device, in some embodiments, any suitable number of devices may be used to perform the functions performed by server 120. For example, in some embodiments, multiple devices may be used to implement the functions performed by server 120. Alternatively, cloud services may be used to implement the functions of server 120.
[0080] The text extraction scheme provided in this application will be described in detail below through specific embodiments. It should be noted that the technical solutions provided in the embodiments of this application may include some or all of the following contents. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0081] Figure 2 This is a flowchart illustrating a text extraction method provided in an embodiment of this application. The text extraction method provided in this embodiment can be applied to... Figure 1 The server shown, and the text extraction method, include the following steps:
[0082] Step 201. Obtain the text extraction task, which includes the target text.
[0083] In one example, the server receives a text extraction task from a client, which includes target text uploaded by the user via the client.
[0084] Optionally, in some embodiments, the text extraction task also includes a user-defined extraction type.
[0085] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0086] It should be noted that entity type corresponds to the entity recognition task in text extraction, which involves extracting the entity span and entity type from the text. Relation type corresponds to the relation extraction task in text extraction, which involves extracting the subject span, relation type, and object span from the text. Event type and event argument type correspond to the event extraction task in text extraction, which involves extracting the event type, trigger word span, argument type, and argument span from the text. Text sentiment type corresponds to the sentiment extraction task in text extraction, which involves extracting the theme, sentiment span, and sentiment type from the text.
[0087] Step 202. Input the first sequence of the target text, the second sequence of the extraction type pre-configured for the text extraction task, and the third sequence of multiple pre-configured vectors into the pre-trained text extraction model.
[0088] In one example, the server obtains the first sequence of target text from a text extraction task. This first sequence of target text is obtained by converting the target text into a machine-readable numerical sequence based on a pre-defined dictionary.
[0089] In one example, the server obtains the pre-configured extraction types, such as entity types and event types, from the text extraction task and converts the extraction types into a second sequence.
[0090] In one example, the server retrieves multiple pre-configured vectors and transforms them into a third sequence. These vectors can be viewed as a matrix consisting of M n-dimensional vectors, where n is a positive integer greater than 1. The matrix can be denoted as... An n-dimensional vector corresponds to a text extraction module in step 203, which is used for data processing of the text extraction module. For specific execution, please refer to the following embodiments.
[0091] Based on the above examples, the server concatenates the first, second, and third sequences and inputs the concatenated sequence into a pre-trained text extraction model.
[0092] Step 203. Through parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0093] In this embodiment, the text extraction model includes multiple text extraction modules, and the data processing of the multiple text extraction modules is executed in parallel and independently of each other.
[0094] For example, Figure 3 This is a schematic diagram of the structure of a text extraction model provided in an embodiment of this application. For example... Figure 3 As shown, the text extraction model in this embodiment includes an encoding module, a text detection module, multiple text extraction modules, and an extraction result fusion module. The encoding module is connected to the text detection module and the multiple text extraction modules, and the multiple text extraction modules are also connected to the text detection module and the extraction result fusion module. The text extraction module includes two multilayer perceptron (MLP) modules, such as... Figure 3 The first text extraction module includes a first MLP module and a second MLP module, and the second text extraction module includes a third MLP module and a fourth MLP module.
[0095] It should be noted that, Figure 3 Only two text extraction modules are shown. In some embodiments, the text extraction modules may include more than two text extraction modules. This application does not impose any restrictions on this.
[0096] based on Figure 3The text extraction model shown below, combined with the appendix Figure 4 This section provides a detailed explanation of the internal processing steps of the text extraction model. For example, Figure 4 This is a schematic diagram illustrating the internal processing flow of a text extraction model provided in an embodiment of this application. Figure 4 As shown, after the server obtains the first sequence of the target text, the second sequence of the pre-configured extraction type of the text extraction task, and the third sequence of multiple pre-configured vectors, it concatenates the first, second, and third sequences and inputs them into the encoding module of the text extraction model to obtain the first feature representation (ht) and the second feature representation (hq). The first feature representation is the encoded feature representation corresponding to the target text and the extraction type, while the second feature representation includes the encoded feature representations corresponding to the multiple vectors.
[0097] The first feature representation is input into the text detection module of the text extraction model to obtain the text detection result. The text detection result is used to indicate each text element in the target text and the position information of each text element, such as... Figure 4 As shown, the text detection module detects multiple candidate text elements in the target text, along with their position coordinates, such as the first text element (2,2), the second text element (3,4), the third text element (4,2), and the fourth text element (4,3). The position coordinates of each text element refer to the coordinates of its position within the target text. Figure 4 The position coordinates in the matrix shown. For example, the target text is "Zhang San takes office as the general manager of Company A. He is conscientious and responsible in his work". After text detection, the first text element in the target text is "Zhang San", the second text element is "take office", the third text element is "Company A", and the fourth text element is "conscientious and responsible".
[0098] In one example, the text detection module includes a self-attention mechanism module.
[0099] After the text detection module outputs the text detection result, the text detection result, the first feature representation, and the second feature representation are used as inputs to multiple text extraction modules of the text extraction model. Through parallel data processing by these multiple text extraction modules, multiple text extraction results are obtained. The parallel data processing of these multiple text extraction modules is independent of each other.
[0100] To facilitate understanding of the solution, the following section uses a text extraction model, including a first text extraction module and a second text extraction module, as an example to explain in detail the parallel data processing process of multiple text extraction modules in the text extraction model.
[0101] It should be noted that the second feature representation output by the encoding module includes a third feature representation and a fourth feature representation. For example, the third feature representation may be the first vector among a pre-configured plurality of vectors (e.g., The corresponding encoded feature representation, the fourth feature representation can be the second vector among a pre-configured set of vectors (e.g., The corresponding encoded feature representation.
[0102] It should also be noted that different text extraction modules correspond to different vectors among multiple vectors. For example, the first text extraction module uses the encoded feature representation corresponding to the first vector among multiple vectors to perform data processing; the second text extraction module uses the encoded feature representation corresponding to the second vector among multiple vectors to perform data processing.
[0103] The internal processing procedures of the first text extraction module and the second text extraction module are described below.
[0104] For the first text extraction module, the text detection result, the first feature representation, and the third feature representation are input into the first text extraction module. After data processing by the first text extraction module, the first text extraction result of the first text element in the target text is obtained. For example, Figure 4 The first text extraction module selects the first text element (2,2) from the text detection results, combines the first feature representation and the third feature representation of the input, and determines the first text extraction result of the first text element. The first text extraction module sends the first text extraction result to the extraction result fusion module.
[0105] For example, Figure 5 This is a schematic diagram of data processing for the first text extraction module provided in an embodiment of this application. (See attached diagram.) Figure 5 As shown, the first text extraction module includes a first multilayer perceptron (MLP) module and a second MLP module. The first MLP module acquires the text detection result, a first feature representation (ht), and a third feature representation (e.g., ...). The first MLP module selects the first text element (2,2) from the text detection results. After processing by the first MLP module, an intermediate result of the first text extraction result is obtained. The intermediate result is used to indicate at least one text element (e.g., the third text element (3,4)) that is related to the first text element (2,2). Subsequently, the intermediate result and the first feature representation (ht) are input into the second MLP module. After processing by the second MLP module, the first text extraction result is obtained.
[0106] In one example, the first text extraction result is used to indicate the entity type of the first text element and the relationship type between the first text element and the third text element. For example, the first text element is "Zhang San", the third text element is "Company A", the entity type of the first text element is "person", and the relationship type between the first text element and the third text element is "works at".
[0107] Figure 5 The example first text extraction module extracts entity types and relation types from the target text, realizing entity recognition and relation extraction of the target text.
[0108] For the second text extraction module, the text detection result, the first feature representation, and the fourth feature representation are input into the second text extraction module. After data processing by the second text extraction module, the second text extraction result of the second text element in the target text is obtained. For example, Figure 4 The second text extraction module selects the second text element (4,2) from the text detection results, combines the first feature representation and the fourth feature representation of the input, and determines the second text extraction result of the second text element. The second text extraction module sends the second text extraction result to the extraction result fusion module.
[0109] For example, Figure 6 This is a schematic diagram illustrating the data processing of the second text extraction module provided in an embodiment of this application. For example... Figure 6 As shown, the second text extraction module includes a third MLP module and a fourth MLP module. The third MLP module acquires the text detection result, the first feature representation (ht), and the fourth feature representation (e.g., ...). The third MLP module selects the second text element (4,2) from the text detection results. After processing by the third MLP module, an intermediate result of the second text extraction result is obtained. The intermediate result is used to indicate at least one text element (e.g., the first text element (2,2) and the third text element (3,4)) that is related to the second text element (4,2). Subsequently, the intermediate result and the first feature representation (ht) are input into the fourth MLP module. After processing by the fourth MLP module, the second text extraction result is obtained.
[0110] In one example, the second text extraction result is used to indicate the event type of the second text element, as well as the argument types of the first and third text elements associated with the second text element. For example, the second text element is the trigger word "appointment" for the event, the first text element "Zhang San" has the argument type "employee", and the third text element "Company A" has the argument type "employer".
[0111] In the example above, the first text extraction module and the second text extraction module perform data processing in parallel and independently of each other.
[0112] Figure 6 The example shows the second text extraction module, which extracts the event type and argument type from the target text, thus achieving event extraction from the target text.
[0113] In some embodiments, the multiple text extraction modules further include a third text extraction module, which includes a fifth MLP module and a sixth MLP module. Similar to the first and second text extraction modules, the fifth MLP module in the third text extraction module can be used to identify at least one text element (emotional span) associated with the first text element (theme of (person)), and the sixth MLP module can be used to determine the emotional polarity of at least one text element associated with the first text element. For example, if the first text element is "Zhang San" and the fourth text element associated with the first text element is "conscientious and responsible", the corresponding emotional type is "praise".
[0114] It should be noted that the structures of the first, second, third, and fourth MLP modules are similar. In order to distinguish the different MLP modules, the MLP modules in the different text extraction modules are sequentially numbered. Figure 4 Only two text extraction modules are shown. Other text extraction modules also include two MLP modules, and their internal processing is similar to that of the first or second text extraction module. Data processing in each text extraction module is executed in parallel and is independent of the others.
[0115] Based on the examples above, refer to Figure 4 The text extraction result fusion module of the text extraction model determines the text extraction result of the target text based on the text extraction results output by multiple text extraction modules, such as the first text extraction result output by the first text extraction module and the second text extraction result output by the second text extraction module. In this example, the extraction result fusion module integrates the text extraction results output by each text extraction module, performs data fusion and summarization on the text extraction results, and outputs the final text extraction result of the target text.
[0116] It should also be noted that in some embodiments, both the first text extraction module and the second text extraction module can be used to extract entity types and relation types from the target text. The first and second text extraction modules can analyze the entity types and relation types in the target text based on different text elements. For example, the first text extraction module extracts entity types and relation types from the target text based on first text elements (such as...). Figure 5 As shown in the diagram, the second text extraction module extracts entity types and relation types (not shown) from the target text based on the third text element. In this way, the extraction result fusion module can combine the text extraction results output by the first and second text extraction modules respectively to determine the entity types and relation types in the target text. The parallel execution of multiple text extractions not only improves the text extraction speed but also the accuracy of text extraction.
[0117] It should also be noted that the internal processing of multiple text extraction modules is similar. For each text extraction module, the text is first processed by the first MLP module in that text extraction module, and then processed by the second MLP module in that text extraction module. The first MLP module is mainly used to identify other text elements in the target text that are associated with the candidate text elements. The second MLP module is mainly used to determine the extraction type of each text element in the target text. The extraction types include entity type, relation type, event type, argument type, and text sentiment type, etc.
[0118] The text extraction method illustrated in this application obtains a text extraction task containing target text. A first sequence of the target text, a second sequence of extraction types pre-configured for the text extraction task, and a third sequence of multiple pre-configured vectors are input into a pre-trained text extraction model. Through parallel data processing by multiple text extraction modules within the model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text elements corresponding to the extraction type. The extraction type includes at least one of entity type, relation type, event type, event argument type, and text sentiment type. This scheme, through parallel data processing by multiple text extraction modules, can not only simultaneously output multiple types of extraction results, such as relation extraction results, event extraction results, and sentiment extraction results, but also improve the text extraction speed.
[0119] Figure 7 This is a flowchart illustrating a text extraction method provided in an embodiment of this application. Figure 7 As shown, the text extraction method provided in this embodiment includes the following steps:
[0120] Step 701. The edge device sends a text extraction task to the cloud device. The text extraction task includes the target text.
[0121] Step 702. The cloud-side device inputs the first sequence of the target text, the second sequence of the extraction type pre-configured for the text extraction task, and the third sequence of multiple pre-configured vectors into the pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained.
[0122] The text extraction result is used to indicate the text element corresponding to the extraction type.
[0123] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0124] Step 703. The cloud-side device sends the text extraction results to the end-side device.
[0125] Step 702 in this embodiment can be referred to step 202 in the previous embodiment, and will not be repeated here.
[0126] In the text extraction method shown in this embodiment, after receiving a text extraction task from the terminal device, the cloud-side device can obtain various types of text extraction results through parallel data processing of multiple text extraction modules in the pre-trained text extraction model deployed on the cloud-side device, such as the entity type, relation type, event type, and argument type of the text. At the same time, since the multiple text extraction modules in the model are processed in parallel, the speed of text extraction by the cloud-side device is improved.
[0127] In some of the processes described in the above embodiments and figures, multiple operations are included that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The sequence numbers are merely used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.
[0128] The text extraction method provided by the embodiments of this application has been described above. The electronic device provided by the embodiments of this application will be described below.
[0129] For example, Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 8 As shown, the electronic device 800 of this embodiment includes: an acquisition unit 801 and a processing unit 802.
[0130] The acquisition unit 801 is used to acquire a text extraction task, wherein the text extraction task includes target text;
[0131] The processing unit 802 is used to input the first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0132] The extraction types mentioned therein include at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0133] In an optional embodiment of this example, the text extraction model further includes: an encoding module, a text detection module, and an extraction result fusion module;
[0134] Processing unit 802 is used to input the first sequence, the second sequence and the third sequence into the encoding module of the text extraction model to obtain the first feature representation and the second feature representation;
[0135] The first feature representation is the encoded feature representation corresponding to the target text and the extraction type, and the second feature representation includes the encoded feature representation corresponding to the plurality of vectors.
[0136] In an optional embodiment of this example, the processing unit 802 is configured to:
[0137] The first feature representation is input into the text detection module of the text extraction model to obtain the text detection result, which is used to indicate each text element in the target text and the position information of each text element.
[0138] The text detection result, the first feature representation, and the second feature representation are used as inputs to multiple text extraction modules of the text extraction model. After parallel data processing by the multiple text extraction modules, multiple text extraction results are obtained.
[0139] The extraction result fusion module of the text extraction model determines the text extraction result of the target text based on the multiple text extraction results.
[0140] In an optional embodiment of this example, the second feature representation includes a third feature representation and a fourth feature representation, wherein the third feature representation is the encoded feature representation corresponding to the first vector among the plurality of vectors, and the fourth feature representation is the encoded feature representation corresponding to the second vector among the plurality of vectors; the plurality of text extraction modules include a first text extraction module and a second text extraction module;
[0141] The processing unit 802 is used to input the text detection result, the first feature representation and the third feature representation into the first text extraction module, and after data processing by the first text extraction module, obtain the first text extraction result of the first text element in the target text.
[0142] The processing unit 802 is further configured to input the text detection result, the first feature representation, and the fourth feature representation into the second text extraction module, and after data processing by the second text extraction module, obtain the second text extraction result of the second text element in the target text.
[0143] In an optional embodiment of this embodiment, the first text extraction module includes a first multilayer perceptron (MLP) module and a second MLP module; the processing unit 802 is used for:
[0144] The text detection result, the first feature representation, and the third feature representation are input into the first MLP module. After processing by the first MLP module, an intermediate result of the first text extraction result is obtained. The intermediate result is used to indicate at least one text element that is related to the first text element.
[0145] The intermediate results and the first feature representation are input into the second MLP module. After processing by the second MLP module, the first text extraction result is obtained.
[0146] In an optional embodiment of this embodiment, the second text extraction module includes a third MLP module and a fourth MLP module; the processing unit 802 is used for:
[0147] The text detection result, the first feature representation, and the fourth feature representation are input into the third MLP module. After processing by the third MLP module, an intermediate result of the second text extraction result is obtained. The intermediate result is used to indicate at least one text element that is related to the second text element.
[0148] The intermediate results and the first feature representation are input into the fourth MLP module. After processing by the fourth MLP module, the second text extraction result is obtained.
[0149] In an optional embodiment of this example, the text detection module includes a self-attention mechanism module.
[0150] The electronic device shown in the embodiments of this application can execute the technical solutions of the foregoing method embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0151] For example, Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 9 As shown, the electronic device 900 of this embodiment includes: a receiving unit 901, a processing unit 902, and a transmitting unit 903.
[0152] The receiving unit 901 is used to receive a text extraction task from the end-side device, wherein the text extraction task includes target text;
[0153] The processing unit 902 is used to input the first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type.
[0154] Sending unit 903 is used to send the text extraction result to the terminal device;
[0155] The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type.
[0156] The electronic devices shown in the embodiments of this application can be cloud-side devices that can execute the technical solutions of the aforementioned method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0157] For example, Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device 1000 includes a memory 1001 and a processor 1002. The memory 1001 stores computer programs and can be configured to store various other data to support operation on the electronic device. The processor 1002, coupled to the memory 1001, executes the computer programs in the memory 1001 to implement the technical solutions of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0158] In some embodiments, such as Figure 10 As shown, the electronic device also includes other components such as a firewall 1003, a load balancer 1004, a communication component 1005, and a power supply component 1006. Figure 10 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 10 The components shown.
[0159] This application provides a text processing system, as shown in the attached document. Figure 1 The system includes end-side devices (e.g., Figure 1 The client 110 shown) and cloud-side devices (e.g., Figure 1 As shown in the server 120, cloud-side devices can communicate and connect with end-side devices through the end-cloud link.
[0160] In this embodiment, the edge device specifically refers to the text data production device, including but not limited to smartphones, laptops, tablets, wearable devices, and smart home appliances. The edge device is responsible for the production, collection, and uploading of text data. The cloud device can be a central cloud device with a distributed architecture or an edge cloud device with a distributed architecture. The cloud device provides powerful computing and storage capabilities, and can extract information, including but not limited to entities, relationships, events, and sentiment, from the text data uploaded by the edge device.
[0161] In one example, the edge device sends a text extraction task to the cloud device. The text extraction task includes target text. The cloud device inputs a first sequence of the target text, a second sequence of extraction types pre-configured for the text extraction task, and a third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type. The cloud device sends the text extraction result to the edge device. The extraction type includes at least one of the following: entity type, relation type, event type and argument type of the event, and text sentiment type.
[0162] In the text processing system shown in this embodiment, the cloud-side device can simultaneously predict multiple types of information in the target text, such as entities, relationships, events, and sentiments, through a pre-trained text extraction model. The types of information extracted are more diversified, and the information extraction speed is faster because the text extraction model can process data in parallel.
[0163] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the technical solution described in the foregoing method embodiments.
[0164] This application provides a computer program product, including a computer program / instructions, which, when executed by a processor, cause the processor to implement the technical solution as described in the foregoing method embodiments.
[0165] This application provides a chip, including a processing module and a communication interface. The processing module is capable of executing the technical solutions described in the foregoing method embodiments. In some embodiments, the chip further includes a storage module (e.g., a memory), which stores instructions. The processing module executes the instructions stored in the storage module, and the execution of the instructions stored in the storage module causes the processing module to execute the technical solutions described in the foregoing method embodiments.
[0166] The aforementioned storage can be object storage (OSS).
[0167] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0168] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, and other mobile communication networks, or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0169] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0170] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0171] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0172] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0173] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0174] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0175] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0176] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0177] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0178] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A text extraction method, characterized in that, include: Obtain a text extraction task, wherein the text extraction task includes target text; The first sequence of the target text, the second sequence of the extraction type pre-configured for the text extraction task, and the third sequence of multiple pre-configured vectors are input into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type. The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type. The text extraction model also includes: an encoding module, a text detection module, and an extraction result fusion module; The step of inputting the first sequence of the target text, the second sequence of the extraction type pre-configured for the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model includes: inputting the first sequence, the second sequence, and the third sequence into the encoding module of the text extraction model to obtain a first feature representation and a second feature representation; the first feature representation is the encoded feature representation corresponding to the target text and the extraction type, and the second feature representation includes the encoded feature representation corresponding to the multiple vectors; The process of obtaining the text extraction result of the target text through parallel data processing by multiple text extraction modules in the text extraction model includes: inputting the first feature representation into the text detection module of the text extraction model to obtain a text detection result, wherein the text detection result is used to indicate each text element in the target text and the position information of each text element; using the text detection result, the first feature representation, and the second feature representation as inputs to multiple text extraction modules of the text extraction model, and obtaining multiple text extraction results through parallel data processing by the multiple text extraction modules; and the extraction result fusion module of the text extraction model determining the text extraction result of the target text based on the multiple text extraction results.
2. The method according to claim 1, characterized in that, The second feature representation includes a third feature representation and a fourth feature representation. The third feature representation is the encoded feature representation corresponding to the first vector among the plurality of vectors, and the fourth feature representation is the encoded feature representation corresponding to the second vector among the plurality of vectors. The plurality of text extraction modules include a first text extraction module and a second text extraction module. The text detection result, the first feature representation, and the second feature representation are used as inputs to multiple text extraction modules of the text extraction model. Through parallel data processing by these multiple text extraction modules, multiple text extraction results are obtained, including: The text detection result, the first feature representation, and the third feature representation are input into the first text extraction module. After data processing by the first text extraction module, the first text extraction result of the first text element in the target text is obtained. The text detection result, the first feature representation, and the fourth feature representation are input into the second text extraction module. After data processing by the second text extraction module, the second text extraction result of the second text element in the target text is obtained.
3. The method according to claim 2, characterized in that, The first text extraction module includes a first multilayer perceptron (MLP) module and a second MLP module. The text detection result, the first feature representation, and the third feature representation are input into the first text extraction module. After data processing by the first text extraction module, a first text extraction result of the first text element in the target text is obtained, including: The text detection result, the first feature representation, and the third feature representation are input into the first MLP module. After processing by the first MLP module, an intermediate result of the first text extraction result is obtained. The intermediate result is used to indicate at least one text element that is related to the first text element. The intermediate results and the first feature representation are input into the second MLP module. After processing by the second MLP module, the first text extraction result is obtained.
4. The method according to claim 2, characterized in that, The second text extraction module includes a third MLP module and a fourth MLP module; the text detection result, the first feature representation, and the fourth feature representation are input into the second text extraction module, and after data processing by the second text extraction module, the second text extraction result of the second text element in the target text is obtained, including: The text detection result, the first feature representation, and the fourth feature representation are input into the third MLP module. After processing by the third MLP module, an intermediate result of the second text extraction result is obtained. The intermediate result is used to indicate at least one text element that is related to the second text element. The intermediate results and the first feature representation are input into the fourth MLP module. After processing by the fourth MLP module, the second text extraction result is obtained.
5. A text extraction method, characterized in that, Applied to cloud-side devices, the method includes: Receive a text extraction task from an end-side device, wherein the text extraction task includes target text; The first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors are input into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type. Send the text extraction result to the terminal device; The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type; The text extraction model also includes: an encoding module, a text detection module, and an extraction result fusion module; The step of inputting the first sequence of the target text, the second sequence of the extraction type pre-configured for the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model includes: inputting the first sequence, the second sequence, and the third sequence into the encoding module of the text extraction model to obtain a first feature representation and a second feature representation; the first feature representation is the encoded feature representation corresponding to the target text and the extraction type, and the second feature representation includes the encoded feature representation corresponding to the multiple vectors; The process of obtaining the text extraction result of the target text through parallel data processing by multiple text extraction modules in the text extraction model includes: inputting the first feature representation into the text detection module of the text extraction model to obtain a text detection result, wherein the text detection result is used to indicate each text element in the target text and the position information of each text element; using the text detection result, the first feature representation, and the second feature representation as inputs to multiple text extraction modules of the text extraction model, and obtaining multiple text extraction results through parallel data processing by the multiple text extraction modules; and the extraction result fusion module of the text extraction model determining the text extraction result of the target text based on the multiple text extraction results.
6. A text processing system, characterized in that, include: End-side equipment and cloud-side equipment; The edge device sends a text extraction task to the cloud device, and the text extraction task includes the target text; The cloud-side device inputs the first sequence of the target text, the second sequence of the extraction type pre-configured by the text extraction task, and the third sequence of multiple pre-configured vectors into a pre-trained text extraction model. After parallel data processing by multiple text extraction modules in the text extraction model, the text extraction result of the target text is obtained. The text extraction result is used to indicate the text element corresponding to the extraction type. The cloud-side device sends the text extraction result to the terminal-side device; The extraction type includes at least one of the following: entity type, relation type, event type and event argument type, and text sentiment type; The text extraction model also includes: an encoding module, a text detection module, and an extraction result fusion module; The cloud-side device inputs a first sequence of the target text, a second sequence of the extraction type pre-configured for the text extraction task, and a third sequence of multiple pre-configured vectors into a pre-trained text extraction model, including: inputting the first sequence, the second sequence, and the third sequence into the encoding module of the text extraction model to obtain a first feature representation and a second feature representation; the first feature representation is the encoded feature representation corresponding to the target text and the extraction type, and the second feature representation includes the encoded feature representation corresponding to the multiple vectors; The process of obtaining the text extraction result of the target text through parallel data processing by multiple text extraction modules in the text extraction model includes: inputting the first feature representation into the text detection module of the text extraction model to obtain a text detection result, wherein the text detection result is used to indicate each text element in the target text and the position information of each text element; using the text detection result, the first feature representation, and the second feature representation as inputs to multiple text extraction modules of the text extraction model, and obtaining multiple text extraction results through parallel data processing by the multiple text extraction modules; and the extraction result fusion module of the text extraction model determining the text extraction result of the target text based on the multiple text extraction results.
7. An electronic device, characterized in that, include: Memory, processor, and computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Petition element extraction method and extraction system based on deep learning model
CN113806548A