Intelligent question answering method and system for risk decision, computer equipment, storage medium and program product
Through the construction of a corpus database and the use of semantic models, Q & A models to make risk decision -making intelligence and answer, the complexity of personal risk information has caused difficulties in decision -making, and rapid and accurate risk decision -making acquisition has been achieved.
Patent Information
- Application Number
- CN202411286285.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-28
AI Technical Summary
The information involved in personal risks is complex, and it is difficult for ordinary individuals to fully understand and evaluate various risks, making it difficult to obtain risk decisions.
By constructing a corpus database, using semantic models and Q & A models, obtaining the problem with the user input for pre -processing and physical identification, traversing the physical relationship with the physical relationship and the knowledge map, and generating answers to answering the question of user input.
The difficulty of reducing the obtaining risk decision -making can get the corresponding answers only need to enter the problem, which improves the efficiency and accuracy of risk decision -making.
Smart Images

Figure CN119378677A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a risk decision-making intelligent question-answering method, system, computer device, storage medium and program product. Background Art
[0002] With the rapid development of the power industry and the enhancement of people's safety awareness, more and more power practitioners and the public have begun to pay attention to power safety. How to effectively prevent and deal with various types of power-related personal risks has become the research focus of power supply enterprise managers. Especially for those risks that can be reduced through preventive measures, such as risks closely related to power laws and regulations, safety operating procedures and industry standards encountered in daily life or work in the power industry, although these risks vary in size, they all pose a potential threat to personal life safety and the smooth progress of work. If you can get the right decision-making guidance in advance, you can avoid these personal risks related to power safety to a large extent.
[0003] However, due to the complexity of the information involved in personal risks, it is often difficult for ordinary individuals to fully understand and evaluate various risks, which leads to the problem of difficulty in making risk decisions. Summary of the invention
[0004] Based on this, it is necessary to provide a risk decision intelligent question-answering method, system, computer equipment, storage medium and program product that reduces the difficulty of obtaining risk decisions in response to the above technical problems.
[0005] In the first aspect, the present application provides an intelligent question-answering method for risk decision-making, the method comprising: constructing a corpus database based on collected knowledge related to personal risks, the data in the corpus database being a knowledge graph; obtaining questions input by users, preprocessing the questions input by users based on a semantic model, and obtaining query statements; retrieving target knowledge matching the query statement from the corpus database based on the question-answering model to obtain answers to the questions input by users.
[0006] In one of the embodiments, a corpus database is constructed based on the collected knowledge related to personal risks, including: performing at least one of format mark removal, special character removal, and stop word removal processing on the collected knowledge related to personal risks; performing at least one of legal clause labeling, entity relationship labeling, named entity recognition, and event extraction on the knowledge after the removal processing to obtain corpus data; performing data format conversion on the corpus data, and importing the expected data after the data format conversion into a graph database to obtain a corpus database.
[0007] In one of the embodiments, the question input by the user is preprocessed based on a semantic model to obtain a query statement, including: semantically parsing the question input by the user based on the semantic model to obtain trigger words and key information; using the trigger words to select a target question template from multiple question templates, and adding the key information to the reserved field position in the target question template to obtain a query statement.
[0008] In one of the embodiments, target knowledge matching the query statement is retrieved from a corpus database based on a question-answering model to obtain an answer to a question input by a user, including: performing entity recognition and entity relationship recognition on the query statement based on the question-answering model to obtain a query graph; traversing the entities and entity relationships in the query graph to match them with triples in the knowledge graph to obtain target knowledge; and generating an answer to the question input by the user based on the target knowledge.
[0009] In one embodiment, generating an answer to a question input by a user based on target knowledge includes: performing word embedding processing on the target knowledge based on a question-answering model to obtain an answer to the question input by the user.
[0010] In one embodiment, the method steps for collecting knowledge related to personal risks include at least one of the following: cooperating with industry suppliers to obtain at least one of laws, regulations and case information through an application programming interface (API); using crawler technology to crawl at least one of laws, regulations, policy documents, industry standards and company system documents; using legal document retrieval tools to perform keyword searches to obtain at least one of laws, regulations, policy documents and industry standards; using academic search engines to perform keyword searches to obtain at least one of laws, regulations, policy documents and industry standards.
[0011] On the second aspect, the present application also provides an intelligent question-and-answer system for risk decision-making, which includes: a construction module, which is used to construct a corpus database based on the collected knowledge related to personal risks, and the data in the corpus database is a knowledge graph; a preprocessing module, which is used to obtain questions input by users, and preprocess the questions input by users based on a semantic model to obtain query statements; a search module, which is used to retrieve target knowledge matching the query statement from the corpus database based on the question-and-answer model to obtain answers to the questions input by users.
[0012] In one of the embodiments, a construction module is specifically used to perform at least one of format mark removal, special character removal, and stop word removal processing on the collected knowledge related to personal risks; perform at least one of legal clause labeling, entity relationship labeling, named entity recognition, and event extraction on the knowledge after the removal processing to obtain corpus data; perform data format conversion on the corpus data, and import the expected data after the data format conversion into a graph database to obtain a corpus database.
[0013] In one of the embodiments, the preprocessing module is specifically used to perform semantic analysis on the questions input by the user based on the semantic model to obtain trigger words and key information; use the trigger words to select a target question template from multiple question templates, add the key information to the reserved field position in the target question template, and obtain a query statement.
[0014] In one of the embodiments, the search module is specifically used to perform entity recognition and entity relationship recognition on the query statement based on the question-answering model to obtain a query graph; traverse the entities and entity relationships in the query graph and match them with triples in the knowledge graph to obtain target knowledge; and generate answers to questions input by the user based on the target knowledge.
[0015] In one of the embodiments, the search module is specifically used to perform word embedding processing on the target knowledge based on the question-answering model to obtain the answer to the question input by the user.
[0016] In one embodiment, the system also includes a collection module for performing at least one of the following: cooperating with industry suppliers to obtain laws, regulations and case information through an application programming interface (API); using crawler technology to crawl laws, regulations, policy documents, industry standards, and company system documents; using legal document retrieval tools to perform keyword searches to obtain laws, regulations, policy documents, and industry standards; using academic search engines to perform keyword searches to obtain laws, regulations, policy documents, and industry standards.
[0017] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0018] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0019] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0020] The above-mentioned intelligent question-answering method, system, computer device, storage medium and program product for risk decision-making construct a corpus database based on the collected knowledge related to personal risks, and the data in the corpus database is a knowledge graph; obtain the questions input by the user, pre-process the questions input by the user based on the semantic model, and obtain the query statement; retrieve the target knowledge matching the query statement from the corpus database based on the question-answering model to obtain the answer to the question input by the user, so that the user only needs to enter the question he wants to ask to get the corresponding answer, which reduces the difficulty of obtaining risk decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0022] FIG1 is a schematic diagram of a process flow of an intelligent question-answering method for risk decision-making in one embodiment;
[0023] FIG2 is a schematic diagram of a flow chart of a method for constructing a corpus database in one embodiment;
[0024] FIG3 is a technical development diagram of named entity recognition in one embodiment;
[0025] FIG4 is a schematic diagram of the principle of BiLSTM-CRF in one embodiment;
[0026] FIG5 is a schematic diagram of a flow chart of a method for obtaining a query statement in one embodiment;
[0027] FIG6 is a flow chart of a method for obtaining an answer to a question input by a user in one embodiment;
[0028] FIG7 is a block diagram of a risk decision intelligent question-answering system in one embodiment;
[0029] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] In an exemplary embodiment, as shown in FIG1 , a risk decision intelligent question answering method is provided, the method is applied to a risk decision intelligent question answering system, and the method comprises the following steps:
[0032] Step 101, based on the collected knowledge related to personal risks, a corpus database is constructed, and the data in the corpus database is a knowledge graph.
[0033] Among them, knowledge related to personal risks includes laws and regulations, policy documents, industry standards, company systems, case information and other knowledge.
[0034] Optionally, perform data cleaning on the collected knowledge related to personal risks, such as deleting incomplete sentences and removing duplicates; preprocess the cleaned knowledge, such as removing formatting tags, labeling entity relationships, and recognizing named entities; and construct a corpus database based on the preprocessed knowledge.
[0035] Step 102: obtaining a question input by a user, and preprocessing the question input by the user based on a semantic model to obtain a query statement.
[0036] The risk decision intelligent question-answering system includes an interactive interface, and the user can input questions based on the interactive interface. When the risk decision intelligent question-answering system receives the questions input by the user, it pre-processes the questions input by the user based on the semantic model.
[0037] Generally, the semantic information contained in the questions input by users may usually be relatively small. Directly querying the corpus database using the questions input by users may not provide answers that can solve the user's problems. Therefore, it is necessary to expand the questions input by users based on the semantic model in order to query accurate content from the corpus database.
[0038] Step 103, based on the question-answering model, target knowledge matching the query statement is retrieved from the corpus database to obtain an answer to the question input by the user.
[0039] Optionally, the query statement is vectorized based on the question-answering model to obtain a first vector; multiple candidate knowledge related to the query statement is searched from the corpus database through an inverted index search method, and each candidate knowledge is vectorized based on the question-answering model to obtain a second vector corresponding to each candidate knowledge, and the similarity between the first vector and each second vector is calculated, and the candidate knowledge corresponding to the second vector with the highest similarity is taken as the target knowledge.
[0040] After obtaining the target knowledge, the target knowledge can be directly used as the answer to the question input by the user and output, or the target knowledge can be further processed and the processed target knowledge can be used as the answer to the question input by the user and output.
[0041] For example, the question input by the user is "What are the specific safety requirements when digging a pit?", and the answer to the question input by the user is "According to the power safety work regulations, when digging a pit, loose soil and rocks near the pit mouth should be cleared in time, and others are prohibited from staying near the pit. When working in a foundation pit more than 1.5m deep, soil and rocks thrown out of the pit should be prevented from falling back into the pit. Workers should not rest in the pit. It is strictly forbidden to pry and dig up and down the slope at the same time. No one should be below the rolling soil and rocks, and a special person should be on guard."
[0042] For example, the question input by the user is "What are the regulations for handling grounding faults in electrical equipment?", and the answer to the question input by the user is "When a grounding fault occurs in high-voltage equipment, the power safety work regulations stipulate that people should not approach the fault point within 4m indoors, and should not approach the fault point within 8m outdoors. People entering the above range should wear insulating boots and wear insulating gloves when touching the casing and frame of the equipment. This is to prevent electric shock accidents caused by grounding faults.".
[0043] In the above-mentioned intelligent question-answering method for risk decision-making, a corpus database is constructed based on the collected knowledge related to personal risks, and the data in the corpus database is a knowledge graph; the questions input by the user are obtained, and the questions input by the user are preprocessed based on the semantic model to obtain query statements; based on the question-answering model, the target knowledge matching the query statement is retrieved from the corpus database to obtain the answer to the question input by the user. In this way, the user only needs to enter the question he wants to ask to get the corresponding answer, which reduces the difficulty of obtaining risk decisions.
[0044] In one embodiment, as shown in FIG. 2 , a method for constructing a corpus database is provided. In the above step 101 , based on the collected knowledge related to personal risk, constructing a corpus database includes the following steps:
[0045] Step 201 , performing at least one of format mark removal, special character removal, and stop word removal processing on the collected knowledge related to personal risks.
[0046] Formatting markup removal: For web page data, you can use HTML (HyperText Markup Language) parsing libraries (such as BeautifulSoup) to extract text content from web pages and remove HTML tags and styles. For formats such as PDF (Portable Document Format), you can use text extraction tools (such as PyPDF2) to extract text content from PDF and remove formatting marks. For other formats, you can write regular expressions or use related tools to extract and remove formatting marks according to the specific situation.
[0047] Special character removal processing: In one implementable way, a whitelist containing characters to be retained is constructed, and characters not in the whitelist in the text are filtered out. In another implementable way, regular expressions are used to match and remove special characters, such as non-alphabetic, non-numeric, non-space, or non-punctuation characters. In yet another implementable way, for Unicode characters, appropriate escape processing can be performed to ensure the consistency and readability of the text.
[0048] Stop word removal processing: In one implementable way, a stop word list is used to create a list containing common stop words, such as "de", "shi", "he", etc. When processing the text, these stop words are removed from the text. In another implementable way, a custom stop word list is defined according to the characteristics of the field, and common words irrelevant to a specific topic are removed. In yet another implementable way, the stop word function provided by the natural language processing toolkit is utilized to quickly remove stop words from the text. Natural language processing toolkits such as NLTK and spaCy can be used.
[0049] Step 202: Perform at least one of the following processes on the processed knowledge: legal clause annotation, entity relationship annotation, named entity recognition, and event extraction, to obtain corpus data.
[0050] Among them, the corpus data is triple data.
[0051] Optionally, based on an annotation tool, legal clause annotation and entity relationship annotation are performed on the processed knowledge, where entities include companies, industries, personal risk categories, etc.
[0052] The specific method adopted for named entity recognition is at least one of the method based on rules and dictionaries, the method based on classical statistical learning, and the method based on deep learning.
[0053] The specific way adopted for event extraction is at least one of the method based on pattern matching, the method based on traditional machine learning, and the method based on deep learning.
[0054] Among them, named entity recognition aims to identify specific entities from the knowledge after removal of processing. Entities generally include names of people, places, institutions, time, etc. For legal and regulatory knowledge, the characteristics of the requirements can be annotated in the training phase to identify the required entities. As shown in Figure 3, named entity recognition has evolved from early rule-based and dictionary-based methods to traditional machine learning-based methods, and later to deep learning-based methods, all the way to the current popular attention mechanisms, graph neural networks, transfer learning, and semi-supervised learning research methods. The named entity recognition technology route is constantly evolving over time. The named entity recognition used in this embodiment is mainly divided into rule-based and dictionary-based methods, traditional machine learning-based methods, and deep learning-based methods.
[0055] (1) Rule-based and dictionary-based methods:
[0056] The rule-based and dictionary-based methods mostly use specific rule templates or special dictionaries constructed manually by linguists based on the characteristics of the data set. The rules include keywords, position words, directional words, central words, demonstrative words, statistical information, punctuation marks, etc. The dictionary is composed of a dictionary composed of feature words and an external dictionary, which refers to an existing common sense dictionary. After the rules and dictionaries are formulated, the text is usually processed in a matching manner to achieve named entity recognition.
[0057] (2) Methods based on traditional machine learning:
[0058] In the statistical learning-based methods, named entity recognition is regarded as a sequence labeling problem. Compared with the classification problem, the current predicted label in the sequence labeling problem is not only related to the current input features, but also to the previous predicted labels, that is, there is a strong interdependence between the predicted label sequences. The machine learning methods used mainly include one or more combinations of HMM (Hidden Markov Model), ME (Maximum Entropy), MEMM (Maximum Entropy Markov Model), SVM (Support Vector Machine), CRF (Conditional Random Fields), etc.
[0059] Among them, ME has a compact structure and good versatility. HMM directly models the transition probability and the performance probability and counts the co-occurrence probability. ME and SVM have higher accuracy than HMM, but HMM is faster in training and recognition. MEMM establishes a joint probability for the transition probability and the performance probability and counts the conditional probability. CRF counts the global probability and considers the global distribution of the data during normalization, rather than just normalizing locally. In traditional machine learning, CRF is regarded as the mainstream model for named entity recognition. Its advantage is that CRF can use internal and contextual feature information in the process of labeling a position.
[0060] (3) Methods based on deep learning:
[0061] The deep learning methods mainly include the combination model of LSTM (Long Short-Term Memory) and CRF (abbreviated as LSTM-CRF), the combination model of BiLSTM (Bi-directional Long Short-Term Memory) and CRF (abbreviated as BiLSTM-CRF), and the combination model of BiLSTM, CNN (Convolutional Neural Network) and CRF (abbreviated as BiLSTM-CNN-CRF).
[0062] The advantage of BiLSTM is that it can learn the dependencies between observation sequences (input words) through a bidirectional setting. During the training process, BiLSTM can automatically extract the features of the observation sequence according to the target (such as identifying entities), but the disadvantage is that it cannot learn the relationship between state sequences (output annotations). In the named entity recognition task, there is a certain relationship between annotations. For example, a B-type annotation (indicating the beginning of an entity) will not be followed by another B-type annotation. Therefore, when BiLSTM solves sequence annotation tasks such as named entity recognition, although it can save a lot of complicated feature engineering, it also has the disadvantage of not being able to learn the annotation context. On the contrary, the advantage of CRF is that it can model implicit states and learn the characteristics of state sequences, but its disadvantage is that it needs to manually extract sequence features. Therefore, the general practice is to add another layer of CRF after BiLSTM to obtain the advantages of both.
[0063] Therefore, BiLSTM-CRF is commonly used at present. The principle of BiLSTM-CRF is shown in Figure 4, where the input of BiLSTM-CRF is the word vector and the output is the predicted label corresponding to each word. The principle of BiLSTM-CRF is as follows: Step 1, word input, the word enters the look-up layer, and is mapped to a word vector using the CBOW model, Skip-gram model or glove model. Step 2, the word vector enters the BiLSTM layer, and by learning the context information, the score probability of each word corresponding to each label is output. For example, for w 0 , the output scores of BiLSTM are 1.5 (B-Person), 0.9 (I-Person), 0.1 (B-Organization), 0.08 (I-Organization) and 0.05 (O). These scores are used as the input of CRF. The score probability of the label here is used as the unnormalized emission probability in the CRF model. Step 3, all BiLSTM outputs will be used as the input of the CRF layer. By learning the sequential dependency information between labels, the final prediction result, that is, the predicted label corresponding to each word, is obtained.
[0064] Among them, event extraction is to extract events of interest to users from unstructured information and present them to users in a structured manner. There are three types of event extraction methods: pattern matching-based methods, traditional machine learning-based methods, and deep learning-based methods.
[0065] The pattern matching method is to identify and extract events under the guidance of some patterns. The pattern is mainly used to indicate the contextual constraints that constitute the target information, which embodies the integration of domain knowledge and language knowledge. When extracting, it is only necessary to find the information that meets the pattern constraints through various pattern matching algorithms. The core is the construction of the extraction pattern.
[0066] The traditional machine learning-based method mainly constructs effective features based on the lexical, syntactic, semantic, and dependency information of event trigger words and event elements, and then uses statistical machine learning models for classification and extraction based on the features.
[0067] There are currently two commonly used methods. One is a modular event extraction method that breaks down the task into: trigger word recognition, event argument recognition, event argument attribute analysis, and merging of coreference events. This method includes two classifiers, TiMBL (Tilburg Memory-Based Learner) and MegaM (Mega Matrix Multiplication), which extract multidimensional features from the semantics, grammar, and entity information of the text to complete the classification task. A clustering-based event recognition. This method includes two novel distance calculation methods to achieve sentence clustering, and uses machine learning methods to distinguish coreference event sentences.
[0068] Methods based on deep learning: The neural network method models event extraction into an end-to-end system, and uses word vectors containing rich language features as input to automatically extract features. It does not require or relies very little on external natural language processing tools, avoiding the tedious work of manually designing features. Currently, there are CNN-based methods and BiLSTM-based methods in the field of event extraction. In the CNN-based method, the input of the model is the word vector obtained by pre-training, and then CNN is used to extract features and output classification results. The BiLSTM-based method uses BiLSTM to simulate contextual input and uses combined attributes to complete multi-task event extraction.
[0069] Step 203, convert the data format of the corpus data, and import the expected data after the data format conversion into the graph database to obtain the corpus database.
[0070] Among them, the graph database is used to store graph-structured data, specifically using nodes (entities), edges (entity relationships) and attributes to represent and store data. For example, the graph database can be Neo4j, Amazon Neptune, etc.
[0071] Optionally, the corpus data is converted into a data format supported by the graph database, and then the expected data after the data format conversion is imported into the graph database to obtain the corpus database. The query language of this type of corpus database can use Cypher.
[0072] In addition, an inverted index can be created for the corpus database, which can speed up the query. Semantic reasoning rules can also be added to the corpus database to infer new entity relationships or attributes; knowledge representation language can be used to support semantic reasoning and expansion. A visual graphical interface can also be created for the corpus database to display the content and structure of the knowledge base map. This visual graphical interface can help users understand the knowledge relationships in the map.
[0073] In one embodiment, as shown in FIG. 5 , a method for obtaining a query statement is provided. In the above step 102, the user input question is preprocessed based on the semantic model to obtain the query statement, which includes the following steps:
[0074] Step 501 , semantically parse the question input by the user based on the semantic model to obtain trigger words and key information.
[0075] Step 502, using trigger words to select a target question template from multiple question templates, adding key information to the reserved field position in the target question template, and obtaining a query statement.
[0076] The question template is a query statement format and content defined in advance with full consideration of the characteristics of the semantic model and the requirements of the target task, so that the semantic model can expand the questions input by the user. The question template is provided with corresponding trigger words and reserved field positions.
[0077] A trigger word may correspond to multiple question templates. Therefore, the target question template obtained by selecting a target question template from multiple question templates using the trigger word may include multiple question templates, and thus the query sentence obtained may be a combination of multiple sentences.
[0078] The semantic model performs semantic analysis on the questions input by the user to obtain trigger words and key information. For example, if the question input by the user is "What are the specific safety requirements when digging pits?", the trigger word obtained is "safety" and the key information is "digging pits". The question templates corresponding to the trigger word include "[ ] What are the safety requirements" and "[ ] How to deal with safety accidents". The key information is added to the reserved field position in the target question template, and the query statements obtained include "[digging pits] What are the safety requirements" and "[digging pits] How to deal with safety accidents". In this way, users' questions can be answered from multiple angles.
[0079] In one embodiment, as shown in FIG. 6 , a method for obtaining an answer to a question input by a user is provided. In the above step 103, the target knowledge matching the query statement is retrieved from the corpus database based on the question-answering model to obtain the answer to the question input by the user, including the following steps:
[0080] Step 601, perform entity recognition and entity relationship recognition on the query statement based on the question-answering model to obtain a query graph.
[0081] Step 602, traverse the entities and entity relationships in the query graph and match them with the triples in the knowledge graph to obtain the target knowledge.
[0082] Optionally, multiple candidate triples with the same entities as the query graph are searched from multiple triples in the knowledge graph by searching using an inverted index, and each candidate triple is vectorized to obtain a second vector corresponding to each candidate triple. For each set of entities and entity relationships in the query graph, the entities and entity relationships in the query graph are vectorized to obtain a first vector, and the similarity between the first vector and each second vector is calculated, and the candidate triple corresponding to the second vector with the highest similarity is used as the target knowledge.
[0083] Step 603: Generate an answer to the question input by the user based on the target knowledge.
[0084] Alternatively, using the target knowledge directly as the answer will appear stiff and lack communicative emotion. In order to make the answer appear less stiff, the target knowledge may be processed a second time. For example, word embedding may be performed on the target knowledge based on a question-answering model to obtain the answer to the question input by the user.
[0085] Specifically, the question-answering model combines the questions input by the user and performs word embedding processing on the target knowledge, such as adding modal particles and transition sentences. Transition sentences include "I understand. The following is the answer generated for you", "The safety requirements in pit digging operations are as follows:" and "Safety accidents in pit digging operations can be handled as follows:".
[0086] In one embodiment, the method steps of collecting knowledge related to personal risk include at least one of the following:
[0087] Cooperate with industry suppliers to obtain at least one of legal regulations and case information through application programming interfaces (APIs);
[0088] Use crawler technology to crawl at least one of laws, regulations, policy documents, industry standards and company system documents;
[0089] Use legal document search tools to perform keyword searches to obtain at least one of the following: laws, regulations, policy documents, and industry standards;
[0090] Use academic search engines to perform keyword searches to obtain at least one of the following: laws, regulations, policy documents, and industry standards.
[0091] In this embodiment, by cooperating with industry suppliers, using crawler technology, and document retrieval, the efficiency and feasibility of data acquisition can be improved, and the acquired data has better integrity and wider coverage.
[0092] In addition, it should be noted that both the semantic model and the question-answering model are trained deep learning models. The specific training method can be unsupervised training, semi-supervised training or supervised training, which is not limited here.
[0093] The training of the above semantic model also includes fine-tuning training. Specifically, by setting fine-tuning parameters including learning rate, optimizer selection, and loss function, more specific task or domain-specific data is added to the model to be trained to obtain a semantic model that can better adapt to specific tasks and fields. In fine-tuning training, a feedback channel can be opened for users to provide feedback on the prediction results (that is, query statements) of the semantic model to further improve and fine-tune the semantic model. In fine-tuning training, the fine-tuning effect is verified, specifically, various performance indicators including accuracy, recall rate, and F1 score are calculated to understand the performance of the semantic model on specific tasks for further optimization. In fine-tuning training, semantic model fine-tuning retrieves, searches and finds semantic models that have been fine-tuned, and searches according to different standards including model performance, model training data, and model creation time, so as to better manage and utilize the semantic models that have been fine-tuned. Semantic model fine-tuning provides a complete toolset for intelligent semantic analysis, identification, and generation of risk decision intelligent question-answering systems for knowledge graphs, so that users can effectively fine-tune, evaluate, and manage their models.
[0094] After the training of the above-mentioned question-answering model is completed, the question-answering model needs to be evaluated and optimized. Specifically, the question-answering model is evaluated by selecting or defining indicators for measuring the performance of the question-answering model according to specific tasks or applications, including precision, recall rate, F1 score, and AUC-ROC (Area Under the Curve - Receiver Operating Characteristic); selecting a question-answering model evaluation dataset, and selecting a dataset related to the task or application to evaluate the performance of the question-answering model, so as to understand the generalization performance of the question-answering model by evaluating the question-answering model on new data; applying the question-answering model to the evaluation dataset, calculating the consistency between the predicted results and the true results, and calculating the model performance according to the predetermined evaluation indicators to generate the evaluation results; comparing the evaluation results, evaluation indicators, and training time of different question-answering models, and selecting one or more question-answering models that are most suitable for the task being processed based on this information. Question-answering model evaluation and optimization provides a complete set of evaluation and optimization tools for intelligent semantic analysis, identification, and generation of risk decision-making intelligent question-answering systems for knowledge graphs, helping model developers select and apply the best model.
[0095] The question-answering model has the following characteristics: (1) The question-answering model can be converted into a format that can run in a specific hardware or software environment and configured with the necessary service interfaces. The question-answering model can be integrated into existing applications or services. (2) The question-answering model can respond to service start requests, service stop requests, resource scheduling requests, and concurrent service requests, thus ensuring the availability and efficiency of the question-answering model.
[0096] (3) The question-answering model can directly respond to questions input by users without the need for a semantic model to pre-process the questions input by users. In other words, the question-answering model can directly retrieve target knowledge from the corpus database based on the questions input by users and generate answers to the questions input by users. (4) The question-answering model can support multimodal input, that is, the question-answering model can receive different types of data.
[0097] The above question templates are determined after a large number of experiments, evaluations, and optimizations. The specific process is as follows: obtain multiple initial question and answer templates, test different initial question and answer templates, analyze their impact on the prediction results (query statements) of the semantic model, and adjust the initial question and answer template according to the test results. Perform multiple iterations until the optimal initial question and answer template is found as the question template to improve the accuracy of the semantic model. In addition, define evaluation indicators, select evaluation data sets, and run semantic models for evaluation to evaluate the impact of different initial question and answer templates on the prediction performance of the semantic model. Provide valuable feedback through the evaluation results to further optimize the initial question and answer template to obtain the question template. During the iteration process, the version of each initial question and answer template is also recorded, which makes it easy to trace back and reuse old versions of the initial question and answer template, and to manage and track the versions of the initial question and answer template.
[0098] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0099] Based on the same inventive concept, the embodiment of the present application also provides a risk decision intelligent question-answering system for implementing the risk decision intelligent question-answering method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more risk decision intelligent question-answering system embodiments provided below can refer to the limitations of the risk decision intelligent question-answering method above, and will not be repeated here.
[0100] In an exemplary embodiment, as shown in FIG7 , a risk decision intelligent question answering system is provided. The risk decision intelligent question answering system 700 includes: a construction module 701, a preprocessing module 702 and a search module 703, wherein:
[0101] A construction module 701 is used to construct a corpus database based on the collected knowledge related to personal risks, where the data in the corpus database is a knowledge graph;
[0102] A preprocessing module 702 is used to obtain a question input by a user, and preprocess the question input by the user based on a semantic model to obtain a query statement;
[0103] The search module 703 is used to retrieve target knowledge matching the query statement from the corpus database based on the question-answering model to obtain answers to the questions input by the user.
[0104] In one embodiment, the construction module 701 is specifically used to perform at least one of format mark removal, special character removal, and stop word removal processing on the collected knowledge related to personal risks; perform at least one of legal clause labeling, entity relationship labeling, named entity recognition, and event extraction on the knowledge after the removal processing to obtain corpus data; perform data format conversion on the corpus data, and import the expected data after the data format conversion into a graph database to obtain a corpus database.
[0105] In one of the embodiments, the preprocessing module 702 is specifically used to perform semantic analysis on the questions input by the user based on the semantic model to obtain trigger words and key information; use the trigger words to select a target question template from multiple question templates, add the key information to the reserved field position in the target question template, and obtain a query statement.
[0106] In one embodiment, the search module 703 is specifically used to perform entity recognition and entity relationship recognition on the query statement based on the question-answering model to obtain a query graph; traverse the entities and entity relationships in the query graph and match them with triples in the knowledge graph to obtain target knowledge; and generate answers to questions input by users based on the target knowledge.
[0107] In one embodiment, the search module 703 is specifically used to perform word embedding processing on the target knowledge based on the question-answering model to obtain the answer to the question input by the user.
[0108] In one embodiment, the system also includes a collection module for performing at least one of the following: cooperating with industry suppliers to obtain laws, regulations and case information through an application programming interface (API); using crawler technology to crawl laws, regulations, policy documents, industry standards, and company system documents; using legal document retrieval tools to perform keyword searches to obtain laws, regulations, policy documents, and industry standards; using academic search engines to perform keyword searches to obtain laws, regulations, policy documents, and industry standards.
[0109] Each module in the above-mentioned risk decision intelligent question-answering system can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0110] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a risk decision intelligent question-answering method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0111] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial 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 shown in the figure, or combine certain components, or have a different arrangement of components.
[0112] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any one of the method embodiments described above are implemented.
[0113] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the method embodiments described above are implemented.
[0114] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements the steps of any one of the method embodiments described above when executed by a processor.
[0115] It should be noted that the laws, regulations, case information, policy documents, industry standards, company system documents and other data involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0116] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0118] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A risk decision intelligent question answering method, characterized in that: The method comprises: Based on the collected knowledge related to personal risks, a corpus database is constructed, wherein the data in the corpus database is a knowledge graph; Obtaining a question input by a user, and preprocessing the question input by the user based on a semantic model to obtain a query statement; Based on the question-answering model, target knowledge matching the query statement is retrieved from the corpus database to obtain an answer to the question input by the user.
2. The method according to claim 1, characterized in that The corpus database is constructed based on the collected knowledge related to personal risks, including: Perform at least one of format mark removal, special character removal, and stop word removal on the collected knowledge related to personal risks; Perform at least one of legal clause labeling, entity relationship labeling, named entity recognition, and event extraction on the knowledge after the removal process to obtain corpus data; The corpus data is converted into a data format, and the expected data after the data format conversion is imported into a graph database to obtain the corpus database.
3. The method according to claim 1 or 2, characterized in that: The preprocessing of the question input by the user based on the semantic model to obtain a query statement includes: Perform semantic analysis on the question input by the user based on the semantic model to obtain trigger words and key information; The trigger word is used to select a target question template from multiple question templates, and the key information is added to the reserved field position in the target question template to obtain the query statement.
4. The method according to claim 1, characterized in that: The step of retrieving target knowledge matching the query statement from the corpus database based on the question-answering model to obtain an answer to the question input by the user includes: Perform entity recognition and entity relationship recognition on the query statement based on the question-answering model to obtain a query graph; Traversing the entities and entity relationships in the query graph and matching them with triples in the knowledge graph to obtain the target knowledge; An answer to the question input by the user is generated according to the target knowledge.
5. The method according to claim 4, characterized in that The step of generating an answer to the question input by the user according to the target knowledge comprises: The target knowledge is word-embedded based on the question-answering model to obtain an answer to the question input by the user.
6. The method according to claim 1, characterized in that The method steps for collecting knowledge related to personal risk include at least one of the following: Cooperate with industry suppliers to obtain at least one of legal regulations and case information through application programming interfaces (APIs); Use crawler technology to crawl at least one of laws, regulations, policy documents, industry standards and company system documents; Use legal document search tools to perform keyword searches to obtain at least one of the following: laws, regulations, policy documents, and industry standards; Use academic search engines to perform keyword searches to obtain at least one of the following: laws, regulations, policy documents, and industry standards.
7. A risk decision intelligent question-answering system, characterized in that: The system comprises: A construction module, used to construct a corpus database based on the collected knowledge related to personal risks, wherein the data in the corpus database is a knowledge graph; A preprocessing module, used to obtain a question input by a user, and preprocess the question input by the user based on a semantic model to obtain a query statement; The search module is used to retrieve target knowledge matching the query statement from the corpus database based on the question-answering model to obtain an answer to the question input by the user.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Experimental question and answer method and system based on knowledge graph
CN121071164A