A method for classifying educational information and related equipment
By integrating the corpus of text information of education type and non-education type and training of education classification models, the problem of insufficient classification accuracy of education information in the existing technology is solved, and higher classification accuracy is achieved.
Patent Information
- Application Number
- CN202410964171.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-07-18
AI Technical Summary
When existing educational information classification methods deal with complex corpus that integrates educational type and non-educational type text information, it is difficult to accurately distinguish educational type and non-educational type text, resulting in insufficient classification accuracy.
By fusing the first sample corpus containing the text information of education type and the second sample corpus containing the text information of non-education type, a third sample corpus containing the text information of education type and non-education type was obtained, and the education classification model was trained using these three sample corpus to improve the model's understanding and distinction ability in the learning process.
Through this method, the model can better understand and distinguish the text characteristics of educational types and non-educational types, fully learn and understand the inherent characteristics and their intrinsic differences of the two types of texts, thereby improving the classification accuracy of educational information.
Smart Images

Figure CN118673150B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of smart education and artificial intelligence technology, and in particular to an educational information classification method and related equipment. Background Art
[0002] With the rapid development of information technology and the advent of the big data era, the amount of information in the field of education has exploded. As a key technology for processing and organizing these massive data, educational information classification is of great significance for improving the retrieval efficiency of educational resources and promoting educational informatization. However, traditional educational information classification methods are often based on simple keyword matching or manually set rules, which makes it difficult to accurately distinguish between educational and non-educational text information, and cannot meet the current high requirements for classification accuracy and efficiency.
[0003] In order to solve the above problems, automatic classification methods based on machine learning and deep learning technology have gradually become a research hotspot in recent years. These methods build classification models by training a large amount of corpus data, thereby realizing the automatic classification of educational information. However, when existing classification methods process complex corpora that combine educational and non-educational text information, because educational texts contain non-educational content, and non-educational texts may contain some educational content, the model is disturbed during feature extraction and classification decisions, affecting the accuracy of classification. Summary of the invention
[0004] The embodiment of the present invention provides an educational information classification method, which aims to solve the problem of insufficient accuracy of existing educational information classification. A first sample corpus containing educational text information and a second sample corpus containing non-educational text information are fused to obtain a third sample corpus that fuses educational and non-educational text information. The first sample corpus, the second sample corpus, and the third sample corpus are used to train an educational classification model, so that the model can better understand and distinguish between educational and non-educational text features during the learning process, fully learn and understand the intrinsic features and intrinsic differences of educational and non-educational texts, thereby improving the classification accuracy of educational information.
[0005] In a first aspect, an embodiment of the present invention provides a method for classifying educational information, the method comprising:
[0006] Acquire a first sample corpus and a second sample corpus, wherein the first sample corpus includes text information of an educational type, and the second sample corpus includes text information of a non-educational type;
[0007] The first sample corpus and the second sample corpus are fused to obtain a third sample corpus, wherein the third sample corpus includes fused text information of educational type and non-education type;
[0008] Performing supervised training on the education classification model to be trained by using the first sample corpus, the second sample corpus, and the third sample corpus, and obtaining a trained education classification model after the training is completed, wherein the output of the education classification model is a classification type;
[0009] Obtain the educational information to be classified, classify the educational information to be classified using the trained educational classification model, and obtain the classification type of the educational information to be classified.
[0010] Optionally, the step of fusing the first sample corpus with the second sample corpus to obtain a third sample corpus includes:
[0011] In the text information of the education type, determining the word length distribution of the target keyword, the word length distribution including the distribution relationship between the word length and the quantity, the target keyword is an education-related keyword;
[0012] In the word length distribution, determining at least one target word length;
[0013] Based on the target word length, randomly split each of the first sample corpora to obtain a plurality of first sub-corpora data;
[0014] Based on the target word length, randomly split each second sample corpus to obtain a plurality of second sub-corpus data;
[0015] Based on the first sub-corpus data and the second sub-corpus data, the first sample corpus and the second sample corpus are fused to obtain a third sample corpus.
[0016] Optionally, the step of fusing the first sample corpus and the second sample corpus based on the first sub-corpus data and the second sub-corpus data to obtain a third sample corpus includes:
[0017] Clustering the first sub-corpus data and the second sub-corpus data according to education type and non-education type to obtain a first sub-corpus data cluster of the education type and a second sub-corpus data cluster of the non-education type;
[0018] Determine an intermediate space between the first sub-corpus data cluster and the second sub-corpus data cluster, wherein the distance between the intermediate space and the first sub-corpus data cluster is the same as the distance between the intermediate space and the second sub-corpus data cluster;
[0019] The intermediate space is used as the target semantic space, and corpus text in the target semantic space is generated based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain a third sample corpus.
[0020] Optionally, the step of taking the intermediate space as the target semantic space and generating corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain the third sample corpus comprises:
[0021] Randomly select n1 sub-corpus data from the first sub-corpus data cluster according to the distance balance principle, and randomly select n2 sub-corpus data from the second sub-corpus data cluster according to the distance balance principle;
[0022] The n1 sub-corpus data and the n2 sub-corpus data are used as text generation seeds to generate corpus text in the target semantic space to obtain a third sample corpus.
[0023] Optionally, the step of using the n1 sub-corpus data and the n2 sub-corpus data as text generation seeds to generate the corpus text in the target semantic space to obtain the third sample corpus includes:
[0024] Determining a central semantic vector of the target semantic space;
[0025] Encode the n1 sub-corpus data and the n2 sub-corpus data into the vector space to obtain the seed vector;
[0026] Generate corpus text in the target semantic space with the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space;
[0027] Based on the corpus text in the target semantic space, a third sample corpus is determined.
[0028] Optionally, the step of determining a third sample corpus based on the corpus text in the target semantic space includes:
[0029] Calculating a first distance and a second distance between each corpus text in the target semantic space and the first sub-corpus data cluster and the second sub-corpus data cluster;
[0030] If the first distance is greater than the second distance, the corpus text in the target semantic space is determined to be a pseudo-educational type; if the first distance is less than the second distance, the corpus text in the target semantic space is determined to be a pseudo-non-educational type.
[0031] Optionally, the step of performing supervised training on the education classification model to be trained by using the first sample corpus, the second sample corpus, and the third sample corpus includes:
[0032] In the first training stage, supervised training is performed on the education classification model to be trained using the first sample corpus and the second sample corpus, and a first-stage training model is obtained after the first loss value drops to a preset loss value;
[0033] In the second training stage, supervised training is performed on the education classification model to be trained using the first sample corpus, the second sample corpus, and the third sample corpus, and a second-stage training model is obtained after the second loss value drops to a preset loss value;
[0034] determining the second-stage training model as a trained education classification model;
[0035] The first loss value is calculated by the following first loss function:
[0036] Loss1=γ1·(yf(x)) 2 +(1-γ1)·(yf(x)) 2 ;
[0037] Where, γ1 is 1 when it is an education type and 0 when it is a non-education type, f(x) is the output of the education classification model to be trained, x is the first sample corpus or the second sample corpus, and y is the type label;
[0038] The second loss value is calculated by the following second loss function:
[0039] Loss2 = γ2·(d(y, f`(x`))) 2 +(1-γ2)·(d(y,f`(x`))) 2 +γ3·
[0040] max(a, d(y, f`(x`))) 2 +(1-γ3)·max(a,d(y,f`(x`))) 2 ;
[0041] Among them, x` is the first sample corpus or the second sample corpus or the third sample corpus, f`(x`) is the output of the first stage training model, γ2 takes the value of 1 when x` is an education type, γ2 takes the value of 0 when x` is a non-education type, γ2 is 0 when x` is a pseudo-education type or a pseudo-non-education type, γ3 takes the value of 1 when x` is a pseudo-education type, γ3 takes the value of 0 when x` is a pseudo-non-education type, γ3 is 0 when x` is an education type or a non-education type, d(y, f`(x`)) represents the distance between the type label and the output of the first stage training model, max(a, d(y, f`(x`))) means taking a when d(y, f`(x`)) is less than a, and taking d(y, f`(x`)) when d(y, f`(x`)) is greater than a, and a represents the distance from the central semantic vector of the target semantic space to the first sub-corpus data cluster or the second sub-corpus data cluster.
[0042] In a second aspect, an embodiment of the present invention further provides an educational information classification device, the educational information classification device comprising:
[0043] An acquisition module, used to acquire a first sample corpus and a second sample corpus, wherein the first sample corpus includes educational text information, and the second sample corpus includes non-educational text information;
[0044] A processing module, configured to perform fusion processing on the first sample corpus and the second sample corpus to obtain a third sample corpus, wherein the third sample corpus includes fused text information of educational type and non-education type;
[0045] a training module, configured to perform supervised training on the education classification model to be trained by using the first sample corpus, the second sample corpus, and the third sample corpus, and obtain a trained education classification model after the training is completed, wherein the output of the education classification model is the education type or the non-education type;
[0046] The classification module is used to obtain the educational information to be classified, classify the educational information to be classified through the trained educational classification model, and obtain the classification type of the educational information to be classified.
[0047] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the educational information classification method provided in the embodiment of the present invention when executing the computer program.
[0048] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the educational information classification method provided in the embodiment of the invention are implemented.
[0049] In an embodiment of the present invention, a first sample corpus and a second sample corpus are obtained, wherein the first sample corpus includes text information of an education type, and the second sample corpus includes text information of a non-education type; the first sample corpus and the second sample corpus are fused to obtain a third sample corpus, wherein the third sample corpus includes fused text information of an education type and a non-education type; a supervised training is performed on an education classification model to be trained using the first sample corpus, the second sample corpus, and the third sample corpus, and after the training is completed, a trained education classification model is obtained, and the output of the education classification model is the education type or the non-education type; education information to be classified is obtained, and the education information to be classified is classified using the trained education classification model to obtain the classification type of the education information to be classified. By fusing a first sample corpus containing educational text information and a second sample corpus containing non-educational text information, a third sample corpus that fuses educational and non-educational text information is obtained. The first, second and third sample corpora are used to train an education classification model, which enables the model to better understand and distinguish between educational and non-educational text features during the learning process, fully learn and understand the intrinsic features and intrinsic differences between educational and non-educational texts, thereby improving the classification accuracy of educational information. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 This is a process of an educational information classification method provided by an embodiment of the present invention Figure 2
[0052] Figure 2 This is a schematic diagram of the structure of an educational information classification device provided by an embodiment of the present invention. Figure 2
[0053] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] like Figure 1 As shown, Figure 1 : is a method flow chart of an educational information classification method provided by an embodiment of the present invention. The educational information classification method comprises the steps of:
[0056] 10 1. Obtain a first sample corpus and a second sample corpus.
[0057] In an embodiment of the present invention, the above-mentioned education information classification method can be applied to an education information management platform. The above-mentioned education information management platform can be composed of a server or a distributed server. The above-mentioned education information management platform is also connected to a user terminal in communication. The user terminal can send the education information to be classified to the education information management platform. The education information management platform calls the education classification model to classify the education information to be classified and obtains the classification type of the education information to be classified. The above-mentioned classification type may include education type or non-education type. At the same time, on the education information management platform, a training environment for the education classification model can also be built, and the education classification model can be trained through the training environment of the education classification model, so that the education classification model has the ability to classify education information.
[0058] The first sample corpus includes educational text information, and the second sample corpus includes non-educational text information. The first sample corpus and the second sample corpus can be collected through the Internet and a big data platform. Specifically, the first sample corpus can be collected through an education network or an Internet platform related to education, and the second sample corpus can be collected through a non-education network or an Internet platform unrelated to education.
[0059] The first sample corpus corresponds to an education type label, and the second sample corpus corresponds to a non-education type label. The education type label can be one or more types, and the non-education type label can also be one or more types. When there is only one education type label, the education type label can be "education"; when there is only one non-education type label, the non-education type label can be "non-education"; when there are multiple education type labels, the education type label can be a hierarchical label, such as "education", "children", "literacy", etc.; when there are multiple non-education type labels, the non-education type labels can be hierarchical labels or parallel labels, such as "non-education", "entertainment", "music" and other hierarchical labels, or they can be "food", "music", "travel", etc.
[0060] Preferably, in the embodiment of the present invention, considering the classification of educational information, the subdivision of non-educational information does not require too much attention, and therefore, there is at least one educational label and only one non-educational label.
[0061] 102. The first sample corpus and the second sample corpus are fused to obtain a third sample corpus, where the third sample corpus includes fused text information of educational type and non-educational type.
[0062] In the embodiment of the present invention, since the first sample corpus is an educational type corpus and the second sample corpus is a non-educational type corpus, a third sample corpus that combines educational type and non-educational type can be obtained by fusing the first sample corpus with the second sample corpus.
[0063] Compared with the third sample corpus including educational and non-educational types collected from the Internet and big data platforms, the third sample corpus obtained through fusion processing is more targeted and easier to annotate.
[0064] The above fusion processing can adopt the LLM large model, and use the prompt word engineering of the LLM large model to construct the input text of the LLM large model. The input text of the LLM large model includes the first sample corpus and the second sample corpus. For example, the above input text is as follows:
[0065] ″Provide the first sample corpus of education type: ...;
[0066] Provide a second sample of non-educational types: ...;
[0067] Please fuse the first sample corpus and the second sample corpus provided to generate text containing educational and non-educational types. ″
[0068] The fused text is output by the LLM large model as the third sample corpus. After obtaining the third sample corpus, the third sample corpus can be classified and annotated by an automatic annotation method, or it can be classified and annotated by the education type or non-education type corresponding to the text output by the LLM large model to obtain a pseudo-education label or pseudo-non-education label of the third sample corpus. It should be noted that since the third sample corpus contains both educational content and non-education content, the label of the third sample corpus is a pseudo-education label or a pseudo-non-education label.
[0069] 103. The education classification model to be trained is supervisedly trained using the first sample corpus, the second sample corpus, and the third sample corpus. After the training is completed, a trained education classification model is obtained.
[0070] In an embodiment of the present invention, the output of the education classification model is a classification type; the total number of classification types output by the education classification model is the same as the total number of education labels and non-education labels, and each classification type corresponds to a label.
[0071] The classification types can be education type and non-education type. Specifically, the education information model only outputs the classification types whose confidence is greater than the preset confidence threshold. For example, if the confidence of the education type is 0.98, which is greater than the preset confidence threshold, only the education type is output. If the confidence of the non-education type is 0.97, which is greater than the preset confidence threshold, only the non-education type is output. The classification type of the education type can be one or more types, and the classification type of the non-education type can also be one or more types. When there is only one label of the education type, the classification type of the education type can be "education", when there is only one label of the non-education type, the classification type of the non-education type can be "non-education", when there are multiple labels of the education type, the classification height of the education type can be "education", "children", "literacy", etc., when there are multiple labels of the non-education type, the classification type of the non-education type can be "non-education", "entertainment", "food", "music", "travel", etc.
[0072] Preferably, in an embodiment of the present invention, considering the classification of educational information, the subdivision of non-educational information does not require too much attention. Therefore, there is at least one label of the educational type and at least one classification type corresponding to the educational type, while there is only one label of the non-educational type and there is only one classification type corresponding to the non-educational type.
[0073] After obtaining the third sample corpus, the first sample corpus, the second sample corpus and the third sample corpus are mixed to obtain a training data set, and the education classification model to be trained is supervised by the training data set. After the training is completed, a trained education classification model is obtained. Among them, the education classification model can be a classification model based on a neural network, specifically, a classification model based on a convolutional neural network CNN, a recurrent neural network RNN, and a long short-term memory network LSTM. The above-mentioned supervised training can be understood as training the education classification model guided by labels. During the training process, the parameters of the education classification model are adjusted according to the error between the output and the result, so that the output of the education classification model is the same or close to the label.
[0074] 104. Obtain the education information to be classified, classify the education information to be classified using the trained education classification model, and obtain the classification type of the education information to be classified.
[0075] In an embodiment of the present invention, after obtaining the education classification model, the education classification model can be deployed in an education information management platform. After receiving the education information to be classified, the education information management platform calls the trained education classification model to classify the education information to be classified, and outputs the classification type of the education information to be classified, such as outputting the education information to be classified as an education type or a non-education type.
[0076] In an embodiment of the present invention, a first sample corpus and a second sample corpus are obtained, wherein the first sample corpus includes text information of the education type, and the second sample corpus includes text information of the non-education type; the first sample corpus and the second sample corpus are fused to obtain a third sample corpus, wherein the third sample corpus includes fused text information of the education type and the non-education type; the first sample corpus, the second sample corpus, and the third sample corpus are used to perform supervised training on the education classification model to be trained, and after the training is completed, a trained education classification model is obtained; education information to be classified is obtained, and the education information to be classified is classified by the trained education classification model to obtain the classification type of the education information to be classified. By fusion processing of the first sample corpus containing the education type text information and the second sample corpus containing the non-education type text information, a third sample corpus fused with the education type and non-education type text information is obtained, and the education classification model is trained by using the first sample corpus, the second sample corpus, and the third sample corpus, so that the model can better understand and distinguish the text features of the education type and the non-education type in the learning process, fully learn and understand the intrinsic features and intrinsic differences of the education type and non-education type texts, thereby improving the classification accuracy of the education information.
[0077] It is understandable that in the specific implementation of this application, sample corpus, educational information and other related data are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data, as well as the training and calling of large AI models or models need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0078] Optionally, the step of fusing the first sample corpus with the second sample corpus to obtain the third sample corpus specifically includes: determining the word length distribution of the target keyword in the text information of the education type, the word length distribution includes the distribution relationship between the word length and the quantity, and the target keyword is an education-related keyword; in the word length distribution, determining at least one target word length; performing random text splitting on each first sample corpus to obtain multiple first sub-corpus data; performing random text splitting on each second sample corpus to obtain multiple second sub-corpus data; based on the first sub-corpus data and the second sub-corpus data, fusing the first sample corpus with the second sample corpus to obtain the third sample corpus.
[0079] In an embodiment of the present invention, education-related keywords are extracted from education-type text information to obtain target keywords related to education, and the word length of the target keywords is counted. The word length is the number of characters constituting the target keywords. The number of target keywords under different word lengths is determined, and then the word length distribution of the target keywords is obtained. Since the word length distribution includes the distribution relationship between the word length and the number, the N word lengths with the largest number of target keywords can be counted as the target word lengths. The target keywords are keywords related to education. In the word length distribution, at least one target word length is determined;
[0080] The text of each first sample corpus can be randomly split according to the target word length to obtain multiple first sub-corpus data, that is, the word length of the first sub-corpus data is the target word length, and the above target word length can be multiple, such as 2, 3, 4, etc. characters. In the splitting process, the splitting length can be a random target word length, and the splitting starting point can be a random position. The situation of the random target word length is applied to multiple target word lengths, that is, in each splitting step, a random word length from multiple target word lengths will be split, and the random position of the splitting starting point can be a randomly selected position in the text to start splitting. Of course, the above-mentioned random splitting position can also be split by character-by-character traversal, and the splitting length is the target word length. Of course, in some possible embodiments, the first sample corpus can also be randomly split according to the three splitting methods of paragraph, field, and word element at the same time to obtain multiple first sub-corpus data.
[0081] Similarly, each second sample corpus can be randomly split according to the target word length to obtain multiple second sub-corpus data. Of course, the second sample corpus can also be randomly split according to the three splitting methods of paragraph, field, and word unit at the same time to obtain multiple second sub-corpus data.
[0082] It should be noted that the first sub-corpus data and the second sub-corpus data are only used to indicate that the sub-corpus data are derived from the first sample corpus or the second sample corpus, and are essentially some paragraphs, fields or words.
[0083] All or part of the corpus can be selected from the first sample corpus and the second sample corpus for splitting. When the selected first sample corpus and the second sample corpus are fully split, a plurality of first sub-corpus data and a plurality of second sub-corpus data can be obtained.
[0084] After obtaining a plurality of first sub-corpus data and a plurality of second sub-corpus data, the first sample corpus and the second sample corpus are fused based on the first sub-corpus data and the second sub-corpus data. The fusion process may adopt the LLM large model, and the prompt word engineering of the LLM large model is used to construct the input text of the LLM large model. The input text of the LLM large model includes the first sample corpus and the second sample corpus. For example, the input text is as follows:
[0085] "Provide the first sub-corpus data: ...;
[0086] Provide the second sub-corpus data:......;
[0087] Please fuse the first sub-corpus data and the second sub-corpus data provided to generate text containing both educational and non-educational types. ″
[0088] The fused text is output by the LLM large model as the third sample corpus. After obtaining the third sample corpus, the third sample corpus can be classified and annotated by an automatic annotation method, or it can be classified and annotated by the education type or non-education type corresponding to the text output by the LLM large model to obtain a pseudo-education label or pseudo-non-education label of the third sample corpus. It should be noted that since the third sample corpus contains both educational content and non-education content, the label of the third sample corpus is a pseudo-education label or a pseudo-non-education label.
[0089] In one possible approach, a seed corpus can be selected from the first sub-corpus data and the second sub-corpus data, and the seed corpus can be used as the input of a generative adversarial network (GAN network). The generative adversarial network is used to process the seed corpus to generate corresponding text as a third sample corpus, and the third sample corpus is classified and labeled through an automatic labeling method to obtain a pseudo-educational label or a pseudo-non-educational label for the third sample corpus.
[0090] Optionally, based on the first sub-corpus data and the second sub-corpus data, the first sample corpus and the second sample corpus are merged to obtain the third sample corpus, the steps specifically including: clustering the first sub-corpus data and the second sub-corpus data according to education type and non-education type to obtain a first sub-corpus data cluster of education type and a second sub-corpus data cluster of non-education type; determining the middle space between the first sub-corpus data cluster and the second sub-corpus data cluster, the middle space being at the same distance from the first sub-corpus data cluster and the second sub-corpus data cluster; taking the middle space as the target semantic space, generating corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain the third sample corpus.
[0091] In the embodiment of the present invention, after obtaining the first sub-corpus data and the second sub-corpus data, the first sub-corpus data and the second sub-corpus data can be mixed to obtain a sub-corpus data set to be clustered, and similar sub-corpus data can be clustered together through a clustering algorithm (such as K-means, hierarchical clustering, etc.) to form a first sub-corpus data cluster of the education type and a second sub-corpus data cluster of the non-education type. In this way, the characteristics and type boundaries of the two types of corpus can be more clearly identified.
[0092] After obtaining the first sub-corpus data cluster and the second sub-corpus data cluster, the first sub-corpus data cluster and the second sub-corpus data cluster can be regarded as two independent spaces. In the two independent spaces, an intermediate space of a preset range is determined. The intermediate space can be understood as a "bridge" or "transition area" between the two types of corpora. It is at the same distance from the two data clusters, which means that it neither completely belongs to the educational type nor completely belongs to the non-educational type, but is the combination of the two.
[0093] Taking the middle space as the target semantic space, the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster are used to generate the corpus text in the target semantic space. The corpus text in the target semantic space can be generated by natural language generation technology, such as template-based generation, deep learning model generation, or LLM large model. The generated corpus text retains the characteristics of educational type corpus and incorporates elements of non-educational type corpus, thus forming a brand new third sample corpus. And because it is generated based on the first sample corpus and the second sample corpus, the third sample corpus integrates some features of the first sample corpus and the second sample corpus, making it a more difficult to identify sample corpus.
[0094] By organically integrating two different types of corpora, a new third sample corpus with the characteristics of both types of corpora is generated, which increases the richness of the sample corpus.
[0095] Optionally, taking the intermediate space as the target semantic space, generating the corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster, the step of obtaining the third sample corpus specifically includes: randomly selecting n1 sub-corpus data in the first sub-corpus data cluster according to the distance balance principle, and randomly selecting n2 sub-corpus data in the second sub-corpus data cluster according to the distance balance principle; using the n1 sub-corpus data and the n2 sub-corpus data as text generation seeds to generate the corpus text in the target semantic space, to obtain the third sample corpus.
[0096] In an embodiment of the present invention, n1 sub-corpus data can be randomly selected in the first sub-corpus data cluster (education type) according to the "distance balance principle". The above-mentioned "distance balance principle" refers to ensuring that the average distance of the selected sub-corpus data to the center in the data cluster is within a preset range, and that a certain difference is maintained between each other, so that sub-corpus data that can comprehensively and stably express the characteristics of the data cluster can be selected each time. Similarly, in the second sub-corpus data cluster (non-education type), n2 sub-corpus data are randomly selected according to the same principle. Among them, n1 and n2 are integers greater than or equal to 1, and n1 and n2 can be the same or different.
[0097] The n1 and n2 sub-corpus data selected from the two data clusters are used as seeds for text generation and as the starting point for generating new texts, ensuring that the generated third sample corpus contains both educational and non-educational elements.
[0098] Using the seeds of text generation, a text generation technology (such as a text generation model based on deep learning, a GAN network, or an LLM large model) is used to generate corpus text in the target semantic space (i.e., the middle space). The text generation model combines the features of the two types of corpora to generate new text that is neither completely educational nor completely non-educational. The generated text is used as the third sample corpus.
[0099] The third sample corpus obtained through the above text generation can enrich the diversity of the corpus and provide more valuable training data for subsequent natural language processing tasks.
[0100] Optionally, n1 sub-corpus data and n2 sub-corpus data are used as text generation seeds to generate corpus text in the target semantic space, and the steps of obtaining the third sample corpus specifically include: determining the central semantic vector of the target semantic space; encoding the n1 sub-corpus data and n2 sub-corpus data into the vector space to obtain the seed vector; generating the corpus text in the target semantic space with the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space; and determining the third sample corpus based on the corpus text in the target semantic space.
[0101] In the embodiment of the present invention, the center point of the target semantic space (intermediate space) can be determined, and this center point can be represented by a vector, called a "central semantic vector". The central semantic vector can be understood as the most representative point in the semantic space, representing the core meaning or theme of the target semantic space.
[0102] Encode the n1 and n2 sub-corpus data previously selected from the two sub-corpus data clusters, and convert the n1 and n2 sub-corpus data into vector form, which are "seed vectors". The encoding process can be carried out using natural language processing technology, such as word embeddings or sentence embeddings. Through vector encoding, text data can be converted into mathematical vector representation.
[0103] Under the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space, the generation of new corpus text begins. The text generation process can adopt a text generation model such as a text generation model based on deep learning, a GAN network or an LLM large model, which can generate text that meets the requirements based on a given seed vector and a central semantic vector. The generated text should be located in the target semantic space, that is, it is neither completely biased towards the first sample corpus (education type) nor completely biased towards the second sample corpus (non-education type), but is located in the middle ground between the two. It can be understood that under the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space, the text semantic vector of the generated text needs to be located in the target semantic space.
[0104] Based on the corpus text generated in the target semantic space, the final third sample corpus is determined. The third sample corpus combines the characteristics of both the first sample corpus and the second sample corpus, forming a new and unique corpus type.
[0105] In the embodiment of the present invention, by determining the central semantic vector, encoding the sub-corpus data, generating the text in the target semantic space and finally determining the third sample corpus, the effective fusion of two different types of corpora is achieved, and the generation of the third sample corpus is constrained so that the third sample corpus does not deviate from the target semantic space.
[0106] Optionally, based on the corpus text in the target semantic space, the step of determining the third sample corpus specifically includes: calculating the first distance and the second distance between each corpus text in the target semantic space and the first sub-corpus data cluster and the second sub-corpus data cluster; if the first distance is greater than the second distance, then the corpus text in the target semantic space is determined to be a pseudo-educational type; if the first distance is less than the second distance, then the corpus text in the target semantic space is determined to be a pseudo-non-educational type.
[0107] In the embodiment of the present invention, the distance from each corpus text in the target semantic space to the first sub-corpus data cluster (education type) can be calculated, and this distance is called the "first distance". Similarly, the distance from each corpus text to the second sub-corpus data cluster (non-education type) is calculated, and this distance is called the "second distance". The above distance can be the Euclidean distance.
[0108] If the first distance of a corpus text is greater than the second distance, it means that the text is farther away from the first sub-corpus data cluster (education type) and closer to the second sub-corpus data cluster (non-education type). Therefore, this corpus text can be determined as "pseudo non-education type".
[0109] On the contrary, if the first distance of a corpus text is less than the second distance, it means that the text is closer to the first sub-corpus data cluster (education type) and farther from the second sub-corpus data cluster (non-education type). Therefore, this corpus text can be determined as a "pseudo-education type".
[0110] Each corpus text in the target semantic space can be classified more finely to understand which type (education type or non-education type) each corpus text is more inclined to, so that the education classification model can better understand and utilize these generated third sample corpora. At the same time, the addition of "pseudo" characters indicates that although these texts are inclined to a certain type, they do not completely belong to this type, but are located at the boundary or transition area between the two types.
[0111] Optionally, the step of performing supervised training on the education classification model to be trained using the first sample corpus, the second sample corpus, and the third sample corpus specifically includes: in the first training stage, the education classification model to be trained is subjected to supervised training using the first sample corpus and the second sample corpus, and after the first loss value drops to a preset loss value, a first-stage training model is obtained; in the second training stage, the education classification model to be trained is subjected to supervised training using the first sample corpus, the second sample corpus, and the third sample corpus, and after the second loss value drops to a preset loss value, a second-stage training model is obtained; the second-stage training model is determined as the trained education classification model; the first loss value is calculated using the following first loss function:
[0112] Loss1=γ1·(yf(x)) 2 +(1-γ1)·(yf(x)) 2 ;
[0113] Among them, γ1 takes the value of 1 when it is an education type and takes the value of 0 when it is a non-education type, f(x) is the output of the education classification model to be trained, x is the first sample corpus or the second sample corpus, and y is the type label.
[0114] The second loss value is calculated by the following second loss function:
[0115] Loss2 = γ2·(d(y, f`(x`))) 2 +(1-γ2)·(d(y,f`(x`))) 2 +γ3·
[0116] max(a, d(y, f`(x`))) 2 +(1-γ3)·max(a,d(y,f`(x`))) 2 ;
[0117] Among them, x` is the first sample corpus or the second sample corpus or the third sample corpus, f`(x`) is the output of the first stage training model, γ2 takes the value of 1 when x` is an education type, γ2 takes the value of 0 when x` is a non-education type, γ2 is 0 when x` is a pseudo-education type or a pseudo-non-education type, γ3 takes the value of 1 when x` is a pseudo-education type, γ3 takes the value of 0 when x` is a pseudo-non-education type, γ3 is 0 when x` is an education type or a non-education type, d(y, f`(x`)) represents the distance between the type label and the output of the first stage training model, max(a, d(y, f`(x`))) represents when d(y, f`(x`)) is less than a, take a, when d(y, f`(x`)) is greater than a, take d(y, f`(x`)), a represents the distance from the central semantic vector of the target semantic space to the first sub-corpus data cluster or the second sub-corpus data cluster.
[0118] In the embodiment of the present invention, in the first training stage, the first sample corpus (education type) and the second sample corpus (non-education type) can be used to train the model. Since the types of the first sample corpus and the second sample corpus are distinct, the education classification model can be quickly gradient-dropped in two clear directions of education type and non-education type, and the training of the education classification model in the two directions of education type and non-education type can be quickly completed to obtain the first stage training model.
[0119] Through supervised training with these two clearly classified corpus data, the model can initially learn how to distinguish between educational and non-educational texts. During the training process, the loss value (i.e., the difference between the model prediction and the actual label) can be continuously monitored. When the first loss value drops to the preset first loss value threshold, it means that the model has initially mastered the classification ability, and the "first stage training model" is obtained.
[0120] It should be noted that since the first-stage training model only used the first sample corpus and the second sample corpus for training, it has a better classification effect when classifying educational information with clear content to be classified. However, the classification accuracy will decrease when classifying educational information with unclear content to be classified. This is due to the insufficient generalization ability of the first-stage training model.
[0121] On the basis of the first stage, we enter the second training stage. At this time, in addition to continuing to use the first and second sample corpora, we also introduce the third sample corpus (i.e., the corpus that combines the characteristics of education and non-education types) for training. The addition of the third sample corpus enables the model to learn more complex and ambiguous text classification situations, thereby enhancing its generalization ability and classification accuracy.
[0122] Similarly, in the second training stage, the loss value is continuously monitored. When the second loss value drops to the second loss value threshold, it indicates that the model has further improved its classification ability, and the "second stage training model" is obtained. The second loss value threshold is less than the first loss value threshold.
[0123] After the above two stages of training, the model obtained in the second stage of training can be identified as the "trained education classification model". The "trained education classification model" not only learns how to distinguish between clear education type and non-education type texts, but also can handle complex texts that combine the characteristics of the two types. It can classify complex texts with unclear content into education categories, thereby improving the accuracy of education classification of complex texts.
[0124] like Figure 2 As shown, an embodiment of the present invention provides an educational information classification device, the educational information classification device comprising:
[0125] An acquisition module 201 is used to acquire a first sample corpus and a second sample corpus, wherein the first sample corpus includes educational text information, and the second sample corpus includes non-educational text information;
[0126] A processing module 202 is used to fuse the first sample corpus and the second sample corpus to obtain a third sample corpus, wherein the third sample corpus includes fused text information of educational type and non-education type;
[0127] A training module 203 is used to perform supervised training on the education classification model to be trained by using the first sample corpus, the second sample corpus and the third sample corpus, and after the training is completed, a trained education classification model is obtained, and the output of the education classification model is a classification type;
[0128] The classification module 204 is used to obtain the educational information to be classified, classify the educational information to be classified by using the trained educational classification model, and obtain the classification type of the educational information to be classified.
[0129] Optionally, the processing module 202 is also used to determine the word length distribution of target keywords in the text information of the education type, the word length distribution including the distribution relationship between word length and quantity, and the target keywords are education-related keywords; in the word length distribution, at least one target word length is determined; based on the target word length, the text of each of the first sample corpus is randomly split to obtain multiple first sub-corpus data; based on the target word length, the text of each of the second sample corpus is randomly split to obtain multiple second sub-corpus data; based on the first sub-corpus data and the second sub-corpus data, the first sample corpus and the second sample corpus are fused to obtain a third sample corpus.
[0130] Optionally, the processing module 202 is also used to cluster the first sub-corpus data and the second sub-corpus data according to education type and non-education type to obtain a first sub-corpus data cluster of the education type and a second sub-corpus data cluster of the non-education type; determine the intermediate space between the first sub-corpus data cluster and the second sub-corpus data cluster, the distance between the intermediate space and the first sub-corpus data cluster is the same as the distance between the intermediate space and the second sub-corpus data cluster; take the intermediate space as the target semantic space, and generate the corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain a third sample corpus.
[0131] Optionally, the processing module 202 is also used to randomly select n1 sub-corpus data from the first sub-corpus data cluster according to the distance balance principle, and randomly select n2 sub-corpus data from the second sub-corpus data cluster according to the distance balance principle; use the n1 sub-corpus data and the n2 sub-corpus data as text generation seeds to generate corpus text in the target semantic space, and obtain a third sample corpus.
[0132] Optionally, the processing module 202 is also used to determine the central semantic vector of the target semantic space; encode n1 sub-corpus data and n2 sub-corpus data into the vector space to obtain a seed vector; generate the corpus text in the target semantic space with the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space; and determine a third sample corpus based on the corpus text in the target semantic space.
[0133] Optionally, the processing module 202 is also used to calculate the first distance and the second distance between each corpus text in the target semantic space and the first sub-corpus data cluster and the second sub-corpus data cluster; if the first distance is greater than the second distance, the corpus text in the target semantic space is determined to be a pseudo-educational type; if the first distance is less than the second distance, the corpus text in the target semantic space is determined to be a pseudo-non-educational type.
[0134] Optionally, the training module 203 is also used to perform supervised training on the education classification model to be trained through the first sample corpus and the second sample corpus in the first training stage, and obtain the first stage training model after the first loss value drops to a preset loss value; in the second training stage, perform supervised training on the education classification model to be trained through the first sample corpus, the second sample corpus and the third sample corpus, and obtain the second stage training model after the second loss value drops to a preset loss value; determine the second stage training model as the trained education classification model;
[0135] The first loss value is calculated by the following first loss function:
[0136] Loss1=γ1·(yf(x)) 2 +(1-γ1)·(yf(x)) 2 ;
[0137] Where, γ1 is 1 when it is an education type and 0 when it is a non-education type, f(x) is the output of the education classification model to be trained, x is the first sample corpus or the second sample corpus, and y is the type label;
[0138] The second loss value is calculated by the following second loss function:
[0139] Loss2 = γ2·(d(y, f`(x`))) 2 +(1-γ2)·(d(y,f`(x`))) 2 +γ3·
[0140] max(a, d(y, f`(x`))) 2 +(1-γ3)·max(a,d(y,f`(x`))) 2 ;
[0141] Among them, x` is the first sample corpus or the second sample corpus or the third sample corpus, f`(x`) is the output of the first stage training model, γ2 takes the value of 1 when x` is an education type, γ2 takes the value of 0 when x` is a non-education type, γ2 is 0 when x` is a pseudo-education type or a pseudo-non-education type, γ3 takes the value of 1 when x` is a pseudo-education type, γ3 takes the value of 0 when x` is a pseudo-non-education type, γ3 is 0 when x` is an education type or a non-education type, d(y, f`(x`)) represents the distance between the type label and the output of the first stage training model, max(a, d(y, f`(x`))) represents when d(y, f`(x`)) is less than a, take a, when d(y, f`(x`)) is greater than a, take d(y, f`(x`)), a represents the distance from the central semantic vector of the target semantic space to the first sub-corpus data cluster or the second sub-corpus data cluster.
[0142] The educational information classification device provided in the embodiment of the present invention can implement each process implemented by the educational information classification method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0143] See also Figure 3 , Figure 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, it includes: a memory 302, a processor 301, and a computer program of an educational information classification method stored in the memory 302 and executable on the processor 301, wherein:
[0144] The processor 301 is used to call the computer program stored in the memory 302 and execute the following steps:
[0145] Acquire a first sample corpus and a second sample corpus, wherein the first sample corpus includes text information of an educational type, and the second sample corpus includes text information of a non-educational type;
[0146] The first sample corpus and the second sample corpus are fused to obtain a third sample corpus, wherein the third sample corpus includes fused text information of educational type and non-education type;
[0147] Performing supervised training on the education classification model to be trained by using the first sample corpus, the second sample corpus, and the third sample corpus, and obtaining a trained education classification model after the training is completed, wherein the output of the education classification model is a classification type;
[0148] Obtain the educational information to be classified, classify the educational information to be classified using the trained educational classification model, and obtain the classification type of the educational information to be classified.
[0149] Optionally, the step of fusing the first sample corpus and the second sample corpus to obtain a third sample corpus performed by the processor 301 includes:
[0150] In the text information of the education type, determining the word length distribution of the target keyword, the word length distribution including the distribution relationship between the word length and the quantity, the target keyword is an education-related keyword;
[0151] In the word length distribution, determining at least one target word length;
[0152] Based on the target word length, randomly split each of the first sample corpora to obtain a plurality of first sub-corpora data;
[0153] Based on the target word length, randomly split each second sample corpus to obtain a plurality of second sub-corpus data;
[0154] Based on the first sub-corpus data and the second sub-corpus data, the first sample corpus and the second sample corpus are fused to obtain a third sample corpus.
[0155] Optionally, the step of fusing the first sample corpus and the second sample corpus based on the first sub-corpus data and the second sub-corpus data to obtain a third sample corpus performed by the processor 301 includes:
[0156] Clustering the first sub-corpus data and the second sub-corpus data according to education type and non-education type to obtain a first sub-corpus data cluster of the education type and a second sub-corpus data cluster of the non-education type;
[0157] Determine an intermediate space between the first sub-corpus data cluster and the second sub-corpus data cluster, wherein the distance between the intermediate space and the first sub-corpus data cluster is the same as the distance between the intermediate space and the second sub-corpus data cluster;
[0158] The intermediate space is used as the target semantic space, and corpus text in the target semantic space is generated based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain a third sample corpus.
[0159] Optionally, the step of taking the intermediate space as the target semantic space and generating corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain a third sample corpus performed by the processor 301 includes:
[0160] Randomly select n1 sub-corpus data from the first sub-corpus data cluster according to the distance balance principle, and randomly select n2 sub-corpus data from the second sub-corpus data cluster according to the distance balance principle;
[0161] The n1 sub-corpus data and the n2 sub-corpus data are used as text generation seeds to generate corpus text in the target semantic space to obtain a third sample corpus.
[0162] Optionally, the step of using the n1 sub-corpus data and the n2 sub-corpus data as text generation seeds to generate the corpus text in the target semantic space to obtain the third sample corpus executed by the processor 301 includes:
[0163] Determining a central semantic vector of the target semantic space;
[0164] Encode the n1 sub-corpus data and the n2 sub-corpus data into the vector space to obtain the seed vector;
[0165] Generate corpus text in the target semantic space with the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space;
[0166] Based on the corpus text in the target semantic space, a third sample corpus is determined.
[0167] Optionally, the step of determining a third sample corpus based on the corpus text in the target semantic space performed by the processor 301 includes:
[0168] Calculating a first distance and a second distance between each corpus text in the target semantic space and the first sub-corpus data cluster and the second sub-corpus data cluster;
[0169] If the first distance is greater than the second distance, the corpus text in the target semantic space is determined to be a pseudo-educational type; if the first distance is less than the second distance, the corpus text in the target semantic space is determined to be a pseudo-non-educational type.
[0170] Optionally, the step of performing supervised training on the education classification model to be trained by using the first sample corpus, the second sample corpus, and the third sample corpus, performed by the processor 301, includes:
[0171] In the first training stage, supervised training is performed on the education classification model to be trained using the first sample corpus and the second sample corpus, and a first-stage training model is obtained after the first loss value drops to a preset loss value;
[0172] In the second training stage, supervised training is performed on the education classification model to be trained using the first sample corpus, the second sample corpus, and the third sample corpus, and a second-stage training model is obtained after the second loss value drops to a preset loss value;
[0173] determining the second-stage training model as a trained education classification model;
[0174] The first loss value is calculated by the following first loss function:
[0175] Loss1=γ1·(yf(x)) 2 +(1-γ1)·(yf(x)) 2 ;
[0176] Where, γ1 is 1 when it is an education type and 0 when it is a non-education type, f(x) is the output of the education classification model to be trained, x is the first sample corpus or the second sample corpus, and y is the type label;
[0177] The second loss value is calculated by the following second loss function:
[0178] Loss2 = γ2·(d(y, f`(x`))) 2 +(1-γ2)·(d(y,f`(x`))) 2 +γ3·max(a,d(y,f`(x`))) 2 +(1-γ3)·max(a,d(y,f`(x`))) 2 ;
[0179] Among them, x` is the first sample corpus or the second sample corpus or the third sample corpus, f`(x`) is the output of the first stage training model, γ2 takes the value of 1 when x` is an education type, γ2 takes the value of 0 when x` is a non-education type, γ2 is 0 when x` is a pseudo-education type or a pseudo-non-education type, γ3 takes the value of 1 when x` is a pseudo-education type, γ3 takes the value of 0 when x` is a pseudo-non-education type, γ3 is 0 when x` is an education type or a non-education type, d(y, f`(x`)) represents the distance between the type label and the output of the first stage training model, max(a, d(y, f`(x`))) represents when d(y, f`(x`)) is less than a, take a, when d(y, f`(x`)) is greater than a, take d(y, f`(x`)), a represents the distance from the central semantic vector of the target semantic space to the first sub-corpus data cluster or the second sub-corpus data cluster.
[0180] The electronic device provided in the embodiment of the present invention can implement each process implemented by the educational information classification method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0181] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the education information classification method or the application-side education information classification method provided in the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0182] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0183] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for classifying educational information, characterized in that: include: Acquire a first sample corpus and a second sample corpus, wherein the first sample corpus includes text information of an educational type, and the second sample corpus includes text information of a non-educational type; The first sample corpus and the second sample corpus are fused to obtain a third sample corpus, wherein the third sample corpus includes fused text information of education type and non-education type; each of the first sample corpus is subjected to text splitting to obtain a plurality of first sub-corpus data; each of the second sample corpus is subjected to text splitting to obtain a plurality of second sub-corpus data; the first sub-corpus data and the second sub-corpus data are clustered according to education type and non-education type to obtain a first sub-corpus data cluster of the education type and a second sub-corpus data cluster of the non-education type; an intermediate space between the first sub-corpus data cluster and the second sub-corpus data cluster is determined, wherein the distance from the intermediate space to the first sub-corpus data cluster is the same as that from the intermediate space to the second sub-corpus data cluster; the intermediate space is used as the target semantic space, and the corpus text in the target semantic space is generated based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain a third sample corpus; In the first training stage, supervised training is performed on the education classification model to be trained using the first sample corpus and the second sample corpus, and a first-stage training model is obtained after the first loss value drops to a preset loss value; In the second training stage, supervised training is performed on the first stage training model through the first sample corpus, the second sample corpus and the third sample corpus, and the second stage training model is obtained after the second loss value drops to a preset loss value; determining the second-stage training model as a trained education classification model; The first loss value is calculated by the following first loss function: ; in, The value is 1 when it is an education type, and 0 when it is a non-education type. is the output of the education classification model to be trained, is the first sample corpus or the second sample corpus, is the type tag; The second loss value is calculated by the following second loss function: ; in, ` is the first sample corpus or the second sample corpus or the third sample corpus, is the output of the first stage training model, exist `When it is education type, the value is 1, exist `When it is non-education type, the value is 0. exist ` is a pseudo-education type or pseudo-non-education type, exist `When it is a pseudo-education type, it takes 1. exist `For pseudo non-education type, it is 0. exist `If it is education type or non-education type, it is 0. represents the distance between the type label and the output of the first stage training model, Indicates when Less than a Time a ,when Greater than a Time , a Representing the distance from the central semantic vector of the target semantic space to the first sub-corpus data cluster or the second sub-corpus data cluster; after the training is completed, a trained education classification model is obtained, and the output of the education classification model is the education type or the non-education type; Obtain the educational information to be classified, classify the educational information to be classified using the trained educational classification model, and obtain the classification type of the educational information to be classified.
2. The method according to claim 1, characterized in that The step of fusing the first sample corpus with the second sample corpus to obtain a third sample corpus comprises: In the text information of the education type, determining the word length distribution of the target keyword, the word length distribution including the distribution relationship between the word length and the quantity, the target keyword is an education-related keyword; In the word length distribution, determining at least one target word length; Based on the target word length, randomly split each of the first sample corpora to obtain a plurality of first sub-corpora data; Based on the target word length, randomly split each second sample corpus to obtain a plurality of second sub-corpus data; Based on the first sub-corpus data and the second sub-corpus data, the first sample corpus and the second sample corpus are fused to obtain a third sample corpus.
3. The method according to claim 2, characterized in that The step of taking the intermediate space as the target semantic space and generating corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain the third sample corpus comprises: Randomly select n1 sub-corpus data from the first sub-corpus data cluster according to the distance balance principle, and randomly select n2 sub-corpus data from the second sub-corpus data cluster according to the distance balance principle; The n1 sub-corpus data and the n2 sub-corpus data are used as text generation seeds to generate corpus text in the target semantic space to obtain a third sample corpus.
4. The method according to claim 3, characterized in that The step of using the n1 sub-corpus data and the n2 sub-corpus data as text generation seeds to generate corpus text in the target semantic space to obtain a third sample corpus comprises: Determining a central semantic vector of the target semantic space; Encoding the n1 sub-corpus data and the n2 sub-corpus data into a vector space to obtain a seed vector; Generate corpus text in the target semantic space with the constraint that the distance between the seed vector and the central semantic vector is less than the boundary of the target semantic space; Based on the corpus text in the target semantic space, a third sample corpus is determined.
5. The method according to claim 4, characterized in that The step of determining a third sample corpus based on the corpus text in the target semantic space comprises: Calculating a first distance and a second distance between each corpus text in the target semantic space and the first sub-corpus data cluster and the second sub-corpus data cluster; If the first distance is greater than the second distance, the corpus text in the target semantic space is determined to be a pseudo-educational type; if the first distance is less than the second distance, the corpus text in the target semantic space is determined to be a pseudo-non-educational type.
6. An educational information classification device, characterized in that: The educational information classification device comprises: An acquisition module, used to acquire a first sample corpus and a second sample corpus, wherein the first sample corpus includes educational text information, and the second sample corpus includes non-educational text information; A processing module, used for fusing the first sample corpus and the second sample corpus to obtain a third sample corpus, wherein the third sample corpus includes fused text information of education type and non-education type; specifically performing text splitting on each of the first sample corpus to obtain a plurality of first sub-corpus data; performing text splitting on each of the second sample corpus to obtain a plurality of second sub-corpus data; clustering the first sub-corpus data and the second sub-corpus data according to education type and non-education type to obtain a first sub-corpus data cluster of the education type and a second sub-corpus data cluster of the non-education type; determining an intermediate space between the first sub-corpus data cluster and the second sub-corpus data cluster, wherein the distance from the intermediate space to the first sub-corpus data cluster is the same as that from the intermediate space to the second sub-corpus data cluster; taking the intermediate space as a target semantic space, generating corpus text in the target semantic space based on the sub-corpus data in the first sub-corpus data cluster and the second sub-corpus data cluster to obtain a third sample corpus; The training module is used for, in a first training stage, performing supervised training on the education classification model to be trained through the first sample corpus and the second sample corpus, and obtaining the first stage training model after the first loss value drops to a preset loss value; in a second training stage, performing supervised training on the first stage training model through the first sample corpus, the second sample corpus and the third sample corpus, and obtaining the second stage training model after the second loss value drops to a preset loss value; determining the second stage training model as the trained education classification model; the first loss value is calculated by the following first loss function: ; in, The value is 1 when it is an education type, and 0 when it is a non-education type. is the output of the education classification model to be trained, is the first sample corpus or the second sample corpus, is the type label; the second loss value is calculated by the following second loss function: ; in, ` is the first sample corpus or the second sample corpus or the third sample corpus, is the output of the first stage training model, exist `When it is education type, the value is 1, exist `When it is non-education type, the value is 0. exist ` is a pseudo-education type or pseudo-non-education type, exist `When it is a pseudo-education type, it takes 1. exist `For pseudo non-education type, it is 0. exist `If it is education type or non-education type, it is 0. represents the distance between the type label and the output of the first stage training model, Indicates when Less than a Time a ,when Greater than a Time , a Representing the distance from the central semantic vector of the target semantic space to the first sub-corpus data cluster or the second sub-corpus data cluster, after the training is completed, a trained education classification model is obtained, and the output of the education classification model is the education type or the non-education type; The classification module is used to obtain the educational information to be classified, classify the educational information to be classified through the trained educational classification model, and obtain the classification type of the educational information to be classified.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the educational information classification method as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the educational information classification method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Language model training method, electronic equipment, storage medium and product
CN116401364A
Object detection model training method, detection method, apparatus, device and medium
WO2024120157A1