Semantic feature recognition method and device based on deep syntax tree, equipment and medium

Through the semantic feature recognition method based on deep grammar tree, the problem of large differences in interpretation in Chinese text analysis in government affairs is solved. Through word segmentation, grammar tree analysis and semantic analysis models, the accuracy of text parsing is improved, ensuring the relevance of reply text and accuracy.

CN119047485APending Publication Date: 2024-11-29PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411263093.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The existing Chinese text semantic feature understanding technology lacks comprehensibility in downstream tasks in government affairs, and it is difficult to accurately analyze complex texts, such as the "Nanjing Yangtze River Bridge", which leads to large differences in interpretations and affects the accuracy of text analysis results.

Method used

The semantic feature recognition method based on the deep grammar tree is adopted, word segmentation is processed through the text word segmentation model, grammar features are obtained in combination with the grammar tree analytical algorithm, and the semantic analysis model is used to predict language probability, output reply text, and ensure the correct recognition of vocabulary units and sentences. Understanding of structure.

Benefits of technology

Improve the accuracy of text parsing results, ensure that the reply text is more in line with the user's query intentions and needs, and enhance the accuracy and relevance of semantic understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047485A_ABST
    Figure CN119047485A_ABST
Patent Text Reader

Abstract

The invention provides a semantic feature recognition method and device based on a deep syntax tree, equipment and a medium, and relates to the field of natural language processing. According to the method, the input text is subjected to word segmentation through the text analysis model, the text word segmentation features are obtained, and correct recognition of vocabulary units in the text can be ensured through accurate word segmentation processing; according to the method, grammar analysis is performed on an input text through a grammar tree analysis algorithm to obtain grammar features, and the grammar tree analysis algorithm reveals dependency and syntactic relationships among words in the text, so that a model can more accurately understand a sentence structure. In combination with the word segmentation features and the grammatical features of the text, correlation understanding is carried out on the relation between characters or between words in the text, deeper semantic understanding can be carried out through the semantic analysis model, the internal meaning of the text is captured, the generated reply text better fits the query intention and demand of a user, and the accuracy of a text analysis result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing, and in particular to a semantic feature recognition method, device, equipment and medium based on a deep syntax tree. Background Art

[0002] The current semantic feature understanding technology for Chinese text in the industry mainly relies on pre-training models for word embedding feature processing. Although there is a large-scale corpus for pre-training, when extracting features for downstream tasks, it is not possible to parse and extract vocabulary based on text grammar. Pre-training uses general-domain text for model understanding, which lacks comprehensibility for specific downstream tasks in the government affairs field and often misinterprets professional knowledge with common sense knowledge.

[0003] In government affairs processing scenarios, there are usually typical texts that are difficult to understand semantically using natural language processing models. For example, when "Nanjing Yangtze River Bridge" appears in a text, it is difficult for the model to understand whether the user is saying: Nanjing / Mayor / Yangtze River Bridge, or: Nanjing / Yangtze River Bridge. The difference between these two interpretations is quite large, and existing technologies have difficulty understanding this type of government affairs text.

[0004] Therefore, how to improve the accuracy of text parsing results has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The present application provides a semantic feature recognition method, apparatus, device and medium based on a deep syntax tree, aiming to improve the accuracy of text parsing results.

[0006] In a first aspect, the present application provides a semantic feature recognition method based on a deep syntax tree, the semantic feature recognition method based on a deep syntax tree comprising the following steps:

[0007] Based on the text segmentation model, the input text is segmented to obtain text segmentation features;

[0008] Based on a syntax tree parsing algorithm, grammar analysis is performed on the input text to obtain grammatical features of the input text;

[0009] Based on the semantic parsing model, language probability prediction is performed on the text segmentation features and the grammatical features, and a reply text is output.

[0010] In a second aspect, the present application further provides a semantic feature recognition device based on a deep syntax tree, the semantic feature recognition device based on a deep syntax tree comprising:

[0011] The text segmentation module is used to perform segmentation processing on the input text based on the text segmentation model to obtain text segmentation features;

[0012] A grammatical feature recognition module, used to perform grammatical analysis on the input text based on a grammar tree parsing algorithm to obtain grammatical features of the input text;

[0013] The semantic parsing module is used to perform language probability prediction on the text word segmentation features and the grammatical features based on the semantic parsing model, and output a reply text.

[0014] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the semantic feature recognition method based on the deep syntax tree as described above are implemented.

[0015] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the semantic feature recognition method based on a deep syntax tree as described above are implemented.

[0016] The present application provides a semantic feature recognition method, device, computer equipment and storage medium based on a deep syntax tree. The method of the present application includes segmenting the input text based on a text segmentation model to obtain text segmentation features; performing syntax analysis on the input text based on a syntax tree parsing algorithm to obtain the grammatical features of the input text; performing language probability prediction on the text segmentation features and the grammatical features based on a semantic parsing model, and outputting a reply text. Through the above-mentioned method, the present application performs segmentation on the input text through a text analysis model to obtain text segmentation features. Accurate segmentation processing can ensure the correct identification of vocabulary units in the text; performing syntax analysis on the input text through a syntax tree parsing algorithm to obtain grammatical features. The syntax tree parsing algorithm reveals the dependency and syntactic relationship between words in the text, which helps the model to understand the sentence structure more accurately. Combining text segmentation features and grammatical features, the relationship between words and words or words in the text is associated and understood. The semantic parsing model can perform a deeper level of semantic understanding, capture the intrinsic meaning of the text, and help the semantic analysis model to perform semantic understanding analysis in the right direction, so that the generated reply text is more in line with the user's query intention and needs, and improves the accuracy of the text parsing results. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 A flowchart of a first embodiment of a semantic feature recognition method based on a deep syntax tree provided by the present application;

[0019] Figure 2 A schematic diagram of the structure of a semantic parsing model provided in an embodiment of the present application;

[0020] Figure 3 A flowchart of a second embodiment of a semantic feature recognition method based on a deep syntax tree provided by the present application;

[0021] Figure 4 A flowchart of a third embodiment of a semantic feature recognition method based on a deep syntax tree provided by the present application;

[0022] Figure 5 It is a structural schematic diagram of a first embodiment of a semantic feature recognition device based on a deep syntax tree provided by the present application;

[0023] Figure 6 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0024] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0028] Please refer to Figure 1 , Figure 1 A flowchart of a first embodiment of a semantic feature recognition method based on a deep syntax tree provided in the present application.

[0029] like Figure 1As shown, the semantic feature recognition method based on the deep syntax tree includes steps S101 to S103.

[0030] S101. Based on the text tokenization model, perform tokenization on the input text to obtain text tokenization features;

[0031] In one embodiment, the text tokenization model of the present application may include at least two tokenization methods.

[0032] Exemplarily, as Figure 2 shown, the text tokenization model can tokenize the input text in two ways. One is to tokenize the input text at the token character level through a pre-trained model; the other way is to tokenize the input text through a syntax tree parsing module and identify the part-of-speech of the tokens in the input text.

[0033] In one embodiment, for different processing methods, the pre-trained model needs to tokenize the text at the token character level, that is, separate each character one by one, and then input it into the pre-trained model to extract features. The disadvantage of this method is that it cannot understand the association information between characters and easily induces the model to misjudge the semantics. Therefore, the syntax tree parsing module can automatically parse the text for better tokenization.

[0034] Further, based on a preset tokenization method, tokenize the input text to obtain a second text tokenization, where the preset tokenization method includes tokenizing at the token character level of the token; based on the text tokenization model, extract features from the second text tokenization to obtain the text tokenization features.

[0035] In one embodiment, a token refers to a symbol used to represent a word or phrase in the process of natural language processing. A token can be a single character or a sequence of multiple characters.

[0036] In one embodiment, the pre-trained model tokenizes the input text at the token character level to obtain a second text tokenization, that is, each Chinese character or letter is processed separately instead of combining them into words or phrases. For example, for the Chinese text "Nanjing Yangtze River Bridge", it will be tokenized by the pre-trained model into "南", "京", "市", "长", "江", "大", "桥".

[0037] In one embodiment, after the preprocessing model separates the input text into individual characters, it converts the encoding of each character into a vector form. Each character's encoding can be mapped to a vector in a high-dimensional space by looking up pre-trained word embeddings (such as Word2Vec, GloVe, etc.), thereby obtaining text tokenization features.

[0038] In one embodiment, the vector converted from a single character (i.e., the text segmentation feature) may contain the semantic information of the character, and may capture the usage and meaning of the character in different contexts, so as to provide input for subsequent natural language processing tasks (such as feature fusion, feature matching, etc.).

[0039] S102, performing syntax analysis on the input text based on a syntax tree parsing algorithm to obtain grammatical features of the input text;

[0040] In one embodiment, the input text of the pre-trained model is also input into the syntax tree parsing module, and the syntax tree parsing algorithm in the syntax tree parsing module analyzes the syntactic structure of the input text and constructs a syntax tree. Then, the grammatical features of the input text are extracted from the constructed syntax tree to help understand the deep structure and semantics of the input text.

[0041] Furthermore, based on the syntax tree parsing algorithm, the input text is parsed to generate a syntax tree; based on the syntax tree, the syntactic structure of the input text is identified to obtain first text segments and the part of speech of each of the first text segments; based on the first text segments and the part of speech of the segments, the grammatical features are generated.

[0042] In one embodiment, the syntax tree parsing module will first parse the syntax of an input text and then perform word segmentation. In the syntax tree parsing module, the text will be divided according to the part of speech. For example, Figure 2 As shown in the figure, the syntax tree parsing module divides the Nanjing Yangtze River Bridge into two types of nouns, proper noun NR and other noun NN. The access to the syntax tree can effectively distinguish the contextual relevance of the text.

[0043] In one embodiment, the syntax tree is a tree structure in which each node represents a word or phrase, and the relationship between nodes indicates their grammatical roles in the sentence.

[0044] In one embodiment, the grammar parsing algorithm performs part-of-speech tagging on each word in the text to determine whether it is a noun, verb, adjective, etc.

[0045] In one embodiment, the dependency relationships between words in the input text are identified by a syntax tree parsing algorithm, which define how the words are connected to each other to form meaningful sentences. Based on the dependency relationships, a complete syntax tree is constructed, and the root of the tree is usually the subject or predicate of the sentence, while the other parts are connected to the corresponding positions of the tree according to the dependency relationships. Grammatical features are extracted from the constructed syntax tree, and these grammatical features may include part of speech, dependency relationships, syntactic roles, context information, etc.

[0046] It is understandable that other natural language processing techniques may also be used to extract grammatical features of the input text, such as part-of-speech tagging, named entity recognition, dependency parsing, semantic role labeling, and the like.

[0047] Among them, part-of-speech tagging can be used to identify the part of speech of each word in the text, such as noun, verb, adjective, etc., which helps to understand the composition of the sentence. Named entity recognition can identify specific entities in the text, such as names, places, organizations, dates, etc., and can realize information extraction. Dependency syntactic analysis is similar to syntax tree parsing. Dependency syntactic analysis focuses on the dependency relationship between words. Semantic role labeling can identify the semantic role played by each component in the sentence, such as agent, patient, etc., which helps to understand the semantic structure of the sentence.

[0048] In this embodiment, one or more grammatical feature extraction algorithms can be selected according to actual scenario requirements to extract the grammatical features of the input text, and this embodiment of the application does not specifically limit this.

[0049] S103: Based on the semantic parsing model, perform language probability prediction on the text word segmentation features and the grammatical features, and output a reply text.

[0050] In one embodiment, the semantic parsing model uses the above-extracted text segmentation features and grammatical features as input. The text segmentation features extracted by the pre-training model and the grammatical features extracted by the syntax tree parsing module are cascaded and input into the semantic parsing model. After the semantic parsing model is trained and learned to reach the best fit state, a softmax function or sigmoid is connected to perform language probability prediction. Finally, in a robot scenario (such as a government robot, etc.), the reply text is output.

[0051] In one embodiment, text segmentation features (such as word vectors, part of speech, word frequency, etc.) and grammatical features (such as dependencies, syntactic roles, etc.) are used as input. A semantic parsing model is used to understand the deep meaning of the input text, including but not limited to identifying intent, extracting key information, and understanding context.

[0052] In one embodiment, a statistical model or a deep learning model may be used to predict the probability distribution of a language, such as a language model such as an n-gram model, a recurrent neural network (RNN), a long short-term memory network (LSTM), or a Transformer model.

[0053] In one embodiment, the reply text is generated according to the predicted language probability distribution. The most likely word sequence can be selected or a sequence-to-sequence (Seq2Seq) model can be used to generate the reply text.

[0054] In one embodiment, when generating a reply text, the context information of the conversation is considered to ensure that the reply text is coherent with the previous conversation content. Finally, the semantic parsing model outputs the generated reply text, which can be used in application scenarios such as chat robots, automatic customer service systems, and language translation.

[0055] This embodiment provides a semantic feature recognition method based on a deep syntax tree. The method of this application uses a text analysis model to segment the input text and obtain text segmentation features. Accurate segmentation processing can ensure the correct recognition of vocabulary units in the text; the input text is parsed by a syntax tree parsing algorithm to obtain grammatical features. The syntax tree parsing algorithm reveals the dependencies and syntactic relationships between words in the text, which helps the model to understand the sentence structure more accurately. Combining text segmentation features and grammatical features, the relationship between characters or words in the text is understood in an associated manner. The semantic parsing model can perform a deeper level of semantic understanding, capture the intrinsic meaning of the text, and help the semantic analysis model perform semantic understanding analysis in the right direction, so that the generated reply text is more in line with the user's query intentions and needs, and improves the accuracy of the text parsing results.

[0056] Please refer to Figure 3 , Figure 3 A flowchart of a second embodiment of a semantic feature recognition method based on a deep syntax tree provided in the present application.

[0057] In this embodiment, Figure 3 As shown, based on the above Figure 1 In the illustrated embodiment, step S103 specifically includes steps S201 to S203.

[0058] S201, parsing the text word segmentation features and the grammatical features based on the semantic parsing model, and outputting a text parsing result;

[0059] In one embodiment, the text parsing results may include word segmentation results, part-of-speech tagging, dependency relationships, syntactic role tagging, intent recognition, key information extraction, etc.

[0060] Exemplarily, the word segmentation result refers to dividing the input text into independent vocabulary units. For example, the input text is "What materials do I need to renew my passport?", which can be decomposed into ["I", "need", "apply", "passport", "renew", "need", "which", "materials"].

[0061] Exemplarily, identify the part of speech of each word, such as [("I", "pronoun"), ("need", "verb"), ("apply", "verb"), ("passport", "noun"), ("update", "verb"), ("need", "verb"), ("which", "pronoun"), ("material", "noun")].

[0062] Exemplarily, the dependency relationship between words is determined, such as ("need", "process", "object"), ("process", "passport", "object").

[0063] In one embodiment, the syntactic role of each word in a sentence is identified, such as ("I", "subject"), ("need", "predicate"), ("apply for passport renewal", "object").

[0064] Exemplary, understanding the intent or purpose of the text, such as the intent may be "processing passport renewal".

[0065] Exemplarily, important information or keywords are extracted from the input text, for example, the key information is "materials required for passport renewal".

[0066] Furthermore, based on the grammatical features and the text segmentation features, the context information of the input text is identified; based on a feature fusion algorithm, the text segmentation features and the grammatical features are fused to obtain fused features; based on the semantic parsing model, the fused features and the context information are parsed to obtain the text parsing result.

[0067] In one embodiment, after feature extraction, the text information is fed into a semantic parsing model. This model can be a variety of neural networks, such as a recurrent neural network (RNN), a long short-term memory network (LSTM), or a Transformer, etc., for further training and understanding the semantic information of the input text.

[0068] In one embodiment, the input text is segmented into independent vocabulary units, and a part-of-speech tag is assigned to each vocabulary unit, such as verb, noun, adjective, etc., the dependency relationship between vocabulary units is identified, the dependency tree of the sentence is constructed, and then the role of each vocabulary in the sentence is determined, such as subject, object, attributive, etc.

[0069] In one embodiment, the context information of the input text is analyzed based on the grammatical features and text segmentation features, which may include the conversation history, the context of the text, and the situation information. The text segmentation features (such as word vectors, parts of speech, word frequency) and grammatical features (dependencies, syntactic roles) are combined using a feature fusion algorithm to form fused features. The fused features and context information are input into the semantic parsing model, and the model understands the deep meaning of the text through training and learning.

[0070] In one embodiment, based on the output of the semantic parsing model, a text parsing result is generated, which generally includes but is not limited to intent recognition, key information extraction, sentiment analysis, language probability prediction, and generation of reply text.

[0071] Among them, intent recognition refers to identifying the main intent or purpose of the text. Key information extraction refers to extracting key entities, attributes or concepts in the text. Sentiment analysis refers to determining the emotional tendency of the text. Language probability prediction refers to predicting the probability distribution of words or phrases in the text. Generating reply text refers to generating appropriate replies or outputs based on the parsing results.

[0072] S202, based on a probability prediction algorithm, performing probability prediction on the text recognition result to determine the text intent;

[0073] In one embodiment, a classification model can be pre-selected and trained using a labeled data set, and the model can identify different intents. The trained model is used to make probability predictions on the input text, and the model outputs the probability of each intent category. Then, the intent category with the highest probability is selected as the predicted intent of the text. The predicted intent and the corresponding probability are output.

[0074] In one embodiment, a threshold may be set to determine the confidence of the prediction, and the prediction is considered reliable only when the prediction probability exceeds this threshold.

[0075] For example, if there is the following user input text: "I need help setting up my wireless router." The process based on the probability prediction algorithm can be:

[0076] Text preprocessing: word segmentation to get ["I", "need", "help", "come", "set", "my", "wireless", "router"].

[0077] Feature extraction: Use word embedding to convert the word segmentation results into vector form.

[0078] Contextual information integration: If the user has mentioned network issues before, this can serve as contextual information.

[0079] Model training: Use a dataset with similar intent annotations to train a classification model, such as support vector machine (SVM), random forest, gradient boosting machine (GBM), deep neural network, etc.

[0080] Probability prediction: Input the feature vector into the model, and the model predicts the probability of each intent.

[0081] Intent Identification: Suppose the model predicts that the “technical support” intent has the highest probability, for example 0.9.

[0082] Threshold setting: If 0.9 is above the set threshold (e.g. 0.7), then accept this prediction.

[0083] Result output: Output the predicted intent "technical support" with a probability of 0.9.

[0084] S203: Generate the reply text based on the recognition intention.

[0085] In one embodiment, an appropriate reply strategy is selected based on the identified intent. A reply text is generated using a template, rule, or machine learning model. It can be a simple text template or a complex generation model, such as a sequence-to-sequence (Seq2Seq) model based on deep learning.

[0086] For example, assume that the user enters the following text: "I need to apply for a replacement for a lost ID card."

[0087] Text segmentation results: ["I", "need", "apply", "ID card", "lost", "reissue", "procedure"]

[0088] Grammatical feature analysis:

[0089] Identify parts of speech: [PRP, V, V, NN, V, V, NN]

[0090] Semantic parsing: Use text segmentation models to extract semantic features of text.

[0091] Feature fusion: The semantic features extracted by the text segmentation model are fused with the grammatical features extracted by the syntax tree parsing module to form a comprehensive feature representation to obtain a more comprehensive text representation.

[0092] Context modeling: Utilize contextual information, such as dependencies, syntactic structures, etc., to enhance semantic representation.

[0093] Probabilistic prediction: The predicted text intent is "Reissue of lost ID card".

[0094] Recognize text: Determine that the user's intention is to replace a lost ID card.

[0095] Generate reply text: Based on the recognized intent, generate reply text: "Hello, the following steps are required to replace a lost ID card:..."

[0096] Through such a processing flow, the semantic understanding model can accurately identify the user's intention and generate appropriate responses to meet the user's needs.

[0097] In this embodiment, through text segmentation, part-of-speech tagging, dependency and syntactic role tagging, the model can more deeply understand the structure and meaning of the text; accurately identify the intent or purpose of the text, which helps to provide more targeted services or responses. Contextual information, such as conversation history and situational information, is used to enhance the model's understanding of the text and improve the relevance and accuracy of the response.

[0098] Please refer to Figure 4 , Figure 4 A flowchart of a third embodiment of a semantic feature recognition method based on a deep syntax tree provided in the present application.

[0099] In this embodiment, Figure 4 As shown, based on the above Figure 1 In the illustrated embodiment, before step S101, the following steps are further included:

[0100] S301, obtaining model training text data;

[0101] In one embodiment, text data related to government dialogues can be collected from data source paths such as web pages, books, news, and dialogue texts, and then the collected text data can be processed through data preprocessing to obtain model training text data.

[0102] In one embodiment, data preprocessing may include data cleaning, data deduplication, data enhancement, data labeling, etc.

[0103] S302, training the pre-training model based on the model training text data to obtain the semantic parsing model;

[0104] In one embodiment, a pre-trained model suitable for semantic parsing tasks may be selected, such as BERT, GPT, ERNIE, etc. The text data is pre-processed according to the requirements of the model, including word segmentation, part-of-speech tagging, vocabulary building, etc.

[0105] In one embodiment, training parameters are set, such as learning rate, batch size, number of training epochs, optimizer type, etc. The model is trained using the model training text data training data.

[0106] In one embodiment, the loss and performance indicators during the training process can be monitored. The model performance can be evaluated on the validation set, and the hyperparameters can be adjusted to optimize the model. The generalization ability of the model can be evaluated using the test set.

[0107] In one embodiment, the semantic parsing capability of the model can be evaluated using indicators such as accuracy, recall, and F1 score. The model is tuned based on the evaluation results, which may include changing the model structure, adjusting the training strategy, etc.

[0108] S303: Based on the text prediction result of the semantic parsing model, iteratively optimize the model parameters of the semantic parsing model until the text prediction accuracy of the semantic parsing model reaches a preset accuracy threshold.

[0109] In one embodiment, a target accuracy threshold can be determined as one of the stopping conditions for model training; then, the text prediction accuracy of the current model is evaluated using a validation set or a test set. If the current accuracy does not reach the threshold, the bottleneck of the model performance is analyzed, such as error type analysis, confusion matrix, etc. Based on the error analysis, further data enhancement or cleaning can be performed to improve the model, and the model structure can be adjusted as needed, such as increasing or decreasing the number of layers, changing the number of neurons, etc.

[0110] Optionally, hyperparameters can be adjusted using methods such as grid search, random search, or Bayesian optimization; regularization techniques such as dropout and weight decay can be applied to prevent model overfitting; the model can be retrained using updated model structure and hyperparameters; cross-validation can be used to ensure model stability and generalization. Once the model reaches a predetermined accuracy, the model parameters are updated. Thus, the semantic parsing model is systematically optimized until its text prediction accuracy reaches a preset accuracy threshold.

[0111] Furthermore, after step S103, the method further includes: obtaining feedback data of the text input terminal for the reply text; and iteratively optimizing and training the semantic parsing model based on the feedback data and the input text.

[0112] In one embodiment, user feedback data on the reply text is collected from the text input terminal, wherein the feedback data may be a satisfaction score, a mark of whether the problem is solved, error correction or user-modified text, etc.

[0113] In one embodiment, the collected feedback data is combined with the original input text to form an annotated dataset for model training. The feedback data is analyzed to identify model weaknesses, such as common misunderstandings, error types, or reasons for user dissatisfaction. For user corrections or feedback, the annotations of the original input text are updated for use in training.

[0114] In one embodiment, the updated annotated dataset is preprocessed, including word segmentation, part-of-speech tagging, vocabulary building, etc., and the updated dataset is used to fine-tune the existing model. The performance of the fine-tuned model is evaluated on the validation set to ensure that the improvement is based on the effectiveness of user feedback.

[0115] Alternatively, an incremental learning approach can be used to train the model only on new data or feedback data to preserve the model's original knowledge.

[0116] This embodiment can significantly improve the prediction accuracy of the model by improving the weaknesses of the model in a targeted manner. The optimized model can better understand the user's intention and provide satisfactory responses, thereby improving user satisfaction. By learning new feedback data, the model can adapt to changes in language usage and emerging expressions. Through user corrections and feedback, the model can learn to avoid common misunderstandings and errors and improve the fluency of conversations.

[0117] See also Figure 5 , Figure 5 It is a structural schematic diagram of a first embodiment of a semantic feature recognition device based on a deep syntax tree provided in the present application. The semantic feature recognition device based on a deep syntax tree is used to execute the aforementioned semantic feature recognition method based on a deep syntax tree.

[0118] like Figure 5 As shown, the semantic feature recognition device 300 based on the deep syntax tree includes: a text segmentation module 301, a grammatical feature recognition module 302 and a semantic parsing module 303.

[0119] The text segmentation module 301 is used to perform segmentation processing on the input text based on the text segmentation model to obtain text segmentation features;

[0120] A grammatical feature recognition module 302 is used to perform grammatical analysis on the input text based on a grammar tree parsing algorithm to obtain grammatical features of the input text;

[0121] The semantic analysis module 303 is used to perform language probability prediction on the text word segmentation features and the grammatical features based on the semantic analysis model, and output a reply text.

[0122] In one embodiment, the grammatical feature recognition module 302 includes:

[0123] A syntax tree generating unit, configured to perform text parsing on the input text based on the syntax tree parsing algorithm to generate a syntax tree;

[0124] A grammatical structure recognition unit, configured to recognize the syntactic structure of the input text based on the grammatical tree, and obtain first text segmentations and the part of speech of each of the first text segmentations;

[0125] A grammatical feature generating unit is used to generate the grammatical feature based on the first text segmentation and the part of speech of the segmentation.

[0126] In one embodiment, the semantic parsing module 303 includes:

[0127] A text parsing unit, used to parse the text word segmentation features and the grammatical features based on the semantic parsing model, and output a text parsing result;

[0128] A text prediction unit, configured to perform probability prediction on the text recognition result based on a probability prediction algorithm to determine the text intent;

[0129] A reply text generating unit is used to generate the reply text based on the recognition intention.

[0130] In one embodiment, the text parsing unit includes:

[0131] A context information identification subunit, used to identify the context information of the input text based on the grammatical features and the text segmentation features;

[0132] A feature fusion subunit, used for fusing the text word segmentation feature and the grammatical feature based on a feature fusion algorithm to obtain a fusion feature;

[0133] The text parsing subunit is used to parse the fusion feature and the context information based on the semantic parsing model to obtain the text parsing result.

[0134] In one embodiment, the text segmentation module 301 includes:

[0135] A text segmentation unit, configured to segment the input text based on a preset segmentation method to obtain a second text segmentation, wherein the preset segmentation method includes segmenting at a token character level;

[0136] The word segmentation feature extraction unit is used to extract features of the second text word segmentation based on the text word segmentation model to obtain the text word segmentation features.

[0137] In one embodiment, the semantic feature recognition device 300 based on the deep syntax tree further includes a model training module, and the model training module specifically includes:

[0138] A training data acquisition unit, used to acquire model training text data;

[0139] A model training unit, used to train the pre-trained model based on the model training text data to obtain the semantic parsing model;

[0140] The model optimization unit is used to iteratively optimize the model parameters of the semantic parsing model based on the text prediction result of the semantic parsing model until the text prediction accuracy of the semantic parsing model reaches a preset accuracy threshold.

[0141] In one embodiment, the semantic feature recognition device 300 based on the deep syntax tree further includes a model optimization module, and the model optimization module specifically includes:

[0142] A feedback data acquisition unit, used to acquire feedback data of the text input terminal for the reply text;

[0143] A model iterative training unit is used to iteratively optimize the semantic parsing model based on the feedback data and the input text.

[0144] It should be noted that technical personnel in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned embodiment of the semantic feature recognition method based on the deep syntax tree, and will not be repeated here.

[0145] The apparatus provided in the above embodiment may be implemented in the form of a computer program. The computer program may be Figure 6 Runs on the computer device shown.

[0146] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0147] See also Figure 6 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0148] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any semantic feature recognition method based on a deep syntax tree.

[0149] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0150] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any semantic feature recognition method based on the deep syntax tree.

[0151] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0152] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0153] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0154] Based on the text segmentation model, the input text is segmented to obtain text segmentation features;

[0155] Based on a syntax tree parsing algorithm, grammar analysis is performed on the input text to obtain grammatical features of the input text;

[0156] Based on the semantic parsing model, language probability prediction is performed on the text segmentation features and the grammatical features, and a reply text is output.

[0157] In one embodiment, when the processor implements the syntax tree-based parsing algorithm to perform syntax parsing on the input text to obtain the grammatical features of the input text, it is configured to implement:

[0158] Based on the syntax tree parsing algorithm, the input text is parsed to generate a syntax tree;

[0159] Based on the syntax tree, identifying the syntactic structure of the input text, obtaining first text segmentations and the part of speech of each of the first text segmentations;

[0160] The grammatical feature is generated based on the first text segmentation and the part of speech of the segmentation.

[0161] In one embodiment, when the processor implements the language probability prediction based on the semantic parsing model for the text word segmentation features and the grammatical features and outputs the reply text, it is used to implement:

[0162] Based on the semantic parsing model, the text word segmentation features and the grammatical features are parsed, and a text parsing result is output;

[0163] Based on a probability prediction algorithm, a probability prediction is performed on the text recognition result to determine the text intent;

[0164] Based on the identified intent, the reply text is generated.

[0165] In one embodiment, when the processor implements the parsing of the text word segmentation features and the grammatical features based on the semantic parsing model and outputting the text parsing result, it is used to implement:

[0166] Based on the grammatical features and the text segmentation features, identifying context information of the input text;

[0167] Based on a feature fusion algorithm, the text segmentation feature and the grammatical feature are fused to obtain a fusion feature;

[0168] Based on the semantic parsing model, the fusion feature and the context information are parsed to obtain the text parsing result.

[0169] In one embodiment, when the processor implements the text segmentation model based on the input text to perform word segmentation processing and obtain the text segmentation features, it is used to implement:

[0170] Based on a preset word segmentation method, the input text is segmented to obtain a second text segmentation, wherein the preset word segmentation method includes segmenting at a token character level;

[0171] Based on the text segmentation model, feature extraction is performed on the second text segmentation to obtain the text segmentation feature.

[0172] In one embodiment, before implementing the text segmentation model to perform segmentation processing on the input text and obtain the text segmentation features, the processor is further used to implement:

[0173] Get model training text data;

[0174] Based on the model training text data, the pre-training model is trained to obtain the semantic parsing model;

[0175] Based on the text prediction result of the semantic parsing model, the model parameters of the semantic parsing model are iteratively optimized until the text prediction accuracy of the semantic parsing model reaches a preset accuracy threshold.

[0176] In one embodiment, after implementing the semantic parsing model based on which the language probability prediction is performed on the text segmentation features and the grammatical features and the reply text is output, the processor is further configured to implement:

[0177] Obtaining feedback data from the text input terminal regarding the reply text;

[0178] Based on the feedback data and the input text, the semantic parsing model is iteratively optimized and trained.

[0179] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the semantic feature recognition methods based on a deep syntax tree provided in the embodiments of the present application.

[0180] The computer-readable storage medium may be an internal storage unit of the computer device described in the above embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the computer device.

[0181] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A semantic feature recognition method based on a deep syntax tree, characterized in that: The method comprises: Based on the text segmentation model, the input text is segmented to obtain text segmentation features; Based on a syntax tree parsing algorithm, grammar analysis is performed on the input text to obtain grammatical features of the input text; Based on the semantic parsing model, language probability prediction is performed on the text segmentation features and the grammatical features, and a reply text is output.

2. The semantic feature recognition method based on deep syntax tree according to claim 1, characterized in that: The step of performing grammatical parsing on the input text based on a grammar tree parsing algorithm to obtain grammatical features of the input text includes: Based on the syntax tree parsing algorithm, the input text is parsed to generate a syntax tree; Based on the syntax tree, identifying the syntactic structure of the input text, obtaining first text segmentations and the part of speech of each of the first text segmentations; The grammatical feature is generated based on the first text segmentation and the part of speech of the segmentation.

3. The semantic feature recognition method based on deep syntax tree according to claim 1, characterized in that: The method of performing language probability prediction on the text word segmentation features and the grammatical features based on the semantic parsing model and outputting a reply text includes: Based on the semantic parsing model, the text word segmentation features and the grammatical features are parsed, and a text parsing result is output; Based on a probability prediction algorithm, a probability prediction is performed on the text recognition result to determine the text intent; Based on the identified intent, the reply text is generated.

4. The semantic feature recognition method based on deep syntax tree according to claim 3 is characterized in that: The step of parsing the text word segmentation features and the grammatical features based on the semantic parsing model and outputting the text parsing results includes: Based on the grammatical features and the text segmentation features, identifying context information of the input text; Based on a feature fusion algorithm, the text segmentation feature and the grammatical feature are fused to obtain a fusion feature; Based on the semantic parsing model, the fusion feature and the context information are parsed to obtain the text parsing result.

5. The semantic feature recognition method based on deep syntax tree according to claim 1, characterized in that: The text segmentation model is based on which the input text is segmented to obtain text segmentation features, including: Based on a preset word segmentation method, the input text is segmented to obtain a second text segmentation, wherein the preset word segmentation method includes segmenting at a token character level; Based on the text segmentation model, feature extraction is performed on the second text segmentation to obtain the text segmentation feature.

6. The semantic feature recognition method based on deep syntax tree according to claim 1, characterized in that: The method further includes: performing word segmentation processing on the input text based on the text word segmentation model to obtain the text word segmentation features. Get model training text data; Based on the model training text data, the pre-training model is trained to obtain the semantic parsing model; Based on the text prediction result of the semantic parsing model, the model parameters of the semantic parsing model are iteratively optimized until the text prediction accuracy of the semantic parsing model reaches a preset accuracy threshold.

7. The semantic feature recognition method based on deep syntax tree according to claim 1, characterized in that: After performing language probability prediction on the text segmentation features and the grammatical features based on the semantic parsing model and outputting the reply text, the method further includes: Obtaining feedback data from the text input terminal regarding the reply text; Based on the feedback data and the input text, the semantic parsing model is iteratively optimized and trained.

8. A semantic feature recognition device based on a deep syntax tree, characterized in that: The semantic feature recognition device based on the deep syntax tree includes: The text segmentation module is used to perform segmentation processing on the input text based on the text segmentation model to obtain text segmentation features; A grammatical feature recognition module, used to perform grammatical analysis on the input text based on a grammar tree parsing algorithm to obtain grammatical features of the input text; The semantic parsing module is used to perform language probability prediction on the text word segmentation features and the grammatical features based on the semantic parsing model, and output a reply text.

9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the semantic feature recognition method based on a deep syntax tree as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the semantic feature recognition method based on a deep syntax tree as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Intelligent legal dictionary generation method and system

    CN119886121A

  • Korean context prompting method and device, electronic equipment and storage medium

    CN120297230A