Open relation extraction method, electronic device and storage medium

By translating the source language text into English and using the phrase alignment model for Chinese and English alignment, the data quality and applicability problems of cross-language open relationship extraction in the prior art are solved, and simplified and accurate relationship extraction is achieved.

CN114254640BActive Publication Date: 2024-11-12AISPEECH CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202111609569.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-11-12
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

In the existing technology, open relationship extraction that relies on remote supervision has data quality problems, and large-scale relationship entities are difficult to obtain, and the missed marking problem during remote supervision is difficult to solve. Some technologies mainly support English texts and are not friendly to other language fields. .

Method used

Get the source language relationship tuple collection, suitable for all language types, without building large-scale construction, by translating the source language text with the preset phrase alignment model Translated or open relationship extraction datasets.

Benefits of technology

It realizes open relationship extraction across languages, simplifies the process, improves the accuracy and applicability of the extraction results, applies to all languages, and avoids the need to build large-scale data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254640B_ABST
    Figure CN114254640B_ABST
Patent Text Reader

Abstract

The present invention discloses an open relation extraction method, an electronic device and a storage medium, wherein the method comprises: inputting an English translation text corresponding to a source language text into a preset tool for open relation extraction, obtaining at least one English relation tuple set corresponding to the English translation text as output; and using a preset phrase alignment model to perform Chinese-English phrase alignment on the English relation tuple set and the source language text to obtain a source language relation tuple set. In an embodiment of the present invention, a source language relation tuple set can be obtained by performing Chinese-English phrase alignment on the English relation tuple set and the source language text using a preset phrase alignment model. The method is applicable to all languages, and does not require the construction of a large-scale translation data set or a large-scale open relation extraction data set. The overall function can be realized by performing some simple phrase alignment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of open relationship extraction, and in particular relates to an open relationship extraction method, electronic equipment and storage medium. Background Art

[0002] In the prior art, the relevant technologies include "Chinese open relationship prediction method, device, computer equipment and storage medium" (CN111476035A), which uses named entity recognition to determine entity pairs, and once a preset pattern is hit, it enters a specific relationship prediction model to obtain an open relationship; "Open relationship extraction method, device, electronic equipment and storage medium" (CN113051356A) uses remote supervision to construct a training set, trains the model in a deep learning manner and predicts the entity relationship of the entity; "A Chinese unsupervised open entity relationship extraction method based on dependency semantics" (CN107291687A) extracts relationship triples according to whether the syntactic structure mapped by the dependency path matches the paradigm of the dependency semantic paradigm set; "A Chinese open entity relationship extraction method using dependency analysis" (CN104933027B) combines heuristic rules and dependency analysis to determine the entity position, determines the named entity position according to the distance and outputs the triple. "Open language learning for information extraction" (US20140156264A1) provides a system for extracting relation tuples from sentences. The system includes a bootstrap, an open pattern learner, and a pattern matcher.

[0003] For the "Chinese Open Relation Prediction Method, Device, Computer Equipment and Storage Medium" (CN111476035A), entity pairs are constructed according to the named entities and the content of the sentence to be predicted; when the entity type matches the preset pattern, it is input into the relationship prediction model again to obtain the relationship type of the entity pair. The "Open Relation Extraction Method, Device, Electronic Equipment and Storage Medium" (CN113051356A) uses remote supervision to construct a training set, trains the model and predicts the entity relationship of the entity, clusters the entities and relationships, and obtains the relationship extraction results. "A Chinese Unsupervised Open Entity Relationship Extraction Method Based on Dependency Semantics" (CN107291687A) performs Chinese word segmentation, named entity recognition, part-of-speech tagging and dependency syntax analysis on the text, and arbitrarily selects two entities from the named entity recognition to find the dependency path between the two. Once the dependency path meets the predefined paradigm match, it is further parsed to obtain the relationship triple.

[0004] The inventors found that the above-mentioned technology relies on the quality of the data obtained by remote supervision, and large-scale relationship entity pairs are difficult to obtain. The problem of missing labels in the remote supervision process is also difficult to solve. Experts are also required to develop flexible and high-precision paradigms. For some texts, the extraction results are not ideal. Some of them mainly support English texts and are not friendly to texts in other language fields. Summary of the invention

[0005] The embodiments of the present invention aim to solve at least one of the above technical problems.

[0006] In a first aspect, an embodiment of the present invention provides an open relationship extraction method, comprising: inputting an English translation text corresponding to a source language text into a preset tool for open relationship extraction, and obtaining at least one English relationship tuple set corresponding to the English translation text as output; using a preset phrase alignment model to perform Chinese-English phrase alignment on the English relationship tuple set and the source language text to obtain a source language relationship tuple set, wherein the input of the preset phrase alignment model is the source language text and each English phrase text in the English relationship tuple set, and the output of the preset phrase alignment model is each source language phrase text corresponding to each English phrase text, and the source language relationship tuple is composed of each source language phrase text.

[0007] In a second aspect, an embodiment of the present invention provides an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the above-mentioned open relationship extraction methods of the present invention.

[0008] In a third aspect, an embodiment of the present invention provides a storage medium, in which one or more programs including execution instructions are stored. The execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute any of the above-mentioned open relationship extraction methods of the present invention.

[0009] In a fourth aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product comprises a computer program stored on a storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes any one of the above-mentioned open relationship extraction methods.

[0010] The embodiment of the present invention can obtain a source language relation tuple set by using a preset phrase alignment model to align the English relation tuple set and the source language text with Chinese and English phrases. This method is applicable to all languages ​​and does not require the construction of a large-scale translation dataset or a large-scale open relation extraction dataset. Only some simple phrase alignment is required to achieve the overall function. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0012] Figure 1 A flowchart of an embodiment of an open relationship extraction method of the present invention;

[0013] Figure 2 A flowchart of another embodiment of the open relationship extraction method of the present invention;

[0014] Figure 3 An example diagram of calling the preset tool provided by the present invention;

[0015] Figure 4 An example diagram of a preset phrase alignment model provided by the present invention;

[0016] Figure 5 A process flow chart of an open relationship extraction method provided by an embodiment of the present invention;

[0017] Figure 6 It is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0020] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0021] In the present invention, "module", "device", "system" and the like refer to related entities applied to computers, such as hardware, a combination of hardware and software, software or software in execution, etc. In detail, for example, an element can be, but is not limited to, a process, a processor, an object, an executable element, an execution thread, a program and / or a computer running on a processor. In addition, an application or script program running on a server, a server can all be an element. One or more elements can be in an execution process and / or thread, and an element can be localized on a computer and / or distributed between two or more computers, and can be operated by various computer-readable media. An element can also communicate through local and / or remote processes according to a signal with one or more data packets, for example, a signal from a data that interacts with another element in a local system, a distributed system, and / or a network on the Internet through a signal to interact with other systems.

[0022] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include" and "comprise" include not only those elements, but also other elements that are not explicitly listed, or also include elements inherent to such processes, methods, articles or equipment. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or equipment that includes the elements.

[0023] The embodiment of the present invention provides an open relationship extraction method, which can be applied to electronic devices. The electronic devices can be computers, servers, or other electronic products, etc., which are not limited in the present invention.

[0024] Please refer to Figure 1 , which shows an open relationship extraction method provided by an embodiment of the present invention.

[0025] like Figure 1As shown, in step 101, an English translation text corresponding to a source language text is input into a preset tool for open relation extraction, and at least one English relation tuple set corresponding to the English translation text is obtained as output;

[0026] In step 102, a preset phrase alignment model is used to perform Chinese-English phrase alignment on the English relation tuple set and the source language text to obtain a source language relation tuple set, wherein the input of the preset phrase alignment model is the source language text and each English phrase text in the English relation tuple set, the output of the preset phrase alignment model is each source language phrase text corresponding to each English phrase text, and the source language relation tuple is composed of each source language phrase text;

[0027] In this embodiment, for step 101, the English translation text corresponding to the source language text is input into a preset tool for open relation extraction, and at least one English relation tuple set corresponding to the English translation text is outputted. For example, the source language is "Yao Ming is a basketball player" which is converted into "YaoMing is a basketball player" by using the translation tool. "YaoMing is a basketball player" is subjected to open relation extraction to obtain an English relation tuple set (YaoMing, is, a basketball player). Any language is converted into English through the translation tool, and the converted English is input into the open relation extraction tool for extraction to obtain an English relation tuple set corresponding to the English translation text, wherein the source language can be any language, and the translation tool can be any translation tool on the market.

[0028] Afterwards, for step 102, the English relation tuple set and the source language text are aligned in Chinese and English by using a preset phrase alignment model to obtain a source language relation tuple set, wherein the input of the preset phrase alignment model is the source language text and each English phrase text in the English relation tuple set, and the output of the preset phrase alignment model is each source language phrase text corresponding to each English phrase text, and the source language relation tuple is composed of each source language phrase text. For example, the English relation tuple set (YaoMing, is, a basketball player) and "Yao Ming is a basketball player" are aligned in Chinese and English by using a preset phrase alignment model to obtain a source language relation tuple set (Yao Ming, is, a basketball player).

[0029] The method of the embodiment of the present application can obtain a source language relationship tuple set by aligning the English relationship tuple set and the source language text with Chinese and English phrases using a preset phrase alignment model. This method is applicable to all languages ​​and does not require the construction of a large-scale translation dataset or a large-scale open relationship extraction dataset. It only requires some simple phrase alignment to achieve the overall function.

[0030] In some optional embodiments, when the results of aligning the English relation tuple set and the source language text by using a preset phrase alignment model cannot completely correspond, the source language text is post-processed. For example, when the source language is "Yao Ming is a basketball player", the results obtained by aligning the English relation tuple set and the source language text by using a preset phrase alignment model are in line with expectations. When the source language is "Shanghai Men's Basketball Team investor Yao Ming Will Become Chairman", it is translated as Shanghai Men's Basketball Team investor Yao Ming Will Become Chairman, and the English relation tuple set is (Yao Ming; investor; Shanghai Men's Basketball Team). Therefore, the Chinese relation tuple result is (Yao Ming, investor, Shanghai Men's Basketball Team). The results obtained by the Chinese and English phrase alignment cannot completely correspond. At this time, the source language text needs to be post-processed to ensure that each English phrase text and each source language phrase text are accurately corresponding one by one.

[0031] In the method of the embodiment of the present application, when the result obtained by aligning the Chinese and English phrases cannot completely correspond, the result obtained by aligning the Chinese and English phrases can be made to maintain a one-to-one correspondence by post-processing the source language text.

[0032] In some optional embodiments, if there is an automatically completed English phrase text in the English relationship tuple set, the source language phrase text corresponding to the automatically completed English phrase text is automatically completed with the preceding and following prepositions. For example, the source language is "Shanghai Men's Basketball Team investor Yao Ming will serve as chairman", which is translated into "Shanghai Men's Basketball Teaminvestor Yao Ming Will Become Chairman". The resulting English relationship tuple set is (Yao Ming; [is]investor[of]; Shanghai Men's Basketball Team), and the investor is directly aligned with "investor". The resulting Chinese relationship tuple result is (Yao Ming, investor, Shanghai Men's Basketball Team). The English open relationship extraction automatically completes the preceding and following prepositions, so corresponding post-processing is required to complete the relationship from "investor" to "is the investor of...", and the final relationship tuple result is (Yao Ming, is the investor of..., Shanghai Men's Basketball Team), [is]investor[of] is aligned with "investor", and after completing the preceding and following prepositions, it becomes "is the investor of..."

[0033] The method of the embodiment of the present application can achieve corresponding results of Chinese and English phrase alignment by automatically completing the preceding and following prepositions of the source language phrase text corresponding to the automatically completed English phrase text, wherein each English phrase text and each source language phrase text are accurately corresponding one by one.

[0034] In some alternative embodiments, if there is a content of another source language short text in a certain source language short text in the set of source language relation tuples, the content of the other source language short text is removed from the certain source language short text to obtain the post-processed certain source language short text. For example, the source language is "Readers may be bored with a large amount of repetitive data in the book", and after translation, it is "The reader may weary of so many repetitive statistics". The obtained English relation tuple set is (the reader, may weary of, so many repetitive statistics), where the phrases corresponding to "may weary of" are "may be bored with" and "be weary of" respectively, and the alignment result of "so many repetitive statistics" is "a large amount of repetitive data". No matter how the alignment is done, some parts will always be omitted or other phrase alignment parts will be covered. Therefore, during training, the phrase alignment model is biased towards maximizing the alignment result, that is, finding the corresponding Chinese boundary Start as "Readers may be bored with" and End as "烦" according to the English, obtaining the alignment result "Readers may be bored with a large amount of repetitive data in the book", and then removing according to the object in the relation tuple to obtain the relation "may be bored with...", and the final extraction result is (Readers, may be bored with..., a large amount of repetitive data in the book). So when aligning "May weary of", "a large amount of repetitive data" needs to be removed.

[0035] The method of the embodiment of the present application removes the object in the relation tuple to obtain the open relation extraction result, which can make the result obtained by the Chinese-English phrase alignment keep corresponding, and each English short text and each source language short text correspond precisely one by one.

[0036] In some optional embodiments, if there are meaningless English phrase texts in the English relation tuple set, the alignment result with the meaningless English phrase texts will be set to empty when generating the source language relation tuple set. For example, the source language is "The kids are impolite and too noisy", which is translated into "The kids have badmanners and make too much noise". The English relation tuple set is (The kids, have, badmanners), (The kids, make, too much noise), where "have" and "make" in the English relation tuple set have no practical meaning, and the alignment result given by the preset phrase alignment model is empty. However, the English phrases "badmanners" and "too much noise" correspond to "impolite" and "too noisy" respectively, so the final extraction result is converted into two tuples (kids, impolite) and (kids, too noisy), and the alignment result of the meaningless English phrase texts is set to empty.

[0037] The method of the embodiment of the present application can achieve a one-to-one correspondence between the results of the alignment of Chinese and English phrases by setting the alignment results of the English phrase texts that have no practical meaning in the English relation tuple set to null.

[0038] Please refer to Figure 2 , which shows another open relationship extraction method provided by an embodiment of the present invention. Figure 1 A flow chart of further defined steps.

[0039] like Figure 2 As shown, in step 201, the input source language text and the English phrase text to be aligned are tokenized respectively to obtain a source language tokenization result and an English phrase tokenization result;

[0040] In step 202, the concatenation result of the source language tokenization result and the English phrase tokenization result is input into a pre-trained language representation model for encoding;

[0041] In step 203, an output feature matrix of the pre-trained language representation model is obtained, wherein the output feature matrix corresponds to the starting position and the ending position of the English phrase tokenization result in the source language tokenization result respectively;

[0042] In step 204, a source language phrase text corresponding to the English phrase text is output based on the start position and the end position.

[0043] In this embodiment, for step 201, the input source language text and the English phrase text to be aligned are tokenized respectively to obtain the source language tokenization result and the English phrase tokenization result. For step 202, the source language tokenization result and the English phrase tokenization result are spliced, and the spliced ​​result is input into the pre-trained language representation model for encoding. Then, for step 203, the output feature matrix of the pre-trained language representation model is obtained, and the output feature matrix corresponds to the starting position and the ending position of the English phrase tokenization result in the source language tokenization result. ,

[0044] Then, for step 204, the source language phrase text corresponding to the English phrase text is output according to the starting position and the ending position in the source language tokenization result.

[0045] The method of the embodiment of the present application tokenizes the source language text and the corresponding English text respectively, then inputs the processed results into a pre-trained language representation model for encoding, and outputs the starting position and ending position of the source language tokenization results. According to the starting position and the ending position, the source language phrase text corresponding to the English phrase text can be obtained.

[0046] In some optional embodiments, the loss formula is used for calculation when the preset phrase alignment model is trained. When H is the output after being encoded by the language representation model, only the corresponding part of the result in Chinese is fully connected to obtain logits: logits = W·H[1:n]+b, where the dimension of W is (hidden_dims, 2) and the dimension of b is (2,). Therefore, the dimension of the final output feature matrix logits is (n, 2), which is the logical matrix corresponding to start and end respectively. The loss formula of this model is as follows:

[0047]

[0048] in, Indicates the true label of the start row corresponding to the i-th position, with a value range of 0 or 1. Indicates the probability that the label of the start row corresponding to the i-th position is 1; Indicates the true label of the end row corresponding to the i-th position, with a value range of 0 or 1. Indicates the probability that the label of the end row corresponding to the i-th position is 1.

[0049] Please refer to Figure 3 , which shows an example diagram of the preset tool call of the present invention.

[0050] like Figure 3As shown, the preset tool is the OpenIE5.1 tool, and the English translation text is input into the OpenIE5.1 tool for open relation extraction, wherein a single sentence is input and relation extraction is performed each time.

[0051] The input of this tool is English text. According to the calling experience, the more sentences in the input text, the longer the parsing time of the tool will be, and the accuracy will decrease accordingly. Therefore, in order to ensure the accuracy of relation tuple extraction, each call is made with a single sentence, and the returned result is in the form of a list, with the first column value being the confidence of the relation tuple, and the following is the relation tuple.

[0052] Please refer to Figure 4 , which shows an example diagram of the preset phrase alignment model provided by the present invention.

[0053] like Figure 4 As shown, after obtaining multiple English relation tuple sets, each English phrase needs to be aligned with the Chinese text.

[0054] Tokenize the input Chinese text and the translation results that need to be aligned, and input the concatenated results into the BERT model for encoding. Let H be the output after encoding by the BERT layer, and only take the corresponding part of the Chinese results for full connection to obtain logits:

[0055] logits=W·H[1:n]+b

[0056] The dimension of W is (hidden_dims, 2), and the dimension of b is (2,). Therefore, the dimension of the final output feature matrix logits is (n, 2), which is the logical matrix corresponding to start and end respectively. The loss formula of this model is as follows:

[0057]

[0058] in, Indicates the true label of the start row corresponding to the i-th position, with a value range of 0 or 1 (for example Figure 4 The first row is the start row, so the start label of the first row is 1, and the start label of the second row is 0. Similarly, the label of the first row is 0, and the label of the second row is 1). represents the probability that the start row label of the i-th position is 1 (for example, Figure 4In the first line, the fourth position, that is, the position corresponding to "一" is the starting position of the Chinese short text corresponding to "a basketball player", and the position corresponding to "员" is the ending position of the Chinese short text corresponding to "a basketball player". Therefore, the Chinese short text output by the phrase alignment model corresponding to "a basketball player" is "一名篮球运动员"); and Similarly.

[0059] It should be noted that the design process of this article includes three main steps and involves three models or tools. Although this article uses Chinese as the source language for illustration, those skilled in the art can understand that the source language can be any:

[0060] The first step is a machine translation system, which involves a Chinese-English translation model. The input of this step is a Chinese text, and the output is the English translation result of this Chinese text. The field of machine translation has developed relatively maturely in recent years and can basically meet the requirements of this process.

[0061] The second step is English open relation extraction, which involves the OpenIE5.1 tool. The input of this tool is an English text, and the output is the English relation tuples contained in this text.

[0062] The third step is Chinese-English phrase alignment, which involves a phrase alignment model based on mBERT (bert-base-multilingual-cased). This model is created by this article. The expected input is a Chinese text and an English short text. It is known that this English short text must correspond to a certain phrase in the Chinese text, and the output of the model is the Chinese short text corresponding to this English short text.

[0063] After performing phrase alignment on each English phrase in each relation tuple of the second step, multiple groups of Chinese relation tuples are obtained. This set of relation tuples is the open relation extraction result of the input Chinese text in the first step.

[0064] The process proposed in this article integrates the models in various fields well, such as machine translation and English open relation extraction. The development of these fields is relatively mature and the error propagation is low. Moreover, the process proposed in this article does not require building large-scale Chinese-English translation datasets or large-scale open relation extraction datasets. Only by doing some simple Chinese-English phrase alignment can the overall function be achieved.

[0065] Please refer to Figure 5 , which shows the implementation flowchart of the open relation extraction method of the present invention.

[0066] such as Figure 5As shown, step 1: Chinese to English translation based on machine translation system;

[0067] The input Chinese text is passed through the online translation API or offline translation model to obtain the English translation result of the Chinese sentence, which is then parsed by the subsequent English open relation extraction tool. This paper uses the trained offline translation package to obtain the English translation result in the Encoder-Decoder method.

[0068] Step 2: Extract English triples based on OpenIE5.1 tool;

[0069] The input of this tool is English text. According to the calling experience, the more sentences in the input text, the longer the parsing time of the tool will be, and the accuracy will decrease accordingly. Therefore, in order to ensure the accuracy of relation tuple extraction, it is called with a single sentence each time.

[0070] Step 3: Align Chinese and English phrases;

[0071] After step (2), multiple relation tuple sets are obtained. At this time, each English phrase needs to be aligned with the Chinese text.

[0072] Step 4: Entity Relationship Post-Processing

[0073] For simple sentences, Figure 5 For example, the relation extraction result after phrase alignment is (Yao Ming, is, a basketball player), which is in line with expectations. In actual calls, it is not difficult to find that there are some special sentence patterns in the process of Chinese-English translation, such as inversion.

[0074] Case 1.

[0075] English: Yao Ming, investor of Shanghai Men's Basketball Team, will serve as chairman.

[0076] English: Shanghai Men's Basketball Team investor Yao Ming Will BecomeChairman.

[0077] OpenIE5.1:

[0078] 0.88(Yao Ming;[is]investor[of];Shanghai Men's Basketball Team)

[0079] This example has two extraction results. For the first extraction result, the direct alignment result of "investor" is "投资人", so the resulting Chinese relation tuple is (Yao Ming, 投资人, Shanghai Men's Basketball Team). Obviously, this sentence is incorrect. From the English extraction result, it can be seen that OpenIE5.1 automatically completes the prepositions before and after this sentence. Therefore, in such cases, corresponding post-processing needs to be done, and the relation should be completed from "投资人" to "是…的投资人". Finally, the relation tuple result is (Yao Ming, 是…的投资人, Shanghai Men's Basketball Team).

[0080] Case 2.

[0081] Chinese: Readers may be bored with the large amount of repetitive data in the book.

[0082] English: The reader may weary of so many repetitive statistics.

[0083] OpenIE5.1:

[0084] 0.96(the reader, may weary of, so many repetitive statistics)

[0085] For the phrase "may weary of,", it is difficult to find a completely corresponding phrase in the text. The relatively corresponding phrases are "可能会对" and "感到厌烦" respectively. No matter how the alignment is done, some parts will always be omitted or other phrase alignment parts will be covered. This is caused by translation grammar.

[0086] Therefore, to solve this problem, after the OpenIE5.1 results are obtained and before the phrase alignment based on the multilingual BERT model, some post-processing is done. During training, we make the phrase alignment model tend to maximize the alignment result, that is, find the corresponding Chinese boundaries according to the English, obtain the alignment result "可能会对书中大量的重复数据感到厌烦", and then eliminate according to the object in the relation tuple to get the relation "可能会对…感到厌烦". Finally, the extraction result is (读者, 可能会对…感到厌烦, 书中大量的重复数据).

[0087] Case 3.

[0088] Chinese: The kids are impolite and too noisy.

[0089] English: The kids have bad manners and make too much noise.

[0090] OpenIE5.1:

[0091] 0.97(The kids,have,bad manners)

[0092] 0.94(The kids,make,too much noise)

[0093] In this example, have and make have no practical meaning, and the phrase alignment model gives an empty alignment result, but the phrases "bad manners" and "too much noise" correspond to "impolite" and "too noisy" respectively, so the final extraction result is converted into a bigram (children, impolite) and (children, too noisy).

[0094] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of combined actions, but those skilled in the art should be aware that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0095] In some embodiments, an embodiment of the present invention provides a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored. The execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute any of the above-mentioned open relationship extraction methods of the present invention.

[0096] In some embodiments, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any one of the above-mentioned open relationship extraction methods.

[0097] In some embodiments, an embodiment of the present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the open relationship extraction method.

[0098] Figure 6is a schematic diagram of the hardware structure of an electronic device for executing an open relationship extraction method provided by another embodiment of the present application, such as Figure 6 As shown, the device includes:

[0099] One or more processors 610 and memory 620, Figure 6 A processor 610 is taken as an example.

[0100] The device for executing the open relationship extraction method may further include: an input device 630 and an output device 640 .

[0101] The processor 610, the memory 620, the input device 630 and the output device 640 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0102] The memory 620 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the open relationship extraction method in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 620, that is, the open relationship extraction method in the above method embodiment is implemented.

[0103] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the open relationship extraction device, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the open relationship extraction device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0104] The input device 630 can receive input digital or character information and generate signals related to user settings and function control of the open relationship extraction device. The output device 640 can include display devices such as display screens.

[0105] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, the open relationship extraction method in any of the above method embodiments is executed.

[0106] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0107] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:

[0108] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.

[0109] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.

[0110] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0111] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.

[0112] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An open relation extraction method, comprising: Inputting the English translation text corresponding to the source language text into a preset tool for open relation extraction, and obtaining at least one English relation tuple set corresponding to the English translation text as output, wherein the preset tool includes an OpenIE5.1 tool, and each time a single sentence is input and relation extraction is performed; Use a preset phrase alignment model to perform Chinese-English phrase alignment on the English relation tuple set and the source language text to obtain a source language relation tuple set, wherein the input of the preset phrase alignment model is the source language text and each English phrase text in the English relation tuple set, the output of the preset phrase alignment model is each source language phrase text corresponding to each English phrase text, the source language relation tuple is composed of each source language phrase text, the expected input of the preset phrase alignment model is a sentence of Chinese text and a paragraph of English phrase text, it is known that the English phrase text must correspond to a phrase in the Chinese text, and the output of the preset phrase alignment model is the Chinese phrase text corresponding to the English phrase text; The preset phrase alignment model includes performing phrase alignment using the following steps: tokenizing the input source language text and the English phrase text to be aligned respectively to obtain a source language tokenization result and an English phrase tokenization result; inputting the concatenation result of the source language tokenization result and the English phrase tokenization result into a pre-trained language representation model for encoding; obtaining an output feature matrix of the pre-trained language representation model, wherein the output feature matrix corresponds to a starting position and an ending position of the English phrase tokenization result in the source language tokenization result respectively; and outputting a source language phrase text corresponding to the English phrase text based on the starting position and the ending position.

2. The method according to claim 1, wherein: After obtaining the source language relation tuple set, the method further includes: When the results of performing Chinese-English phrase alignment on the English relation tuple set and the source language text using a preset phrase alignment model cannot completely correspond, the source language text is post-processed.

3. The method according to claim 2, wherein: The post-processing of the source language text comprises: If there is an automatically completed English phrase text in the English relation tuple set, the preceding and following prepositions are automatically completed for the source language phrase text corresponding to the automatically completed English phrase text.

4. The method according to claim 2, wherein: The post-processing of the source language text further comprises: If there is a source language phrase text in the source language relation tuple set that contains the content of other source language phrase texts, the content of other source language phrase texts is removed from the source language phrase text to obtain a post-processed source language phrase text.

5. The method according to claim 2, wherein: The post-processing of the English relation tuple set further comprises: If there are meaningless English phrase texts in the English relation tuple set, the alignment result with the meaningless English phrase texts is set to null when generating the source language relation tuple set.

6. The method according to claim 1, wherein: The preset phrase alignment model is trained using the following loss formula: in, Indicates the true label of the start row corresponding to the i-th position, with a value range of 0 or 1. Indicates the probability that the label of the start row corresponding to the i-th position is 1; Indicates the true label of the end row corresponding to the i-th position, with a value range of 0 or 1. Indicates the probability that the label of the end row corresponding to the i-th position is 1.

7. An electronic device, comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method described in any one of claims 1 to 6.

8. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • An Open Chinese Entity Relationship Extraction Method Using Dependency Analysis

    CN104933027B

  • Dependency semantic-based Chinese unsupervised open entity relationship extraction method

    CN107291687A

  • Chinese open relationship prediction method and device, computer equipment and storage medium

    CN111476035A

  • Open relationship extraction method and device, electronic equipment and storage medium

    CN113051356A

  • Open language learning for information extraction

    US20140156264A1