A semantic phrase extraction method and related device
By preprocessing, clustering and modeling text information, and extracting semantic phrases, it solves the problem that users find it difficult to efficiently process information under information overload, and realizes efficient semantic phrase extraction, improving user experience and accuracy.
Patent Information
- Application Number
- CN202111236111.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-10-22
AI Technical Summary
In the case of information overload, it is difficult for users to efficiently identify and process the required information, resulting in inefficiency and poor experience.
By performing word segmentation on the input text information, processing without meaning, converting it into a text vector matrix, calculating the text vector using the activation function, and obtaining regular expressions through clustering, identifying candidate dependencies and noun modules, building a dictionary, combining BERT Embedding and RNN to create a model, and extracting semantic phrases.
It improves the efficiency of information processing, reduces unnecessary time and energy investment, improves user experience, and enhances the accuracy and recall rate of semantic phrase extraction.
Smart Images

Figure CN113886530B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence, and in particular to a semantic phrase extraction method and related devices. Background Art
[0002] With the continuous development of technology, especially the application and popularization of Internet technology, information can be transmitted at a higher speed, which enables people to receive more and more information. Based on this received information, people can make appropriate processing, thereby continuously improving the efficiency of work and life.
[0003] However, a large amount of information can overwhelm users, distract their attention, and make information processing difficult, forcing users to spend unnecessary time and energy to identify the information they really need, resulting in a poor user experience and limited efficiency. Summary of the Invention
[0004] The embodiments of the present application provide a semantic phrase extraction method and a semantic phrase extraction device.
[0005] A semantic phrase extraction method, comprising:
[0006] Perform word segmentation and remove meaningless words on the input text information to obtain text information to be processed, wherein the input text information is information used for training;
[0007] Converting the text information to be processed to obtain a text vector matrix;
[0008] Calculating a text vector according to the text vector matrix based on an activation function;
[0009] Clustering the text vector to obtain a first regular expression;
[0010] Target text information is extracted according to the first regular expression to obtain first target semantic phrases, where the first target semantic phrases include noun entities and phrases consisting of verbs and noun entities.
[0011] Optionally, calculating the text vector according to the text vector matrix based on an activation function includes:
[0012] The text vector is calculated according to the following formula:
[0013] y i =f(∑ω i ·x i,i+m-1 +β);
[0014] y i Represents the text vector of the i-th dimension;
[0015] f represents the activation function;
[0016] ω i represents the weight matrix of the i-th dimension;
[0017] β represents the bias value;
[0018] m represents the step size of each convolution kernel;
[0019] x i,i+m-1 Represents the matrix formed by the convolution kernel from the i-th row vector to the i+m-1-th row vector.
[0020] Optionally, after clustering the text vectors to obtain a first regular expression, and before extracting target text information according to the first regular expression to obtain a first target semantic phrase, the method further includes:
[0021] identifying candidate dependency relationships between input semantic phrases in the input text information;
[0022] determining a target dependency relationship according to the candidate dependency relationships;
[0023] Obtaining a second regular expression through the target dependency relationship;
[0024] The target text information is extracted according to the first regular expression to obtain the first target semantic phrase including:
[0025] The target text information is extracted according to the first regular expression and the second regular expression to obtain the first target semantic phrase, which includes the extraction results of the first regular expression and the extraction results of the second regular expression.
[0026] Optionally, after obtaining the second regular expression through the target dependency relationship, and before extracting the target text information according to the first regular expression and the second regular expression and obtaining the first target semantic phrase, the method further includes:
[0027] Identifying noun modules in the input text information;
[0028] constructing a dictionary based on the semantic relationship between nouns in the noun module;
[0029] Extracting the target text information according to the first regular expression and the second regular expression to obtain the first target semantic phrase includes:
[0030] The target text information is extracted according to the first regular expression, the second regular expression, the dictionary and the template matching the dictionary to obtain the first target semantic phrase, which includes the extraction result of the first regular expression, the extraction result of the second regular expression and the extraction result of the technology combining the dictionary and the template.
[0031] Optionally, after extracting the target text information according to the first regular expression, the second regular expression, the dictionary, and a template matching the dictionary to obtain the first target semantic phrase, the method further includes:
[0032] Based on the input text information, a knowledge framework is generated by ontology language, wherein the knowledge framework includes concepts, relationships and attributes of the input text information;
[0033] Based on the knowledge framework, a model is established through Chinese-based bidirectional encoder embedding representation from transformer and recurrent neural network;
[0034] Extracting the target text information using the model to obtain a second target semantic phrase, wherein the second target semantic phrase includes a noun entity and a phrase of a verb plus a noun entity;
[0035] A third target semantic phrase is obtained according to the first target semantic phrase and the second target semantic phrase, where the third target semantic phrase includes the first target semantic phrase and the second target semantic phrase.
[0036] Optionally, after extracting the target text information using the model to obtain a second target semantic phrase, the method further includes:
[0037] The second target semantic phrase is classified to determine a label of the second target semantic phrase.
[0038] Optionally, classifying the second target semantic phrase to determine a label of the second target semantic phrase includes:
[0039] By aligning the triples in the knowledge graph and the large-scale text corpus, the second target semantic phrase is classified and the label of the second target semantic phrase is determined.
[0040] A semantic phrase extraction device, comprising:
[0041] a processing unit, configured to segment input text information and remove meaningless words to obtain text information to be processed, wherein the input text information is information used for training;
[0042] A conversion unit, configured to convert the text information to be processed into a text vector matrix;
[0043] a calculation unit, configured to calculate a text vector according to the text vector matrix based on an activation function;
[0044] A clustering unit, configured to cluster the text vector to obtain a first regular expression;
[0045] The extraction unit is configured to extract the target text information according to the first regular expression to obtain a first target semantic phrase, wherein the first target semantic phrase includes a noun entity and a phrase consisting of a verb plus a noun entity.
[0046] A semantic phrase extraction device, comprising:
[0047] CPU, memory and input / output interfaces;
[0048] The memory is a transient storage memory or a persistent storage memory;
[0049] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the aforementioned method.
[0050] A computer-readable storage medium includes instructions. When the instructions are executed on a computer, the computer is caused to execute the above method.
[0051] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0052] After preprocessing the input text information, preprocessed text information is obtained, which is then converted into a text vector matrix, and then the text vector is calculated. The text vectors are clustered to obtain a first regular expression, and finally, extraction is performed based on the first regular expression to obtain a first target semantic phrase. This allows users to extract using the semantic phrase extraction device without wasting unnecessary time and effort, improving work efficiency and providing a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a schematic diagram of an embodiment of the semantic phrase extraction method of the present application;
[0054] Figure 2 This is a schematic diagram of another embodiment of the semantic phrase extraction method according to the embodiment of the present application;
[0055] Figure 3 This is a schematic diagram of a case study of a semantic phrase extraction method according to an embodiment of the present application;
[0056] Figure 4 This is a schematic diagram of another embodiment of the semantic phrase extraction method according to the embodiment of the present application;
[0057] Figure 5 This is a schematic diagram of an embodiment of a semantic phrase extraction device according to an embodiment of the present application;
[0058] Figure 6 This is a schematic diagram of another embodiment of the semantic phrase extraction device of the embodiment of the present application. DETAILED DESCRIPTION
[0059] The embodiments of the present application provide a semantic phrase extraction method and a semantic phrase extraction device.
[0060] With the application and popularization of Internet technology, users can receive more information. Taking the recruitment field as an example, due to the continuous development of Internet technology, traditional offline recruitment has shown shortcomings such as low efficiency and small coverage. On the one hand, more and more companies publish massive amounts of relevant recruitment information through websites, and on the other hand, applicants can submit resumes through the Internet. However, this recruitment method has the disadvantages of large amount of information, rapid information growth, difficulty in information processing, and mismatched information between the two parties. In order to solve the above problems, a semantic phrase extraction method and a semantic phrase extraction device according to an embodiment of the present application are provided.
[0061] The following describes the semantic phrase extraction method of the embodiment of the present application. Figure 1 An embodiment of the semantic phrase extraction method of the present application includes:
[0062] 101. Segment the input text information and remove meaningless words to obtain text information to be processed;
[0063] The input text is preprocessed, namely, by segmenting and removing meaningless words, to obtain the text to be processed. The input text is used for training. For example, if the input text is "Software application product design experience ah," segmenting this sentence yields "software application product," "of," "design experience," and "ah." Further meaningless word removal is performed, removing "of" and "ah," yielding "software application product" and "design experience," the text to be processed.
[0064] The input text information may be training information crawled from the Internet, or may be training information obtained from a pre-prepared database, and the specifics are not limited here.
[0065] 102. Convert the text information to be processed to obtain a text vector matrix;
[0066] After obtaining the text information to be processed, it is converted into a form that can be processed by the computer, namely a text vector matrix. Each sentence in the text information to be processed is converted into a sentence vector, and then these sentence vectors are combined into a text vector matrix.
[0067] 103. Calculate a text vector according to the text vector matrix based on an activation function;
[0068] The text vector is calculated based on the obtained text vector matrix and the activation function. The text vector matrix is input into the convolutional neural network through the input layer, and then the calculation is performed in the convolution layer of the convolutional neural network. The size of the convolution kernel in the convolution layer can be selected from multiple different sizes according to needs. To ensure that the length of each convolution kernel slides over exactly one sentence vector, the dimension of the sentence vector is regarded as the width of the convolution kernel, and its height can be preset to the corresponding value according to needs.
[0069] Specifically, multiple text vectors can be obtained based on the text vector matrix, the convolution kernel weight matrix and the bias value, and the activation function. The weight matrix and the bias value are obtained using the commonly used gradient descent method.
[0070] 104. Clustering the text vector to obtain a first regular expression;
[0071] The resulting text vectors are clustered to obtain the first regular expression. Clustering is performed by determining the similarity between multiple text vectors. Cosine similarity, Euler similarity, Manhattan similarity, and other metrics can be used to measure the similarity between two text vectors. If the similarity between the two meets a preset condition, the two text vectors are grouped together, and so on. Because vectors and texts are mapped, the corresponding text can be determined from the vectors in each category. The commonalities between the texts can then be extracted to obtain the first regular expression.
[0072] 105. Extract target text information according to the first regular expression to obtain a first target semantic phrase.
[0073] After obtaining the first regular expression, the target text information is extracted to obtain a first target semantic phrase, wherein the target text information is information from which the user wants to extract semantic phrases, and the first target semantic phrase includes a noun entity and a phrase consisting of a verb plus a noun entity.
[0074] For example, if the text before clustering is "Proficient in image processing software; Proficient in office software; Proficient in common office software; Proficient in related software; Proficient in office software; Proficient in a post-production software," clustering yields the regular expression "Proficient in .{5} software." Then, using the regular expression "Proficient in .{5} software" to extract the target text, we obtain the first target semantic phrase, such as "visio" or "cad."
[0075] In the embodiment of the present application, after preprocessing the input text information to obtain preprocessed text information, the preprocessed text information is then converted into a text vector matrix, and then the text vector is calculated. The text vectors are clustered to obtain a first regular expression, and finally, extraction is performed based on the first regular expression to obtain a first target semantic phrase. This allows users to extract using the semantic phrase extraction device without wasting unnecessary time and effort, thereby improving work efficiency and providing a better user experience.
[0076] See also Figure 2 Another embodiment of the semantic phrase extraction method of the present application includes:
[0077] 201. Segment the input text information and remove meaningless words to obtain text information to be processed;
[0078] The input text is preprocessed, namely, by segmenting and removing meaningless words, to obtain the text to be processed. The input text is used for training. For example, if the input text is "Software application product design experience ah," segmenting this sentence yields "software application product," "of," "design experience," and "ah." Further meaningless word removal is performed, removing "of" and "ah," yielding "software application product" and "design experience," the text to be processed.
[0079] The input text information may be training information crawled from the Internet, or may be training information obtained from a pre-prepared database, and the specifics are not limited here.
[0080] 202. Convert the text information to be processed to obtain a text vector matrix;
[0081] After obtaining the text information to be processed, it is converted into a form that can be processed by the computer, namely a text vector matrix. Each sentence in the text information to be processed is converted into a sentence vector, and then these sentence vectors are combined into a text vector matrix.
[0082] 203. Calculate a text vector according to the text vector matrix based on an activation function;
[0083] The text vector is calculated based on the obtained text vector matrix and the activation function. The text vector matrix is input into the convolutional neural network through the input layer, and then the calculation is performed in the convolution layer of the convolutional neural network. The size of the convolution kernel in the convolution layer can be selected from multiple different sizes according to needs. To ensure that the length of each convolution kernel slides over exactly one sentence vector, the dimension of the sentence vector is regarded as the width of the convolution kernel, and its height can be preset to the corresponding value according to needs.
[0084] Specifically, multiple text vectors can be calculated based on the text vector matrix, the weight matrix of the convolution kernel, and the bias value based on the activation function. For example, the text vector can be calculated using the following formula:
[0085] y i =f(∑ω i ·x i,i+m-1 +β);
[0086] y i Represents the text vector of the i-th dimension;
[0087] f represents the activation function;
[0088] ω i represents the weight matrix of the i-th dimension;
[0089] β represents the bias value;
[0090] m represents the step size of each convolution kernel, which can be set in advance;
[0091] x i,i+m-1 Represents the matrix formed by the convolution kernel from the i-th row vector to the i+m-1-th row vector.
[0092] The weight matrix and bias value are obtained by the commonly used gradient descent method. It is understood that the text vector can also be obtained by a variation of the above formula or other formulas, which are not limited here.
[0093] 204. Clustering the text vector to obtain a first regular expression;
[0094] The obtained text vectors are clustered to obtain the first regular expression. Clustering is performed by determining the similarity between multiple text vectors. Cosine similarity, Euler similarity, Manhattan similarity, etc. can be used as a measurement indicator to measure the similarity between two text vectors. For example, using cosine similarity as a measurement indicator, the similarity can be calculated according to the following formula:
[0095]
[0096] and are two different text vectors.
[0097] If the similarity between the two text vectors meets the preset criteria, the two text vectors are grouped together, and so on. Because vectors and texts are mapped, the corresponding text can be determined from the vectors in each category. The commonalities between the texts are then extracted to generate the first regular expression. For example, if the text information before clustering is "Proficient in image processing software; Proficient in office software; Proficient in common office software; Proficient in related software; Proficient in office software; Proficient in a post-production software," clustering yields the regular expression "Proficient in .{5} software."
[0098] 205. Identify candidate dependency relationships between input semantic phrases in the input text information;
[0099] The input semantic phrases in the input text information are identified to obtain candidate dependency relationships between the input semantic phrases for subsequent operations. The candidate dependency relationships between the input semantic phrases include attributive-predicate relationships, parallel relationships, core relationships, and verb-object relationships.
[0100] 206. Determine a target dependency relationship based on the candidate dependency relationships;
[0101] After obtaining the candidate dependencies, a target dependency is determined based on the candidate dependencies. The target dependency is one or more of the candidate dependencies, which may be pre-set or determined by user operation, and the specifics are not limited here.
[0102] 207. Obtain a second regular expression through the target dependency relationship;
[0103] After obtaining the target dependency, the second regular expression can be obtained using the target dependency.
[0104] To make it easier to understand, let's use an example. Figure 3 , the input text information is "Job responsibilities: maintain company media resources, publish articles;", the input semantic phrases of the sentence are identified, and candidate dependency relationships between the input semantic phrases are obtained. Among them, Root is the root node, ATT is the subject-attribute relationship, COO is the parallel relationship, HED is the core relationship, VOB is the subject-verb relationship, and WP is punctuation. Determine one or more target dependency relationships from the candidate dependency relationships, such as determining the subject-verb relationship as the target dependency relationship. According to the subject-verb relationship: maintain resources, publish articles, the second regular expression can be obtained as "maintain resources" and "publish articles".
[0105] 208. Identify noun modules in the input text information;
[0106] Identify the input text information and obtain the noun module of the input text information to prepare conditions for subsequent operations.
[0107] 209. Construct a dictionary based on the semantic relationship between nouns in the noun module;
[0108] After obtaining the noun modules of the input text information, a dictionary can be constructed based on the semantic relationships between the nouns in the noun modules. For example, the dictionary can be "Axure; Visio; xmind; Mindmanager; Office; PPT..."
[0109] 210. Extract the target text information according to the first regular expression, the second regular expression, the dictionary, and a template matching the dictionary to obtain the first target semantic phrase.
[0110] Target text information is extracted using a first regular expression, a second regular expression, a dictionary, and a template matching the dictionary to obtain a first target semantic phrase. The target text information is information from which a user wishes to extract semantic phrases, and the first target semantic phrases include nouns and verb-plus-noun phrases. The first target semantic phrase comprises the extraction results of the first regular expression, the extraction results of the second regular expression, and the extraction results of a technique combining the dictionary and the template matching the dictionary. In other words, the first target semantic phrase is the union of these three extraction results.
[0111] For ease of understanding, the following example briefly describes the technique of combining dictionaries and matching templates. Consider a dictionary called "Axure; Visio; xmind; Mindmanager; Office; PPT..." The matching template is: ((?: familiar|proficient|proficient|master|master|proficient|excellent|knowledge)(?: use|apply|operate|apply)?)[(?: familiar|proficient|master|proficient|excellent|knowledge|use|apply|operate|apply)\s]{,20} + the software in the dictionary. When a sentence like "proficient in using office software, Photoshop, HTML5, etc." appears in the target text, the dictionary and matching template can be used to extract the corresponding sentence.
[0112] In this embodiment, a first regular expression, a second regular expression, a dictionary, and a template matching the dictionary are obtained through training using input text information. These results are then used to extract semantic phrases from the target text information, yielding a first target semantic phrase, which is the union of the three extraction results. This reduces the workload of manually analyzing phrases and sentences in job postings and improves the recall rate of semantic phrase extraction using template matching technology.
[0113] See also Figure 4 Another embodiment of the semantic phrase extraction method of the present application includes:
[0114] 401. Segment the input text information and remove meaningless words to obtain text information to be processed;
[0115] 402. Convert the text information to be processed to obtain a text vector matrix;
[0116] 403. Calculate a text vector according to the text vector matrix based on an activation function;
[0117] 404. Cluster the text vector to obtain a first regular expression;
[0118] 405. Identify candidate dependency relationships between input semantic phrases in the input text information;
[0119] 406. Determine a target dependency relationship based on the candidate dependency relationships;
[0120] 407. Obtain a second regular expression through the target dependency relationship;
[0121] 408. Identify noun modules in the input text information;
[0122] 409. Construct a dictionary based on the semantic relationship between nouns in the noun module;
[0123] 410. Extract the target text information according to the first regular expression, the second regular expression, the dictionary, and a template matching the dictionary to obtain the first target semantic phrase;
[0124] Steps 401 to 410 in this embodiment are similar to those in the aforementioned Figure 2 Steps 201 to 210 in the illustrated embodiment are similar and will not be described again here.
[0125] 411. Generate a knowledge framework using an ontology language based on the input text information;
[0126] Using ontology language to identify the semantics of the input text, a knowledge framework is generated. For example, occupational information such as academic qualifications, training and certifications, experience, software skills, and job relationships (e.g., internal and external relationships) can be categorized using ontology language. The knowledge framework includes the concepts, relationships, and attributes of the input text.
[0127] 412. Based on the knowledge framework, a model is established by using a bidirectional encoder embedding representation from a transformer and a recurrent neural network based on Chinese;
[0128] After generating the knowledge framework, a model was built using bidirectional encoder representations from transformers embedding (BERTEmbedding) and a recurrent neural network (RNN) based on Chinese. Specifically, BERTEmbedding's pre-trained vectors and RNN layers were used to model the classification labels.
[0129] 413. Extract the target text information using the model to obtain a second target semantic phrase;
[0130] The model is used to extract the target text information to obtain second target semantic phrases. The target text information is the information from which the user wishes to extract semantic phrases. The second target semantic phrases include noun entities and verb-plus-noun entity phrases. Mutual information can also be combined with a text ranking algorithm to expand the number of semantic phrases.
[0131] 414. Classify the second target semantic phrase by aligning the triples in the knowledge graph and the large-scale text corpus, and determine a label for the second target semantic phrase;
[0132] The second target semantic phrase is classified using the triples and text corpus to determine its label. For ease of understanding, the following example illustrates this. For example, the target text is: "Position: Overall responsibility for Amazon / eBay product development." Using the above model, we can extract the semantic phrases "position," "Amazon," and "eBay." We then classify and determine that the relationship between "position," "Amazon," and "eBay" is a "development relationship," or in other words, the label for "Amazon" and "eBay" is "development."
[0133] 415. Obtain a third target semantic phrase according to the first target semantic phrase and the second target semantic phrase.
[0134] After obtaining the first target semantic phrase and the second target semantic phrase, a third target semantic phrase can be obtained, wherein the third target semantic phrase includes the first target semantic phrase and the second target semantic phrase, that is, the third target semantic phrase is the union of the first target semantic phrase and the second target semantic phrase.
[0135] To facilitate understanding of this embodiment, the following examples are given for illustration:
[0136] Job Responsibilities:
[0137] 1. Writing and operating content such as official WeChat accounts, soft article promotions, and press releases;
[0138] 2. Combine industry hot topics with company product advantages and customer cases to produce high-quality content;
[0139] 3. Assist other partners in the department to carry out offline activities;
[0140] 4. Complete other tasks assigned by superiors.
[0141] Job requirements:
[0142] 1. Applicants must have more than 2 years of work experience, a bachelor's degree or above, preferably a major in Journalism or Chinese Language, and must have excellent writing skills. Experience as a reporter / editor / copywriter or in financial media is preferred.
[0143] 2. Candidates with education or working background in the financial industry are preferred;
[0144] 3. Have strong interest in new media operations and have certain insights;
[0145] 4. Clear thinking and good creative ability;
[0146] 5. Have certain ability to withstand pressure, high work efficiency, self-motivated, good communication skills and team spirit.
[0147] Job Category: Product / Brand Manager WeChat Sharing
[0148] For “basic abilities”, the first target semantic phrase is [“clear thinking”, “creative ability”, “ability to withstand pressure”, “high work efficiency”, “motivated”, “communication skills”, “teamwork spirit”].
[0149] The second target semantic phrases are [“motivated”, “communication skills”, “teamwork spirit”, “clear thinking”, “high work efficiency”, “ability to withstand pressure”, “excellent writing style”].
[0150] The third target semantic phrases are [“motivated”, “communication skills”, “teamwork spirit”, “clear thinking”, “high work efficiency”, “ability to withstand pressure”, “excellent writing style”, “creative ability”].
[0151] In this embodiment, a knowledge framework can be generated by inputting text information, and then modeling can be performed using the pre-trained vectors and RNN layers of BERT Embedding. The model is used for extraction to obtain a second target semantic phrase, which is then classified to determine its label. Finally, the first target semantic phrase is combined to obtain the union of the first target semantic phrase and the second target semantic phrase, i.e., the third target semantic phrase. This ensures the generalization of semantic phrase extraction, has good transferability, improves the precision and recall rate of semantic phrase extraction, and can also label semantic phrases, greatly facilitating user operations and significantly improving the user experience.
[0152] The following describes the semantic phrase extraction device of the embodiment of the present application. Figure 5 An embodiment of the semantic phrase extraction device of the present application includes:
[0153] The processing unit 501 is used to perform word segmentation and remove meaningless words on the input text information to obtain text information to be processed, wherein the input text information is information used for training;
[0154] A conversion unit 502 is configured to convert the text information to be processed to obtain a text vector matrix;
[0155] A calculation unit 503, configured to calculate a text vector according to the text vector matrix based on an activation function;
[0156] A clustering unit 504, configured to cluster the text vector to obtain a first regular expression;
[0157] The extraction unit 505 is configured to extract the target text information according to the first regular expression to obtain a first target semantic phrase, where the first target semantic phrase includes a noun entity and a phrase consisting of a verb plus a noun entity.
[0158] In this embodiment, processing unit 501 preprocesses input text information to obtain preprocessed text information, which is then converted into a text vector matrix by conversion unit 502, and then the text vector is calculated by calculation unit 503. Clustering unit 504 clusters the text vectors to obtain a first regular expression, and finally extraction unit 505 extracts the first target semantic phrase based on the first regular expression. This saves users from unnecessary time and effort, improves work efficiency, and provides a better user experience.
[0159] The functions and processes performed by each unit in the semantic phrase extraction device of this embodiment are similar to those of the aforementioned Figures 1 to 4 The functions and processes performed by the entity extraction device are similar and will not be repeated here.
[0160] Figure 61 is a schematic diagram of the structure of a semantic phrase extraction device provided in an embodiment of the present application. The semantic phrase extraction device 600 may include one or more central processing units (CPU) 601 and a memory 605, in which one or more applications or data are stored.
[0161] The memory 605 may be a volatile memory or a persistent memory. The program stored in the memory 605 may include one or more modules, each of which may include a series of instruction operations in the semantic phrase extraction device 600. Furthermore, the central processing unit 601 may be configured to communicate with the memory 605 so that the semantic phrase extraction device 600 executes the series of instruction operations in the memory 605.
[0162] The semantic phrase extraction device 600 may also include one or more power supplies 602, one or more wired or wireless network interfaces 603, one or more input and output interfaces 604, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0163] The CPU 601 can execute the aforementioned Figures 1 to 4 The operations performed by the semantic phrase extraction device in the illustrated embodiment will not be described in detail here.
[0164] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0167] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0168] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk, and other media that can store program code.
Claims
1. A semantic phrase extraction method, characterized in that: include: Perform word segmentation and remove meaningless words on the input text information to obtain text information to be processed, wherein the input text information is information used for training; Converting the text information to be processed to obtain a text vector matrix; Calculating a text vector according to the text vector matrix based on an activation function; Clustering the text vector to obtain a first regular expression; Extracting target text information according to the first regular expression to obtain first target semantic phrases, wherein the first target semantic phrases include noun entities and phrases of verbs plus noun entities; After clustering the text vectors to obtain a first regular expression and before extracting the target text information according to the first regular expression to obtain a first target semantic phrase, the method further includes: identifying candidate dependency relationships between input semantic phrases in the input text information; determining a target dependency relationship according to the candidate dependency relationships; Obtaining a second regular expression through the target dependency relationship; Accordingly, extracting the target text information according to the first regular expression to obtain the first target semantic phrase includes: The target text information is extracted according to the first regular expression and the second regular expression to obtain the first target semantic phrase, which includes the extraction results of the first regular expression and the extraction results of the second regular expression.
2. The semantic phrase extraction method according to claim 1, characterized in that: Calculating the text vector according to the text vector matrix based on the activation function includes: The text vector is calculated according to the following formula: y i =f(∑ω i ·x i,i+m-1 +b); y i Represents the text vector of the i-th dimension; f represents the activation function; ω i represents the weight matrix of the i-th dimension; β represents the bias value; m represents the step size of each convolution kernel; x i,i+m-1 Represents the matrix formed by the convolution kernel from the i-th row vector to the i+m-1-th row vector.
3. The semantic phrase extraction method according to claim 1, characterized in that: After obtaining the second regular expression through the target dependency relationship, and before extracting the target text information according to the first regular expression and the second regular expression to obtain the first target semantic phrase, the method further includes: Identifying noun modules in the input text information; constructing a dictionary based on the semantic relationship between nouns in the noun module; Extracting the target text information according to the first regular expression and the second regular expression to obtain the first target semantic phrase includes: The target text information is extracted according to the first regular expression, the second regular expression, the dictionary and the template matching the dictionary to obtain the first target semantic phrase, which includes the extraction result of the first regular expression, the extraction result of the second regular expression and the extraction result of the technology combining the dictionary and the template.
4. The semantic phrase extraction method according to claim 3, characterized in that: After extracting the target text information according to the first regular expression, the second regular expression, the dictionary, and a template matching the dictionary to obtain the first target semantic phrase, the method further includes: Based on the input text information, a knowledge framework is generated by ontology language, wherein the knowledge framework includes concepts, relationships and attributes of the input text information; Based on the knowledge framework, a model is established through Chinese-based bidirectional encoder embedding representation from transformer and recurrent neural network; Extracting the target text information using the model to obtain a second target semantic phrase, wherein the second target semantic phrase includes a noun entity and a phrase consisting of a verb plus a noun entity; A third target semantic phrase is obtained according to the first target semantic phrase and the second target semantic phrase, where the third target semantic phrase includes the first target semantic phrase and the second target semantic phrase.
5. The semantic phrase extraction method according to claim 4, characterized in that: After extracting the target text information through the model to obtain a second target semantic phrase, the method further includes: The second target semantic phrase is classified to determine a label of the second target semantic phrase.
6. The semantic phrase extraction method according to claim 5, characterized in that: Classifying the second target semantic phrase and determining a label of the second target semantic phrase includes: By aligning the triples in the knowledge graph and the large-scale text corpus, the second target semantic phrase is classified and the label of the second target semantic phrase is determined.
7. A semantic phrase extraction device, characterized in that: include: a processing unit, configured to segment input text information and remove meaningless words to obtain text information to be processed, wherein the input text information is information used for training; A conversion unit, configured to convert the text information to be processed into a text vector matrix; a calculation unit, configured to calculate a text vector according to the text vector matrix based on an activation function; A clustering unit, configured to cluster the text vector to obtain a first regular expression; an extraction unit, configured to extract the target text information according to the first regular expression to obtain a first target semantic phrase, wherein the first target semantic phrase includes a noun entity and a phrase consisting of a verb plus a noun entity; Wherein, after clustering the text vectors to obtain a first regular expression and before extracting the target text information according to the first regular expression to obtain a first target semantic phrase, the method further includes: identifying candidate dependency relationships between input semantic phrases in the input text information; determining a target dependency relationship according to the candidate dependency relationships; Obtaining a second regular expression through the target dependency relationship; Accordingly, the extraction unit is specifically configured to: The target text information is extracted according to the first regular expression and the second regular expression to obtain the first target semantic phrase, which includes the extraction results of the first regular expression and the extraction results of the second regular expression.
8. A semantic phrase extraction device, characterized in that: include: CPU, memory and input / output interfaces; The memory is a transient storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The method comprises instructions, which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Legal field event extraction method based on pre-training model and convolutional neural network algorithm
CN112966525A