A question and answer method combining a sequence model and a knowledge graph
By combining the Seq2Seq model and knowledge graph technology, a domain knowledge question answering system was constructed, which solved the problem of insufficient flexibility of question answering systems in handling professional and non-professional questions, and achieved more intelligent and accurate question answering results.
Patent Information
- Application Number
- CN202310010370.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-04
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-01-04
AI Technical Summary
Existing question-answering systems struggle to flexibly handle both professional and non-professional questions when dealing with domain-specific knowledge, and largely rely on human intervention, resulting in poor flexibility.
By combining the Seq2Seq model and knowledge graph technology, and through data preprocessing, BERT model fine-tuning, cosine similarity algorithm and attention mechanism of Seq2Seq model, a domain knowledge question answering system is constructed to achieve flexible answers to both professional and non-professional questions.
It improves the intelligence and accuracy of the question-and-answer system, enabling it to flexibly handle both professional and non-professional questions, reduce user judgment and trial-and-error costs, and provide more accurate answers.
Smart Images

Figure CN116127095B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and in particular to a domain knowledge Chinese question answering method based on the Seq2Seq model and knowledge graph technology. Background Technology
[0002] With the explosive growth of internet information, traditional search engines struggle to meet users' needs for precise information retrieval. Question-answering systems (QA) semantically categorize questions, enabling them to return more accurate and intuitive answers, thus improving user experience and efficiency. However, most QA systems are rule-based, lacking flexibility and requiring significant human intervention. Knowledge graphs, a concept proposed by Google in 2012, aim to improve search results by describing various entities and concepts in the real world and the relationships between them. By constructing a knowledge graph, a semantic network is formed. Based on this, QA systems can understand user intent to a certain extent based on the entities and relationships within the knowledge graph, finding the information users truly need. Knowledge-based QA often maps user questions to structured queries, ultimately targeting entities within a knowledge base. These entities contain rich relevant information; therefore, accurately locating the entity in the knowledge base allows for convenient and concise responses. Compared to traditional search engines, QA systems can provide more accurate and efficient reliable information.
[0003] Currently, numerous scholars both domestically and internationally have applied knowledge graph-based question-answering systems to various fields. For example, Wu et al. established a question-answering system using a self-built knowledge graph of mental health counseling and employed a BiLSTM model to detect and intervene in users with suicidal tendencies. Zhang et al. used a Ro Berta-Lattice_LSTM-CRF-based question entity recognition method and a Ro Berta-Text CNN-based question semantic classification method for semantic analysis, realizing a Chinese query platform. WenpenY et al. implemented question answering based on convolutional neural networks, mapping questions and knowledge graph elements to a common embedding space through a deep learning model, and obtaining answers through the similarity and relevance of embedding vectors. Yan G et al. proposed the MCQA question-answering model, using deep learning algorithms to classify questions and constructing a mobile medical question-answering system with automatic domain dictionary extraction and automatic question annotation. Xing Z et al. combined medical background information with a Seq2Seq question-answering model, selecting independent recurrent neural networks as the encoder and decoder of the model, establishing an automatic question-answering system for medical triage stations. All of these scholars have successfully integrated question-answering systems with the medical and health field, each with its own application area.
[0004] Numerous studies have proposed strategies for combining knowledge graphs with question-answering systems. However, most of these studies are limited to implementing question-answering based on domain-specific knowledge. This prompts this study to explore the combination of deep learning models and knowledge graph technology for basic knowledge question answering. By adopting different strategies for different types of datasets, this approach undoubtedly better meets user needs, resulting in more accurate and efficient answers from the question-answering system. Summary of the Invention
[0005] The purpose of this invention is to provide a domain knowledge Chinese question answering method based on the combination of Seq2Seq model and knowledge graph technology, and to provide a natural language question answering solution. For different types of domain knowledge datasets, a natural language question answering method based on deep learning and knowledge graph is designed and developed.
[0006] This invention applies natural language processing techniques such as triplet extraction, named entity recognition, and semantic matching, and combines the Seq2Seq model, BERT model, and cosine similarity algorithm used in this invention to design a domain knowledge Chinese question answering method.
[0007] To achieve the above objectives, this invention adopts the following technical solution: Python is chosen as the programming language for better implementation of the entire method. In the data preprocessing stage, Pandas and rule matching are used for dataset cleaning and partitioning. Model building and training are primarily implemented using the Tensorflow framework. First, three types of domain knowledge datasets are collected and processed: domain professional knowledge dataset, domain basic knowledge question-and-answer dataset, and domain knowledge chat dataset, and the processed data is stored. Question texts are classified using matching rules in question judgment. Different answer retrieval methods are developed based on the question category, and "domain professional knowledge semantic data" is constructed from the domain professional knowledge dataset. Professional answers from the knowledge graph are obtained through keyword extraction and template matching. "Domain basic knowledge question-and-answer semantic data" is constructed from the domain basic knowledge question-and-answer dataset, and the best answer from the domain knowledge chat dataset is obtained using a sentence vector similarity algorithm to train a Seq2Seq model as a supplement to the knowledge graph question-and-answer strategy. The overall structure of this invention is shown in the diagram below. Figure 1 As shown.
[0008] A question-answering method combining sequence models and knowledge graphs mainly includes:
[0009] Step 1: Knowledge Acquisition Methods
[0010] Existing domain knowledge is acquired through large public knowledge graphs such as DBpedia and Ownthink. Public data is obtained using Scrapy+Redis and Selenium tools to expand and complete the knowledge graph. Question-and-answer training data is obtained through keyword searches in question-and-answer communities.
[0011] like Figure 2 The diagram illustrates the web crawling strategy for acquiring domain knowledge. First, crawling requests are made to question-and-answer communities or other publicly available databases. The Selenium tool is used to retrieve this publicly available data, automatically searching for keywords related to domain-specific and fundamental knowledge within web pages. A Redis server is then used to schedule and deduplicate the retrieved data. After standardizing the obtained data, it is converted to RDF format and stored in the "Domain Knowledge Chinese Knowledge Graph".
[0012] Step 2: Data Preprocessing
[0013] To improve model training performance, data preprocessing is necessary. Since chat datasets often contain a large amount of invalid data, data cleaning is required. This invention primarily cleans non-text content, special titles, and duplicate text from the dataset. The cleaned dataset may contain a large amount of discontinuous information. By writing rules, this invention merges information that conforms to the rules. The specific rules are as follows:
[0014] 1) Message IDs match;
[0015] 2) Same user identity;
[0016] 3) No identity switching occurs between multiple messages;
[0017] 4) The maximum time interval between multiple messages shall not exceed 1 hour;
[0018] 5) The dialogue between the same pair of questioners and answerers is combined into a question-and-answer pair.
[0019] After the appeal process, a dataset that can be used for model training can be obtained.
[0020] Step 3: Construct a Seq2Seq Chinese dialogue model
[0021] The BERT model, based on a bidirectional encoder using the Transformer model, has achieved remarkable results in natural language processing. BERT is a pre-trained language model that can convert words in text that cannot be directly computed into vectors or matrices. In this way, the vectorized numbers reflect the meaning of the words in the text. Simultaneously, it overcomes the problem of previous language models that mapped one word to one vector, leading to the inability to accurately represent polysemous words. BERT's architecture is a multi-layer bidirectional Transformer encoder; after inputting data in a specific format, it outputs the training results of a black-box model composed of multiple Transformers. Therefore, the BERT model can combine left and right contextual conditions to obtain the current meaning of polysemous words.
[0022] The first stage of the BERT model is called "pre-training," which involves training the language model using an unlabeled corpus. The second stage is called "fine-tuning." This stage uses the pre-trained language model to complete specific downstream NLP tasks. The values of the last layer of the BERT model are too close to the target values of the training task, and the first few layers of the BERT model may not have fully learned semantic features. Therefore, this experiment chooses the penultimate layer of BERT as the sentence vector. This invention uses a domain-based knowledge question-answering dataset to fine-tune BERT. The fine-tuned BERT model is used to vectorize questions in the domain-based knowledge question-answering dataset, and the sentence vectors are stored in existing domain-based knowledge question-answering semantic data. The best answer is found through sentence vector similarity matching.
[0023] In professional fields, everyday question answering includes not only professional and basic questions but also casual, conversational questions. Knowledge graphs excel at storing limited and fixed professional knowledge. However, this means that knowledge graphs struggle to flexibly handle casual, conversational questions. To address this issue, this invention introduces the Seq2Seq model. The Seq2seq model is a variant of the traditional recurrent neural network (RNN), whose framework includes an encoder and a decoder. This model accepts input sentences, i.e., vector sequences, and its output is also a vector sequence. In the encoder-decoder framework, the encoder transforms the sequence into a fixed-length vector, and then the decoder transforms that vector into the desired sequence and outputs it. In this invention, an LSTM model is used for both the encoder and decoder parts of the model.
[0024] Simple Seq2Seq models excel at handling short sentences but struggle with long ones. This is because the encoder encodes all input sequences into a uniform semantic vector, which is then decoded by the decoder. Therefore, the finite length of this semantic vector, containing all the information from the original sequence, reduces the model's accuracy. Furthermore, this implementation only uses the last hidden layer state, resulting in low information utilization. To overcome this problem, this invention incorporates an attention mechanism. This mechanism allows the vector compiled by the encoder to be dynamically adjusted in real-time based on what the decoder is currently decoding. The semantic vector is no longer fixed but its weights are continuously adjusted to accommodate different input semantic vectors. This enhances the neural network's memory capacity, enabling it to perform complex sequence-to-sequence learning tasks.
[0025] The cosine similarity algorithm is used to compare the similarity between two things. This invention uses this algorithm to calculate the similarity between the question text and existing questions in the knowledge graph. The cosine value of the angle between two vectors in vector space is used to measure the difference between the two individuals. The closer the value is to 1, that is, the closer the angle is to 0°, the more similar the two vectors are; conversely, the closer the cosine value is to 0, that is, the closer the angle is to 90°, the less similar the two vectors are. Therefore, this invention obtains the similarity between sentences by calculating the cosine distance between sentence vectors. The equation for calculating the cosine of two-dimensional vectors a and b is shown in Equation 1:
[0026]
[0027] Extending vectors a and b in Equation 1 to n dimensions, the cosine of the angle between the vectors is calculated as shown in Equation 2:
[0028] Step 4: Model Training
[0029] This experiment preprocessed a dataset of 6.6 million anonymized chat logs from various professional fields, resulting in 490,000 question-and-answer text pairs. To ensure sufficient data for model training while reserving some data for testing, 70% of the chat logs were selected as the training set. The training set was then input into a pre-written program, and the trained model was obtained through execution.
[0030] Step 5: Construct a knowledge graph
[0031] Knowledge graphs can store large amounts of fixed, specialized domain knowledge, fundamentally ensuring the accuracy of the content. Answers obtained through reasoning and querying using knowledge graphs originate from this accurate data, guaranteeing the authority of the answers. The application of knowledge graph technology can improve the intelligence of question-answering systems. The knowledge graph in this invention describes things in the form of triples, consisting of entities and their interrelationships.
[0032] To increase the data diversity of the knowledge graph and thus enhance the flexibility of the dialogue system, this invention constructs a "Domain Basic Question-Answer Knowledge Graph" by integrating "domain-specific semantic data" and "domain-based question-answering semantic data." Furthermore, after pre-training, this invention uses the BERT Chinese model to calculate the sentence vectors of questions in the "Domain Basic Question-Answer Knowledge Graph." The calculated question sentence vectors are then stored in the knowledge graph as semantic data. The overall architecture of the "Domain Basic Question-Answer Knowledge Graph" is as follows: Figure 3 As shown.
[0033] Knowledge graph construction process:
[0034] Step 1: Perform triplet data annotation on the knowledge obtained using web crawlers and the data obtained from large public knowledge graphs.
[0035] Step 2: Train the triplet extraction model.
[0036] Step 3: Call the triplet extraction interface to extract the data and store the extracted results.
[0037] Step 4: Review the extracted triplet data.
[0038] Step 5: Store the reviewed data into the corresponding space in the graph database, which will serve as the knowledge base for that data.
[0039] Step 6: Generate sequence model
[0040] By combining a domain-based question-answering knowledge graph with a Seq2Seq Chinese dialogue model, a non-continuous sequence adversarial generative model is constructed. The model is trained using an imbalanced training dataset to obtain a well-trained model.
[0041] Step 7: Question Judgment and Answer Generation
[0042] Traditional search engines can retrieve the most valuable information from available online resources based on a user's request. In contrast, domain-specific question-answering systems based on artificial intelligence can analyze questions in real time, accurately locate the knowledge required by the user, and reduce the user's judgment and trial-and-error costs.
[0043] This invention determines the type of user-input question text through dictionary lookup, template matching, and similarity algorithms. For different question types, knowledge graph reasoning and text generation techniques are used to obtain the final answer. To improve the accuracy of the question-answering system, this invention categorizes user-submitted questions into two types: domain-specific and non-domain-specific questions. This invention uses a domain dictionary combined with template matching to determine whether the question involves professional knowledge. Keywords representing domain knowledge attributes are extracted and integrated from the knowledge graph to construct a keyword dictionary of domain-specific knowledge.
[0044] By combining the constructed dictionary with a question type judgment template, the question type can be determined. If the question involves domain-specific knowledge, keywords are combined with a SPARQL template to search for the best answer in the knowledge graph. A fine-tuned BERT model is used to vectorize the questions in the domain-based knowledge question-answering dataset, and the sentence vectors are stored in the existing "domain-based knowledge semantic data." The best answer is found through sentence vector similarity matching. The cosine similarity algorithm is used to calculate the similarity between the question text and existing questions in the knowledge graph. Question texts with similarity values below a threshold are input into the trained Seq2Seq model to generate answer text. The similarity threshold in this experiment was obtained by calculating the similarity of 100 pairs of question texts using the BERT model combined with the similarity algorithm, and was manually set to 0.985. The architecture diagram of the domain-based knowledge question-answering system of this invention is shown below. Figure 4 .
[0045] The inventiveness of this invention is mainly reflected in:
[0046] Current research on domain-specific question-answering methods is primarily focused on answering professional questions, with research on classifying and answering professional and non-professional questions still in its infancy. This invention combines the logical reasoning language of knowledge graphs with the probabilistic computation techniques of deep learning to provide users with flexible answers to both types of questions. The question-answering system, combining knowledge graph technology and deep learning models, expands the types of questions that can be answered while ensuring professionalism. Utilizing accurate and reliable knowledge from the knowledge graph, it can answer professional questions posed by users. The text generation technology of deep learning models serves as a supplement to the knowledge graph, answering non-professional questions in informal conversations. By preprocessing user questions to determine their categories, the efficiency of the question-answering system in obtaining answers is further improved. Attached Figure Description
[0047] Figure 1 This is a diagram illustrating the overall structure of the question-answering method based on the combination of sequence models and knowledge graphs in this invention.
[0048] Figure 2 A graph of crawler strategies for domain knowledge acquisition
[0049] Figure 3 Overall architecture diagram of the "Domain-Based Question-Answering Knowledge Graph"
[0050] Figure 4 This is a diagram illustrating the domain knowledge question-answering system architecture of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0052] This invention provides a question-answering method that combines sequence models and knowledge graphs, specifically including the following steps:
[0053] Step 1: Data Collection
[0054] We downloaded existing domain knowledge from large public knowledge graphs such as DBpedia and Ownthink. We then used Scrapy+Redis and Selenium to crawl domain knowledge not found in these large public knowledge graphs, extending the knowledge graphs. Finally, we obtained question-and-answer training data through keyword searches on question-and-answer communities.
[0055] Step 2: Data Preprocessing
[0056] The crawled data is unstructured. Before expanding this data into the knowledge graph, some processing is needed based on actual requirements. A Redis server is used to schedule and deduplicate the retrieved data. After standardizing the obtained data, it is converted to RDF format and stored in the "Domain Knowledge Chinese Knowledge Graph".
[0057] Meanwhile, the acquired chat dataset contains a large amount of invalid data, thus requiring data cleaning. This invention primarily cleans up non-text content, special titles, and duplicate text in the dataset. This invention uses rules to merge discontinuous information within the cleaned dataset. The specific rules are as follows:
[0058] 1) Message IDs match;
[0059] 2) Same user identity;
[0060] 3) No identity switching occurs between multiple messages;
[0061] 4) The maximum time interval between multiple messages shall not exceed 1 hour;
[0062] 5) The dialogue between the same pair of questioners and answerers is combined into a question-and-answer pair.
[0063] After the appeal process, a dataset that can be used for model training can be obtained.
[0064] Step 3: Dataset Partitioning and Model Training
[0065] The collected and processed domain knowledge is divided into three types of datasets: domain professional knowledge datasets, domain basic knowledge question-and-answer datasets, and domain knowledge chat datasets.
[0066] This experiment preprocessed a de-identified chat dataset of 6.6 million professional domains to obtain 490,000 question-and-answer text data. The domain knowledge chat dataset was divided into training and testing sets in a 7:3 ratio, with 343,000 question-and-answer text pairs used as the model training set and 147,000 question-and-answer text pairs used as the testing set.
[0067] We built BERT and Seq2Seq models using Python, input the training set into the models, and completed the sequence model after training. We then tested the model's ability to process data using a test set.
[0068] Step 4: Knowledge Graph Construction
[0069] This invention constructs a "domain basic question-and-answer knowledge graph" by integrating "domain professional knowledge semantic data" and "domain basic knowledge question-and-answer semantic data".
[0070] The knowledge graph construction process of this system involves the following steps:
[0071] 1. Perform triplet data annotation on knowledge obtained through web crawling and data obtained from large public knowledge graphs.
[0072] 2. Train the triplet extraction model using the training set.
[0073] 3. Segment the extracted data.
[0074] 4. Call the triplet extraction interface to extract the data and store the extracted results.
[0075] 5. Review the triplet extraction, cleaning, and re-labeling, and write the re-labeled training data into the training file.
[0076] 6. Store the reviewed data into the corresponding space in the graph database, which will serve as the knowledge base for that data.
[0077] Step 5: Generate sequence model
[0078] By combining a domain-based question-answering knowledge graph with a Seq2Seq Chinese dialogue model, a non-continuous sequence adversarial generative model is constructed. The model is trained using an imbalanced training dataset to obtain a well-trained model.
[0079] Step 6: Question Judgment and Answer Generation
[0080] This invention categorizes user-submitted questions into two types: domain-specific questions and non-domain-specific questions. It determines whether a user-inputted question is a domain-specific question through dictionary lookup, template matching, and similarity algorithms.
[0081] The cosine similarity algorithm is used to calculate the similarity between question text and existing questions in the knowledge graph. This invention uses the BERT model combined with a similarity algorithm to calculate the similarity of 100 pairs of question texts to obtain a similarity threshold, which is manually set to 0.985. The fine-tuned BERT model is used to vectorize questions in the domain-specific knowledge question-answering dataset, and the sentence vectors are stored in existing "domain-specific knowledge semantic data." The best answer is found through sentence vector similarity matching. If the similarity between the question and existing questions in the knowledge graph is greater than the similarity threshold, the question involves domain-specific expertise. Keywords are combined with SPARQL templates to search for the best answer in the knowledge graph. If the similarity between the question and existing questions in the knowledge graph is less than the similarity threshold, the question is a non-expert question, i.e., chat data. The question text is then input into a trained Seq2Seq model to generate the answer text.
[0082] In summary, this invention, through the research and application of the Seq2S2q and BERT models, enables downstream NLP tasks such as sentence pair classification, question answering, and named entity recognition. By applying NLP technology and constructing knowledge graphs from domain-specific data, it combines the logical reasoning language of knowledge graphs with the probabilistic computation techniques of deep learning. To a certain extent, this allows the question answering system to accurately determine the type of question and flexibly answer both professional and non-professional questions, making the domain knowledge question answering system more intelligent.
[0083] Obviously, the described embodiments are only some, not all, of the embodiments of the present invention, and the scope of protection of the present invention is defined by the claims. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
Claims
1. A method for question answering by combining a sequence model with a knowledge graph, characterized in that, The implementation process of the method is as follows: The data preprocessing stage uses Pandas and rule matching to realize data set cleaning, data set division, and the model is built and trained using the Tensorflow framework; Three types of data sets of domain knowledge are collected and processed: domain professional knowledge data set, domain basic knowledge question and answer data set and domain knowledge chat data set, and the processed data is stored; The problem text is classified through the matching rules in the problem judgment; different answer retrieval methods are formulated according to the category of the question, the "domain professional knowledge semantic data" is constructed from the domain professional knowledge data set, and the professional answers in the knowledge graph are obtained through keyword extraction and template matching; the "domain basic knowledge question and answer semantic data" is constructed from the domain basic knowledge question and answer data set, and the best answer of the domain knowledge chat data set is obtained using the sentence vector similarity algorithm to train the Seq2Seq Chinese dialogue model as a supplement to the knowledge graph question and answer strategy; The construction of the Seq2Seq Chinese dialogue model is as follows: The bidirectional encoder representation Bert model based on the Transformer model converts the words in the text that cannot be directly calculated into vectors or matrices; The first stage of the Bert model is called "pre-training", that is, training the language model using unlabeled corpus; the second stage is called "fine-tuning"; The pre-trained language model is used to complete the specific NLP downstream task; The value of the last layer of the Bert model is close to the target value of the training task, and the second to last layer of Bert is selected as the sentence vector; The Bert is fine-tuned using the domain basic knowledge question and answer data set; The Seq2Seq model is introduced to accept the input sentence, that is, the vector sequence, and its output is also a vector sequence; in the encoder-decoder framework, the encoder converts the sequence into a fixed length vector, and then the decoder converts the vector into the required sequence and outputs; the LSTM model is used for the encoder and the decoder; The attention mechanism is added to allow the vector compiled by the encoder to be dynamically adjusted in real time according to the current decoding content of the decoder; The semantic vector continuously adjusts the weight to input different semantic vectors, enhances the memory capacity of the neural network, and completes the complex sequence-to-sequence learning task; The cosine value of the angle between two vectors in the vector space is used to measure the difference between the two individuals; the closer the cosine value is to 1, that is, the closer the angle is to 0°, the more similar the two vectors are; On the contrary, the closer the cosine value is to 0, that is, the closer the angle is to 90°, the less similar the two vectors are; the similarity between sentences is obtained by calculating the cosine distance between sentence vectors; The equation for calculating the cosine of two-dimensional vectors a and b is shown in equation 1: , The vectors a and b in equation 1 are extended to n dimensions, and the cosine calculation of the angle between the vectors is shown in equation 2: 。 2. The method of claim 1, wherein the method further comprises: The knowledge acquisition method is as follows: The existing domain knowledge is obtained through DBpedia and Ownthink knowledge graph; The public data is obtained using Scrapy+Redis and Selenium tools, the knowledge is expanded to complete the knowledge graph, the training data of one question and one answer is obtained through keyword search in the question and answer community; A crawler request is made to a Q&A community or other public data, the public data is obtained using the Selenium tool, and keywords for field expertise and field basic knowledge are automatically searched in the webpage, the obtained data is scheduled and de-duplicated using a Redis server; After standardizing the obtained data, the data is converted into RDF format and stored in the "field knowledge Chinese knowledge graph". 3.The method of claim 1, wherein, The data preprocessing process is as follows: Non-text content, special titles and duplicate texts in the data set are cleaned; the cleaned data set may contain discontinuous information; by writing rules, information meeting the rules is merged; the specific rules are as follows: 1) consistent message ID; 2) same user identity; 3) no identity switching between multiple messages; 4) the maximum time interval of multiple messages is not more than 1 hour; 5) the dialogue between the same pair of questioners and answerers is combined into a pair of questions and answers; the data set for model training is obtained.
4. The method of claim 1, wherein the method further comprises: The model training process is as follows: after preprocessing the 6.6 million professional field desensitization chat data set, 490,000 pairs of question and answer text data are obtained, and 70% of the chat data is selected as the training set; the training set is input into the prepared program, and the trained model is obtained by running.
5. The method of claim 1, wherein the method further comprises: The knowledge graph construction process is as follows: The knowledge graph describes things in the form of triples, and is composed of entities and their mutual relationships; by integrating "field professional knowledge semantic data" and "field basic knowledge Q&A semantic data", a "field basic Q&A knowledge graph" is constructed; after pre-training, the Bert Chinese model is used to calculate the sentence vector of the question in the "field basic Q&A knowledge graph"; and the calculated question sentence vector is stored in the knowledge graph in the form of semantic data; The knowledge graph construction process is as follows: Step 1: triple data annotation is performed on the knowledge obtained using the crawler and the data obtained from large public knowledge graphs; Step 2: train the triple extraction model; Step 3: call the triple extraction interface for extraction, and store the results after extraction; Step 4: audit the extracted triple data; Step 5: store the data after auditing into the corresponding space of the graph database as the corresponding knowledge base; Step 6, generate sequence model; Combine the field basic Q&A knowledge graph and the Seq2Seq Chinese dialogue model to construct a non-continuous sequence generative adversarial model, use the non-balanced training data set to train the model, and obtain the trained model; Step 7, question judgment and answer generation; Through dictionary query, template matching text and similarity algorithm calculation, the type of the question text input by the user is judged; according to different question types, the knowledge graph reasoning technology and text generation technology are used to obtain the final answer; in order to improve the accuracy of the Q&A system, the questions put forward by the user are divided into two categories, namely professional questions and non-professional questions in the field; Use the field dictionary combined with template matching to determine whether the question involves professional knowledge; Extract and integrate the keywords of the field knowledge attributes in the knowledge graph to construct a keyword dictionary of field professional knowledge.
Citation Information
Patent Citations
Intelligent customer service reply method and device
CN113987151A
Intelligent question-answering system self-adaptive to knowledge maps in different fields and construction method of intelligent question-answering system
CN115080710A