A knowledge extraction method, system, device and storage medium

By constructing syntactic trees and using knowledge prediction classification models, the problem of extracting redundant knowledge from text data is solved, achieving efficient extraction of core knowledge, and is applicable to the portability and scalability of knowledge graphs.

CN116226397BActive Publication Date: 2025-12-30CHEZHI HULIAN BEIJING SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310033751.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2025-12-30
Estimated Expiration
2043-01-10

AI Technical Summary

Technical Problem

Existing technologies struggle to extract knowledge from text data by focusing on the core components while avoiding redundant parts, resulting in overly redundant extracted knowledge.

Method used

By constructing a syntactic tree, generating candidate knowledge using syntactic relation templates and syntactic analysis tools, reviewing it using a knowledge prediction model, and classifying it using a knowledge classification model, the correct core knowledge is identified.

Benefits of technology

It enables the extraction of only core knowledge from text data, reducing redundancy and improving the accuracy of knowledge extraction, and is suitable for the portability and scalability of knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226397B_ABST
    Figure CN116226397B_ABST
Patent Text Reader

Abstract

The present disclosure discloses a knowledge extraction method, system, device and storage medium. The knowledge extraction method comprises: obtaining and processing text data describing an object to determine a plurality of sentences and an object category corresponding to each sentence; generating a syntax relationship template for each sentence, the syntax relationship template comprising the part of speech of each word and the dependency relationship between the words; generating a syntax tree corresponding to each sentence through syntax analysis; matching the syntax relationship template and the syntax tree, and if the match is consistent, generating a candidate knowledge using the matched syntax subtree; using a knowledge prediction model to predict whether the candidate knowledge is correct knowledge; and using a knowledge classification model to process the predicted correct knowledge to identify the knowledge category corresponding to each piece of knowledge. The knowledge extracted according to the present scheme has the characteristics of low redundancy and high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a knowledge extraction method, system, device and storage medium. Background Technology

[0002] Knowledge extraction is one of the core problems in knowledge graph construction. Knowledge graphs generally draw from two sources: structured data (such as linked data and databases) and text data. For structured data, important information can be directly extracted as knowledge. However, extracting knowledge from text data is not so easy. Currently, knowledge extraction from text data mainly relies on triple extraction. On the one hand, triple extraction depends on a large amount of labeled data for model training; on the other hand, the triple extraction method depends on the NER (Named Entity Recognition) model, which can lead to overly redundant phrases. For example, in the text describing a vehicle: "In terms of appearance, the new car's front face adopts a familiar 'X' shape," the desired extraction would be "The new car's front face adopts an 'X' shape." However, since NER can only extract continuous text content, the final extraction is "The new car's front face adopts a familiar 'X' shape," meaning it cannot extract more refined phrases.

[0003] Therefore, a new knowledge extraction scheme is needed that can extract only the core parts from text data without extracting the redundant parts, so that the extracted knowledge is more concise. Summary of the Invention

[0004] This disclosure provides a knowledge extraction scheme in an attempt to solve or at least alleviate at least one of the problems mentioned above.

[0005] According to one aspect of this disclosure, a knowledge extraction method is provided, comprising: acquiring and processing text data describing an object to determine multiple sentences and the object category corresponding to each sentence; generating syntactic relation templates for each sentence, the syntactic relation templates including the parts of speech of each word and the dependency relations between words; generating a syntactic tree corresponding to each sentence through syntactic analysis; matching the syntactic relation templates and the syntactic trees, and if the match is consistent, generating candidate knowledge using the matched syntactic subtrees; predicting whether the candidate knowledge is correct knowledge using a knowledge prediction model; and processing the predicted correct knowledge using a knowledge classification model to identify the knowledge category corresponding to each piece of knowledge.

[0006] Optionally, the method according to this disclosure further includes: for knowledge whose knowledge category is identified, associating the knowledge, the object category corresponding to the knowledge, and the knowledge category to obtain a knowledge base.

[0007] Optionally, in the method according to this disclosure, the step of acquiring and processing text data describing a specific object to determine multiple sentences and the object category corresponding to each sentence includes: acquiring text data describing a specific object, the text data containing multiple articles; identifying the object category corresponding to each article, and segmenting each article into sentences to obtain the association between each sentence and its corresponding object category.

[0008] Optionally, in the method according to this disclosure, the step of generating a syntax tree corresponding to each sentence through syntactic analysis includes: performing dependency parsing on each sentence using HanLP to obtain corresponding syntactic analysis results; and generating a syntax tree using the syntactic analysis results, wherein each node of the syntax tree is a word and its corresponding part of speech, and nodes are connected through parent-node relationships.

[0009] Optionally, in the method according to this disclosure, the step of matching the syntactic relation template and the syntactic tree, and generating candidate knowledge using the matched syntactic subtree if the match is consistent, includes: traversing the syntactic relation template, determining whether there is a syntactic subtree in the syntactic tree that corresponds to the syntactic relation template; if there is, the match is consistent, and extracting the nodes of the matched syntactic subtree; concatenating the extracted nodes in syntactic order to generate a phrase as candidate knowledge corresponding to the object category.

[0010] Optionally, in the method according to this disclosure, the step of matching the syntactic relation template and the syntactic tree, and generating candidate knowledge using the matched syntactic subtree if a match is found, further includes: traversing the syntactic tree to generate a set of candidate knowledge as a first set.

[0011] Optionally, in the method according to this disclosure, the step of using a knowledge prediction model to predict whether the candidate knowledge is correct knowledge further includes: selecting a portion of candidate knowledge from the first set for annotation, and using the annotated candidate knowledge and its annotation data to generate a knowledge verification training set, wherein the annotation data includes correct and incorrect; using the knowledge verification training set to train and generate a knowledge prediction model; selecting the remaining candidate knowledge from the first set and inputting it into the knowledge prediction model to predict whether the input candidate knowledge is correct knowledge.

[0012] Optionally, in the method according to this disclosure, the step of processing the predicted correct knowledge using a knowledge classification model to identify the knowledge category corresponding to each piece of knowledge includes: generating a second set using the knowledge predicted as correct; selecting a portion of the correct knowledge from the second set and labeling the corresponding knowledge categories as a knowledge classification training set; training and generating a knowledge classification model using the knowledge classification training set; and selecting the remaining correct knowledge from the second set and inputting it into the knowledge classification model to identify the knowledge category of the input correct knowledge.

[0013] Optionally, in the method according to this disclosure, both the knowledge prediction model and the knowledge classification model are based on a long short-term memory neural network (LSTM).

[0014] Optionally, in the method according to this disclosure, the object is a vehicle, and the object category is a vehicle series; the knowledge categories include: space, power, handling, fuel consumption, comfort, appearance, interior, and cost-effectiveness.

[0015] According to another aspect of this disclosure, a knowledge extraction system is provided, comprising: a syntactic analysis device, including: a preprocessing unit adapted to acquire and process text data describing objects to determine multiple sentences and the object category corresponding to each sentence; a first analysis unit adapted to generate syntactic relation templates for each sentence, the syntactic relation templates including the parts of speech of each word and the dependency relationships between words; a second analysis unit adapted to generate a syntactic tree corresponding to each sentence through syntactic analysis; a matching processing unit adapted to match the syntactic relation templates and the syntactic trees, and if the match is consistent, to generate candidate knowledge using the matched syntactic subtrees; a knowledge prediction device adapted to use a knowledge prediction model to predict whether the candidate knowledge is correct knowledge; and a knowledge classification device adapted to use a knowledge classification model to process the predicted correct knowledge to identify the knowledge category corresponding to each piece of knowledge.

[0016] According to another aspect of this disclosure, a computing device is provided, comprising: one or more processor memories; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods described above.

[0017] According to another aspect of this disclosure, a computer-readable storage medium is provided for storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform any of the methods described above.

[0018] In summary, according to the scheme disclosed herein, candidate knowledge is extracted from sentences by summarizing the syntactic relation templates corresponding to knowledge and combining them with syntactic analysis algorithms. Then, the candidate knowledge is reviewed using a classification model to obtain correct knowledge, which forms the first set. Next, a knowledge classification model is used to classify the knowledge in the first set and identify the corresponding knowledge category. Since this scheme extracts knowledge through syntactic structure, only the core parts can be extracted, without extracting redundant parts, resulting in relatively concise candidate knowledge. Furthermore, a text classification model is used to further review and classify the extracted candidate knowledge, eliminating the need for extensive labeled corpora for model training.

[0019] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description

[0020] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0021] Figure 1 A schematic diagram of a knowledge extraction system 100 according to some embodiments of the present disclosure is shown;

[0022] Figure 2 A schematic diagram of a computing device 200 according to some embodiments of the present disclosure is shown;

[0023] Figure 3 A flowchart illustrating a knowledge extraction method 300 according to some embodiments of the present disclosure is shown.

[0024] Figure 4 A schematic diagram of a syntactic relation template according to some embodiments of the present disclosure is shown;

[0025] Figure 5 A schematic diagram of a syntax tree according to some embodiments of the present disclosure is shown. Detailed Implementation

[0026] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0027] According to the knowledge extraction scheme disclosed herein, based on a specific object, firstly, knowledge is extracted from text data describing the specific object by constructing a syntactic tree; then, the extracted knowledge is reviewed by a knowledge prediction model to filter out the correct knowledge; finally, the knowledge is classified to clarify the knowledge category to which it belongs.

[0028] Furthermore, taking vehicles as a specific example, this solution can extract core knowledge from massive amounts of text data, identify the category to which the knowledge belongs, and then associate it with the vehicle series it describes.

[0029] Figure 1 A schematic diagram of a knowledge extraction system 100 according to this disclosure is shown. Figure 1 As shown, the knowledge extraction system 100 includes: a syntactic analysis device 110, a knowledge prediction device 120, and a knowledge classification device 130.

[0030] Specifically, for text data describing a specific object, the syntactic analysis device 110 constructs a syntactic tree, matches the corresponding syntactic subtree from a pre-generated syntactic relation template, and generates alternative knowledge based on the matched syntactic subtree.

[0031] According to some embodiments, the syntactic analysis device 110 further includes: a preprocessing unit 112, a first analysis unit 114, a second analysis unit 116, and a matching processing unit 118.

[0032] The preprocessing unit 112 acquires and processes the text data describing the object to determine multiple sentences and the object category corresponding to each sentence. As mentioned earlier, the object is a vehicle, and the corresponding object category is a car series. In some embodiments, articles explaining a single car series are acquired, and the car series name corresponding to the article is obtained. Then, each article is segmented into sentences to obtain a set of "sentence-car series".

[0033] The first analysis unit 114 generates syntactic relation templates for each sentence. In some embodiments, effective knowledge is manually summarized to extract knowledge from sentences; then, the extracted knowledge is segmented to obtain multiple words and the part of speech of each word is determined; then, each word is treated as a node, and syntactic relation templates are generated based on the dependency relationships between words. The syntactic relation templates include the part of speech of each word (node) and the dependency relationships between words (nodes).

[0034] The second analysis unit 116 generates syntactic trees for each sentence through syntactic analysis. Many open-source dependency parsing tools exist; according to some embodiments, HanLP is used to perform dependency parsing on each sentence separately, thereby generating syntactic trees. Dependency parsing relies on the results of word segmentation and part-of-speech tagging. Dependency parsing predicts the relationship between every two words in a supervised manner, thus obtaining the syntactic relations. The specific algorithm is not detailed here.

[0035] The matching processing unit 118 matches the syntactic relation template and the syntactic tree. If the match is consistent, the matching syntactic subtree is used to generate candidate knowledge. According to some embodiments, all syntactic relation templates are traversed to determine whether there is a syntactic subtree in the syntactic tree that corresponds to the syntactic relation template. If it exists, the match is consistent, and the nodes of the matching syntactic subtree are extracted to generate candidate knowledge.

[0036] Subsequently, the set of candidate knowledge is fed into the knowledge prediction device 120, which performs knowledge verification on these candidate knowledge to filter out the correct knowledge. In some embodiments, the knowledge prediction device 120 uses a knowledge prediction model to predict whether the candidate knowledge is correct.

[0037] Subsequently, the combination of correctly predicted knowledge is fed into the knowledge classification device 130, which classifies the knowledge and clarifies its knowledge category. Knowledge categories revolve around the object and include, for example, aspects such as space, power, handling, fuel consumption, comfort, appearance, interior, and cost-effectiveness, but are not limited to these. In some embodiments, the knowledge classification device 130 uses a knowledge classification model to process the predicted correct knowledge to identify the knowledge category corresponding to each piece of knowledge.

[0038] According to the knowledge extraction system 100 disclosed herein, a scheme for knowledge mining from text data is provided, which yields knowledge with low redundancy and high accuracy. In knowledge graph mining, it possesses portability and scalability.

[0039] Furthermore, although this example uses a vehicle series as the subject, it should be understood that this solution is not limited to this. Based on the knowledge extraction scheme described in this disclosure, knowledge can be extracted from other objects or domains to generate knowledge with low redundancy and high accuracy.

[0040] According to this disclosure, the knowledge extraction system 100 can be displayed using one or more computing devices.

[0041] Figure 2 A structural block diagram of a computing device 200 according to an embodiment of the present disclosure is shown.

[0042] like Figure 2 As shown, in basic configuration 202, computing device 200 typically includes system memory 206 and one or more processors 204. Memory bus 208 can be used for communication between processor 204 and system memory 206.

[0043] Depending on the desired configuration, processor 204 can be any type of processor, including but not limited to: microprocessors (μP), microcontrollers (μC), digital information processors (DSPs), or any combination thereof. Processor 204 may include one or more levels of cache such as L1 cache 210 and L2 cache 212, processor core 214, and registers 216. Example processor core 214 may include an arithmetic logic unit (ALU), a floating-point unit (FPU), a digital signal processing (DSP) core, or any combination thereof. Example memory controller 218 may be used with processor 204, or in some implementations, memory controller 218 may be an internal part of processor 204.

[0044] Depending on the desired configuration, system memory 206 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device typically refers to volatile RAM, and data on a disk needs to be loaded into physical memory before it can be read by processor 204. System memory 206 may include operating system 220, one or more applications 222, and program data 224. In some embodiments, applications 222 may be arranged to execute instructions on the operating system using program data 224 by one or more processors 204. Operating system 220 may be, for example, Linux, Windows, etc., and includes program instructions for handling basic system services and performing hardware-dependent tasks. Applications 222 include program instructions for implementing various user-desired functions, and applications 222 may be, for example, browsers, instant messaging software, software development tools (such as integrated development environments (IDEs), compilers, etc.), but are not limited to these.

[0045] When the computing device 200 starts up, the processor 204 reads the program instructions of the operating system 220 from the memory 206 and executes them. The application 222 runs on the operating system 220 and uses the interfaces provided by the operating system 220 and the underlying hardware to implement various functions expected by the user. When the user starts the application 222, the application 222 is loaded into the memory 206, and the processor 204 reads and executes the program instructions of the application 222 from the memory 206.

[0046] The computing device 200 also includes a storage device 232, which includes a removable storage device 236 (e.g., CD, DVD, USB flash drive, portable hard drive, etc.) and a non-removable storage device 238 (e.g., hard disk drive, HDD, etc.). Both the removable storage device 236 and the non-removable storage device 238 are connected to the storage interface bus 234.

[0047] The computing device 200 may also include a storage interface bus 234. The storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to the basic configuration 202 via the bus / interface controller 230. At least a portion of the operating system 220, applications 222, and program data 224 may be stored on the removable storage 236 and / or the non-removable storage 238, and loaded into system memory 206 via the storage interface bus 234 when the computing device 200 is powered on or when the application 222 is to be executed, and executed by one or more processors 204.

[0048] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via a bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via a network communication link through one or more communication ports 264.

[0049] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in a modulated data signal, such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A “modulated data signal” can be a signal whose data set, or its modifications, can be encoded as information within the signal. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media including sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term “computer-readable medium” as used herein can include both storage media and communication media.

[0050] The computing device 200 can be implemented as a personal computer, including desktop and laptop computer configurations. Of course, the computing device 200 can also be implemented as part of a small-sized portable (or mobile) electronic device, such as a cellular phone, digital camera, personal digital assistant (PDA), personal media player device, wireless network browsing device, personal head-mounted device, application-specific device, or a hybrid device that may include any of the above functions. It can even be implemented as a server, such as a file server, database server, application server, and web server. The embodiments of the present invention do not limit this.

[0051] In an embodiment according to this disclosure, computing device 200 is configured to execute knowledge extraction method 300 according to this disclosure. An application 222 arranged on an operating system includes multiple program instructions for executing one or more of the above methods, which can instruct processor 204 to execute the methods of this disclosure to achieve knowledge extraction.

[0052] Figure 3 A flowchart illustrating a knowledge extraction method 300 according to some embodiments of the present disclosure is shown. In some embodiments, method 300 is performed using the aforementioned system 100. It should be understood that the descriptions of method 300 and system 100 are complementary, and related details will not be repeated.

[0053] like Figure 3 As shown, method 300 begins with step 310.

[0054] In step 310, the text data describing the object is obtained and processed to determine multiple sentences and the object category corresponding to each sentence.

[0055] Specifically, text data describing a specific object (e.g., a vehicle) is obtained, which contains multiple articles; then, the object category corresponding to each article is identified, and each article is segmented into sentences to obtain the relationship between each sentence and its corresponding object category (e.g., vehicle series).

[0056] According to some embodiments, a large number of articles about a single vehicle series are obtained from websites and other sources as text data describing the vehicles. Simultaneously, the vehicle series name corresponding to each article is obtained. Then, each article is segmented into sentences, resulting in a set of "sentence-vehicle series". This disclosure does not limit the specific algorithm used for sentence segmentation.

[0057] Furthermore, in some embodiments, the vehicle series is used to indicate the model of the vehicle, typically consisting of "brand + model". Examples include BMW M series, BMW 8 Series, Audi S series, and so on.

[0058] In step 320, syntactic relation templates for each sentence are generated.

[0059] According to this disclosure, the syntactic relation template includes the parts of speech of each word and the dependency relations between words. Dependency syntax theory posits that there is a master-subordinate relationship between words. In a sentence, if one word modifies another word, the modifier is called the subordinate word, the modified word is called the governing word, and the grammatical relationship between them is called a dependency relation.

[0060] According to some implementation methods, effective knowledge is extracted from sentences by manually summarizing it. Then, the extracted knowledge is segmented into multiple words, and the part of speech of each word is determined. Next, each word is treated as a node, and a syntactic relation template is generated based on the dependency relationships between words. Parts of speech include, for example, nouns, adjectives, verbs, pronouns, and numerals.

[0061] Figure 4 A schematic diagram of a syntactic relation template according to some embodiments of the present disclosure is shown. For example, the sentence is: "The side profile of the BMW 3 Series is very smooth and aesthetically pleasing.", where the extracted knowledge is "the side profile is smooth and aesthetically pleasing," and the syntactic relation template for this knowledge is as follows: Figure 4 As shown, node1 represents "smoothness," node2 represents "side view," node3 represents "line," node4 represents "aesthetics," and node5 represents "extremely." "f" represents "locative word," "n" represents "noun," and "a" represents "adjective." In Figure 4 In Chinese, an arrow is used to connect two words to indicate a dependency relationship between them. Furthermore, as... Figure 4 As shown, in this sentence, "side view" and "smooth" are in an adverbial-head relationship (adverbial-head structure), "lines" and "smooth" are in a subject-verb relationship, "extremely" and "aesthetically pleasing" are in a modifier-head relationship, and "aesthetically pleasing" and "smooth" are in a coordinate relationship. Furthermore, a sentence has one and only one word as its root node, which does not depend on other words.

[0062] Furthermore, the syntactic order corresponding to this syntactic relation template is "node2:f, node3:n, node1:a, node5:n, node4:n".

[0063] In step 330, syntactic trees are generated for each sentence through syntactic analysis.

[0064] Syntactic parsing is a key technique in natural language processing (NLP). It involves analyzing text to obtain its syntactic structure. Analyzing syntactic structure is necessary for language understanding itself, as syntactic parsing is a crucial component of language understanding. It also supports other NLP tasks. Dependency analysis identifies the interdependencies between words in a sentence.

[0065] Representing the dependencies of all words in a sentence as directed edges yields a tree, called a dependency syntax tree. Dependency syntax trees have the following four binding axioms:

[0066] 1) A sentence has one and only one word as the virtual root node, which does not depend on other words;

[0067] 2) All words must depend on other words;

[0068] 3) Each word can only depend on one other word;

[0069] 4) If word A depends on B, then word C, which is located between A and B, can only depend on words between A, B, or AB.

[0070] In this syntactic tree, each node represents a word and its corresponding part of speech, and nodes are connected through a parent-child relationship, meaning that each node has a unique parent node.

[0071] Dependency parsing relies on the results of word segmentation and part-of-speech tagging. Simply put, dependency parsing predicts the relationship between any two words in a supervised manner, thus obtaining syntactic relations. Many open-source dependency parsing tools exist, and their specific algorithms are not detailed here. According to this disclosure, HanLP is selected to perform dependency parsing on each sentence separately, yielding corresponding syntactic analysis results. Then, using these results, a (dependency) syntax tree is generated.

[0072] Figure 5 A schematic diagram of a syntax tree according to some embodiments of this disclosure is shown. For example, the sentence "The side profile of the BMW 3 Series is very smooth and aesthetically pleasing." Figure 5 As shown, the nodes obtained after syntactic analysis are: "side view", "line", "very", "of", "smooth", ",", "extremely", "aesthetically pleasing", and ".". Connecting these nodes with directed edges generates a syntactic tree. Similarly, Figure 5 The Chinese text indicates the part of speech of each word, where "f" represents a locative word, "n" represents a noun, "a" represents an adjective, "u" represents an auxiliary word, "b" represents an adverb, and "w" represents a punctuation mark.

[0073] Next, in step 340, a manually summarized syntactic relation template is matched with a syntactic tree generated by a syntactic analysis tool to extract information that can be used as knowledge (i.e., candidate knowledge) from the syntactic tree. According to some embodiments, when a match is found, candidate knowledge is generated using the matched syntactic subtree.

[0074] Specifically, all syntactic relation templates are traversed to determine if a syntactic subtree corresponding to a given syntactic relation template exists in the syntactic tree. A syntactic subtree is a tree consisting of one node in the syntactic tree and all its nodes. If a match is found, the nodes of the matched syntactic subtree are extracted. Then, the extracted nodes are concatenated in syntactic order to generate a phrase, which serves as candidate knowledge for the object category.

[0075] In some embodiments, all syntax trees are traversed until all are matched, and the generated alternative knowledge is used to generate a set of alternative knowledge, which serves as the first set.

[0076] In step 350, a knowledge prediction model is used to predict whether the candidate knowledge is correct.

[0077] According to some embodiments, a portion of candidate knowledge (in some embodiments, tens of thousands of candidate knowledge items are randomly selected) is selected from the first set and labeled. The labeling data includes "correct" and "incorrect". Then, the labeled candidate knowledge and the labeled data are used to generate a knowledge audit training set.

[0078] Subsequently, a knowledge prediction model is trained using a knowledge audit training set. According to some embodiments of this disclosure, the knowledge prediction model is used to predict whether the input knowledge is correct. In some embodiments, the knowledge prediction model is a model based on a Long Short-Term Memory (LSTM) neural network; more specifically, the knowledge prediction model is an LSTM binary classification model, with classification results including correct knowledge and incorrect knowledge.

[0079] The LSTM model is a special type of RNN model, primarily addressing the long-range dependency problem in RNNs. In standard RNNs, the repeating module has a very simple structure, such as a single tanh layer. For each node, the input token embedding and the hidden state of the previous node are used as input, and the output of the current node's hidden state is used for the next node. The hidden state of the last node is then input into a softmax model for classification. To address the long-range dependency problem in RNNs, the LSTM model was proposed. LSTM also has a similar chain structure, but the repeating module has a different structure, mainly consisting of three gates: the forget gate, the input gate, and the output gate. The forget gate determines how much of the previous node's output needs to be remembered. The input gate determines which current and historical information needs to be remembered. The output gate determines which of the remembered information is particularly important and prioritizes its memorization.

[0080] According to the embodiments of this disclosure, candidate knowledge from the knowledge review training set is input into a pre-trained knowledge prediction model. After processing, a classification result is output (the classification result is, for example, the probability that the candidate knowledge is correct). The parameters of the model are adjusted using labeled data and the classification result until training is completed. The knowledge prediction model at this point is the final knowledge prediction model generated by training. The training process and specific structure of the LSTM model will not be elaborated here. It should be understood that knowledge prediction models can also be generated based on models such as TEXTCNN and BERT used for performing text classification tasks. This disclosure does not impose many limitations on this.

[0081] After training is completed, the remaining candidate knowledge in the first set is selected as the test set, input into the trained knowledge prediction model, and after processing, the corresponding classification result is output to predict whether the input candidate knowledge is correct.

[0082] In step 360, the predicted correct knowledge is processed using a knowledge classification model to identify the knowledge category corresponding to each piece of knowledge.

[0083] According to some implementation methods, a second set is generated using knowledge that is predicted to be correct (i.e., positive samples). Thus, the second set stores the knowledge that is considered correct for each object category (vehicle series), but the category corresponding to each piece of knowledge is unknown. For example, the second set may contain correct knowledge such as "Audi A4L (vehicle series name) - Stylish Exterior (knowledge)" and "Audi A4L (vehicle series name) - Luxurious Interior (knowledge)", but the category corresponding to each piece of knowledge is unknown.

[0084] Therefore, in some embodiments, a subset of correct knowledge is selected from the second set and its corresponding knowledge category is labeled to serve as a knowledge classification training set.

[0085] Next, a knowledge classification model is trained using a knowledge classification training set. This model processes the input knowledge to identify its category. For vehicles, knowledge categories include, for example, space, power, handling, fuel consumption, comfort, exterior, interior, and cost-effectiveness, describing vehicle attributes. In some embodiments, the knowledge classification model, like the knowledge prediction model, is based on a Long Short-Term Memory (LSTM) neural network; however, the vector indicating the category output by the knowledge classification model is more than two-dimensional. For example, when the knowledge categories include space, power, handling, exterior, and cost-effectiveness, the model outputs a five-dimensional vector indicating the probability that the knowledge belongs to a certain category. Typically, when the probability value is greater than a certain threshold, the knowledge is considered to belong to the category indicated by that probability value.

[0086] According to the embodiments of this disclosure, knowledge from the knowledge classification training set is input into a pre-trained knowledge classification model. After processing, classification results are output (the classification results are, for example, the probability of knowledge belonging to each knowledge category). The parameters of the model are adjusted using the labeled knowledge categories and classification results until training is completed. The knowledge classification model at this point is the final trained knowledge classification model. The training process and specific structure of the LSTM model will not be elaborated here. It should be understood that knowledge classification models can also be generated based on models such as TEXTCNN and BERT used for performing text classification tasks. This disclosure does not impose many limitations on this.

[0087] After training, the remaining correct knowledge from the second set is selected and input into the trained knowledge classification model to identify the knowledge category of the input correct knowledge. Continuing the previous example, the knowledge classification model can identify that the knowledge category corresponding to the knowledge "grand appearance" is "appearance" and the knowledge category corresponding to the knowledge "luxurious interior" is "interior".

[0088] Accordingly, based on the knowledge extraction scheme disclosed herein, candidate knowledge is extracted from sentences by summarizing the syntactic relation templates corresponding to knowledge and combining them with syntactic analysis algorithms. Then, the candidate knowledge is reviewed using a classification model to obtain correct knowledge, which forms the first set. A knowledge classification model is then used to classify the knowledge in the first set and identify the corresponding knowledge category. Since this scheme extracts knowledge through syntactic structure, only the core parts can be extracted, without extracting redundant parts, resulting in relatively concise candidate knowledge. Furthermore, a text classification model is used to further review and classify the extracted candidate knowledge, eliminating the need for extensive labeled corpora for model training.

[0089] According to other embodiments of this disclosure, for knowledge whose knowledge category is identified, associating the knowledge, the corresponding object category, and the knowledge category—that is, knowledge-vehicle series-knowledge category—results in a knowledge base. Storing the knowledge base in a structured database yields a knowledge graph about the object.

[0090] Because the knowledge extracted using this method is characterized by low redundancy and high accuracy, it possesses portability and scalability in knowledge graph mining. The application can be extended to other scenarios and domains, allowing for the extraction of corresponding knowledge from relevant text data using this method; these examples will not be listed here.

[0091] This announcement also includes:

[0092] A8. The method as described in any one of A1-7, wherein the step of processing the predicted correct knowledge using a knowledge classification model to identify the knowledge category corresponding to each piece of knowledge includes: generating a second set using the knowledge predicted as correct; selecting a portion of the correct knowledge from the second set and labeling the corresponding knowledge categories as a knowledge classification training set; training a knowledge classification model using the knowledge classification training set; selecting the remaining correct knowledge from the second set and inputting it into the knowledge classification model to identify the knowledge category of the input correct knowledge.

[0093] A9. The method as described in any one of A1-8, wherein the knowledge prediction model and the knowledge classification model are both based on a long short-term memory neural network (LSTM).

[0094] A10. The method as described in any one of A1-9, wherein the object is a vehicle, the object category is a vehicle series; and the knowledge category includes: space, power, handling, fuel consumption, comfort, appearance, interior, and cost-effectiveness.

[0095] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of this disclosure, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing this disclosure.

[0096] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the knowledge extraction method of this disclosure according to instructions in the program code stored in the memory.

[0097] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0098] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this disclosure. Based on the above description, the required structure for constructing such systems is apparent. Furthermore, this disclosure is not directed to any particular programming language. It should be understood that the contents of this disclosure described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing preferred embodiments of this disclosure.

[0099] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this disclosure may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0100] Similarly, it should be understood that, for the sake of brevity and to aid in understanding one or more of the various aspects of the disclosure, in the foregoing description of exemplary embodiments of the disclosure, various features of the disclosure are sometimes grouped together in a single embodiment, figure, or description thereof. However, this approach to disclosure should not be construed as reflecting an intention that the claimed disclosure requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, the aspects of the disclosure consist of fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the disclosure.

[0101] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0102] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0103] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of this disclosure and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0104] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method elements forms means for implementing the method or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by the elements for the purposes of this disclosure.

[0105] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0106] Although this disclosure has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of this disclosure. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for interpreting or limiting the subject matter of this disclosure. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. Regarding the scope of this disclosure, the disclosure is illustrative and not restrictive, and the scope of this disclosure is defined by the appended claims.

Claims

1. A knowledge extraction method, comprising: acquiring and processing text data describing an object to determine a plurality of sentences and an object category corresponding to each sentence; generating a syntactic relationship template for each sentence, the syntactic relationship template including the part of speech of each word and the dependency relationship between the words; generating a syntactic tree corresponding to each sentence through syntactic analysis; matching the syntactic relationship template and the syntactic tree, and if the matching is consistent, generating an alternative knowledge using the matched syntactic subtree; using a knowledge prediction model to predict whether the alternative knowledge is correct knowledge; using a knowledge classification model to process the predicted correct knowledge to identify the knowledge category corresponding to each piece of knowledge; wherein the step of matching the syntactic relationship template and the syntactic tree, and if the matching is consistent, generating an alternative knowledge using the matched syntactic subtree, comprises: traversing the syntactic relationship template manually summarized to determine whether there is a syntactic subtree in the syntactic tree corresponding to the syntactic relationship template; if there is a match, extracting the nodes of the matched syntactic subtree; concatenating the extracted nodes in syntactic order to generate a phrase as the alternative knowledge corresponding to the object category.

2. The method of claim 1, further comprising the step of: associating the knowledge, the object category corresponding to the knowledge, and the knowledge category to obtain a knowledge base for the knowledge identified as the knowledge category.

3. The method of claim 1 or 2, wherein, The step of acquiring and processing text data describing a specific object to determine a plurality of sentences and an object category corresponding to each sentence comprises: acquiring text data describing a specific object, the text data including a plurality of articles; identifying the object category corresponding to each article, and dividing each article into sentences to obtain the association between each sentence and its corresponding object category.

4. The method of claim 1 or 2, wherein, The step of generating a syntactic tree corresponding to each sentence through syntactic analysis comprises: performing dependency syntactic analysis on each sentence using HanLP to obtain a syntactic analysis result; using the syntactic analysis result to generate a syntactic tree, wherein each node of the syntactic tree is a word and its corresponding part of speech, and the nodes are connected by parent node relationships.

5. The method of claim 1, wherein, The step of matching the syntactic relationship template and the syntactic tree, and if the matching is consistent, generating an alternative knowledge using the matched syntactic subtree, further comprises: traversing the syntactic tree to generate a set of alternative knowledge as a first set.

6. The method of claim 5, wherein, The step of using a knowledge prediction model to predict whether the alternative knowledge is correct knowledge further comprises: selecting some of the alternative knowledge from the first set for annotation, and using the annotated alternative knowledge and its annotation data to generate a knowledge review training set, the annotation data including correct and incorrect; training a knowledge prediction model using the knowledge review training set; selecting the remaining alternative knowledge in the first set and inputting it into the knowledge prediction model to predict whether the input alternative knowledge is correct knowledge.

7. The method of claim 6, wherein, The step of using a knowledge classification model to process the predicted correct knowledge to identify the knowledge category corresponding to each piece of knowledge comprises: using the knowledge predicted to be correct to generate a second set; selecting part of correct knowledge from the second set and labeling corresponding knowledge categories as a knowledge category training set; training a knowledge category model using the knowledge category training set; selecting the remaining correct knowledge in the second set and inputting the knowledge category model to identify the knowledge category of the input correct knowledge. 8.The method of claim 1, wherein, the knowledge prediction model and the knowledge category model are both long short-term memory neural network (LSTM) based models. 9.The method of claim 1, wherein, the object is a vehicle, and the object category is a vehicle series; the knowledge categories include space, power, handling, fuel consumption, comfort, appearance, interior, and cost performance. 10.A knowledge extraction system, comprising: a syntax analysis device, comprising: a preprocessing unit adapted to obtain and process text data describing an object to determine a plurality of sentences and object categories corresponding to each sentence; a first analysis unit adapted to generate a syntax relationship template for each sentence, the syntax relationship template including the part of speech of each word and the dependency relationship between the words; a second analysis unit adapted to generate a syntax tree corresponding to each sentence through syntax analysis; a matching processing unit adapted to match the syntax relationship template and the syntax tree, and if the match is consistent, generate candidate knowledge using the matched syntax sub-tree; a knowledge prediction device adapted to use a knowledge prediction model to predict whether the candidate knowledge is correct knowledge; and a knowledge category device adapted to use a knowledge category model to process the predicted correct knowledge to identify the knowledge category corresponding to each piece of knowledge; wherein the matching of the syntax relationship template and the syntax tree, and if the match is consistent, generating candidate knowledge using the matched syntax sub-tree, comprises: traversing the syntax relationship template manually summarized to determine whether there is a syntax sub-tree in the syntax tree corresponding to the syntax relationship template; if there is, the match is consistent, and the nodes of the matched syntax sub-tree are extracted; concatenating the extracted nodes in syntax order to generate a phrase as candidate knowledge corresponding to the object category. 11.A computing device, comprising: one or more processors; memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing the method of any one of claims 1-9. 12.A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions that, when executed by a computing device, cause the computing device to perform the method of any one of claims 1-9.

Citation Information

Patent Citations

  • Sentence trunk extraction method and equipment based on dependency syntax and readable storage medium

    CN112069801A

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

    CN112232074A