Smart classroom-oriented learning environment ontology construction method and device
By automatically identifying entities in the learning environment of smart classrooms and extracting entity relationships, and transforming them into OWL ontology formal descriptions, the problem of smart classroom development and diminishing technological benefits is solved, and the in-depth deconstruction and optimization of the learning environment of smart classrooms is achieved.
Patent Information
- Application Number
- CN202411723197.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-18
AI Technical Summary
The problem of smart classroom development in depth and diminishing technological benefits has led to unclear boundaries between people-machine-environment interactions, making it difficult to effectively solve the essential problems of classroom teaching.
By automatically identifying entities and extracting entity relationships from text corpus of smart classroom learning environments, the joint iterative optimization process is used to improve the accuracy of entity recognition and relationship extraction, and transform the entity relationship triple into OWL ontology formal description.
The learning environment of smart classrooms is deconstructed, the correlation mechanism between various elements is explored, the time and cost of manually constructing the ontology is reduced, the development and deployment of related applications and services of smart classrooms is accelerated, and the construction and optimization of smart classrooms is guided.
Smart Images

Figure CN119646236A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of deep learning, and more specifically, relates to a method and device for constructing an ontology of learning environment for smart classrooms. Background Art
[0002] Supported by emerging technologies such as artificial intelligence, big data, and the Internet of Things, traditional educational environments such as campuses and classrooms have been transformed into smart educational environments composed of network architectures, digital technologies, and intelligent devices. As a typical smart educational environment, the smart classroom is an inevitable choice for smart education in the current information era and an important place to carry out educational teaching reform and digital transformation, and has received extensive attention in recent years.
[0003] However, the research on smart classrooms mostly stays at the technical level, focusing on the continuous introduction and iteration of intelligent technologies, and fails to solve the essential problems of classroom teaching. A large number of multi-source heterogeneous devices have flooded into smart classrooms, resulting in unclear interaction boundaries between humans, machines, and the environment, so that the in-depth development of smart classrooms has slowed down and the technical benefits have decreased. Summary of the Invention
[0004] Aiming at the defects of the existing technology, the purpose of this application is to provide a method and device for constructing an ontology of learning environment for smart classrooms, aiming to solve the problems of slow in-depth development and decreasing technical benefits in smart classrooms existing in the existing technology.
[0005] To achieve the above purpose, in the first aspect, this application provides a method for constructing an ontology of learning environment for smart classrooms, including:
[0006] Obtain the entity position probability and entity recognition marker result at the k-th iteration according to the text corpus of the smart classroom learning environment and the text tensor at the k-th iteration;
[0007] Obtain the entity relationship probability and relationship extraction result at the k-th iteration according to the text tensor and entity recognition marker result at the k-th iteration;
[0008] Adjust the total number of iterations K according to the change rate of the performance index at the k-th iteration;
[0009] If k < K, update the current iteration number k to k + 1, and return to execute obtaining the entity position probability and entity recognition marker result at the k-th iteration according to the text corpus of the smart classroom learning environment and the text tensor at the k-th iteration until k = K;
[0010] Obtain the entity relationship triple corresponding to the text corpus of the smart classroom learning environment according to the entity recognition marker result and relationship extraction result at the last iteration;
[0011] According to the entity relationship triples, the OWL ontology representation corresponding to the text corpus of the smart classroom learning environment is obtained.
[0012] In some embodiments, according to the smart classroom learning environment text corpus and the text tensor at the kth iteration, obtaining the entity position probability and the entity recognition tag result at the kth iteration includes:
[0013] Input the smart classroom learning environment text corpus and the text tensor at the kth iteration into the entity recognition model to obtain the entity position probability and entity recognition tagging result at the kth iteration;
[0014] The entity recognition model can be obtained by:
[0015] Based on the smart classroom entity recognition dataset corresponding to the smart classroom learning environment text corpus, the preset entity recognition model is trained to obtain the entity recognition model.
[0016] In some embodiments, according to the text tensor and the entity recognition tag result at the kth iteration, obtaining the entity relationship probability and the relationship extraction result at the kth iteration includes:
[0017] Input the text tensor and entity recognition tag result at the kth iteration into the relation extraction model to obtain the entity relation probability and relation extraction result at the kth iteration;
[0018] The methods for obtaining the relation extraction model include:
[0019] Based on the smart classroom relation extraction dataset corresponding to the smart classroom learning environment text corpus, the preset relation extraction model is trained to obtain the relation extraction model.
[0020] In some embodiments, adjusting the total number of iterations K according to the performance indicator change rate at the kth iteration includes:
[0021] If the performance indicator change rate at the kth iteration is greater than the preset performance indicator threshold, the total number of iterations K is adjusted to K+1;
[0022] If the performance indicator change rate at the kth iteration is less than the preset performance indicator threshold, the total number of iterations K is adjusted to K-1.
[0023] In some embodiments, obtaining the OWL ontology representation corresponding to the smart classroom learning environment text corpus according to the entity relationship triples includes:
[0024] The Jena tool is used to customize the ontology mapping rule algorithm, transform the entity relationship triples, and obtain the OWL ontology representation.
[0025] In some embodiments, the method of obtaining the text corpus of the smart classroom learning environment includes:
[0026] Obtain unstructured text corpora in the field of intelligent classroom learning environments;
[0027] Remove non - text characters from the unstructured text corpora in the field of intelligent classroom learning environments and segment them according to semantics to obtain text corpora for intelligent classroom learning environments.
[0028] In a second aspect, the present application provides a device for constructing an ontology of a learning environment for an intelligent classroom, including:
[0029] A first acquisition module, configured to obtain the entity position probability and entity recognition marker results at the k - th iteration according to the text corpus of the intelligent classroom learning environment and the text tensor at the k - th iteration;
[0030] A second acquisition module, configured to obtain the entity relationship probability and relationship extraction results at the k - th iteration according to the text tensor and entity recognition marker results at the k - th iteration;
[0031] An adjustment module, configured to adjust the total number of iterations K according to the change rate of the performance index at the k - th iteration;
[0032] A loop module, configured to, if k < K, update the current iteration number k to k + 1, and return to execute obtaining the entity position probability and entity recognition marker results at the k - th iteration according to the text corpus of the intelligent classroom learning environment and the text tensor at the k - th iteration until k = K;
[0033] A third acquisition module, configured to obtain entity - relationship triples corresponding to the text corpus of the intelligent classroom learning environment according to the entity recognition marker results and relationship extraction results at the last iteration;
[0034] A fourth acquisition module, configured to obtain the OWL ontology representation corresponding to the text corpus of the intelligent classroom learning environment according to the entity - relationship triples;
[0035] In a third aspect, the present application provides an electronic device, including: at least one memory for storing a program; at least one processor for executing the program stored in the memory, and when the program stored in the memory is executed, the processor is configured to execute the method described in the first aspect or any of some embodiments of the first aspect.
[0036] In a fourth aspect, the present application provides a computer - readable storage medium storing a computer program, and when the computer program runs on a processor, it causes the processor to execute the method described in the first aspect or any of some embodiments of the first aspect.
[0037] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method described in the first aspect or any embodiments of the first aspect.
[0038] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art:
[0039] The method and device for constructing a learning environment ontology for smart classrooms provided in this application automatically identify entities from the text corpus of the smart classroom learning environment and automatically extract the relationship between entities; then use the joint iterative optimization process to continuously improve the accuracy of entity recognition and relationship extraction; and convert entity relationship triples into OWL ontology formal descriptions. It helps to deconstruct the learning environment for smart classrooms and explore the association mechanism between various elements, which can reduce the time and cost required for manual ontology construction, accelerate the development and deployment of smart classroom-related applications and services, and guide the construction and optimization of smart classrooms. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is one of the flow charts of the method for constructing a learning environment ontology for a smart classroom provided in an embodiment of the present application;
[0041] Figure 2 It is a schematic diagram of the overall structure of the BERT-BiLTSM-GA-MCRF model provided in the embodiment of the present application;
[0042] Figure 3 It is a schematic diagram of 15 self-defined relationship types and their meanings in the smart classroom relationship extraction task provided in the embodiment of the present application;
[0043] Figure 4 It is a schematic diagram of the structure of the ALBERT-BiGRU-WLATT model provided in the embodiment of the present application;
[0044] Figure 5 This is the second flow chart of the method for constructing a learning environment ontology for a smart classroom provided in an embodiment of the present application;
[0045] Figure 6 This is the third flow chart of the method for constructing a learning environment ontology for a smart classroom provided in an embodiment of the present application;
[0046] Figure 7 It is a structural schematic diagram of a learning environment ontology construction device for a smart classroom provided in an embodiment of the present application;
[0047] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] 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.
[0049] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0050] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first acquisition module and a second acquisition module are used to distinguish different acquisition modules rather than to describe a specific order of the acquisition modules.
[0051] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0052] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more than two.
[0053] In the related technologies, there is little public ontology knowledge in the field of smart classrooms, and it is difficult to reuse existing ontologies. In addition, many problems faced by smart classrooms are uncertain and complex, and it is difficult to effectively solve them simply by using expert manual experience and mechanism models.
[0054] Therefore, it is necessary to fully consider the weight of teaching subjects in the construction and evaluation of the learning environment, examine the complex interactive system composed of people, machines and environment in the smart learning environment from the perspective of ontological systems theory, conduct in-depth research on its constituent elements and internal interaction mechanisms, and reveal the deep-level evolution laws of the teaching system.
[0055] Based on this, the embodiments of the present application provide a method for constructing a learning environment ontology for a smart classroom, including: training a smart classroom entity recognition model FGAM-SCER (referred to as the entity recognition module for short) using the BERT-BiLSTM-GA-MCRF model to automatically recognize concept entities from smart classroom domain texts; training a smart classroom relationship extraction model SC_ALBWATT (referred to as the relationship extraction module for short) using the ALBERT-BiGRU-WLATT model to automatically extract relationships between entities; continuously improving the accuracy of entity recognition and relationship extraction by utilizing a joint iterative optimization process; converting the set of entity-relationship triples into an OWL ontology formal description; and storing and visualizing it using a graph database.
[0056] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
[0057] See Figure 1 , the embodiments of the present application provide a method for constructing a learning environment ontology for a smart classroom, which may include: steps 110 to 160.
[0058] Step 110 obtains the entity position probability and entity recognition marking result at the k-th iteration according to the smart classroom learning environment text corpus and the text tensor at the k-th iteration.
[0059] Step 120 obtains the entity relationship probability and relationship extraction result at the k-th iteration according to the text tensor and entity recognition marking result at the k-th iteration.
[0060] Step 130 adjusts the total number of iterations K according to the change rate of the performance index at the k-th iteration.
[0061] If k < K in step 140, update the current iteration number k to k + 1, and return to execute obtaining the entity position probability and entity recognition marking result at the k-th iteration according to the smart classroom learning environment text corpus and the text tensor at the k-th iteration until k = K.
[0062] Step 150 obtains the entity-relationship triples corresponding to the smart classroom learning environment text corpus according to the entity recognition marking result and relationship extraction result at the last iteration.
[0063] Step 160 obtains the OWL ontology representation corresponding to the smart classroom learning environment text corpus according to the entity-relationship triples.
[0064] In the embodiments of the present application, the smart classroom learning environment text corpus may be collected from channels such as academic journals, books, and patent documents.
[0065] A text tensor is a mathematical representation of text data when performing smart classroom data processing tasks. It converts text data into a multidimensional array in numerical form, which enables machine learning models to process and analyze text. It is a multidimensional array that can contain vector representations of information such as words, characters, sentences, or paragraphs in the text. Text tensors are used to pass text information during iterative optimization to help the model better understand and process text data.
[0066] In the embodiment of the present application, k is an integer greater than or equal to 1.
[0067] In step 110, entity recognition is performed on the smart classroom learning environment text corpus according to the smart classroom learning environment text corpus and the text tensor at the kth iteration to obtain the entity position probability and entity recognition tagging result at the kth iteration. Exemplarily, the entity recognition tagging result can be divided into three categories: human (PER), machine (MACH) and environment (ENV), and the entity position probability is the probability of being recognized as human, machine and environment.
[0068] In step 120, based on the entity recognition tagging result at the kth iteration and the text tensor at the kth iteration obtained in step 110, relationship extraction is performed on the entity recognition tagging result to obtain entity relationship probability and relationship extraction result.
[0069] Exemplarily, it is assumed that the relationship between entities can be divided into a hierarchical relationship and an associative relationship, wherein the hierarchical relationship can be further divided into "include" and "belong to".
[0070] The entity relationship probability obtained in step 120 may be the probability that the human, machine and environment are in a hierarchical relationship or an associative relationship in the entity recognition labeling result in step 110. The relationship extraction result obtained in step 120 is that the human, machine and environment are in a hierarchical relationship or an associative relationship in each other.
[0071] Set the performance index at the kth iteration to P k , the performance index change rate is shown as follows: Where P k ′ is the performance index change rate, P k-1 is the performance index at the k-1th iteration. In the embodiment of the present application, P0 is 75%.
[0072] In the present application embodiment, the performance index P k ACC is the entity recognition accuracy NER And the accuracy of relation extraction task ACC RE The weighted average accuracy, P k =0.5×ACC NER +0.5×ACC RE , among which, ACCNER It can be determined according to the entity recognition tagging result, ACC RE It can be determined according to the relationship extraction result.
[0073] In step 130, according to the change rate P' of the performance index in the k-th iteration above, the total number of iterations K is adjusted.
[0074] If k < K, update the current iteration number k to k + 1, enter the next round of iteration, return to execute step 110 until k = K. Through the multi-round joint iteration optimization process, the accuracy of the entity recognition and relationship extraction results obtained in step 110 and step 120 can be improved.
[0075] In step 150, according to the entity recognition tagging result and relationship extraction result obtained in the last iteration, the intelligent classroom learning environment text corpus is represented as a subject-predicate-object (SPO) triple in the form of "entity-relationship-entity" to obtain an entity relationship triple.
[0076] In step 160, the entity relationship triple corresponding to the intelligent classroom learning environment text corpus obtained above is converted into an OWL ontology representation.
[0077] The method for constructing an ontology of the learning environment for intelligent classrooms provided by the embodiments of the present application automatically recognizes entities from the intelligent classroom learning environment text corpus and automatically extracts the relationships between entities; then uses the joint iteration optimization process to continuously improve the accuracy of entity recognition and relationship extraction; converts the entity relationship triple into an OWL ontology formal description, which helps to deconstruct the learning environment for intelligent classrooms and explore the correlation mechanism between various elements, can reduce the time and cost required for manual ontology construction, speed up the development and deployment of intelligent classroom-related applications and services, and guide the construction and optimization of intelligent classrooms.
[0078] Further, in some embodiments, in the above steps, the acquisition method of the intelligent classroom learning environment text corpus includes:
[0079] Obtain the unstructured text corpus in the field of intelligent classroom learning environment;
[0080] Remove non-character characters from the unstructured text corpus in the field of intelligent classroom learning environment and segment it according to semantics to obtain the intelligent classroom learning environment text corpus.
[0081] In the embodiments of the present application, the unstructured text corpus in the field of intelligent classroom learning environment can be collected from channels such as academic journals, books, and patent documents. By removing non-character characters such as labels from the collected unstructured text corpus in the field of intelligent classroom learning environment and dividing it according to semantics with a full stop, the above-mentioned intelligent classroom learning environment text corpus is obtained.
[0082] Further, in some embodiments, in step 110, obtaining the entity position probability and entity recognition tag result at the kth iteration according to the smart classroom learning environment text corpus and the text tensor at the kth iteration includes:
[0083] Input the smart classroom learning environment text corpus and the text tensor at the kth iteration into the entity recognition model to obtain the entity position probability and entity recognition tagging result at the kth iteration;
[0084] The entity recognition model can be obtained by:
[0085] Based on the smart classroom entity recognition dataset corresponding to the smart classroom learning environment text corpus, the preset entity recognition model is trained to obtain the entity recognition model.
[0086] In the embodiment of the present application, the collected smart classroom learning environment text corpus is imported into the annotation platform, and entity annotation and relationship annotation are performed to obtain a smart classroom entity recognition dataset and a smart classroom relationship extraction dataset.
[0087] Specifically, the collected smart classroom learning environment text corpus is imported into a labeling platform such as Label Sudio to label the smart classroom learning environment text corpus.
[0088] When annotating entities, the entities in the smart classroom learning environment text corpus are divided into three categories: people (PER), machines (MACH) and environments (ENV). The BIO (Begin Inside Outside) annotation method is used to annotate entities according to categories to obtain a smart classroom entity recognition dataset.
[0089] The smart classroom entity recognition dataset is used to train the preset entity recognition model and obtain the entity recognition model FGAM-SCER.
[0090] In an embodiment of the present application, the preset entity recognition model adopts the BERT-BiLSTM-GA-MCRF model obtained by fusing multiple algorithms based on BERT-BiLTSM-GA-MCRF.
[0091] Please see further Figure 2 The BERT-BiLSTM-GA-MCRF model consists of four layers: BERT layer, BiLSTM layer, global attention layer, and Mask CRF layer. The BERT model can obtain context-related word vector representations and generate a text tensor for iterative optimization; the BiLSTM layer can fully consider the information expressed by the sentence structure from both forward and reverse directions and extract the features of the sentence; the global attention layer focuses on the key information of the text; and the MCRF layer further improves the accuracy of label recognition by adding a mask mechanism to the CRF.
[0092] like Figure 2 As shown, T0 to T n They represent the first time step (or first word) to the last time step (last word) of the input sequence “Teacher uses the display screen”, n represents the index of the sequence length of the input sequence “Teacher uses the display screen”, h1 to h n They represent the hidden states from the first time step to the last time step respectively. These hidden states are used to capture long-term dependencies in the sequence and provide features for subsequent classification or prediction tasks.
[0093] In an embodiment of the present application, a pre-trained model BERT is introduced as an input encoder, which can capture the semantic information of each word in the context from a text sequence, such as ("the teacher uses the display screen"), and dynamically obtain word vectors, thereby providing more accurate and representative feature representations for subsequent tasks, thereby improving model performance.
[0094] In the embodiment of the present application, the BiLSTM feature extraction layer receives the word vector output by the BERT word embedding layer as input, and learns the contextual semantic information of the text sequence through a bidirectional long short-term memory network (BiLSTM) to achieve semantic representation of the text. The BiLSTM network can capture long-distance dependencies in the text.
[0095] In order to solve the semantic sparsity problem of long text sequences that may be caused by BiLSTM, a global attention mechanism is introduced in the embodiment of the present application to increase the weight of key words in the text sequence. This helps the model to make fuller use of the semantic information of keywords and reduce the impact of irrelevant words on entity recognition.
[0096] In the embodiment of the present application, a conditional random field (CRF) is introduced for decoding. CRF can consider the transition probability between labels, thereby outputting the optimal label sequence, solving the problem of illegal entities, and improving the accuracy of model recognition.
[0097] Through the collaboration of the above layers, efficient and accurate identification of entities in the smart classroom field is achieved.
[0098] The collected smart classroom learning environment text corpus and the text tensor at the kth iteration are input into the entity recognition model, and the entity position probability and entity recognition tagging result at the kth iteration are output.
[0099] Further, in some embodiments, in step 120, obtaining the entity relationship probability and relationship extraction result at the kth iteration according to the text tensor and the entity recognition tag result at the kth iteration includes:
[0100] Input the text tensor and entity recognition tag result at the kth iteration into the relation extraction model to obtain the entity relation probability and relation extraction result at the kth iteration;
[0101] The methods for obtaining the relation extraction model include:
[0102] Based on the smart classroom relation extraction dataset corresponding to the smart classroom learning environment text corpus, the preset relation extraction model is trained to obtain the relation extraction model.
[0103] In the embodiment of the present application, the Label Studio annotation platform is used to annotate the relationship between entities, such as Figure 3 As shown in the figure, in the relationship annotation, the relationship between entities in the text corpus of 15 smart classroom learning environments is analyzed and defined, among which "include" and "belong to" are hierarchical relationships, and the others are associative relationships. When annotating relationships, the directionality of the relationship needs to be strictly determined.
[0104] The ALBERT-BiGRU-WLATT model obtained by fusion of ALBERT-BiGRU-WLATT multiple algorithms is used as the preset relation extraction model in the embodiment of the present application, and a smart classroom relation extraction model SC_ALBWATT (referred to as relation extraction model for short) is generated by training on the smart classroom relation extraction dataset.
[0105] Please see further Figure 4 ,The ALBERT-BiGRU-WLATT model is divided into four layers, namely ALBERT layer, BiGRU layer, word-level attention layer WLATT and classification layer.
[0106] ALBERT layer: As the embedding layer of the model, the ALBERT layer is responsible for converting the input text sequence into a high-dimensional dense word vector representation. This layer uses the powerful language understanding ability of the ALBERT model to fully mine the text context information and provide meaningful feature representations for subsequent layers.
[0107] BiGRU layer: The Bidirectional Gated Recurrent Unit (BiGRU) layer receives the output of the ALBERT layer as input and uses BiGRU to capture long-range dependencies in the sequence. BiGRU obtains complete contextual information by concatenating bidirectional hidden states, thereby enhancing the model's ability to understand text sequences.
[0108] Word-level attention layer: After the BiGRU layer, the model introduces a word-level attention mechanism. This layer weights the output of the BiGRU to highlight the information in the text sequence that is important for entity relationship prediction. Through the attention mechanism, the model can focus more on the key information that is beneficial to the relationship extraction task and eliminate the interference of redundant information.
[0109] The classification layer receives the output of the word-level attention layer as input. It uses the SoftMax activation function to output the classification probability of entity relationships and predict the relationship between entities in the text. The classification layer fuses the output feature vectors of the word-level attention layer and makes the maximum probability prediction for the label of each sample sequence to select the optimal solution.
[0110] like Figure 4 As shown, W1 to W n Represents the weights of the first sentence part to the last sentence part. E c Represents the context embedding vector. In natural language processing tasks, the context embedding vector is used to capture the context information of each word in the input sequence. S Represents the sentence embedding vector. When processing sentences or phrases, the sentence embedding vector is used to represent the semantic information of the entire sentence. p Represents position embedding vector. When processing sequence data, position embedding vector is used to provide the model with information about the position of the word in the sequence. to Represents the candidate forward hidden states from the first time step to the last time step. to Represents the candidate reverse hidden states from the first time step to the last time step. h1 to h n They represent the final hidden states after integration from the first time step to the last time step.
[0111] In an embodiment of the present application, the ALBERT layer obtains context-related word vector representations more efficiently and generates a text tensor for use in iterative optimization; the BiGRU layer extracts richer text feature information; and the word-level attention layer highlights keywords related to the relationship recognition task.
[0112] The text tensor and entity recognition tagging results at the kth iteration are input into the relation extraction model SC_ALBWATT, and the entity relation probability and relation extraction results at the kth iteration are output.
[0113] The learning environment ontology construction method for smart classrooms provided in the embodiment of the present application adopts the BERT-BiLSTM-GA-MCRF model to train the smart classroom entity recognition model FGAM-SCER to automatically recognize entities from the smart classroom learning environment text corpus; adopts the ALBERT-BiGRU-WLATT model to train the smart classroom relationship extraction model SC_ALBWATT to automatically extract the relationship between entities; by utilizing the joint iterative optimization process, the accuracy of entity recognition and relationship extraction is continuously improved; the entity relationship triple set is converted into an OWL ontology formal description, which is helpful to deconstruct the learning environment for smart classrooms and explore the association mechanism between various elements, and can reduce the time and cost required for manual ontology construction, accelerate the development and deployment of smart classroom-related applications and services, and guide the construction and optimization of smart classrooms.
[0114] Further, in some embodiments, in step 130, adjusting the total number of iterations K according to the performance indicator change rate at the kth iteration includes:
[0115] If the performance indicator change rate at the kth iteration is greater than the preset performance indicator threshold, the total number of iterations K is adjusted to K+1;
[0116] If the performance indicator change rate at the kth iteration is less than the preset performance indicator threshold, the total number of iterations K is adjusted to K-1.
[0117] In the embodiment of the present application, the total number of iterations K is first set to a minimum value (for example, K=5), but the total number of iterations is dynamically adjusted according to the fusion result. Specifically, a preset performance indicator threshold Δ is introduced, and the total number of iterations K is dynamically adjusted according to the preset performance indicator threshold Δ. If the performance indicator change rate P at the kth iteration is k ′ is greater than the preset performance index threshold, that is, P k ′>Δ, then adjust the total number of iterations K to K+1; if the performance index conversion rate at the kth iteration is less than the preset performance index threshold, that is, P k ′<Δ, then adjust the total number of iterations K to K-1. This process is repeated until the total number of iterations K is reached.
[0118] In the embodiment of the present application, it is assumed that the text tensor at the kth iteration is H k , when k=1, H1 can be obtained by the following steps:
[0119] The BERT-BiLSTM-GA-MCRF model is used to train the smart classroom entity recognition dataset to generate the smart classroom entity recognition model FGAM-SCER.
[0120] The ALBERT-BiGRU-WLATT model is used to train the smart classroom relation extraction dataset to generate the smart classroom relation extraction model SC_ALBWATT.
[0121] The BERT layer outputs a text tensor (assuming H a ), the ALBERT layer outputs a text tensor (assuming H b ), if H a and H b The dimensions do not match, so we map them to the same dimension through a linear layer to get H a1 and H b1 .
[0122] H1 is calculated based on the following formula:
[0123] H1=0.5×H a1 +0.5×H b1
[0124] When the current iteration number k is updated to k+1, the text tensor H at the k+1th iteration k+1 You can obtain it by following the steps below:
[0125] The entity position probability at the kth iteration (assuming it is P(E k )) and entity relationship probability (assumed to be P(R k )) and H k Input to the attention model, the attention model couples this information and outputs the text tensor H for a new round of iteration k+1 , prepare for the next iteration.
[0126] 1 Calculate the fused tensor:
[0127] First, P(E k ) is normalized, and then the text tensor H obtained in the kth iteration is k and the entity position probability P(E k ) The current fusion tensor BIND is obtained by weighted average calculation k .
[0128] 2-Split embedding dimension:
[0129] BIND the fused tensor k Split on the embedding dimension, the number of pieces is piece (this is a positive integer that can divide BIND k The number of dimensions E). The embedding dimension of each piece after segmentation is BD, which can be calculated by the formula BD = Epiece. This is to prepare for the subsequent multi-head attention mechanism. Each piece after segmentation can be expressed as Where num=0,1,2,...,piece-1.
[0130] 3Construct the attention vector:
[0131] Use the segmented embedding dimension BD and the fused tensor BIND k To construct the query vector Q i , key vector K j Sum value vector V o , as follows:
[0132]
[0133] Where MLP1, MLP2 and MLP3 are multi-layer perceptron (MLP) neural networks with different weight parameters, i, j and o represent the indexes of the query vector, key vector and value vector respectively, and i, j, o = 0, 1, 2, ..., piece-1.
[0134] 4 Calculate the output of the attention mechanism:
[0135] Using the entity relationship probability P(R k ) to guide the calculation of the attention mechanism.
[0136] (1) Calculate the attention score Scoreij = ( Qi+λ·M·P(Rk) ) T ·Kj.
[0137] In the formula, Score ij Denotes the query vector Q i and the key vector K j The attention score between them, λ is a learnable parameter. Select the mechanism M, you can choose M = MLP (P (Rk)), M = MLP ( P(Rk) ) T Or M=one (identity matrix).
[0138] (2) Normalized attention score a ij :
[0139] (3) Calculate the output of the attention mechanism
[0140] 5 concatenate iterative text tensor:
[0141] The output of all attention mechanisms OP i Concatenate on the embedding dimension to get the text tensor H of the k+1th iteration k+1 , where H k+1=[OP0,OP1,...,OP piece-1 ].
[0142] In the embodiment of the present application, the attention model is used to deeply integrate this information. In each iteration, the attention model adjusts the attention to entities and relationships to extract more accurate entity boundaries and relationship types.
[0143] Furthermore, in some embodiments, in step 160, obtaining the OWL ontology representation corresponding to the smart classroom learning environment text corpus according to the entity relationship triples includes:
[0144] The Jena tool is used to customize the ontology mapping rule algorithm, transform the entity relationship triples, and obtain the OWL ontology representation.
[0145] In the embodiment of the present application, the extracted relationships need to be divided into two categories for OWL ontology representation, namely hierarchical relationships and associative relationships. By using the customized mapping rule algorithm of the Jena tool and importing the SPO triple file into Jena, the OWL ontology representation corresponding to the text corpus of the smart classroom learning environment can be output.
[0146] The ontology mapping rule algorithm is as follows:
[0147] Formalizing OWL Ontology Using Jena
[0148] Input: relation triple file spo.txt;
[0149] Output: sc.owl ontology file;
[0150] OntMcreateOntologyModel()); #Create ontology model OntM;
[0151] scUri←“http: / / www.w3.org / 2002 / 07 / owl#
[0152] spoList←read(spo.txt); #Read the txt file in triple form
[0153] owlFilecreateFile(sc.owl); #Create OWL format ontology file;
[0154] for spo in spoList do#traverse all triples;
[0155] startEnt←getFirst();
[0156] endEnt←getLast();
[0157] rel←getMid();
[0158] C1←createClass(OntM, scUri, startEnt); #Create the class corresponding to the concept entity;
[0159] C2←createClass(OntM, scUri, endEnt);
[0160] if rel is contain then
[0161] C1.addSubClass(C2); #Add a hierarchical relationship
[0162] elseifrelisbelongthen
[0163] C2.addSubClass(C1);
[0164] else
[0165] pp←createObjectProperty(OntM, scUri, rel);
[0166] C1.addProperty(op, C2); #Add association relationship;
[0167] end if
[0168] end for
[0169] writeFile(owlFile, OntM); #Write the ontology model into the ontology file
[0170] return sc.owl
[0171] In the embodiment of the present application, after the OWL ontology is obtained, it is stored in the Neo4j graph database for visual display.
[0172] Specifically, when performing knowledge storage, the Neosemantics plug-in is used to convert the OWL ontology representation into RDF format and import it into the Neo4j graph database.
[0173] Please see further Figure 5 The method for constructing a learning environment ontology for a smart classroom provided in an embodiment of the present application may include:
[0174] Step 1: Collect unstructured text corpus in the field of smart classroom learning environment from academic journals, books, patent documents and other channels, remove non-text characters such as labels from the text, divide it by periods according to semantics, and obtain the text corpus of smart classroom learning environment.
[0175] Step 2: Data preprocessing: import the collected smart classroom learning environment text corpus into the annotation platform for entity annotation and relationship annotation to obtain the smart classroom entity recognition dataset and the smart classroom relationship extraction dataset.
[0176] Step 2.1, import the smart classroom learning environment text corpus collected in step 1 into the annotation platform, and use Label Sudio to annotate the data to obtain the smart classroom entity recognition dataset;
[0177] Step 2.2, label the entities. When labeling entities, the conceptual entities in the smart classroom learning environment are divided into three categories: people (PER), machines (MACH), and environments (ENV). Use the BIO labeling method to label entities according to categories to obtain the smart classroom relationship extraction dataset;
[0178] Step 2.3, label the relationship, such as Figure 3 As shown in the figure, in the relationship annotation, 15 types of smart classroom learning environment domain relationships are analyzed and defined, among which "include" and "belong to" are hierarchical relationships, and the others are associative relationships. When annotating relationships, the directionality of the relationship needs to be strictly determined.
[0179] Step 3: Use the BERT-BiLSTM-GA-MCRF model to train the smart classroom entity recognition dataset to generate the smart classroom entity recognition model FGAM-SCER.
[0180] Step 3.1, input the smart classroom entity recognition dataset obtained in step 2.2 into the BERT-BiLSTM-GA-MCRF model for training;
[0181] Step 3.2: Output a text tensor H at the BERT layer a, Used for iterative optimization of step 8;
[0182] Step 3.3, generate the entity recognition model FGAM-SCER after the BERT-BiLSTM-GA-MCRF model.
[0183] Step 4: Use the ALBERT-BiGRU-WLATT model to train the smart classroom relation extraction dataset to generate the smart classroom relation extraction model SC_ALBWATT;
[0184] Step 4.1: Input the smart classroom relationship extraction dataset obtained in step 2.3 into the ALBERT-BiGRU-WLATT model for training;
[0185] Step 4.2: Output a text tensor H at the ALBERT layer b, Used for iterative optimization of step 8;
[0186] Step 4.3, after the ALBERT-BiGRU-WLATT algorithm, the relation extraction model SC_ALBWATT is generated.
[0187] Step 5, initialization and iteration settings, adjust the text tensor, set the number of iterations, and start iterative optimization.
[0188] Step 5.1, such as Figure 6 As shown, set the text tensor H1. If H a and H b The dimensions do not match, so we map them to the same dimension through a linear layer to get H a1 and H b1 Initially, set H1 = 0.5 × H a1 +0.5×H b1 ;
[0189] Step 5.2, set the initial total number of iterations K = 5.
[0190] Step 6: Use the FGAM-SCER model to perform entity recognition on the text content of the smart classroom learning environment; the entity recognition model outputs the entity position probability representation P(E k ) and entity recognition tagging results.
[0191] Step 7: Use the SC_ALBWATT model to extract the relationship between the entity recognition tags identified in step 6. The relationship model outputs the entity relationship probability representation P(R k ) and the relationship extraction results, the extracted relationships will correspond to the entities, and the mapping will be saved in the form of SPO triples.
[0192] Step 8: Part of the data output from step 6 and step 7 and the text tensor are input into the attention model for fusion adjustment. Through multiple rounds of joint iterative optimization process, the accuracy of the entity recognition and relationship extraction results obtained in step 6 and step 7 is improved;
[0193] Step 8.1, attention model fusion. The entity position probability P(E k ) and entity relationship probability P(R k ) and the text tensor H k Input into the attention model. The attention model combines this information and outputs a new round of iterative tensor Hk+1 , prepare for the next iteration;
[0194] Step 8.2, introduce the performance threshold Δ to adjust the total number of iterations K. Let the performance metric at the k-th iteration be P k be the entity recognition accuracy ACC NER and the relationship extraction task accuracy ACC RE weighted average accuracy. That is, P k = 0.5 × ACC NER + 0.5 × ACC RE . Let P0 = 75%. Let the performance metric change rate be P k ′, set Δ = 0.005. If P k ′> Δ, then the total number of iterations K = K + 1; if P k ′< Δ, then the total number of iterations K = K - 1;
[0195] Step 8.3, if k < K, update the current iteration number to k + 1, return to Step 6, and perform the next round of iteration; otherwise, terminate the iteration and jump to Step 9. Through multiple rounds of joint iteration optimization process, improve the accuracy of the entity recognition and relationship extraction results obtained in Step 6 and Step 7.
[0196] Step 9, obtain the set of SPO triples in the form of "entity - relationship - entity" based on the entity recognition tagging results and relationship extraction results obtained in the last iteration, and convert it into OWL ontology representation;
[0197] Step 10, store the OWL ontology obtained in Step 9 into the Neo4j graph database for visual display.
[0198] The learning environment ontology construction method for a smart classroom provided by the embodiments of this application can directly automate the conversion of unstructured text into a smart classroom learning environment ontology; for example, using this learning environment ontology construction method for a smart classroom, it can directly read journal articles, website blogs, etc., and automatically convert the read unstructured natural language into a smart classroom learning environment ontology, improving the intelligence of the generation of the smart classroom learning environment ontology, and greatly improving the efficiency, keeping up with the increasingly updated speed of the smart classroom learning environment.
[0199] Next, a learning environment ontology construction device for a smart classroom provided by this application will be described. The learning environment ontology construction device for a smart classroom described below can be mutually referred to corresponding to the learning environment ontology construction method described above.
[0200] See Figure 7, the learning environment ontology construction device for smart classrooms provided by the embodiments of the present application may include: a first acquisition module 710, a second acquisition module 720, an adjustment module 730, a loop module 740, a third acquisition module 750, and a fourth acquisition module 760.
[0201] The first acquisition module 710 is configured to obtain the entity position probability and entity recognition marker result at the k-th iteration according to the smart classroom learning environment text corpus and the text tensor at the k-th iteration;
[0202] The second acquisition module 720 is configured to obtain the entity relationship probability and relationship extraction result at the k-th iteration according to the text tensor and the entity recognition marker result at the k-th iteration;
[0203] The adjustment module 730 is configured to adjust the total number of iterations K according to the change rate of the performance index at the k-th iteration;
[0204] The loop module 740 is configured to, if k < K, update the current iteration number k to k + 1, and return to execute obtaining the entity position probability and entity recognition marker result at the k-th iteration according to the smart classroom learning environment text corpus and the text tensor at the k-th iteration until k = K;
[0205] The third acquisition module 750 is configured to obtain the entity relationship triple corresponding to the smart classroom learning environment text corpus according to the entity recognition marker result and the relationship extraction result at the last iteration;
[0206] The fourth acquisition module 760 is configured to obtain the OWL ontology representation corresponding to the smart classroom learning environment text corpus according to the entity relationship triple.
[0207] The learning environment ontology construction device for smart classrooms provided by the embodiments of the present application automatically identifies entities from the smart classroom learning environment text corpus and automatically extracts the relationships between entities; then, by using the joint iterative optimization process, it continuously improves the accuracy of entity recognition and relationship extraction; converting the entity relationship triple into an OWL ontology formal description helps to deconstruct the learning environment for smart classrooms and explore the correlation mechanism between various elements, can reduce the time and cost required for manual ontology construction, accelerate the development and deployment of smart classroom-related applications and services, and guide the construction and optimization of smart classrooms.
[0208] It can be understood that the detailed function implementation of the above-mentioned each unit / module can be referred to the introduction in the foregoing method embodiments, and will not be elaborated herein.
[0209] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0210] Based on the method in the above embodiment, the present application embodiment provides an electronic device, see Figure 8 The electronic device may include: a processor (Processor) 810, a communication interface (CommunicationsInterface) 820, a memory (Memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the method in the above embodiment.
[0211] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0212] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0213] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0214] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0215] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0216] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0217] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0218] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for constructing a learning environment ontology for a smart classroom, characterized in that: Including: Obtain the entity position probability and entity recognition marker result at the k-th iteration according to the text corpus of the intelligent classroom learning environment and the text tensor at the k-th iteration; Obtain the entity relationship probability and relationship extraction result at the k-th iteration according to the text tensor at the k-th iteration and the entity recognition marker result; Adjust the total number of iterations K according to the change rate of the performance index at the k-th iteration; If k < K, update the current iteration number k to k + 1, and return to execute obtaining the entity position probability and entity recognition marker result at the k-th iteration according to the text corpus of the intelligent classroom learning environment and the text tensor at the k-th iteration until k = K; Obtain the entity relationship triple corresponding to the text corpus of the intelligent classroom learning environment according to the entity recognition marker result and relationship extraction result at the last iteration; Obtain the OWL ontology representation corresponding to the text corpus of the intelligent classroom learning environment according to the entity relationship triple; 2. The method according to claim 1, characterized in that The obtaining the entity position probability and entity recognition marker result at the k-th iteration according to the text corpus of the intelligent classroom learning environment and the text tensor at the k-th iteration includes: Input the text corpus of the intelligent classroom learning environment and the text tensor at the k-th iteration into the entity recognition model to obtain the entity position probability and entity recognition marker result at the k-th iteration; The obtaining method of the entity recognition model includes: Train a preset entity recognition model based on the intelligent classroom entity recognition data set corresponding to the text corpus of the intelligent classroom learning environment to obtain the entity recognition model.
3. The method according to claim 1, characterized in that The obtaining the entity relationship probability and relationship extraction result at the k-th iteration according to the text tensor at the k-th iteration and the entity recognition marker result includes: Input the text tensor at the k-th iteration and the entity recognition marker result into the relationship extraction model to obtain the entity relationship probability and relationship extraction result at the k-th iteration; The obtaining method of the relationship extraction model includes: Train a preset relationship extraction model based on the intelligent classroom relationship extraction data set corresponding to the text corpus of the intelligent classroom learning environment to obtain the relationship extraction model.
4. The method according to claim 1, characterized in that The adjusting the total number of iterations K according to the change rate of the performance index at the k-th iteration includes: If the change rate of the performance index at the k-th iteration is greater than the preset performance index threshold, adjust the total number of iterations K to K + 1; If the change rate of the performance index at the k-th iteration is less than the preset performance index threshold, adjust the total number of iterations K to K - 1.
5. The method according to claim 1, characterized in that The obtaining the OWL ontology representation corresponding to the text corpus of the intelligent classroom learning environment according to the entity relationship triple includes: Use the Jena tool to customize the ontology mapping rule algorithm to transform the entity relationship triple to obtain the OWL ontology representation.
6. The method according to any one of claims 1 to 5, characterized in that: The obtaining method of the text corpus of the intelligent classroom learning environment includes: Obtain the unstructured text corpus in the field of intelligent classroom learning environment; Remove the non-text characters in the unstructured text corpus in the field of intelligent classroom learning environment and segment it according to semantics to obtain the text corpus of the intelligent classroom learning environment.
7. A learning environment ontology construction device for a smart classroom, characterized in that: Including: The first acquisition module is configured to acquire the entity position probability and entity recognition marker result at the k-th iteration according to the intelligent classroom learning environment text corpus and the text tensor at the k-th iteration; The second acquisition module is configured to acquire the entity relationship probability and relationship extraction result at the k-th iteration according to the text tensor at the k-th iteration and the entity recognition marker result; The adjustment module is configured to adjust the total number of iterations K according to the change rate of the performance index at the k-th iteration; The loop module is configured to, if k < K, update the current iteration number k to k + 1, and return to execute acquiring the entity position probability and entity recognition marker result at the k-th iteration according to the intelligent classroom learning environment text corpus and the text tensor at the k-th iteration until k = K; The third acquisition module is configured to acquire the entity relationship triple corresponding to the intelligent classroom learning environment text corpus according to the entity recognition marker result and relationship extraction result at the last iteration; The fourth acquisition module is configured to acquire the OWL ontology representation corresponding to the intelligent classroom learning environment text corpus according to the entity relationship triple; 8. An electronic device, characterized in that: Comprising: At least one memory for storing a computer program; At least one processor for executing the program stored in the memory, and when the program stored in the memory is executed, the processor is configured to execute the method according to any one of claims 1-6; 9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on the processor, the processor is caused to execute the method according to any one of claims 1-6; 10. A computer program product, characterized in that When the computer program product runs on the processor, the processor is caused to execute the method according to any one of claims 1-6.