Semantic model training method and device, semantic library establishing method and device and electronic equipment
Through semantic model training methods, decomposing and fusing the sub-feature set of training data, the problem that wireless operation and maintenance specialists find it difficult to quickly master operation and maintenance skills is solved, the model's understanding and generalization ability is improved, and the problem of large-scale model hallucination is reduced.
Patent Information
- Application Number
- CN202411706875.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology cannot quickly help wireless operation and maintenance specialists master complex operation and maintenance skills, and the knowledge retrieval system cannot answer based on user questions. It can only search for relevant knowledge based on search terms, making it difficult to retrieve the expected professional knowledge.
A semantic model training method is proposed. By obtaining training data, decompose it into a set of sub-features at multiple levels, and randomly fusion is performed to generate target training samples, train the semantic model, and add a vector transformation device to generate a third semantic model.
It realizes the transmission and fusion of cross-level information, improves the model's understanding of the internal structure and correlation of data, reduces the problem of hallucinations of large models, and adapts to situations where training samples are small.
Smart Images

Figure CN119621871A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of wireless professional and artificial intelligence technology, and in particular to a method, device, and electronic device for semantic model training and semantic library establishment. Background Art
[0002] As the scale of communication networks continues to grow, network management and operation and maintenance have become extremely complex, and professional knowledge is also being updated and iterated. The daily work of wireless operation and maintenance has increasingly higher requirements on the personal skills of professional technicians, and wireless operation and maintenance specialists are unable to quickly master various operation and maintenance skills. At present, operation and maintenance specialists generally obtain the desired wireless operation and maintenance knowledge based on personal computers, personal brains, and various information technology (IT) systems. In current technology, enterprises will build a shared knowledge base or use knowledge graph technology to support the retrieval of professional knowledge through keyword, subject word, etc. search, but cannot answer questions based on users' questions. It can only search for knowledge containing the search terms based on the user's search terms, and it is difficult to retrieve the expected professional knowledge. At the same time, compared with the experience knowledge on personal computers, it cannot be retrieved. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0004] To this end, the first objective of the present disclosure is to propose a semantic model training method.
[0005] The second objective of the present disclosure is to propose a method for establishing a semantic library.
[0006] The third objective of the present disclosure is to provide a semantic model training device.
[0007] The fourth objective of the present disclosure is to provide a semantic library building device.
[0008] A fifth objective of the present disclosure is to provide an electronic device.
[0009] A sixth object of the present disclosure is to provide a non-transitory computer-readable storage medium.
[0010] A seventh objective of the present disclosure is to provide a computer program product.
[0011] To achieve the above-mentioned purpose, the first aspect of the present disclosure proposes a semantic model training method, including: obtaining training data and a first semantic model; decomposing the training data to generate multiple levels of sub-feature sets, each sub-feature set including at least one sub-feature of the corresponding level; randomly selecting at least two sub-feature sets, and fusing the sub-features in the sub-feature sets to generate a target training sample; training the first semantic model based on the target training sample to generate a second semantic model; adding a vector conversion device to the second semantic model to generate a third semantic model.
[0012] According to one embodiment of the present disclosure, the decomposing the training data to generate a plurality of levels of sub-feature sets includes: inputting the training data into a convolutional neural network model; outputting at least two sub-features of different scales based on different levels of the convolutional neural network model; and generating the sub-feature set based on sub-features of the same scale.
[0013] According to one embodiment of the present disclosure, the randomly selecting at least two sub-feature sets and fusing the sub-features in the sub-feature sets to generate a target training sample includes: for any selected sub-feature set, randomly acquiring at least one sub-feature in the sub-feature set; fusing all the acquired sub-features according to a preset fusion method to generate a target training sample.
[0014] According to one embodiment of the present disclosure, the preset fusion method includes at least one of weighted averaging, concatenation, and element-by-element multiplication.
[0015] According to one embodiment of the present disclosure, the vector conversion device is used to convert the input data and output data of the third semantic model into semantic vectors.
[0016] To achieve the above-mentioned purpose, the second aspect embodiment of the present disclosure proposes a method for establishing a semantic library, including: obtaining data to be identified; inputting the data to be identified into a third semantic model to output a first semantic vector corresponding to the data to be identified and a second semantic vector corresponding to the recognition result, wherein the third semantic model is obtained by training the semantic model as described in the first aspect embodiment; and binding the first semantic vector and the second semantic vector and updating them to the semantic library.
[0017] To achieve the above-mentioned purpose, the third aspect embodiment of the present disclosure proposes a semantic model training device, including: an acquisition module, used to acquire training data and a first semantic model; a decomposition module, used to decompose the training data to generate multiple levels of sub-feature sets, each sub-feature set includes at least one sub-feature of the corresponding level; a merging module, used to randomly select at least two sub-feature sets, and fuse the sub-features in the sub-feature sets to generate a target training sample; a training module, used to train the first semantic model based on the target training sample to generate a second semantic model; a conversion module, used to add a vector conversion device to the second semantic model to generate a third semantic model.
[0018] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present disclosure proposes a semantic library establishment device, including: a receiving module, used to obtain data to be identified; an identification module, used to input the data to be identified into a third semantic model to output a first semantic vector corresponding to the data to be identified and a second semantic vector corresponding to the identification result, wherein the third semantic model is trained by the semantic model training method described in the first aspect embodiment; an updating module, used to update the first semantic vector and the second semantic vector into the semantic library after binding them.
[0019] To achieve the above-mentioned purpose, the fifth aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the semantic model training method as described in the first aspect embodiment of the present disclosure, or the semantic library establishment method as described in the second aspect embodiment.
[0020] To achieve the above-mentioned purpose, the sixth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the semantic model training method as described in the first aspect embodiment of the present disclosure, or the semantic library establishment method as described in the second aspect embodiment.
[0021] To achieve the above-mentioned purpose, the seventh aspect embodiment of the present disclosure proposes a computer program product, including a computer program, which, when executed by a processor, is used to implement the semantic model training method as described in the first aspect embodiment of the present disclosure, or the semantic library establishment method as described in the second aspect embodiment.
[0022] Therefore, by generating sub-feature sets at multiple levels and fusing them to generate target training samples, the transmission and fusion of cross-level information is achieved. The model can better understand the intrinsic structure and correlation of the data, thereby improving its performance and generalization ability. At the same time, by vectorizing the model output, the problem and the corresponding vector representation are stored in the database, which reduces the hallucination problem of large models and can adapt to situations where the training samples are small. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a schematic diagram of a semantic model training method according to an embodiment of the present disclosure;
[0024] Figure 2 is a schematic diagram of a low-rank adaptation method in the current technology in one embodiment of the present disclosure;
[0025] Figure 3 It is a schematic diagram of a low-rank adaptation method proposed in the present disclosure in one embodiment of the present disclosure;
[0026] Figure 4 is a schematic diagram of an end-to-end deep learning method in the current technology in one embodiment of the present disclosure;
[0027] Figure 5 is a schematic diagram of an end-to-end deep learning method proposed by the present disclosure in one embodiment of the present disclosure;
[0028] Figure 6 is a schematic diagram of a Transformer encoder according to an embodiment of the present disclosure;
[0029] Figure 7 is a schematic diagram of a feature fusion module according to an embodiment of the present disclosure;
[0030] Figure 8 is a schematic diagram of a semantic library establishment method according to an embodiment of the present disclosure;
[0031] Fig. 9 is a schematic diagram of a semantic model training device according to one embodiment of the present disclosure;
[0032] Fig.10 is a schematic diagram of a semantic library building device according to one embodiment of the present disclosure;
[0033] Fig.11 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0035] The acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of relevant laws and regulations.
[0036] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0037] Figure 1 is a schematic diagram of a semantic model training method according to an embodiment of the present disclosure, such as Figure 1 As shown, the semantic model training method includes the following steps:
[0038] S101, obtaining training data and a first semantic model.
[0039] The semantic model training method of the embodiment of the present application can be applied to the scenario of large language model training in the professional field of wireless operation and maintenance. The executor of the semantic model training of the embodiment of the present application can be the semantic model training device of the embodiment of the present application, and the semantic model training device can be set on an electronic device.
[0040] It should be noted that the first language model in the embodiment of the present disclosure is an untrained initial model, and the first language model can be of various types without any limitation herein. For example, the first language model can be a natural language model.
[0041] In the embodiments of the present disclosure, the training data may be manually created, or may be created based on the historical operating data of the scenario in which the current model needs to be implemented.
[0042] Optionally, the challenge of pre-training deep learning models under large-scale datasets is solved by utilizing open source public datasets and specially collected network operation and maintenance datasets for data cleaning and annotation.
[0043] S102, decomposing the training data to generate sub-feature sets at multiple levels, each sub-feature set including at least one sub-feature at a corresponding level.
[0044] It should be noted that the hierarchical features in the embodiments of the present disclosure refer to data features extracted layer by layer through a multi-layer neural network. Each layer of the network will extract features at different levels of the input data, and the next layer of the network will continue to extract deeper features based on the features extracted in the previous layer. Such a hierarchical structure can help the model understand the complex patterns of the data, because each layer can focus on learning features of a specific scale or level.
[0045] For example, in an image recognition task, the first layer might learn basic features such as edges and colors, the second layer might combine these basic features to recognize shapes and textures, the third layer might further combine these features to recognize larger object parts, and so on, until the last layer can recognize complete objects.
[0046] It should be noted that the levels of different features are designed in advance, and different levels of the same level may exist.
[0047] In the embodiments of the present disclosure, there may be multiple methods for decomposing the training data, and no limitation is made here.
[0048] In one possible implementation, the training data may be processed by a decomposition model, where the decomposition model is trained in advance and stored in a storage space of an electronic device for easy retrieval when needed.
[0049] S103, randomly selecting at least two sub-feature sets, and fusing the sub-features in the sub-feature sets to generate target training samples.
[0050] In the disclosed embodiment, one sub-feature in a sub-feature set may be selected for fusion, or multiple sub-features in a feature set may be selected for fusion with features in other sub-feature sets.
[0051] The fusion method may be various and is not limited here. In one possible implementation, the sub-features in the sub-feature set may be calculated based on a preset fusion algorithm to obtain a target training sample. In actual operation, the fusion algorithm may be changed according to actual design requirements.
[0052] S104: Train the first semantic model based on the target training sample to generate a second semantic model.
[0053] It can be understood that model training is an iterative process, which is carried out by continuously adjusting the network parameters of the model until the overall loss function value of the model is less than the preset value, or the overall loss function value of the model no longer changes or changes slowly, the model converges, and a trained model is obtained.
[0054] S105, adding a vector conversion device to the second semantic model to generate a third semantic model.
[0055] In current technology, trained models may experience hallucination problems. Model hallucination refers to the phenomenon that when using large-scale pre-trained models, such as the Generative Pre-trained Transformer (GPT) model series, the Bidirectional Encoder Representations from Transformers (BERT) model, etc. for generation tasks, the model may produce some seemingly reasonable but actually wrong or fictitious information. This phenomenon is sometimes also called "factual errors", "fictitious facts" or "hallucinations". There are many reasons for model hallucinations, for example, they may include the following reasons:
[0056] 1. Data bias: The learning of pre-trained models relies on a large amount of Internet text data. If the data itself is biased or wrong, the model may learn this wrong information and reproduce it during generation.
[0057] 2. Overfitting: Although large models have strong generalization capabilities, overfitting may still occur if there is insufficient training data or the model is too complex, causing the model to produce statements that are not in line with reality when generating.
[0058] 3. Statistical regularities rather than causal relationships: Large models are good at capturing statistical regularities in text, but this does not mean that they understand the causal relationships behind them. Therefore, the model may generate facts that conform to grammatical and syntactic rules but are meaningless or wrong.
[0059] 4. Lack of common sense and world knowledge: Although large models can learn a lot of surface-level knowledge through massive data, they lack the common sense and world knowledge that humans have, which may cause the model to be unable to correctly judge the authenticity of information when it is generated.
[0060] The present disclosure proposes that by adding a vector conversion device, the output result of the model can be vectorized, thereby reducing the large model hallucination problem.
[0061] In the disclosed embodiment, training data and a first semantic model are first obtained, and then the training data is decomposed to generate sub-feature sets of multiple levels, each sub-feature set includes at least one sub-feature of the corresponding level, and then at least two sub-feature sets are randomly selected, and the sub-features in the sub-feature sets are fused to generate a target training sample, and then the first semantic model is trained based on the target training sample to generate a second semantic model, and finally a vector conversion device is added to the second semantic model to generate a third semantic model. Thus, by generating sub-feature sets of multiple levels and fusing them to generate target training samples, the transmission and fusion of cross-level information is achieved, and the model can better understand the intrinsic structure and correlation of the data, thereby improving its performance and generalization ability. At the same time, by vectorizing the model output, the problem and the corresponding vector representation are stored in the database, reducing the large model hallucination problem, and can adapt to the situation where the training sample is small.
[0062] By generating sub-feature sets at multiple levels and fusing them to generate target training samples, the transmission and fusion of cross-level information is achieved. The model can better understand the intrinsic structure and correlation of the data, thereby improving its performance and generalization ability. At the same time, by vectorizing the model output, the problem and the corresponding vector representation are stored in the database, which reduces the hallucination problem of large models and can adapt to situations where the training samples are small.
[0063] In the embodiment of the present disclosure, the vector conversion device is used to convert the input data and output data of the third semantic model into semantic vectors.
[0064] In the embodiments of the present disclosure, multiple graphics processing units (GPUs) and mixed precision technology may be used: distributed training is performed using multiple GPUs and mixed precision technology to improve training speed and efficiency while meeting the needs of large-scale data sets.
[0065] Incremental pre-training is to adapt and learn based on the data in the vertical field on the basis of the existing large model. This should be noted to be different from the fine-tuning task. The task is the same as the pre-training task during training. Model fine-tuning mode: Model fine-tuning mainly uses model quantization + parameter-efficient fine-tuning (PEFT) technology to fine-tune the base model. In order to fully consider the impact of hardware resources, the model is quantized in the training and reasoning stages, including fp16 half-precision training, int8, int4 and other quantization strategies. Without destroying the original structure of the model, the model is fine-tuned using PEFT technology such as low-rank adaptation (LoRA) and prompt tuning (P-Tuning).
[0066] LoRA is a low-rank adaptation method that indirectly trains some dense layers in the neural network by optimizing the rank decomposition matrix of the dense layer during the adaptation process. Compared with directly training all parameters, LoRA uses a smaller low-rank matrix, making training more efficient and reducing hardware requirements. The advantages of LoRA include:
[0067] Pre-trained models can be shared and used to build many small LoRA modules to handle different tasks. By freezing the shared model and efficiently switching tasks by replacing matrices A and B in the graph, storage requirements and task switching overhead are reduced. Since there is no need to calculate the gradients of most parameters or maintain optimizer state, LoRA makes training more efficient, reducing the hardware threshold by up to 3 times when using adaptive optimizers. Only the injected smaller low-rank matrices are optimized. At deployment time, the simple linear design allows the trainable matrix to be merged with the frozen weights, thus not introducing any inference delay compared to a fully fine-tuned model. LoRA is orthogonal to many previous methods and can be used in conjunction with many of them, such as prefix tuning.
[0068] In summary, LoRA is an efficient model adaptation method with advantages such as high storage and computation efficiency, low overhead, and easy deployment.
[0069] However, since the training process only trains the reduced-dimensional matrix A and the increased-dimensional matrix B, and the training parameters are few, the model after training may be underfitted. Figure 2 shown.
[0070] In the disclosed embodiment, in order to solve this problem, this proposal proposes a new LoRa construction scheme, and proposes an improved LoRa construction scheme. The construction scheme can be as follows:
[0071] (1) Stacking multiple dimensionality reduction matrices and dimensionality increase matrices: In this scheme, multiple dimensionality reduction matrices are used to reduce the feature dimensions, and then the corresponding dimensionality increase matrices are used to remap the features to the original dimensions. This stacking method can achieve flexible control of the number of model parameters.
[0072] (2) Keep the number of training parameters much smaller than the pre-trained model: Although the number of training parameters of the model is increased by stacking the reduced-dimensional matrix and the increased-dimensional matrix, it is still kept much lower than the number of parameters of the original pre-trained model. This helps to avoid overfitting and improve the generalization ability of the model.
[0073] (3) Increased and controllable training parameters: The new construction scheme effectively increases the training parameters of the LoRa model, giving it stronger learning and representation capabilities. At the same time, through the reasonable design of the stacking structure, the increase in the number of parameters is controllable, which is conducive to the management and optimization of the model.
[0074] (4) Effectively improve the effect and quality of LoRa fine-tuning: By increasing the number of model training parameters, the effect and quality of the LoRa model in fine-tuning tasks are improved, making it more suitable for complex practical application scenarios, thereby improving the overall performance and competitiveness of LoRa technology.
[0075] The improved LoRa fine-tuning flowchart is as follows Figure 3 shown.
[0076] In the above embodiment, the training data is decomposed to generate sub-feature sets of multiple levels. The training data can be first input into a convolutional neural network model, and then at least two sub-features of different scales are output based on different levels of the convolutional neural network model, and finally a sub-feature set is generated based on sub-features of the same scale.
[0077] It should be noted that the traditional end-to-end deep learning method can be Figure 4 As shown in Figure 1, only the features from the last layer are used as recognition features in the end-to-end network. These features are usually more general features, and hierarchical features are not used. To overcome this limitation, multi-scale feature fusion can be introduced. The convolutional neural network model of the present disclosure is shown in Figure 1. Figure 5 As shown in Figure 2, this method achieves multi-scale feature fusion through the following steps:
[0078] 1. Multi-level feature extraction: First, by stacking multiple Transformer encoder layers on the input data, each layer can extract feature representations at different levels. These feature representations can capture different levels of abstraction of the input data, from low-level local features to high-level global features.
[0079] Transformer encoder is a powerful neural network structure that can effectively learn the feature representation in the input data. Its structure diagram is as follows Figure 6 As shown. By stacking multiple Transformer encoder layers on the input data, deeper feature extraction can be achieved to capture the diversity and complexity of the data. Each Transformer encoder layer has unique feature extraction capabilities and can model the input data from different perspectives. This multi-level feature extraction method enables the model to gradually learn abstract representations of the data, transitioning from local features to global features. By extracting features layer by layer, the model can better understand the intrinsic structure and correlation of the data, thereby improving its performance and generalization ability. This end-to-end learning method makes the model more flexible and generalizable, and can adapt to different types of data and task requirements.
[0080] 2. Scale feature fusion: In deep learning models, scale feature fusion is a key technology that can effectively integrate feature representations from different levels, thereby improving the representation ability and generalization performance of the model. This proposal introduces feature fusion modules of multiple scales, each of which undertakes the important task of fusing feature representations at different levels.
[0081] Feature fusion module such as Figure 7 As shown in the figure, the feature fusion module of each scale contains a series of key components, including adaptive attention layer, residual connection, layer normalization operation and feedforward neural network. The adaptive attention layer can help the model dynamically adjust the importance of different features, so as to better capture the key information in the data. The residual connection helps to alleviate the gradient vanishing problem, so that the model can learn feature representation more deeply. At the same time, the layer normalization operation can improve the training stability and convergence speed of the model, thereby accelerating the learning process of the model. The feedforward neural network can further process the feature representation, promote the information interaction and fusion between features at different levels, better integrate the feature representations from different scales, and improve the model's ability to understand and represent data.
[0082] 3. Cross-level information transmission: In this proposed model, cross-level information transmission is a key technology that aims to promote information transmission and interaction between features at different levels, thereby enhancing the model's ability to understand the overall structure of the input data. Introducing lateral connections between multiple Transformer encoder layers is an effective method. Through this connection mechanism, low-level feature representations can directly affect higher-level feature generation with high-level features, thus achieving cross-level information transmission and fusion.
[0083] By introducing lateral connections into the model, more flexibility and representation capabilities are provided, allowing the model to more comprehensively capture key information and patterns in the data. The model can establish effective information transfer paths between different levels, thereby achieving effective fusion and integration of features. This cross-level information transfer mechanism helps the model better understand the overall structure of the input data and improve the model's generalization ability and performance.
[0084] In the above embodiment, at least two sub-feature sets are randomly selected, and the sub-features in the sub-feature sets are fused to generate a target training sample. First, for any selected sub-feature set, at least one sub-feature in the sub-feature set is randomly obtained, and then all the obtained sub-features are fused according to a preset fusion method to generate a target training sample.
[0085] It should be noted that the preset fusion method includes at least one of weighted averaging, concatenation, and element-by-element multiplication.
[0086] Figure 8 is a schematic diagram of a semantic library establishment method according to an embodiment of the present disclosure. Figure 8 As shown, the semantic library establishment method includes the following steps:
[0087] S801, obtaining data to be identified.
[0088] S802: Input the data to be recognized into the third semantic model to output a first semantic vector corresponding to the data to be recognized and a second semantic vector corresponding to the recognition result.
[0089] It should be noted that the third semantic model in the embodiment of the present disclosure is as follows Figure 1 The semantic model shown is obtained by training.
[0090] It should be noted that in the embodiment of the present disclosure, the input to the third semantic model may be a vector of the data to be identified, or may be the data to be identified itself. No limitation is made here, and it may be determined according to the actually trained third semantic model.
[0091] S803: Bind the first semantic vector and the second semantic vector and update them into the semantic library.
[0092] In the disclosed embodiment, the data to be identified is first obtained, and then the data to be identified is input into the third semantic model to output a first semantic vector corresponding to the data to be identified and a second semantic vector corresponding to the identification result, and finally the first semantic vector and the second semantic vector are bound and updated to the semantic library. Thus, by establishing a semantic library through semantic vectors, the model can better understand the semantic information behind the data by converting the data to be identified into semantic vectors, which is very helpful for tasks that rely on in-depth semantic understanding, such as sentiment analysis, topic modeling, and question-answering systems.
[0093] In order to achieve efficient vector retrieval, indexing technology such as Faiss or Annoy can be used in the semantic library to build a fast vector index structure, which can speed up the retrieval speed and improve the search performance of the semantic library.
[0094] When a user asks a question, the question is also converted into a vector representation, and the question vector most similar to the user's question is retrieved in the semantic library. In this step, cosine similarity or other similarity measurement methods can be used to calculate the similarity between questions to find the most matching question.
[0095] Based on the most similar question vector retrieved, the corresponding answer can be found and returned to the user. This process can be done by simply looking up the answer corresponding to the question vector, or by further generative methods to generate more detailed and complex answers.
[0096] In one possible implementation, the semantic database can also be evaluated and tuned. A series of evaluation indicators are used to evaluate the performance of the semantic database, such as accuracy, recall, response time, etc. Based on the evaluation results, the semantic database is tuned to optimize the retrieval algorithm, improve the vector representation, or adjust the database structure to improve the system performance and user experience.
[0097] The use of semantic libraries can help achieve efficient information retrieval and answer generation functions. Through the reasonable design of data sets, feature extraction, semantic library construction and system evaluation, a powerful knowledge question-answering system is built to provide users with accurate and timely answers to meet their information needs.
[0098] Corresponding to the semantic model training methods provided in the above-mentioned embodiments, an embodiment of the present disclosure also provides a semantic model training device. Since the semantic model training device provided in the embodiment of the present disclosure corresponds to the semantic model training methods provided in the above-mentioned embodiments, the implementation methods of the above-mentioned semantic model training methods are also applicable to the semantic model training device provided in the embodiment of the present disclosure and will not be described in detail in the following embodiments.
[0099] Fig. 9 is a schematic diagram of a semantic model training device according to an embodiment of the present disclosure. Fig. 9 As shown, the semantic model training device 900 includes: an acquisition module 910, a decomposition module 920, a merging module 930, a training module 940 and a conversion module 950.
[0100] The acquisition module 910 is used to acquire training data and a first semantic model.
[0101] The decomposition module 920 is used to decompose the training data to generate sub-feature sets at multiple levels, each of which includes at least one sub-feature at a corresponding level.
[0102] The merging module 930 is used to randomly select at least two sub-feature sets and fuse the sub-features in the sub-feature sets to generate a target training sample.
[0103] The training module 940 is used to train the first semantic model based on the target training sample to generate a second semantic model.
[0104] The conversion module 950 is used to add a vector conversion device to the second semantic model to generate a third semantic model.
[0105] In one embodiment of the present disclosure, training data is decomposed to generate sub-feature sets at multiple levels, including: inputting the training data into a convolutional neural network model; outputting at least two sub-features of different scales based on different levels of the convolutional neural network model; and generating a sub-feature set based on sub-features of the same scale.
[0106] In one embodiment of the present disclosure, at least two sub-feature sets are randomly selected, and the sub-features in the sub-feature sets are fused to generate a target training sample, including: for any selected sub-feature set, at least one sub-feature in the sub-feature set is randomly acquired; all the acquired sub-features are fused according to a preset fusion method to generate a target training sample.
[0107] In one embodiment of the present disclosure, the preset fusion method includes at least one of weighted averaging, concatenation, and element-by-element multiplication.
[0108] In one embodiment of the present disclosure, the vector conversion device is used to convert the input data and output data of the third semantic model into semantic vectors.
[0109] Therefore, by generating sub-feature sets at multiple levels and fusing them to generate target training samples, the transmission and fusion of cross-level information is achieved. The model can better understand the intrinsic structure and correlation of the data, thereby improving its performance and generalization ability. At the same time, by vectorizing the model output, the problem and the corresponding vector representation are stored in the database, which reduces the hallucination problem of large models and can adapt to situations where the training samples are small.
[0110] Fig.10 is a schematic diagram of a semantic library building device according to an embodiment of the present disclosure. Fig.10 As shown, the semantic library establishing device 1000 includes: a receiving module 1010 , a recognition module 1020 , and an updating module 1030 .
[0111] The receiving module 1010 is used to obtain data to be identified.
[0112] The recognition module 1020 is used to input the data to be recognized into the third semantic model to output a first semantic vector corresponding to the data to be recognized and a second semantic vector corresponding to the recognition result.
[0113] The updating module 1030 is used to update the first semantic vector and the second semantic vector into the semantic library after binding them.
[0114] It should be noted that the third semantic model in the embodiment of the present disclosure is as follows Figure 1 The semantic model shown is obtained by training.
[0115] Therefore, by building a semantic library through semantic vectors, the model can better understand the semantic information behind the data by converting the data to be identified into semantic vectors. This is very helpful for tasks that rely on in-depth semantic understanding, such as sentiment analysis, topic modeling, and question-answering systems.
[0116] In order to implement the above embodiment, the present disclosure further provides an electronic device 1100, Fig.11 is a schematic diagram of an electronic device according to an embodiment of the present disclosure, such as Fig.11 As shown, the electronic device 1100 includes: a processor 1101 and a memory 1102 connected to the processor in communication, the memory 1102 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 1101 to implement the present disclosure. Figure 1-Figure 7 The semantic model training method of the embodiment, or Figure 8 A method for establishing a semantic library according to an embodiment.
[0117] In order to implement the above embodiments, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to implement the above embodiments. Figure 1-Figure 7 The semantic model training method of the embodiment, or Figure 8 A method for establishing a semantic library according to an embodiment.
[0118] In order to implement the above embodiments, the present disclosure also provides a computer program product, including a computer program. When the computer program is executed by a processor, the computer program implements the above embodiments. Figure 1-Figure 7The semantic model training method of the embodiment, or Figure 8 A method for establishing a semantic library according to an embodiment.
[0119] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0120] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0121] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0122] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0123] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0124] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that contains, stores, communicates, propagates or transmits a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0125] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0126] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0127] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0128] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A semantic model training method, characterized in that: include: Obtaining training data and a first semantic model; Decomposing the training data to generate sub-feature sets at multiple levels, each sub-feature set including at least one sub-feature at a corresponding level; Randomly selecting at least two sub-feature sets, and fusing the sub-features in the sub-feature sets to generate target training samples; Training the first semantic model based on the target training sample to generate a second semantic model; A vector conversion device is added to the second semantic model to generate a third semantic model.
2. The method according to claim 1, characterized in that The training data is decomposed to generate sub-feature sets at multiple levels, including: Inputting the training data into a convolutional neural network model; Outputting at least two sub-features of different scales based on different levels of the convolutional neural network model; The sub-feature set is generated based on sub-features of the same scale.
3. The method according to claim 2, characterized in that The randomly selecting at least two sub-feature sets and fusing the sub-features in the sub-feature sets to generate target training samples includes: For any selected sub-feature set, randomly obtain at least one sub-feature in the sub-feature set; All acquired sub-features are fused according to the preset fusion method to generate target training samples.
4. The method according to claim 3, characterized in that: The preset fusion method includes at least one of weighted averaging, concatenation, and element-by-element multiplication.
5. The method according to claim 1, characterized in that The vector conversion device is used to convert the input data and output data of the third semantic model into semantic vectors.
6. A method for establishing a semantic library, characterized in that: include: Obtaining data to be identified; Inputting the data to be recognized into a third semantic model to output a first semantic vector corresponding to the data to be recognized and a second semantic vector corresponding to the recognition result, wherein the third semantic model is obtained by the semantic model training according to any one of claims 1 to 5; The first semantic vector and the second semantic vector are bound and updated into a semantic library.
7. A semantic model training device, characterized in that: include: An acquisition module, used for acquiring training data and a first semantic model; A decomposition module, used for decomposing the training data to generate sub-feature sets of multiple levels, each sub-feature set including at least one sub-feature of a corresponding level; A merging module, used for randomly selecting at least two sub-feature sets, and fusing the sub-features in the sub-feature sets to generate a target training sample; A training module, configured to train the first semantic model based on the target training sample to generate a second semantic model; A conversion module is used to add a vector conversion device to the second semantic model to generate a third semantic model.
8. A semantic library building device, characterized in that: include: A receiving module, used for acquiring data to be identified; A recognition module, used for inputting the data to be recognized into a third semantic model to output a first semantic vector corresponding to the data to be recognized and a second semantic vector corresponding to the recognition result, wherein the third semantic model is trained by the semantic model training method according to any one of claims 1 to 5; An updating module is used to update the first semantic vector and the second semantic vector into a semantic library after binding them.
9. An electronic device, characterized in that: Including memory. processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the semantic model training method as described in any one of claims 1 to 5, or the semantic library establishment method as described in claim 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the semantic model training method as described in any one of claims 1 to 5, or the semantic library establishment method as described in claim 6.