Construction method of intelligent question answering system based on computer discipline knowledge graph

By constructing an intelligent question-answering system based on a computer science knowledge graph, the problems of fragmented computer science knowledge points and inaccurate search engines have been solved. This system enables the scientific organization of knowledge points and provides professional question-answering services, supporting dynamic updates and data expansion of the knowledge graph.

CN115840805BActive Publication Date: 2026-02-17HEBEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211605555.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2026-02-17
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

Computer science knowledge points are scattered and data is inconsistent. Traditional search engine results are inaccurate, making it difficult for college students to systematically understand the knowledge points and their relationships.

Method used

This paper constructs an intelligent question-answering system based on a computer science knowledge graph. It uses a top-down approach to define entity types and relationships, acquires data through web crawling, extracts entities and relationships using BiLSTM-CRF and BiLSTM-ATT models, and builds an intelligent question-answering system based on the Flask and React frameworks to achieve visualization and dynamic updating of the knowledge graph.

Benefits of technology

It achieves the scientific organization and hierarchical nesting of knowledge points, provides professional intelligent question-and-answer services, dynamically updates the knowledge graph, avoids junk information, and supports the expansion of interactive data between students and teachers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115840805B_ABST
    Figure CN115840805B_ABST
Patent Text Reader

Abstract

The application provides a kind of construction method of intelligent question answering system based on computer discipline knowledge graph, first constructs computer discipline ontology, then utilizes crawler technology to collect unstructured data such as electronic books and baidu encyclopedia, completes knowledge processing based on Colabeler tool, BiLSTM-CRF, BiLSTM-ATT, stores the extracted entity, relationship and other data to Neo4j, and finally establishes intelligent question answering system based on backend Flask framework and front-end React framework. First, the keywords of the question are extracted, and the template is matched. If no answer is matched, the relevance of the question is analyzed, and the question is stored in the relational database. The teacher answers, extracts the effective information of the teacher's answer using the knowledge extraction model, and supplements it to the knowledge graph to update the knowledge graph. The application has three characteristics of data structuring, storage refinement and intelligent question answering, which solves the problems of scattered and irregular computer discipline data, coarse discipline knowledge granularity and inaccurate search results.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of knowledge graph and natural language processing, and particularly relates to a construction method of an intelligent question-answering system based on a computer discipline knowledge graph. BACKGROUND

[0002] With the prosperity and development of education and scientific research in China, the knowledge system of each discipline is increasingly complex, and how to systematically sort out and summarize the knowledge points of each discipline has increasingly become a necessary and urgent task. Taking the computer discipline of a university as an example, teaching materials, MOOCs and various blog learning materials are complex and complicated, and a large amount of data is scattered, has various formats and is inconsistent. Traditional discipline construction has a coarse granularity and is often based on courses, but the underlying knowledge points contained in the courses lack systematic sorting, and it is difficult for college students to clearly understand the knowledge points and the relationship between the knowledge points in the initial learning stage and to fully master the knowledge points. In addition, students can obtain related knowledge by means of a search engine, but the search engine can only give similar answers and cannot provide accurate results. SUMMARY

[0003] Therefore, the application aims to provide a construction method of an intelligent question-answering system based on a computer discipline knowledge graph to solve the problems of scattered and irregular data of the computer discipline, coarse granularity of discipline construction and inaccurate search engine results.

[0004] To achieve the above-mentioned purpose, the technical scheme of the application is as follows:

[0005] A construction method of an intelligent question-answering system based on a computer discipline knowledge graph comprises the following steps:

[0006] (1) ontology construction: a top-down method is adopted to determine the computer discipline field entity types as course entities, concept entities, operation entities and method entities, and the relationships as concept hierarchical relationships, front-back sequence relationships and association relationships;

[0007] (2) computer discipline data acquisition: the data source is unstructured data, part of which is computer discipline electronic book data, and the other part is related data obtained by crawling Baidu Baike through a Python web crawler, and after preliminary filtering and integration, the original text data set is obtained;

[0008] (3) Knowledge processing: part of the original data set is labeled by the Colabeler tool to generate entity and relation original data sets. Python realizes the automatic BIO format labeling of entity original data set and the structured representation of relation original data set, and generates entity and relation data sets available for the model; BiLSTM-CRF model is used to complete entity recognition of unstructured data; BiLSTM-ATT model is used to complete relation extraction of unstructured data;

[0009] (4) Construction of computer discipline knowledge graph: the extracted entities and relations are de-duplicated and aligned, and entity and relation lists are generated; the entity and relation lists are stored in the graph database Neo4j, and the storage and visualization of the computer discipline knowledge graph are completed;

[0010] (5) Construction of intelligent question answering system: based on the backend Flask framework and the front-end React framework, an intelligent question answering system is established, and the data is continuously expanded and updated through the crowdsourcing mode of question and answer. In the intelligent question answering, first, the keywords of the student questions are extracted, and the template is matched, and after the system queries the data, the result is returned in a visual dialogue mode; if no data is matched, the relevance of the question is analyzed, and the knowledge points related to the question are returned, and the question is stored in the relational database to expand the original data source; then the teacher answers the student questions that do not match the answer, and uses the knowledge extraction model to extract the effective information of the teacher's answer and supplements it to the knowledge graph to realize the update of the knowledge graph.

[0011] Further, in step (1), the ontology construction defines four types of entities, namely courses, concepts, operations and methods. Among them, the course entity represents the courses contained in the discipline, the concept entity represents the important parts contained in the course, the operation entity represents the specific knowledge unit, and the method entity represents the specific knowledge point of the knowledge unit, which is the relatively independent smallest unit of knowledge, theory, etc. Three types of relations are defined, namely concept hierarchy, pre and post, and association. Among them, the concept hierarchy relation represents the inclusion between entities of different categories; the pre and post sequence relation represents the pre and post relationship of the learning order between entities of the same category; the relationship association relation represents the association relationship between entities of the same category, and the definition standard is the same topic co-occurrence principle.

[0012] Further, in step (2), the network crawler based on Python language is used to obtain computer discipline knowledge data. The specific process is as follows: first, the entry function of the crawler is used to read the list of target knowledge point keywords, and then the keywords are recursively spliced through http: / / baike.baidu.com / item+ to simulate the sending of a request to the server using the request library, grab the web source code, parse the HTML through BeautifulSoup, and then output the data as UTF-8 and save it as a txt file. Finally, after manual screening and sorting, the original corpus file is integrated.

[0013] Further, in step (3), in the entity data set and the relationship data set, the entity annotation rule adopts the BIO format, and each element is annotated as "B-N", "I-N" or "O". Among them, "B-N" indicates that the segment where the element is located belongs to N entity and is the beginning of the entity, "I-N" indicates that the segment where the element is located belongs to N entity and is the middle position element of the entity, and "O" indicates that it does not belong to any type. The relationship annotation adopts the format of <entity1 entity2 relationship entity in the sentence> for annotation.

[0014] Further, in step (4), the computer discipline knowledge graph is constructed, which specifically includes:

[0015] First, the synonym mapping table of entities and relationships is constructed respectively, so as to realize the mapping of entities or relationships with the same meaning to unique entity or relationship names;

[0016] Secondly, according to the synonym mapping table, the entities and relationships obtained in the entity recognition and relationship extraction are replaced by synonyms;

[0017] Finally, the replaced entities and relationships are de-duplicated to generate an entity list and a relationship list, wherein the relationship list is represented in the form of triple <entity, relationship, entity>.

[0018] Further, in step (5), the knowledge graph visualization interaction is realized, which specifically includes:

[0019] First, the React front end initiates an HTTP request to the Flask system backend service, and transmits the data of the node clicked by the user in JSON format;

[0020] Secondly, the backend receives the request, generates a Cypher query statement, and connects the Neo4j graph database. According to the query statement, the node information including the node name, type and attribute information is retrieved. The query structure is returned to the backend;

[0021] Finally, the backend receives the Neo4j graph database query results, packages the data into JSON format, and returns it to the frontend interface for display on the node information card. In addition, the frontend uses the force-directed graph in the D3.js open-source JavaScript library to implement knowledge graph visualization, supporting dynamic interaction with the knowledge graph, including zooming in and out and node dragging.

[0022] Further, in step (5), the student intelligent question answering is implemented, specifically including:

[0023] (5.1) The React frontend initiates an HTTP request to the Flask system backend service, transmitting the user question statement in JSON format;

[0024] (5.2) The backend parses the question statement and returns information;

[0025] (5.3) The information returned by Neo4j is reorganized according to the dialogue template and transmitted to the frontend interface in JSON format, and the frontend displays the question and answer in the form of a dialogue.

[0026] Further, in step (5.2), the backend parses the question statement and returns information, specifically including:

[0027] (5.2.1) According to the entity and relationship list generated in step (4), an AC tree is constructed, and the entities and relationships in the question statement are extracted using the AC tree in a template matching manner to generate <entity, relationship> pairs;

[0028] (5.2.2) According to the <entity, relationship> pairs, a Cypher query statement is generated, and a query request is initiated to Neo4j;

[0029] (5.2.3) If the query is successful, Neo4j returns the relevant information of the entity and its related subgraph to the backend; if the query fails, a failure handling process is performed.

[0030] Further, in step (5.2.3), the failure handling process specifically includes:

[0031] First, the user question is stored in the Mysql relational database's list of difficult problems;

[0032] Second, the Python jieba Chinese word segmentation library is called to perform word segmentation on the question statement;

[0033] Then, the word segmentation results in the question statement are compared with all the words in the entity and relationship list for word similarity calculation, and the word with the highest similarity is returned;

[0034] Finally, generate Cypher statements according to the most similar words, query the Neo4j graph database, and return relevant information to the backend.

[0035] Further, in step (5), the teacher's difficult problem solving specifically includes:

[0036] First, the React front end requests the difficult problem list from the Flask backend, the backend connects the Mysql relational database, and returns all the difficult problem list information to the front end, which is sorted according to the number of likes of the problem, and the front end displays the difficult problem;

[0037] Second, the user inputs the answer to the selected problem on the front-end interface and transmits it to the back-end after submission;

[0038] Finally, the backend stores the answer information corresponding to the problem in the Mysql database, and after manual collection and arrangement, the original data set is expanded, and the model of step (3) is used for entity recognition and relationship extraction to realize the periodic update of the knowledge graph.

[0039] Further, in step (5), the student intelligent question and answer and the teacher's difficult problem solving use the crowd-sourcing mode to expand the data set, specifically including:

[0040] First, randomly select an entity in the entity list and generate a learning test according to the preset problem template. The learning test question is stored in the Mysql database and displayed on the front-end interface through front-end and back-end interaction. The problem template includes: "Do you know if entity 1 and entity 2 are in a question at the same time?", "Do you know if you need to learn about entity 2 before learning about entity 1?", "What is the key content of entity 1?"

[0041] Second, the user participates in the learning test, and the answer is stored in the Mysql database through front-end and back-end interaction.

[0042] Finally, when the preset number of answers reaches the set minimum threshold, the result is counted based on the majority principle to generate a <entity 1, relationship, entity 2> triple to supplement the relationship between entities.

[0043] The above method for constructing an intelligent question and answer system based on a computer discipline knowledge graph, the BeautifulSoup module, Colabeler tool, BiLSTM, CRF, Attention mechanism, Neo4j database, Cypher language, Flask framework and React framework are all known in the art.

[0044] Compared with the prior art, the method for constructing an intelligent question and answer system based on a computer discipline knowledge graph has the following advantages:

[0045] (1) The system described in the application takes knowledge points as the basic design unit, organizes the knowledge points into a computer discipline knowledge graph scientifically and reasonably, and realizes the hierarchical nesting and network knowledge organization structure of courses, concepts, operations and methods.

[0046] (2) The system described in the application continuously expands the relationship between knowledge points based on the crowdsourcing mode, returns the nodes and attribute data with high relevance based on relevance analysis in a dialogue manner, provides explanations, links and other content, avoids the occurrence of garbage information, and provides professional intelligent question and answer services for college student training and teaching activities.

[0047] (3) The system described in the application realizes the intelligent answering function based on the knowledge extraction model and question likes, stores the difficult problems to the relational database to expand the original data source, dynamically adjusts the priority according to the number of question likes, provides a reference for teachers to answer questions, extracts effective information in the answer information by using the knowledge extraction model, and realizes the data update of the knowledge graph. BRIEF DESCRIPTION OF DRAWINGS

[0048] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings do not constitute an undue limitation on the present application. In the drawings:

[0049] Figure 1 The intelligent question and answer system function diagram described in the embodiment of the present application;

[0050] Figure 2 The computer discipline knowledge graph construction diagram described in the embodiment of the present application;

[0051] Figure 3 The entity recognition diagram described in the embodiment of the present application;

[0052] Figure 4 The relationship extraction diagram described in the embodiment of the present application;

[0053] Figure 5 The intelligent question and answer system flow diagram described in the embodiment of the present application;

[0054] Figure 6 The student end diagram of the intelligent question and answer system described in the embodiment of the present application;

[0055] Figure 7 The teacher end diagram of the intelligent question and answer system described in the embodiment of the present application. DETAILED DESCRIPTION

[0056] The present application will be described in detail below with reference to the accompanying drawings and embodiments.

[0057] As Figure 1As shown, the intelligent question and answer system function of the method of the present application has the following functions: the college students send questions to the system, the system answers in a dialogue way after querying the database; when there is no answer to the question, the system requests the teacher to answer, the teacher provides high-quality analysis to improve the system data, and then replies to the students, which also makes the system have the characteristics of continuous learning and improvement.

[0058] Embodiment 1

[0059] A construction method of an intelligent question and answer system based on a computer discipline knowledge graph, as shown in Figure 2 contains the following steps:

[0060] (1) Computer discipline data acquisition, the data source is unstructured data, part of which is computer discipline electronic book data, and the other part is related data crawled on Baidu Encyclopedia through Python web crawler, after preliminary filtering and integration, the original text data set is obtained;

[0061] The specific process is to first read the list of target knowledge point keywords using the crawler entry function, and then traverse them in turn; then the keywords are spliced through recursion http: / / baike.baidu.com / item+keyword, request library is used to simulate sending a request to the server, web page source code is grabbed, and BeautifulSoup is used to parse HTML, mainly to parse some label information in the encyclopedia entry, including <div class=”lemma-summary”>The label content is equalized, and then the data output is saved as UTF-8 in the txt file format. Finally, after manual screening and sorting, the original corpus file is integrated, and the sentences are divided according to ". ";

[0062] (2) Knowledge processing: part of the original data set is labeled by Colabeler tool to generate entity original data set and relationship original data set. Python realizes automatic BIO format labeling of entity original data set and structured representation of relationship original data set to generate entity data set and relationship data set available for model; in the entity data set and relationship data set, the entity labeling rule adopts BIO format, and each element is labeled as "B-N", "I-N" or "O". Among them, "B-N" means that the segment where the element is located belongs to N entity and is the beginning of the entity, "I-N" means that the segment where the element is located belongs to N entity and is the middle position element of the entity, and "O" means not belonging to any type. Further apply BIO to entity labeling to define all entities (courses, concepts, operations and methods), and the labeling categories are B-Subj, I-Subj, B-Conc, I-Conc, B-Oper, I-Oper, B-Meth, I-Meth and O; each sentence contains at least one word and its corresponding label, and the sentences are separated by blank lines; the relationship labeling adopts the format of <entity1 entity2 relationship entity in the sentence>, and the labeling categories are <entity1 entity2 Contain entity in the sentence>, <entity1 entity2 Before and after entity in the sentence> and <entity1 entity2 Correlation entity in the sentence>.

[0063] (3) Entity recognition: BiLSTM-CRF model is used to complete the entity recognition task of unstructured data, and the entity labeling data set in the above step (2) is used for model training, as shown in Figure 3 .

[0064] Firstly, input a sentence containing n words, which is processed by a word embedding layer, and each word is represented by a d-dimensional vector X = (x1, x2, …, xn). n );

[0065] Secondly, each word t is calculated by a single forward LSTM unit and a single backward LSTM unit to obtain its context-related representation and Then the BiLSTM module calculates the hidden layer output for each word t in the input sentence as h t is sent to the hidden layer with an output channel of n to obtain the BiLSTM module output y i of the word t.

[0066] Finally, the conditional random field (CRF) is used to generate the final prediction result of each word y i .

[0067] The model training is in a semi-supervised manner, and the model is trained by a part of the labeled data set. The model training hyperparameter settings are: learning rate is 0.0005, word embedding dimension and LSTM hidden vector dimension are 256, and epoch is 1000. The BiLSTM-CRF model is used to train the artificially labeled data set. The accuracy (Precession), recall (Recall) and F1 value are used to evaluate the model relationship extraction results, and the results are shown in Table 1. The recognition effect is good. After the training is completed, the model is saved as a pkl file.

[0068] The trained model is used for automatic entity extraction of unlabeled original data, and the results are saved to the result.txt file. After processing, the file conforms to the relationship extraction model data set format, which will be used for subsequent automatic relationship extraction. Then, the entities extracted by artificial labeling and automatic extraction are de-duplicated and aligned. The entity alignment method is: define the entity_same.csv file, and the entities with the same meaning will be mapped to a unique entity name. All entities will be audited by a computer after the artificial review to generate the entity list file entity.csv of the computer discipline knowledge graph. Finally, 4351 entities are extracted, including 20 course entities, 326 concept entities, 1247 operation entities and 2758 method entities.

[0069] Table 1 entity extraction model results

[0070]

[0071] (4) Relationship extraction: the BiLSTM-ATT model is used to complete the relationship extraction task of unstructured data. The relationship labeled data set in the above step (2) is used for model training, as shown in Figure 4 . The model is divided into an input layer, a word embedding layer, a bidirectional long short-term memory network layer, an attention layer and an output layer. For a complete sentence, the input layer splits the sentence into words, which are input to the word embedding layer. The word embedding layer maps the words to a low-dimensional space as the input of the bidirectional long short-term memory network layer for high-level feature extraction. The input is multiplied by the weight vector generated by the attention layer to combine the word-level features in each iteration into sentence-level features. Finally, the output layer classifies the sentence-level feature vector to complete the entire relationship extraction.

[0072] The model training is in a semi-supervised manner, and the model is trained by a part of the labeled data set. The model training hyperparameter settings are: learning rate is 0.005, word embedding dimension d w 100, epoch is 1000, batch is 64, L2 regularization parameter λ is 10 -5 The results are shown in Table 2, after the end of training, the model will be saved as a pkl file.

[0073] Table 2 Training results of relationship extraction model

[0074]

[0075] Using the trained model to automatically extract the relationship of unlabeled original data, all relationships will be audited by artificial to generate the relationship list file relation.csv of computer discipline knowledge graph. Finally, a total of 3672 entity relationship is extracted, including 2913 relationships, 136 before and after sequence relationships, and 623 correlation relationships;

[0076] (5) Triple construction: the extracted entities and relationships are de-duplicated and aligned, and the entity list and relationship list are generated, as follows:

[0077] First, the synonym mapping table of entity and relationship is constructed respectively, which realizes the mapping of the same meaning entity or relationship to the unique entity or relationship name;

[0078] Secondly, according to the synonym mapping table, the entities and relationships obtained in the entity recognition task and the relationship extraction task are replaced synonymously;

[0079] Finally, the replaced entities and relationships are de-duplicated to generate the entity list and relationship list, and the relationship list is represented by triple <entity, relationship, entity>.

[0080] (6) Knowledge storage: store the entity list entity.csv and relationship list relation.csv obtained in the above steps into the graph database Neo4j, create nodes for each entity and the relationship between nodes;

[0081] (7) Construction of computer discipline knowledge graph intelligent question answering system: based on the backend Flask framework and the front-end React framework, the intelligent question answering system is established, as shown in the flow Figure 5 The input of the system is the user's natural language question, the system first preprocesses the question, performs entity recognition based on the dictionary library, and performs relationship recognition based on the intent relationship library; In the query template library, match the problem, then use Cypher language to query the answer in the knowledge graph database, if the answer in the question is queried, the answer is provided; If no corresponding entity or relationship is matched, calculate the relevance of the problem and the entity, return the knowledge points with a relevance greater than 90%, if not, provide a friendly prompt. Specifically, it includes the following three parts:

[0082] (7.1) Realize knowledge graph visualization interaction, the specific steps are as follows:

[0083] (7.1.1) React front end initiates HTTP request to Flask system backend service, transmits the data of the node clicked by the user in JSON format;

[0084] (7.1.2) The backend receives the request, generates Cypher query statement, and connects Neo4j graph database. According to the query statement, the node information is retrieved, including node name, type and attribute information. The query structure is returned to the backend;

[0085] (7.1.3) The backend receives the Neo4j graph database query result, packs the data into JSON format, returns to the front-end interface, and displays on the node information card. In addition, the front-end uses the force-directed graph in the open source JavaScript library D3.js to realize knowledge graph visualization, supports dynamic interaction of knowledge graph, including zooming in and out of the graph, and node dragging.

[0086] (7.2) Realize student intelligent question and answer, the specific steps are as follows:

[0087] (7.2.1) React front end initiates HTTP request to Flask system backend service, transmits the data of the node clicked by the user in JSON format;

[0088] (7.2.2) According to the entity and relationship list generated in step (5), build AC tree, use AC tree to extract entities and relationships in the question statement in the form of template matching, generate <entity, relationship> pairs; According to <entity, relationship> pairs, generate Cypher query statement, and query Neo4j; If the query is successful, Neo4j returns the related information of the entity and its related subgraph to the backend; If the query fails, the user question is stored in the difficult problem list in Mysql relational database; Call Python jieba Chinese word segmentation library to segment the question statement; Then calculate the word similarity between the segmentation results in the question statement and all words in the entity and relationship list, return the word with the highest similarity; Finally, according to the word with the highest similarity, generate Cypher statement, query Neo4j graph database, and return the related information to the backend.

[0089] (7.2.3) The information returned by Neo4j is reorganized according to the dialogue template, transmitted to the front-end interface in JSON format, and the front-end displays the question and answer in the form of dialogue.

[0090] (7.3) Realize teacher difficult problem solving, the specific steps are as follows:

[0091] (7.3.1) The React front end requests the list of difficult problems from the Flask backend, the backend connects the Mysql relational database, returns all the difficult problem list information to the front end, sorts the problems according to the number of likes, and the front end displays the difficult problems;

[0092] (7.3.2) The user inputs the answer to the selected problem on the front-end interface, and submits it to the back-end;

[0093] (7.3.3) The backend stores the answer information corresponding to the problem in the Mysql database, expands the original data set after manual collection and arrangement, uses the model of steps (3) and (4) to extract entities and relationships, and realizes the periodic update of the knowledge graph.

[0094] Figure 6 The embodiments shown show that the method of the application constructs an intelligent question and answer system student end to provide services for college students: the left half of the system is an intelligent question and answer assistant that answers questions for students and provides question analysis; the right half of the system displays it on the system interface, collects user answers, and analyzes the answers to expand data. For example, through questions such as "Do entity 1 and entity 2 appear in a question at the same time?" to expand the association relationship between knowledge points; through questions such as "Do you need to understand the relevant knowledge of entity 2 before learning entity 1?" to expand the precedence relationship between knowledge points; through questions such as "What are the key contents of entity 1?" to expand the attribute values of knowledge points.

[0095] Figure 7 The embodiments shown show that the method of the application constructs an intelligent question and answer system teacher end to seek answers from teachers: after the teacher user enters the teacher answer interface, the left side displays a list of difficult problems, and the problems are sorted according to priority. The right side is a teacher answer card, and the teacher user clicks on the problem in the list, inputs the answer through the right card and submits it.

[0096] The above only describes the preferred embodiments of the application and does not limit the application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the application shall be included in the protection scope of the application.

Claims

1. A method for constructing an intelligent question-answering system based on computer science knowledge graphs, characterized in that: The method for constructing a learning aid for computer science knowledge is as follows: (1) Ontology construction: A top-down approach was used to determine the entity types in the computer science field as course entities, concept entities, operation entities and method entities, and to determine the relationships as concept hierarchy relationships, pre- and post-order relationships and association relationships; (2) Data acquisition in computer science: Part of the data source is electronic book data in computer science, and the other part is relevant data crawled from Baidu Encyclopedia based on Python web crawler. After preliminary filtering and integration, the original text dataset is obtained. (3) Knowledge processing: Entity dataset and relation dataset are generated using the Colabeler tool and the original dataset labeled with Python; entity recognition is completed using BiLSTM-CRF, i.e., Bi Long Short-Term Memory-Conditional RandomField model; relation extraction is completed using BiLSTM-ATT, i.e., Bi Long Short-Term Memory-Attention model. (4) Construction of computer science knowledge graph: The extracted entities and relations are deduplicated and aligned to generate entity lists and relation lists and store them in the graph database Neo4j; (5) Intelligent question answering system construction: The intelligent question answering system is built based on the backend Flask framework and the frontend React framework. The data is continuously expanded and updated through the crowdsourcing mode of question answering. In intelligent question answering, the student questions are first extracted by keywords and matched by templates. After the system queries the data, the results are returned in a dialogue manner. If no matching data is found, a relevance analysis is performed on the question to return relevant knowledge points and store the question in a relational database to expand the original data source. Then, the teacher answers the student questions that did not find a match, and uses a knowledge extraction model to extract the valid information from the teacher's answer and add it to the knowledge graph to update the knowledge graph.

2. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, In step (1), the ontology construction defines four types of entities: course, concept, operation, and method. Course entities represent the courses contained in a subject, concept entities represent important concepts contained in a course, operation entities represent specific knowledge units, and method entities represent specific knowledge points, which are the smallest units of knowledge. Three types of relationships are defined: concept hierarchy, pre- and post-order, and association. Among them, concept hierarchy relationship represents the inclusion relationship between different types of entities, pre- and post-order relationship represents the learning order relationship between entities of the same type, and association relationship represents the association relationship between entities of the same type. The definition standard is the principle of co-occurrence of the same topic.

3. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, In step (2), the computer science data includes computer science e-book data and relevant data crawled from Baidu Encyclopedia using Python web crawlers. The unified information is integrated from different data sources, and the data output is saved as UTF-8 and output as a txt file.

4. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, In step (3), the entity annotation rule adopts the BIO format, and each element is labeled as "BN", "IN" or "O". N represents four types of entities: course, concept, operation and method. The relation annotation adopts the format <entity1 entity2 relation entity sentence>.

5. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, Step (4) Construction of a computer science knowledge graph, specifically including: First, construct synonym mapping tables for entities and relations respectively, so that entities or relations with the same meaning are mapped to unique entity or relation names; Secondly, based on the synonym mapping table, the entities and relations obtained from the entity recognition task and the relation extraction task are replaced with synonyms. Finally, duplicate entities and relationships are removed from the replaced entities and relationships to generate entity lists and relationship lists.

6. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, In step (5), the knowledge graph visualization interaction is implemented, specifically including: First, the React frontend sends an HTTP request to the Flask system backend service to transmit the data of the node clicked by the user in JSON format. Secondly, the backend receives the request, generates a Cypher query statement, connects to the Neo4j graph database, retrieves node information based on the query statement, including node name, type and attribute information, and returns the query structure to the backend; Finally, the backend receives the query results from the Neo4j graph database, packages the data into JSON format, and returns it to the frontend interface, displaying it on the node information card. In addition, the frontend uses the force-directed graph in the D3.js open-source JavaScript library to implement knowledge graph visualization, supporting dynamic interaction of the knowledge graph, including zooming in and out of the graph and dragging nodes.

7. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, In step (5), intelligent question and answering for students is implemented, specifically including: (5.1) The React frontend sends an HTTP request to the Flask system backend service, transmitting the user's question statement in JSON format; (5.2) The backend parses the query statement and returns information; (5.3) Reorganize the information returned by Neo4j according to the dialogue template and transmit it to the front-end interface in JSON format. The front-end displays the answers to the questions in the form of a dialogue.

8. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 7, characterized in that, In step (5.2), the backend parses the query statement and returns information, specifically including: (5.2.1) Construct an AC tree based on the generated list of entities and relations, and use the AC tree to extract entities and relations from the problem statement by template matching, generating <entity, relation> pairs; (5.2.2) Generate a Cypher query statement based on <entity, relation> and send a query request to Neo4j; (5.2.3) If the query is successful, Neo4j will return the relevant information of the entity and its related subgraphs to the backend; if the query fails, the query failure will be handled.

9. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 8, characterized in that, In step (5.2.3), the handling of solution failures specifically includes: First, store user questions in a list of difficult questions in a MySQL relational database; Secondly, the Python jieba Chinese word segmentation library is used to segment the question statement into words; Then, the word segmentation results in the question statement are compared with all words in the entity and relation lists to calculate word similarity, and the word with the highest similarity is returned; Finally, a Cypher statement is generated based on the most similar words, which queries the Neo4j graph database and returns the relevant information to the backend.

10. The method for constructing an intelligent question-answering system based on computer science knowledge graphs according to claim 1, characterized in that, In step (5), the teacher's questions are answered, specifically including: First, the React frontend requests a list of unanswered questions from the Flask backend. The backend connects to a MySQL relational database and returns a list of all unanswered questions to the frontend, sorting them by the number of upvotes. The frontend then displays the unanswered questions. Secondly, teacher users enter the answer to the selected question on the front-end interface, submit it, and then transmit it to the back-end. Finally, the backend stores the answer information corresponding to the question into the MySQL database. After manual collection and organization, the original dataset is expanded. The model in step (3) is used to perform entity recognition and relation extraction to realize the regular update of the knowledge graph.

Citation Information

Patent Citations

  • Knowledge graph construction method for mathematical tutoring question-answering system, and system thereof

    CN111475629A

  • Browser testing method and device

    CN112579447A