Label prediction method, apparatus, device, and storage medium

CN114298247BActive Publication Date: 2026-09-11BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210084039.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2026-09-11
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

[0002]目前,由于获取资源的渠道不同,造成资源对应的标签不完整甚至缺失

Benefits of technology

[0018] The solution provided in this disclosure can improve the accuracy of label prediction even with limited sample data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298247B_ABST
    Figure CN114298247B_ABST
Patent Text Reader

Abstract

The disclosure provides a label prediction method and device, equipment and a storage medium, relates to the technical field of artificial intelligence, in particular to the technical field of natural language processing, machine learning, resource search and education resource classification. The specific implementation scheme is: mapping the to-be-tested data into a trained feature space to obtain a feature vector of the to-be-tested data in the feature space; determining the similarity between the to-be-tested data and a plurality of center points of sample data in the feature space based on the feature vector of the to-be-tested data in the feature space and the feature vector of the plurality of center points of the sample data in the feature space; and predicting the label of the to-be-tested data based on the similarity between the to-be-tested data and the plurality of center points of the sample data and the label of the plurality of center points of the sample data. According to the technical scheme of the disclosure, the prediction efficiency and accuracy of the label can be improved under the condition that the sample data is less.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to the fields of natural language processing, machine learning, resource search, and educational resource classification. Background Technology

[0002] Currently, due to different channels for obtaining resources, the corresponding labels for these resources are incomplete or even missing. Regardless of whether traditional solutions or pre-trained models with fine-tuning are used, a large amount of sample data is still required, and the prediction effect is poor for unknown types of data. Summary of the Invention

[0003] This disclosure presents a tag prediction method, apparatus, device, storage medium, and computer program product.

[0004] Firstly, this disclosure provides a label prediction method, including:

[0005] The test data is mapped to the trained feature space to obtain the feature vector of the test data in the feature space;

[0006] Based on the feature vector of the test data in the feature space and the feature vectors of multiple centroids of the sample data in the feature space, the similarity between the test data and the multiple centroids of the sample data is determined.

[0007] Based on the similarity between the test data and multiple centroids of the sample data, and the labels corresponding to the multiple centroids of the sample data, the label of the test data is predicted.

[0008] Secondly, this disclosure provides a label prediction device, comprising:

[0009] The mapping module is used to map the test data to the trained feature space to obtain the feature vector of the test data in the feature space;

[0010] The first determining module is used to determine the similarity between the test data and the multiple center points of the sample data based on the feature vector of the test data in the feature space and the feature vectors of the multiple center points of the sample data in the feature space.

[0011] The prediction module is used to predict the label of the test data based on the similarity between the test data and multiple centroids of the sample data, as well as the labels corresponding to the multiple centroids of the sample data.

[0012] Thirdly, this disclosure provides an electronic device, including:

[0013] At least one processor; and

[0014] The memory is communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method provided in the first aspect above.

[0016] Fourthly, this disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method provided in the first aspect above.

[0017] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in the first aspect above.

[0018] The solution provided in this disclosure can improve the accuracy of label prediction even with limited sample data.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0021] Figure 1 A flowchart illustrating the implementation of the label prediction method provided in this embodiment of the disclosure;

[0022] Figure 2 A flowchart illustrating word segmentation provided for embodiments of this disclosure;

[0023] Figure 3 A schematic diagram of the label prediction process provided in the embodiments of this disclosure;

[0024] Figure 4 This is a schematic diagram illustrating a use case of the label prediction method provided in the embodiments of this disclosure;

[0025] Figure 5 This is a schematic diagram of the structure of the label prediction device according to an embodiment of the present disclosure. Figure 1 ;

[0026] Figure 6 This is a schematic diagram of the structure of the label prediction device according to an embodiment of the present disclosure. Figure 2 ;

[0027] Figure 7 This is a block diagram of an electronic device used to implement the tag prediction method of the embodiments of this disclosure. Detailed Implementation

[0028] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0029] The terms "first," "second," and "third," etc., used in the embodiments, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0030] This disclosure provides a tag prediction method that can be applied to electronic devices, including but not limited to fixed devices and / or mobile devices. For example, fixed devices include, but are not limited to, servers, which can be cloud servers or regular servers. Mobile devices include, but are not limited to, one or more of the following: mobile phones or tablets. Figure 1 As shown, the label prediction method includes:

[0031] S101: Map the data to be tested to the trained feature space to obtain the feature vector of the data to be tested in the feature space;

[0032] S102: Based on the feature vector of the test data in the feature space and the feature vectors of multiple center points of the sample data in the feature space, determine the similarity between the test data and the multiple center points of the sample data.

[0033] S103: Based on the similarity between the test data and multiple centroids of the sample data, and the labels corresponding to the multiple centroids of the sample data, the label of the test data is predicted.

[0034] Here, the feature space is a pre-trained feature space. This feature space can be obtained by training with a small sample dataset. How to obtain this feature space through training with a small sample dataset will be described in detail later and will not be repeated here.

[0035] Here, the labels on the sample data are pre-defined labels. Each label includes at least a first label and a second label. The first and second labels are of different types. For example, the first label might be a subject label, and the second label a grade level label. Another example is a medical subject label, and the second label a medical grade label. Yet another example is a product quality label, and the second label a user experience label. The first and second labels can also be other types of labels. For instance, the first and second labels can be set according to the field, characteristics, research direction, or other attributes of the sample data, which will not be detailed here.

[0036] It should be noted that this disclosure does not restrict the order of the first and second annotation labels.

[0037] Here, the labels for the data to be tested include a first label and a second label, which are labels of different types. For example, the first label might be a subject label, and the second label a grade level label. Another example is a medical subject label, where the first label is a medical level label, the second label is a grade level label, and the second label is a subject label. Yet another example is a product quality label, and the second label a user experience label. The first and second labels can also be other types of labels. For instance, the first and second labels might be determined by a first annotation label and a second annotation label, where the first label is the same as the first annotation label, and the second label is the same as the second annotation label; these will not be elaborated further here.

[0038] Thus, since the labels of the data to be tested include first and second labels, the types of labels in the data to be tested are increased, and the label representation dimension is relatively higher, which helps to improve the label prediction accuracy.

[0039] In some implementations, sample data is obtained through a trained model.

[0040] This increases the number of sample data, thereby improving the generalization of the feature space obtained from the sample data.

[0041] In some implementations, manually labeled sample data is obtained.

[0042] This can improve the accuracy of the feature space obtained from sample data.

[0043] In this embodiment of the disclosure, the method of obtaining sample data is not limited.

[0044] In this embodiment of the disclosure, the sample data includes multiple types of data. This disclosure does not impose mandatory limitations on the number of types of sample data or the number of samples included in each type of sample data.

[0045] The method for determining multiple center points of the sample data in this embodiment will be described in detail in subsequent schemes, and will not be repeated here.

[0046] The aforementioned label prediction method is suitable for label prediction of data in highly specialized fields and / or where manual annotation is costly. For example, label prediction for test questions in the field of educational resources; label prediction for surgery-related resources in the field of medical resources; and label prediction for academic papers in the field of bioengineering.

[0047] The technical solution described in this disclosure improves the dimensionality and accuracy of feature vector representation by mapping the data to be tested to a feature space. This helps to improve the accuracy of the similarity determined based on the feature vector of the data to be tested in the feature space and the feature vector of the center point of the sample data in the same feature space, thereby improving the accuracy of label prediction. In addition, since the label of the center point is more accurate and reliable, predicting the label of the data to be tested based on the similarity between the data to be tested and multiple center points of the sample data can improve the generalization of the prediction and further improve the accuracy of the prediction.

[0048] In some embodiments, determining the similarity between the test data and the multiple center points of the sample data in the feature space based on the feature vector of the test data in the feature space and the feature vectors of the multiple center points of the sample data in the feature space respectively includes: determining the cosine value between the test data and the multiple center points of the sample data based on the feature vector of the test data in the feature space and the feature vectors of the multiple center points of the sample data in the feature space respectively; and determining the similarity between the test data and the multiple center points of the sample data based on the cosine value between the test data and the multiple center points of the sample data respectively.

[0049] Here, similarity can be represented in ways other than the cosine value mentioned above. For example, similarity can also be represented using the Cartesian product, which will not be detailed here.

[0050] Thus, the similarity between the test data and the multiple centroids of the sample data can be determined based on the cosine values ​​of the test data and the multiple centroids of the sample data. The calculation process is relatively simple and helps to improve the efficiency of prediction.

[0051] In some embodiments, determining the feature vector of the center point of each group of sample data includes:

[0052] The feature vectors of each sample data in each group are weighted and averaged to obtain the feature vector of the center point of each group of sample data.

[0053] For example, the eigenvector of the center point can be calculated according to the following formula (1):

[0054]

[0055] Where n represents the number of sample instances in each group of sample data, and i represents the index of the sample instance in each group of samples; emb center The feature vector representing the center point of each set of sample data, emb i This represents the feature vector of the i-th sample in each set of sample data.

[0056] In this way, we can obtain the feature vector of the center point of each group of sample data, which provides a computational basis for subsequently determining the similarity between the test data and multiple center points of the sample data.

[0057] In some embodiments, the label of the test data is predicted based on the similarity between the test data and multiple centroids of the sample data, and the annotation labels corresponding to the multiple centroids of the sample data, including: determining the maximum similarity based on the similarity between the test data and multiple centroids of the sample data; and if the maximum similarity is within a threshold range, using the annotation label corresponding to the centroid of the sample data with the highest similarity to the test data as the label of the test data.

[0058] Here, the threshold is greater than 0 and less than or equal to 1. The threshold can be set or adjusted according to actual requirements such as accuracy or speed. Generally speaking, the higher the accuracy, the larger the threshold; the higher the speed, the smaller the threshold.

[0059] Furthermore, if the maximum similarity is not within the threshold range, it is determined that the label of the data to be tested cannot be predicted, or the label of the data to be tested is determined to be a preset label.

[0060] Thus, by determining the label of the test data based on the label corresponding to the centroid with the highest similarity among multiple centroids of the test data and the sample data, the label prediction accuracy of the test data can be improved.

[0061] Prior to S101, a feature space is trained based on the sample data. In some embodiments, the sample data includes multiple classes of samples, and the method may further include: converting the sample data into a training set with tasks as the basic unit, each task including N classes of samples, each class consisting of K samples, where N is a positive integer greater than or equal to 1, and K is an integer greater than 1; and using a matching network algorithm to train the feature space based on the training set.

[0062] Here, the matching network algorithm can be an existing few-shot learning algorithm.

[0063] Thus, by drawing on matching network algorithms, existing known sample data can be transformed into a training set (N-way, k-shot) with tasks as the basic unit, and a feature space can be constructed. This can effectively utilize labeled data and quickly construct a feature space with relatively good results with only a small amount of labeled data, which helps to improve the efficiency and accuracy of label prediction.

[0064] In some embodiments, the method may further include: performing word segmentation on samples in the training set to obtain word segmentation results; performing transformation processing on at least a portion of samples in the training set based on the word segmentation results to obtain transformation processing results; and optimizing the training set based on the transformation processing results; wherein, training a feature space using a matching network algorithm based on the training set includes: training a feature space using a matching network algorithm based on the optimized training set.

[0065] In this way, by segmenting the samples in the training set, the feature space obtained from the training becomes more accurate, further improving the generalization of the prediction and enabling it to maintain a good performance in unknown data.

[0066] In some embodiments, based on the word segmentation results, at least a portion of the samples in the training set are transformed to obtain the transformation results, including at least one of the following:

[0067] If the word segmentation results contain nouns of a preset type, the nouns of the preset type are mapped based on the first mapping relationship;

[0068] If the word segmentation results contain strings of a preset type, normalize and map the strings of the preset type to the corresponding preset identifiers;

[0069] If there are characters of a preset type in the word segmentation results, the characters of the preset type are mapped based on the second mapping relationship.

[0070] Here, the presupposed nouns can be proper nouns, such as physics, chemistry, biology, etc.

[0071] Here, the default string types include numbers, English letters (including units), and special symbols (parentheses, hyphens, etc.).

[0072] Here, the default type of text can be any text other than strings and proper nouns.

[0073] Here, the first and second mapping relationships can be set or adjusted according to actual conditions such as design requirements. For example, the first mapping relationship is a one-to-one mapping, that is, mapping proper noun 1 to proper noun 1, and mapping proper noun 2 to proper noun 2.

[0074] Here, the second mapping relationship is a many-to-one mapping, that is, mapping strings of the same type to the same identifier.

[0075] Taking the sample data and the test data as test questions as examples, due to the characteristics of the test questions themselves, specific normalization processing will be carried out. The second mapping relationship can be represented by Table 1, which maps numbers to SPEC1, English letters to SPEC2, and special symbols to SPEC3.

[0076] number SPEC1 Numbers appearing in the test questions English SPEC2 English or units of measurement Special symbols SPEC3 Parentheses, horizontal lines, etc. in the test questions

[0077] Table 1

[0078] It is understandable that the normalized identifiers shown in Table 1 can be set or adjusted according to design requirements.

[0079] In this way, mapping pre-defined nouns ensures the professionalism of the recognition, normalizing pre-defined strings improves the generalization of the feature space, and mapping words that cannot be mapped at the character level helps to preserve the integrity of the data to be recognized as much as possible, thereby improving the accuracy of the prediction.

[0080] Figure 2 The flowchart illustrating word segmentation is shown, as follows: Figure 2 As shown, the process includes:

[0081] S201: Obtain the input document;

[0082] S202: Perform word segmentation on the input document;

[0083] S203: Generate word segmentation results;

[0084] S204: Are there any proper nouns in the word segmentation results? If yes, proceed to S208; otherwise, proceed to S205.

[0085] S205: Does the word segmentation result contain numbers? If yes, execute S209; otherwise, execute S206.

[0086] S206: Does the word segmentation result contain English text? If yes, execute S210; otherwise, execute S207.

[0087] S207: Are there any special characters in the word segmentation result? If yes, execute S211; otherwise, execute S212.

[0088] S208: Map proper nouns, then execute S213;

[0089] S209: Map the numbers to the first identifier, such as SPEC1, and then execute S213;

[0090] S210: Map the English text to a second identifier such as SPEC2, and then execute S213;

[0091] S211: Map special symbols to third identifiers such as SPEC3, and then execute S213;

[0092] S212: Perform word mapping, then execute S213;

[0093] S213: Input the converted result.

[0094] Once the input document is mapped, the transformed result is obtained. Label prediction is performed based on the transformed result, or the feature space is trained based on the transformed result.

[0095] Thus, by transforming the input document, the generalization of the feature space can be improved, thereby increasing the accuracy of label prediction.

[0096] It should be understood that Figure 2 The schematic diagrams shown are merely illustrative and not limiting, and are scalable; those skilled in the art can use them as a basis. Figure 2 Even with various obvious changes and / or substitutions to the examples, the resulting technical solutions still fall within the scope of this disclosure.

[0097] In some embodiments, the method may further include: obtaining the annotation labels of the sample data; grouping the sample data based on the annotation labels, mapping the sample data to a feature space, and obtaining the feature vectors of the sample data in the feature space; and determining the feature vector of the center point of each group of sample data in the feature space based on the feature vectors of each group of sample data.

[0098] In this way, we can obtain the feature vector of the center point of each group of sample data, which provides a computational basis for determining the label of the data to be tested.

[0099] In some embodiments, determining the feature vector of the center point of each group of sample data in the feature space includes:

[0100] The eigenvectors of each sample data point in the feature space are weighted and averaged to obtain the eigenvector of the center point of each sample data point in the feature space.

[0101] For example, the labeled data is classified according to the subject and grade level labels of the existing labeled data; the sample data of each category is mapped to the trained feature space to obtain the feature vector of the sample, and the feature vector of the center point is calculated according to formula (1).

[0102] In this way, we can obtain the feature vector of the center point of each group of sample data, which provides a computational basis for subsequently determining the similarity between the test data and multiple center points of the sample data.

[0103] Figure 3 A flowchart illustrating the label prediction process is shown, such as... Figure 3 As shown, the process includes:

[0104] S301: Obtain sample data;

[0105] Here, the sample data can be manually labeled sample data.

[0106] S302: Construct the first training set according to different subjects and grade levels;

[0107] For example, subjects include mathematics, language arts, chemistry, and physics; educational stages include primary school, junior high school, senior high school, and university.

[0108] S303: Map the corresponding data in the sample data;

[0109] Here, the corresponding data in the sample data is mapped, including:

[0110] Map the characters, major names, and strings in the sample data respectively.

[0111] S304: Obtain the second training set;

[0112] S305: Construct the feature space using a matching network algorithm;

[0113] S306: Grouping sample data based on subject and grade level labels;

[0114] S307: Calculate the feature vectors of the center points of each group based on the constructed feature space;

[0115] S308: Obtain the data to be tested;

[0116] S309: Calculate the similarity between the test data and the center points of each group;

[0117] Here, the similarity between the test data and the center points of each group is calculated, including: based on the feature vector of the test data in the feature space and the feature vector of the center points of each group in the feature space, the similarity between the test data and the center points of each group is calculated.

[0118] S310: Does the maximum similarity with the center point meet the threshold? If yes, proceed to S312; otherwise, proceed to S311.

[0119] S311: Determined to be unpredictable;

[0120] S312: Use the subject and grade level labels of the center point with the highest similarity to the data to be tested as the predicted values ​​of the data to be tested.

[0121] In this way, labeled data can be used effectively to quickly construct a feature space with relatively good results with only a small amount of labeled data, while also ensuring the generalization of predictions, so that it can maintain a good effect in unknown data and achieve a relatively good label prediction effect.

[0122] It should be understood that Figure 3 The schematic diagrams shown are merely illustrative and not limiting, and are scalable; those skilled in the art can use them as a basis. Figure 3 Even with various obvious changes and / or substitutions to the examples, the resulting technical solutions still fall within the scope of this disclosure.

[0123] Figure 4 This is a schematic diagram illustrating a use case of the label prediction method provided in the embodiments of this disclosure. See also: Figure 4 The terminals (including terminals 40-1 and 40-2) are equipped with corresponding clients capable of executing different functions. Each client downloads the corresponding target code from the server 600 via network 500. The terminals connect to the server 600 via network 500, which can be a wide area network (WAN), a local area network (LAN), or a combination of both, using a wireless link for data transmission. The software source code can be program code written in one or more programming languages. The software source code may include program files that execute business logic and test software files that test the program entities executing the business logic. The server 600 can extract the code objects to be tested from the test software files. Additionally, the server 600 can also extract a collection of code objects from the program files executing business logic. Before software testing, testers need to analyze each code object in the software code to filter out the code objects to be tested and those not to be tested. Here, a code object refers to a testable functional module in the software. In software code written in different programming languages, code objects can be different types of code entities. For example, in C language software code, a code object can be a function. In Java language software code, a code object can be a class, and in iOS Objective-C, it can be a piece of object code. In C++ language software code, a code object can be a class or a function. This disclosure does not further distinguish the specific type of the code (object code) object.

[0124] Server 600 sends the trained feature space and the predicted label results of the test data to the terminals (terminal 40-1 and / or terminal 40-2) via network 500. As an example, server 600 receives sample data sent by the terminals and transforms the sample data into a training set based on tasks; based on the training set, it trains the feature space using a matching network algorithm. As another example, server 600 maps the test data to the trained feature space to obtain the feature vector of the test data in that feature space; based on the feature vector of the test data in that feature space and the feature vectors of multiple centroids of the sample data in that feature space, it determines the similarity between the test data and the multiple centroids of the sample data; based on the similarity between the test data and the multiple centroids of the sample data, and the corresponding labels of the multiple centroids of the sample data, it predicts the label of the test data.

[0125] In this way, a preliminary version of the label prediction model can be quickly built. This model can obtain some training data with less noise and assist in manually labeling different types of sample data. The trained feature space can be used as a feature vector to optimize the label prediction model. The final online label prediction model uses the feature space as part of the input features, which can improve the precision and recall of label prediction.

[0126] This disclosure also proposes a label prediction device, such as... Figure 5 As shown, the label prediction includes:

[0127] The mapping module 510 is used to map the test data to the trained feature space to obtain the feature vector of the test data in the feature space;

[0128] The first determining module 520 is used to determine the similarity between the test data and the multiple center points of the sample data based on the feature vector of the test data in the feature space and the feature vectors of the multiple center points of the sample data in the feature space.

[0129] The prediction module 530 is used to predict the label of the test data based on the similarity between the test data and multiple centroids of the sample data, and the labels corresponding to the multiple centroids of the sample data.

[0130] In some embodiments, the first determining module 520 is configured to:

[0131] Based on the feature vector of the test data in the feature space and the feature vectors of multiple center points of the sample data in the feature space, the cosine values ​​between the test data and the multiple center points of the sample data are determined.

[0132] The similarity between the test data and multiple centroids of the sample data is determined based on the cosine values ​​between the test data and multiple centroids of the sample data.

[0133] In some embodiments, the prediction module 530 is configured to:

[0134] The maximum similarity is determined based on the similarity between the test data and multiple centroids of the sample data;

[0135] If the maximum similarity is within the threshold range, the label corresponding to the center point with the highest similarity to the test data in the sample data is used as the label of the test data.

[0136] In some embodiments, the sample data includes multiple types of samples, such as Figure 6 As shown, the device may further include:

[0137] The first conversion module 540 is used to convert the sample data into a training set with tasks as the basic unit. Each task includes N classes of samples, and each class of samples consists of K samples, where N is a positive integer greater than or equal to 1 and K is an integer greater than 1.

[0138] Training module 550 is used to train the feature space based on the training set using a matching network algorithm.

[0139] In some embodiments, such as Figure 6 As shown, the device may further include:

[0140] The second conversion module 560 is used to perform word segmentation on the samples in the training set to obtain word segmentation results; based on the word segmentation results, to perform conversion on at least a portion of the samples in the training set to obtain conversion results; and based on the conversion results, to optimize the training set.

[0141] The training module 550 is also used to train the feature space based on the optimized training set using a matching network algorithm.

[0142] In some embodiments, the second conversion module 560 is specifically used for:

[0143] If the word segmentation results contain nouns of a preset type, the nouns of the preset type are mapped based on the first mapping relationship;

[0144] If the word segmentation results contain strings of a preset type, normalize and map the strings of the preset type to the corresponding preset identifiers;

[0145] If there are characters of a preset type in the word segmentation results, the characters of the preset type are mapped based on the second mapping relationship.

[0146] In some embodiments, such as Figure 6 As shown, the device may further include:

[0147] Module 570 is used to acquire the annotation labels of the sample data;

[0148] The second determining module 580 is used to group the sample data based on the labeled data, map each group of sample data to the feature space, and obtain the feature vector of each group of sample data in the feature space.

[0149] The third determining module 590 is used to determine the feature vector of the center point of each set of sample data in the feature space based on the feature vector of each set of sample data in the feature space.

[0150] In some embodiments, the third determining module 590 is configured to:

[0151] The eigenvectors of each sample data point in the feature space are weighted and averaged to obtain the eigenvector of the center point of each sample data point in the feature space.

[0152] In the above scheme, the label includes a first label and a second label, and the first label and the second label are labels of different types.

[0153] Those skilled in the art should understand that the functions of each processing module in the label prediction device of this disclosure embodiment can be understood with reference to the relevant description of the label prediction method described above. Each processing module in the label prediction device of this disclosure embodiment can be implemented by an analog circuit that implements the functions described in the embodiments of this disclosure, or by running software that performs the functions described in the embodiments of this disclosure on an electronic device.

[0154] The label prediction device of this disclosure can ensure the generalization of label prediction and improve the efficiency and accuracy of label prediction.

[0155] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0156] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0157] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0158] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. An input / output (I / O) interface 705 is also connected to bus 704.

[0159] Multiple components in device 700 are connected to I / O interface 705, including: input unit 707, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0160] The computing unit 701 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the tag prediction method. For example, in some embodiments, the tag prediction method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the tag prediction method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the label prediction method by any other suitable means (e.g., by means of firmware).

[0161] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0162] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0165] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0166] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0167] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0168] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for predicting educational resource labels, comprising: The sample test data is transformed into a training set with tasks as the basic unit. Each task includes N classes of samples, and each class consists of K samples, where N is a positive integer greater than or equal to 1 and K is an integer greater than 1. Based on the training set, a feature space is obtained by training a matching network algorithm; wherein, the step of obtaining the feature space by training the training set using a matching network algorithm includes: performing word segmentation on the samples in the training set; if the word segmentation results contain nouns of a preset type, mapping the nouns of the preset type based on a first mapping relationship, wherein the nouns of the preset type include subject-specific terms; if the word segmentation results contain strings of a preset type, normalizing and mapping the strings of the preset type to corresponding preset identifiers, wherein the preset identifiers include different preset identifiers corresponding to numbers, English letters or units of measurement, and special symbols, wherein English letters include English characters and / or units of measurement; for word segmentation results that do not match the first mapping relationship and do not belong to the preset type, mapping is performed at the character level based on a second mapping relationship; in the word segmentation... In the case where there are characters of a preset type, the preset type characters are mapped based on the second mapping relationship. The preset type characters are characters other than nouns and strings of the preset type. An optimized training set is obtained. Based on the optimized training set, a matching network algorithm is used to train and obtain a feature space. The subject labels and grade level labels of the sample test data are obtained, and the sample test data are grouped based on the combination of the subject labels and grade level labels to obtain multiple groups. Each group corresponds to a unique combination of subject labels and grade level labels. The sample test data in each group are mapped to the feature space to obtain the feature vector set of each group in the feature space. Based on the feature vector set of each group, the mean of the feature vectors of that group is calculated as the feature vector of the center point of that group in the feature space. The test question data is mapped to the trained feature space to obtain the feature vector of the test question data in the feature space; Based on the feature vectors of the test question data in the feature space and the feature vectors of multiple centroids of the sample test question data in the feature space, the similarity between the test question data and the multiple centroids of the sample test question data is determined. Based on the similarity between the test question data and the plurality of centroids of the sample test question data, and the subject labels and grade level labels corresponding to the plurality of centroids of the sample test question data, the subject labels and grade level labels of the test question data are predicted.

2. The method according to claim 1, wherein, The step of determining the similarity between the test question data and the multiple centroids of the sample test question data in the feature space, based on the feature vectors of the test question data in the feature space and the feature vectors of the multiple centroids of the sample test question data in the feature space, includes: Based on the feature vectors of the test question data in the feature space and the feature vectors of multiple center points of the sample test question data in the feature space, the cosine values ​​between the test question data and the multiple center points of the sample test question data are determined. Based on the cosine values ​​between the test question data and the plurality of centroids of the sample test question data, the similarity between the test question data and the plurality of centroids of the sample test question data is determined.

3. The method according to claim 1, wherein, The method of predicting the subject label and grade level label of the test question data based on the similarity between the test question data and the plurality of centroids of the sample test question data, and the subject label and grade level label corresponding to the plurality of centroids of the sample test question data, includes: The maximum similarity is determined based on the similarity between the test question data and the multiple centroids of the sample test question data; If the maximum similarity is within the threshold range, the subject label and grade level label corresponding to the center point with the highest similarity to the test question data in the sample test question data are used as the subject label and grade level label of the test question data.

4. A tag prediction device, comprising: The first conversion module is used to convert the sample test data into a training set with tasks as the basic unit. Each task includes N classes of samples, and each class of samples consists of K samples, where N is a positive integer greater than or equal to 1 and K is an integer greater than 1. The training module is used to train a feature space based on the training set using a matching network algorithm; The training module is specifically used for: performing word segmentation on the samples in the training set; and, if the word segmentation results contain nouns of a preset type, performing mapping on the nouns of the preset type based on a first mapping relationship, wherein the nouns of the preset type include subject-specific terms. If the word segmentation results contain strings of a preset type, the strings of the preset type are normalized and mapped to corresponding preset identifiers. The preset identifiers include different preset identifiers corresponding to numbers, English letters or units of measurement, and special symbols. The English letters include English characters and / or units of measurement. For word segmentation results that do not match the first mapping relationship and do not belong to the preset type, they are mapped at the character level based on the second mapping relationship. If the word segmentation results contain characters of a preset type, the preset type characters are mapped based on the second mapping relationship. The preset type characters are characters other than nouns and strings of the preset type. The optimized training set is obtained; Based on the optimized training set, a feature space is obtained by training a matching network algorithm. Obtain the subject labels and grade level labels of the sample test data, and group the sample test data based on the combination of the subject labels and grade level labels to obtain multiple groups. Each group corresponds to a unique combination of subject labels and grade level labels. Map the sample test data in each group to the feature space to obtain the feature vector set of each group in the feature space. Calculate the mean of the feature vectors of each group based on the feature vector set of each group, and use it as the feature vector of the center point of the group in the feature space. The mapping module is used to map the test question data to the trained feature space to obtain the feature vector of the test question data in the feature space. The first determining module is used to determine the similarity between the test question data and the multiple centroids of the sample test question data in the feature space based on the feature vector of the test question data in the feature space and the feature vectors of the multiple centroids of the sample test question data in the feature space respectively. The prediction module is used to predict the subject label and grade level label of the test question data based on the similarity between the test question data and the plurality of centroids of the sample test question data, and the subject label and grade level label corresponding to the plurality of centroids of the sample test question data.

5. The apparatus according to claim 4, wherein, The first determining module is used for: Based on the feature vectors of the test question data in the feature space and the feature vectors of multiple center points of the sample test question data in the feature space, the cosine values ​​between the test question data and the multiple center points of the sample test question data are determined. Based on the cosine values ​​between the test question data and the plurality of centroids of the sample test question data, the similarity between the test question data and the plurality of centroids of the sample test question data is determined.

6. The apparatus according to claim 4, wherein, The prediction module is used for: The maximum similarity is determined based on the similarity between the test question data and the multiple centroids of the sample test question data; If the maximum similarity is within the threshold range, the subject label and grade level label corresponding to the center point with the highest similarity to the test question data in the sample test question data are used as the subject label and grade level label of the test question data.

7. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 3.

8. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 3.

9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Question reply recommendation method and device, computer equipment and storage medium

    CN112597292A

  • Zero-small sample machine learning method and system for fusing image and text description thereof

    CN112801159A