Information classification method and device, electronic equipment and computer readable storage medium
Through the multiple inputs and multi-model fusion of pre-trained information classification models and the construction of sample data in combination with the industry division system, the problem of insufficient information classification accuracy and privacy protection in the existing technology is solved, and efficient and accurate information classification is achieved.
Patent Information
- Application Number
- CN202410027252.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-04
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, information classification methods require a large amount of manual annotation of data, and deep learning models have limited processing capabilities for complex and variable data sets, and insufficient privacy protection and security, resulting in personal privacy leakage or other security issues.
The multiple input and multi-model fusion method of pre-trained information classification model are adopted to construct sample data through the industry division system, and the differences in multiple pre-trained information classification models are used to comprehensively utilize their advantages to improve the accuracy of information classification and protect data privacy.
It reduces the probability of the model fabricating facts, improves the accuracy and generalization ability of information classification, reduces the need for manual labeling of data, enhances the complexity and adaptability of the model, and protects data privacy.
Smart Images

Figure CN120257034A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of artificial intelligence, including but not limited to an information classification method, apparatus, electronic device, and computer-readable storage medium. Background Art
[0002] Information classification refers to a method of dividing and organizing information according to certain classification criteria based on the characteristics and attributes of the information. In related technologies, information classification is achieved through machine learning. During the training process of machine learning models, a large amount of data needs to be manually labeled, resulting in a waste of manpower and material resources. In addition, with the development of deep learning technologies, convolutional neural networks and recurrent neural networks have been widely applied to information classification tasks. However, each deep learning model has limitations and has limited processing capabilities for complex and variable data sets. At the same time, in related technologies, insufficient consideration is given to privacy protection and security, which may lead to personal privacy leakage or other security issues when processing sensitive information. Summary of the Invention
[0003] Embodiments of the present application provide an information classification method, apparatus, electronic device, and computer-readable storage medium, which can be at least applied in the field of artificial intelligence and can improve the accuracy of information classification in a model fusion manner.
[0004] The technical solution of the embodiments of the present application is implemented as follows:
[0005] Embodiments of the present application provide an information classification method, including: obtaining information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries; constructing multiple sample data for each classified industry from a preset industry database according to the industry classification system; for each pre-trained information classification model among multiple pre-trained information classification models, constructing input information of the pre-trained information classification model based on the information to be classified and the sample data of each classified industry; inputting the input information of each pre-trained information classification model into the corresponding pre-trained information classification model multiple times in a loop for information classification processing, and correspondingly obtaining multiple model output results; determining an information classification result of the information to be classified based on the multiple model output results output by each of the multiple pre-trained information classification models.
[0006] An embodiment of the present application provides an information classification device, including: an acquisition module, configured to acquire information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries; a sample data construction module, configured to construct multiple sample data for each of the classified industries from a preset industry database according to the industry classification system; an input information construction module, configured to construct input information of each pre-trained information classification model in multiple preset pre-trained information classification models based on the information to be classified and the sample data of each classified industry; a classification module, configured to repeatedly input the input information of each pre-trained information classification model into the corresponding pre-trained information classification model for information classification processing, and correspondingly obtain multiple model output results; a determination module, configured to determine an information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models.
[0007] In some embodiments, the device further includes: an industry classification system construction module, configured to acquire management requirement information of each of multiple predefined services and the actual business scenario of each service; and construct the industry classification system including the multiple classified industries according to the actual business scenario and the management requirement information of each service.
[0008] In some embodiments, the industry database stores merchant information corresponding to multiple different industries, and the number of merchant information corresponding to each industry is at least one; the sample data construction module is further configured to: acquire each classified industry in the industry classification system; for each classified industry, determine at least one target merchant information corresponding to the corresponding classified industry from the industry database; and perform data mapping processing on the target merchant information and the classified industry to obtain the sample data.
[0009] In some embodiments, the input information construction module is further configured to: construct task description information of the pre-trained information classification model based on the information to be classified; the task description information includes: task content for defining a processing task for performing information classification processing on the information to be classified; construct reference sample information of the pre-trained information classification model based on the sample data of the classified industry; the reference sample information is used to provide prompt information for the pre-trained information classification model when executing the processing task; and determine the task description information and the reference sample information as the input information of the pre-trained information classification model.
[0010] In some embodiments, the task description information further includes: at least one alternative industry, and industry definition information for each of the alternative industries; the input information construction module is further configured to: determine a target classified industry that belongs to the same industry as each of the alternative industries; obtain sample data of the target classified industry; and construct reference sample information for the pre-trained information classification model based on the sample data of the target classified industry.
[0011] In some embodiments, the information classification method is applied to an information classification platform; the apparatus further includes: a model deployment module, configured to obtain initial model parameters of a plurality of pre-trained information classification models before constructing the input information of the pre-trained information classification model; and deploy the plurality of pre-trained information classification models on the information classification platform based on the initial model parameters.
[0012] In some embodiments, the apparatus further includes: a parameter adjustment module, configured to, after deploying the plurality of pre-trained information classification models on the information classification platform, obtain a temperature parameter in the initial model parameters of the pre-trained information classification model; obtain a preset temperature parameter adjustment value corresponding to the temperature parameter; and adjust the initial model parameters of the pre-trained information classification model that has been deployed on the information classification platform based on the preset temperature parameter adjustment value through the information classification platform to obtain a pre-trained information classification model with adjusted parameters; the input information construction module is further configured to: construct the input information of the pre-trained information classification model with adjusted parameters based on the information to be classified and the sample data of each of the classified industries.
[0013] In some embodiments, the apparatus further includes: a model training module, configured to, after deploying the plurality of pre-trained information classification models on the information classification platform, train the pre-trained information classification model that has been deployed on the information classification platform based on preset training samples through the information classification platform to obtain a trained information classification model; the input information construction module is further configured to: construct the input information of the trained information classification model based on the information to be classified and the sample data of each of the classified industries.
[0014] In some embodiments, the determination module is further configured to: determine the model prediction result of each pre-trained information classification model based on the multiple model output results respectively output by the multiple pre-trained information classification models; and determine the information classification result of the information to be classified based on the model prediction results of the multiple pre-trained information classification models.
[0015] In some embodiments, the determining module is further configured to: for each of the pre-trained information classification models, obtain a plurality of model output results output by the pre-trained information classification model; perform a first result classification and statistics on the plurality of model output results to obtain at least one output result category of the model output results and the number of model output results in each output result category; and determine the model output result of the output result category with the largest number as the model prediction result of the pre-trained information classification model.
[0016] In some embodiments, the determining module is further configured to: perform a second result classification and statistics on the model prediction results of the plurality of pre-trained information classification models respectively to obtain at least one prediction result category of the model prediction results and the number of model prediction results in each prediction result category; and determine the model prediction result of the prediction result category with the largest number as the information classification result of the information to be classified.
[0017] An embodiment of the present application provides an electronic device, including: a memory for storing executable instructions; and a processor for implementing the above information classification method when executing the executable instructions stored in the memory.
[0018] An embodiment of the present application provides a computer program product, which includes executable instructions stored in a computer-readable storage medium; wherein, when a processor of an electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the above information classification method is implemented.
[0019] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to implement the above information classification method when executing the executable instructions.
[0020] The embodiments of the present application have the following beneficial effects:
[0021] When performing information classification, first, obtain the information to be classified and a preset industry classification system, and construct multiple sample data for each classified industry according to the industry classification system; then, for each pre-trained information classification model among multiple preset pre-trained information classification models, construct the input information of the pre-trained information classification model based on the information to be classified and the sample data of each classified industry; finally, input the input information of each pre-trained information classification model into the corresponding pre-trained information classification model in a loop for multiple times for information classification processing, and correspondingly obtain multiple model output results. Based on the multiple model output results respectively output by multiple pre-trained information classification models, determine the information classification result of the information to be classified. It can be seen that in the information classification method of the embodiment of the present application, by allowing each pre-trained information classification model to process the same input information multiple times, the probability of the model fabricating facts can be reduced and the accuracy of the model can be improved; moreover, since there are certain differences in the training data and training methods of multiple preset pre-trained information classification models, by fusing multiple pre-trained information classification models, the advantages of different information classification models can be comprehensively utilized, thereby improving the accuracy of information classification. In addition, fusing multiple information classification models can also increase the complexity of the model, thereby enhancing the generalization ability of the model and enabling the model to better adapt to different information classification tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a schematic structural diagram of a traditional classification model provided by the related art;
[0023] Figure 2 is a schematic structural diagram of a single open-source large language model provided by the related art;
[0024] Figure 3 is a schematic structural diagram of invoking the interface of a non-open-source large language model provided by the related art;
[0025] Figure 4 is an optional schematic architectural diagram of an information classification system provided by an embodiment of the present application;
[0026] Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0027] Figure 6 is an optional schematic flowchart of an information classification method provided by an embodiment of the present application;
[0028] Figure 7 is another optional schematic flowchart of an information classification method provided by an embodiment of the present application;
[0029] Figure 8 is a schematic implementation process diagram of constructing multiple sample data provided by an embodiment of the present application;
[0030] Figure 9 It is a schematic diagram of the implementation process of the input information for constructing the pre-trained information classification model provided by the embodiments of the present application;
[0031] Figure 10 It is a schematic diagram of the implementation process of the reference sample information for constructing the pre-trained information classification model provided by the embodiments of the present application;
[0032] Figure 11 It is a schematic diagram of the implementation process of determining the information classification result of the information to be classified provided by the embodiments of the present application;
[0033] Figure 12 It is a schematic diagram of the solution architecture provided by the embodiments of the present application;
[0034] Figure 13 It is a schematic diagram of the implementation process of the information classification method provided by the embodiments of the present application in an actual application scenario. Detailed implementation manners
[0035] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0036] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field to which the embodiments of the present application belong. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0037] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0038] Before describing the information classification method provided by the embodiments of the present application, the professional terms involved in the embodiments of the present application will be described first:
[0039] (1) Self-consistency: It refers to the overall consistency of the text generated by the model, that is, there is a certain logic and coherence between the text generated before and after, including semantic consistency (the generated text is consistent in content and meaning), syntactic consistency (the generated text is coherent in grammatical structure), and stylistic consistency (the generated text is consistent in style and format).
[0040] (2) Prompt: It is a form of input information for the model, used to indicate what actions the AI model should take or what output it should generate when performing a specific task. It is a natural language input, similar to a command or instruction, to let the AI model know what it needs to do.
[0041] To better understand the information classification method provided in the embodiments of the present application, the information classification methods in the related technologies will be described below.
[0042] In the related technologies, information classification is generally performed through traditional classification models, such as the BERT (Bidirectional Encoder Representations from Transformer) model. As Figure 1 shown, the BERT model is a pre-trained language model based on the Transformer architecture. By pre-training on text data and performing supervised learning through manually labeled data, it learns the context information and semantic features of the text, and then applies them to various natural language processing tasks, such as text classification, named entity recognition, sentiment analysis, etc. The BERT model has strong generalization ability and robustness, and has achieved good results in various natural language processing tasks.
[0043] In the related technologies, it is also possible to deploy a single open-source large language model locally. As Figure 2 shown, the open-source large language model (LLM, Large Language Model) 210 is a natural language processing model based on deep learning. It can learn the grammar and semantics of natural language, and thus can generate human-readable text. Open-source large prediction models usually have billions to trillions of parameters and can handle various natural language processing tasks, such as natural language generation, text classification, text summarization, machine translation, speech recognition, etc. In addition, in the related technologies, it is also possible to call the application program interface (API, Application Program Interface) of a non-open-source large language model. As Figure 3 shown, the non-open-source large model API 310 can be customized according to specific requirements to meet the application requirements in different scenarios, and non-open-source large language models usually have high stability and reliability, which can ensure the stability and availability of the service.
[0044] As can be seen, the information classification method in the above related technologies has the following problems: 1) A large amount of labeled data is required in the training process of traditional classification models; 2) Since each open-source large language model has its limitations and cannot adapt to all tasks, the accuracy of using a single open-source large language model is often not high; 3) When the model is trained, it needs to access a large amount of data, and there is a risk of data leakage when calling the interfaces of non-open-source large language models.
[0045] Based on at least one of the above problems existing in the related technologies, the embodiments of the present application provide an information classification method. By means of the self-consistency of the pre-trained information classification model and the fusion of multiple pre-trained information classification models, while improving the accuracy of the pre-trained information classification model for information classification, the privacy of data is protected. And compared with traditional models, only a very small amount of labeled data is required, greatly reducing the labor cost.
[0046] Specifically, in the information classification method provided by the embodiments of the present application, first, obtain the information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries; then, according to the industry classification system, construct multiple sample data for each classified industry from the preset industry database; and for each pre-trained information classification model among multiple preset pre-trained information classification models, based on the information to be classified and the sample data of each classified industry, construct the input information of the pre-trained information classification model; then, input the input information of each pre-trained information classification model into the corresponding pre-trained information classification model multiple times in a loop for information classification processing, and correspondingly obtain multiple model output results; finally, based on the multiple model output results output by each of the multiple pre-trained information classification models, determine the information classification result of the information to be classified. In this way, by allowing each pre-trained information classification model to process the same input information multiple times, the probability of the model fabricating facts can be reduced, and the accuracy of the model can be improved; and since there are certain differences in the training data and training methods of multiple preset pre-trained information classification models, by fusing multiple pre-trained information classification models, the advantages of different information classification models can be comprehensively utilized, thereby improving the accuracy of information classification. In addition, fusing multiple information classification models can increase the complexity of the model, thereby enhancing the generalization ability of the model and enabling the model to better adapt to different information classification tasks.
[0047] Here, the exemplary application of the information classification device according to the embodiments of the present application will be described first. The information classification device is an electronic device for implementing the information classification method. In one implementation, the information classification device (i.e., the electronic device) provided by the embodiments of the present application can be implemented as a terminal or as a server. In one implementation, the device provided by the embodiments of the present application can be implemented as any terminal with information classification functions such as a laptop computer, a tablet computer, a desktop computer, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device, a smart robot, a smart home appliance, and a smart vehicle device; in another implementation, the information classification device provided by the embodiments of the present application can also be implemented as a server, where the server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application. Next, the exemplary application when the information classification device is implemented as a server will be described.
[0048] See Figure 4 , Figure 4 is an optional architecture diagram of the information classification system provided by the embodiments of the present application. To implement the classification of the input information, an information classification platform can be provided, and a pre-trained information classification model is deployed on the information classification platform. The constructed input information is input into the pre-trained information classification model, thereby implementing the information classification method of the embodiments of the present application.
[0049] The information classification system 10 of the embodiments of the present application at least includes a terminal 100, a network 200, and a server 300. An information classification application is deployed on the terminal 100, and the information classification application can be implemented as an information classification platform, and the information classification platform includes a pre-trained information classification model, where the server 300 can be the background server of the information classification application. The terminal 100 can constitute the information classification device of the embodiments of the present application, that is, the information classification method of the embodiments of the present application is implemented through the terminal 100. The terminal 100 is connected to the server 300 through the network 200, and the network 200 can be a wide area network or a local area network, or a combination of the two.
[0050] See Figure 4, the terminal 100 receives the information classification operation of the user. In response to the information classification operation, the terminal 100 generates an information classification request. Then, the terminal 100 sends the information classification request to the server 300 through the network 200. After receiving the information classification request, the server 300, in response to the information classification request, parses to obtain the information to be classified. The server 300, according to the preset industry classification system, which includes multiple classified industries, then, the server 300 constructs multiple sample data for each classified industry from the preset industry database according to the industry classification system; and, for each of the multiple preset pre-trained information classification models by the server 300, based on the information to be classified and the sample data of each classified industry, constructs the input information of the pre-trained information classification model. Then, the server 300 inputs the input information of each pre-trained information classification model into the corresponding pre-trained information classification model for information classification processing in multiple cycles, and correspondingly obtains multiple model output results; finally, the server 300 determines the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models. After obtaining the information classification result, the server 300 returns the information classification result of the information to be classified to the terminal 100 through the network 200, and the terminal 100 can display the information classification result of the information to be classified on the current interface of the information classification application.
[0051] In some embodiments, the above information classification method can also be executed by the terminal. That is to say, after receiving the information classification operation of the user, the terminal 100, in response to the information classification operation, obtains the information to be classified, and obtains the preset industry classification system from the server 300, which includes multiple classified industries; then, the terminal 100 constructs multiple sample data for each classified industry from the preset industry database according to the industry classification system; and, for each of the multiple preset pre-trained information classification models by the terminal 100, based on the information to be classified and the sample data of each classified industry, constructs the input information of the pre-trained information classification model; then, the terminal 100 inputs the input information of each pre-trained information classification model into the corresponding pre-trained information classification model for information classification processing in multiple cycles, and correspondingly obtains multiple model output results; finally, the terminal 100 determines the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models.
[0052] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Figure 5The electronic device shown may be an information classification device, and the information classification device includes: at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. Each component in the information classification device is coupled together through a bus system 540. It can be understood that the bus system 540 is used to implement connection communication between these components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 5 all kinds of buses are labeled as the bus system 540.
[0053] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0054] The user interface 530 includes one or more output devices 531 that enable the presentation of media content, and one or more input devices 532.
[0055] The memory 550 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disk drives, etc. Optionally, the memory 550 includes one or more storage devices that are physically located away from the processor 510. The memory 550 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory. In some embodiments, the memory 550 is capable of storing data to support various operations, and examples of these data include programs, modules, and data structures, or subsets or supersets thereof, which are illustrated below.
[0056] The operating system 551 includes system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, the core library layer, the driver layer, etc., for implementing various basic services and processing hardware-based tasks; the network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB), etc.; the input processing module 553 is used to detect and translate one or more user inputs or interactions from one of one or more input devices 532.
[0057] In some embodiments, the device provided by the embodiments of the present application can be implemented in software. Figure 5 An information classification device 554 stored in the memory 550 is shown. The information classification device 554 can be an information classification device in an electronic device, and it can be software in the form of a program and a plug-in, etc., including the following software modules: an acquisition module 5541, a sample data construction module 5542, an input information construction module 5543, a classification module 5544, and a determination module 5545. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.
[0058] In some embodiments, the device provided by the embodiments of the present application can be implemented in hardware. As an example, the device provided by the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the information classification method provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor can adopt one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field-Programmable Gate Arrays (FPGAs), or other electronic components.
[0059] The information classification method provided by each embodiment of the present application can be executed by an electronic device, where the electronic device can be a server or a terminal, that is, the information classification method provided by each embodiment of the present application can be executed by a server, or can be executed by a terminal, or can also be executed through the interaction between the server and the terminal.
[0060] Figure 6 is an optional process schematic diagram of the information classification method provided by an embodiment of the present application. The following will be described in conjunction with Figure 6 the steps shown, as Figure 6 shown, taking the execution entity of the information classification method as a server as an example for illustration. The method includes the following steps S101 to S105:
[0061] Step S101, obtain the information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries.
[0062] The information to be classified is information or data that needs to be classified or processed. The information to be classified can be any form of information such as text information, image information, video information, etc.
[0063] The industry classification system is a structure or system for classifying and categorizing different industries, designed to better understand and organize each industry for easy comparison, research, and management. The industry classification system can be analogized to a large dictionary, where various industries are sorted according to their characteristics, functions, and products, just like a dictionary arranges words in alphabetical order, and the industry classification system assigns them to different categories according to the similarity or relevance of the industries. In short, the industry classification system is a structure or system that classifies each industry according to its characteristics and relevance. For example, the industry classification system may include the financial industry, manufacturing industry, retail industry, medical industry, catering industry, and clothing industry, etc.
[0064] In some embodiments, the user can select or input the information to be classified on the terminal, and the terminal encapsulates the information to be classified to generate an information classification request. The server can obtain the information to be classified by parsing the information classification request sent by the terminal.
[0065] In some embodiments, the server can obtain the preset industry classification system by calling the program interface provided by the industry classification system; it can also obtain the preset industry classification system by importing a file containing the preset industry classification system, such as a CSV file or an EXCEL file, into the server.
[0066] Step S102, according to the industry classification system, construct multiple sample data for each classified industry from the preset industry database.
[0067] Here, the preset industry database is a database containing different industry classification information. The preset industry database records the characteristics, statistical data, and relevant information of each industry. Among them, the statistical data includes, but is not limited to, relevant data such as the output value, sales volume, market share, and competition situation of different industries; the relevant information refers to information such as the business hours and target audience of different industries.
[0068] Constructing sample data means creating multiple representative data samples for each classified industry. These sample data can be information such as text, numerical values, images, etc. related to the industry, and are used to represent the characteristics and features of the industry.
[0069] In some embodiments, the relevant data of each classified industry can be retrieved from a preset industry database using a database query language; then, according to requirements and goals, samples are randomly selected from the relevant data to construct multiple sample data. In other embodiments, the relevant data of each classified industry can also be obtained according to the industry classification system. Here, the relevant data includes industry names, numbers, keywords, etc.; then, the relevant data of each classified industry is matched and mapped with the data in the preset industry database to establish a corresponding relationship between each classified industry and the data in the preset industry database; finally, according to the corresponding relationship, relevant data is extracted from the preset industry database to construct multiple sample data.
[0070] Step S103, for each pre-trained information classification model among multiple preset pre-trained information classification models, based on the information to be classified and the sample data of each classified industry, construct the input information of the pre-trained information classification model.
[0071] It should be noted that the pre-trained information classification model is a model that is pre-trained on a large-scale dataset. This pre-trained information classification model can be used to solve various classification tasks, such as image classification, text classification, etc. The information to be classified and the sample data of each classified industry are combined as the input information of the model, and the input information can be in the form of text, image, speech, etc.
[0072] In some embodiments, it is necessary to preprocess the input information of the pre-trained information classification model. If the input information is text data, the text data needs to be preprocessed to remove noise and unnecessary information, including removing stop words, punctuation marks, and special characters; and perform stemming and word vector processing on the text data to convert the text data into a digital form that can be understood by a computer. Among them, stemming means converting a word into its stem or basic form to reduce the complexity and diversity of vocabulary in tasks such as text processing and information retrieval, and word vector processing means representing each word as a vector of a fixed length. By preprocessing the text data, the text processing efficiency and the generalization ability of the pre-trained information classification model can be improved.
[0073] In some embodiments, if the form of the input information is an image, speech, or video, image processing and signal processing technologies can be used to convert the input information into a digital representation suitable for input to the pre-trained information classification model.
[0074] Step S104: The input information of each pre-trained information classification model is cyclically input into the corresponding pre-trained information classification model multiple times for information classification processing, and multiple model output results are correspondingly obtained.
[0075] In some embodiments, the input information of each pre-trained information classification model is repeatedly input into the pre-trained information classification model, and a corresponding model output result can be obtained each time. By repeatedly inputting multiple times, multiple model output results of each pre-trained information classification model can be obtained. The model output results of the model may be different each time because after each cycle, the model may adjust parameters and iterate during the information processing.
[0076] Step S105: Based on the multiple model output results respectively output by multiple pre-trained information classification models, determine the information classification result of the information to be classified.
[0077] Specifically, multiple different pre-trained information classification models are used to process the information to be classified. Each pre-trained information classification model will generate multiple model output results. Since each pre-trained information classification model has different structures and parameters, and the training data used by each pre-trained information classification model is also different, the output results of each pre-trained information classification model will also be different. The multiple output results of multiple pre-trained information classification models are collected and integrated. Voting, weighted average or other methods can be used to comprehensively consider these results. The ultimate goal is to determine the information classification result of the information to be classified based on these integrated output results.
[0078] The information classification method provided by the embodiments of the present application, when performing information classification, first obtains the information to be classified and a preset industry classification system, and constructs multiple sample data for each classified industry according to the industry classification system; then, for each pre-trained information classification model among multiple preset pre-trained information classification models, based on the information to be classified and the sample data of each classified industry, constructs the input information of the pre-trained information classification model; finally, inputs the input information of each pre-trained information classification model into the corresponding pre-trained information classification model in a loop for multiple times for information classification processing, and correspondingly obtains multiple model output results, and determines the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models. It can be seen that in the information classification method of the embodiments of the present application, by allowing each pre-trained information classification model to process the same input information multiple times, the probability of the pre-trained information classification model fabricating facts can be reduced, and the accuracy of the pre-trained information classification model can be improved; moreover, since there are certain differences in the training data and training methods of the multiple pre-trained information classification models, by fusing the multiple pre-trained information classification models, the advantages of different pre-trained information classification models can be comprehensively utilized, thereby improving the accuracy of information classification. In addition, fusing the multiple pre-trained information classification models can also increase the complexity of the model, thereby enhancing the generalization ability of the model, enabling the model to better adapt to different information classification tasks.
[0079] The following is an example of the application scenario of the information classification method provided by the embodiments of the present application. The embodiments of the present application can be applied to at least any one of the following exemplary scenarios:
[0080] Scenario 1: A certain platform organizes an online shopping festival activity. To ensure the quality of the activity and the compliance of participating merchants, it is necessary to classify the business industries of merchants and only allow merchants in specific industries to participate. In this case, the information classification method provided in the embodiments of the present application can be adopted. First, the terminal receives the registration information of the merchant, generates an information classification request based on the registration information of the merchant, and sends the information classification request to the server. After receiving the information classification request, the server will parse the information classification request to obtain the information to be classified, where the information to be classified includes some basic information of the merchant. At the same time, the server will also obtain a preset industry classification system, construct multiple sample data in a preset industry database according to the industry classification system. Among them, the sample data is a specific example input into the model. For example, A Noodle Shop belongs to the catering industry, and B Garment Factory belongs to the clothing industry. The server will deploy multiple pre-trained information classification models on the information classification platform. After the deployment of the pre-trained information classification models is completed, the pre-trained information classification models can be trained or the model parameters can be adjusted. The server constructs the input information of the pre-trained information classification model according to the information to be classified and the constructed sample data. The input information includes a task description, industry definitions, sample data, and a problem description. When constructing the input information, first construct the task description and list the alternative industries. For example: XX Steamed Bun Shop, it is necessary to determine which industry XX Steamed Bun Shop belongs to among the alternative industries. The alternative industries are the catering industry, the clothing industry, and the hardware industry; then give the industry definitions. The catering industry refers to the industry engaged in activities such as the processing, sales, and service of food ingredients and beverages. The clothing industry refers to the industry engaged in activities such as clothing design, production, and sales. The hardware industry refers to the industry engaged in activities such as the production, processing, and sales of hardware products; then give the sample data, such as: A Noodle Shop belongs to the catering industry, and B Garment Factory belongs to the clothing industry; finally, describe the problem, such as: Now, please determine which of the above-given industries XX Steamed Bun Shop belongs to? The server inputs the input information of each pre-trained information classification model into the corresponding pre-trained information classification model in a loop multiple times for information classification processing, and correspondingly obtains multiple model output results. A voting operation is performed on the multiple model output results of each model to determine the respective model prediction results of each pre-trained information classification model. Based on the respective model prediction results of the multiple pre-trained information classification models, the information classification result of the information to be classified is determined, so as to determine the specific business industry of the merchant.
[0081] Scenario 2: A certain platform needs to push advertisements to merchants in a specific industry, and it is necessary to first identify users in a certain industry. The server will collect a large amount of merchant information and simultaneously obtain a preset industry classification system. According to the industry classification system, multiple sample data are constructed from a preset industry database, where the sample data is used to provide hints for the model. Then, input information is constructed based on the merchant information and the multiple sample data, and the input information includes a task description, industry definition, sample data, and problem description. The server will deploy multiple pre-trained information classification models on the information classification platform and adjust or train the parameters of the pre-trained information classification models to obtain the adjusted or trained pre-trained information classification models. The server will repeatedly input the input information of each pre-trained information classification model into the corresponding pre-trained information classification model for information classification processing, and correspondingly obtain multiple model output results. A voting operation is performed on the multiple model output results of each pre-trained information classification model to determine the respective model prediction results of each pre-trained information classification model. Based on the respective model prediction results of the multiple pre-trained information classification models, the information classification result of the information to be classified is determined, thereby determining the specific business industry of the merchant and achieving targeted advertisement pushing.
[0082] Next, taking the above Scenario 1 as an example, the information classification method of the embodiments of the present application will be described. Figure 7 is another optional flowchart of the information classification method provided by the embodiments of the present application, as Figure 7 shown, the method includes the following steps S201 to step S213:
[0083] Step S201, the terminal receives the information classification operation of the user.
[0084] Here, an industry classification application can be run on the terminal, and the server constitutes the background server of the industry classification application. The information classification operation can be a selection operation or an input operation input through the client of the industry classification application running on the terminal. For example, the information to be classified (such as the name of a certain merchant) can be selected, or the user can input the information to be classified on the client.
[0085] In some embodiments, the terminal can provide an interface or an input box to allow the user to select or input the information to be classified. The interface can be in the form of a form, a text box, a drop-down menu, etc., and the specific form is not limited in the present application. The user can select the information to be classified from the predetermined options or manually input the information to be classified.
[0086] Step S202, the terminal generates an information classification request in response to the information classification operation.
[0087] Here, the terminal can encapsulate the information to be classified selected or input by the user into the information classification request.
[0088] In some embodiments, in addition to encapsulating the information to be classified into the information classification request, the information classification request may further include more classification-related information, such as a timestamp, a geographical location, a user ID, etc. These additional information can help the server better understand and process the information to be classified.
[0089] In some embodiments, to ensure the security of the information classification request, an authentication parameter is added to the information classification request. The authentication parameter is used to verify the legality of the information classification request to ensure that only authorized users can access the classification service and prevent unauthorized access and abuse by unauthorized users. A common authentication method is to use an API key or a token. An API key is a unique string used to identify and authenticate a user. A token is a credential similar to an access token or an authentication token that contains the user's identity information and permissions. When adding the authentication parameter to the request, the HTTP request header or request body can be used to transmit the authentication information.
[0090] Step S203, the terminal sends an information classification request to the server.
[0091] In some embodiments, the terminal sends the encapsulated information classification request to the server and requests the server to perform an information classification operation, usually using protocols such as HTTP or WebSocket to send the information classification request.
[0092] Step S204, the server responds to the information classification request and parses to obtain the information to be classified.
[0093] Here, after receiving the information classification request, the server parses the information classification request. For example, for an HTTP request, the server can parse the request header and the request body. Parsing the request header to obtain relevant information about the request, such as the request method and path; parsing the request body to obtain the main data of the request, that is, the information to be classified. Parsing specific fields or parameters in the request body, these fields or parameters contain the information to be classified, extracting a specific data format from the request body, such as JSON or XML, and then parsing this data format to obtain the information to be classified.
[0094] In some embodiments, when the server receives an information classification request with an authentication parameter, the server verifies the authentication parameter. The verification process involves operations such as verifying the validity of the API key or token, checking the user's permissions, and recording the information classification request log. If the authentication fails or the request is unauthorized, the server will return a corresponding error response.
[0095] In some embodiments, when the server verifies the validity of an API key or token, first, the server checks whether the format of the API key or token complies with the rules, including checks on aspects such as length and character combination. Next, if the API key or token contains signature information, the server uses the corresponding algorithm to verify the validity of the signature and compares it with other data in the request. Then, the server queries the database or storage system to verify whether the API key or token exists in the authorization list. At the same time, the server also checks the expiration date of the API key or token, and if it has expired, it is considered invalid. In addition, the server can integrate third-party authentication services, such as OAuth, OpenID Connect, etc., to verify the validity of the API key or token. Finally, to enhance security, the server can also add additional security layers, such as IP filtering, request frequency limiting, etc. Through these steps, the server can effectively verify the legality and security of the API key or token and provide a reliable authentication and authorization mechanism.
[0096] Step S205: The server obtains the management requirement information of each of the multiple predefined services and the actual business scenario of each service; according to the actual business scenario and management requirement information of each service, a sector classification system for multiple classified sectors is constructed.
[0097] It should be noted that in some embodiments, the multiple predefined services refer to multiple services that have been determined and defined; the management requirement information refers to the relevant information required for each service during the management process, where the management process refers to the process of managing and making decisions for each service, and the relevant information includes business data, market indicators, business rules, etc.; the actual business scenario refers to the environment, situation, and requirements when each business area actually operates; the sector classification system refers to dividing different business areas into industry groups with relevance and similar characteristics and establishing a corresponding classification system.
[0098] In some embodiments, when it is necessary to construct an industry classification system to manage multiple businesses in the e-commerce field, the predefined multiple businesses may include commodity management, order management, user management, etc. To construct the industry classification system, it is necessary to obtain the management requirement information and actual business scenarios of each business. For the commodity management business, the management requirement information may include classification of commodities, inventory management, price strategies, etc. The actual business scenarios may involve activities such as commodity listing, delisting, and promotional activities. For the order management business, the management requirement information may include order status management, payment processing, logistics positioning, etc. The actual business scenarios may include activities such as placing an order, making a payment, and shipping. For the user management business, the management requirement information may include user registration, login, personal information management, etc. The actual business scenarios may include activities such as user registration, login, and modifying personal information. According to the actual business scenarios and management requirement information of each business, an industry classification system is constructed to classify the above-mentioned businesses into different fields or sub-industries under the e-commerce industry, such as the commodity management field, the order management field, and the user management field. Such an industry classification system can help to better organize and manage each business in the e-commerce field.
[0099] Step S206, the server constructs multiple sample data for each classified industry from a preset industry database according to the industry classification system.
[0100] In some embodiments, the industry database stores merchant information corresponding to multiple different industries, and the number of merchant information corresponding to each industry is at least one. Refer to Figure 8 , Figure 8 shows that in step S206, the server constructs multiple sample data for each classified industry from a preset industry database according to the industry classification system, which can be implemented through the following steps S2061 to S2063:
[0101] Step S2061, the server obtains each classified industry in the industry classification system.
[0102] Step S2062, for each classified industry, the server determines at least one target merchant information corresponding to the corresponding classified industry from the industry database.
[0103] Here, the industry database refers to a database containing different industry classification information, and the industry database records the characteristics, statistical data, and relevant information of each industry.
[0104] Step S2063, the server performs data mapping processing on the target merchant information and the classified industry to obtain sample data.
[0105] In some embodiments, through data mapping processing, the server can correspond the information of merchants to the already divided industries. In this way, the server can quickly associate merchants with their respective industries, thereby obtaining more accurate sample data.
[0106] In some embodiments, the information classification method can be applied to an information classification platform.
[0107] Step S207, the server deploys multiple pre-trained classification models on the information classification platform.
[0108] In some embodiments, when the server deploys multiple pre-trained information classification models on the information classification platform, it can be achieved in the following way: First, before constructing the pre-trained information classification models, the server needs to obtain the model initial parameters of the multiple pre-trained information classification models. Then, based on the model initial parameters, it deploys multiple pre-trained information classification models on the information classification platform.
[0109] Here, the pre-trained information classification model refers to a model that has been pre-trained on a large-scale dataset and can be used to implement various classification tasks, such as image classification, text classification, etc. The information classification platform refers to an online platform or application for classifying, organizing, and categorizing a large amount of information, data, or content so that users can more easily browse, search, and obtain the required information. The model initial parameters refer to the initial numerical values that the model has before starting to learn during the training process, and these parameters determine the initial state of the model.
[0110] In some embodiments, after the server deploys multiple pre-trained information classification models on the information classification platform, it can not only adjust the model initial parameters of the pre-trained information classification models but also train the pre-trained information classification models.
[0111] Step S208, the server obtains the pre-trained information classification model with adjusted parameters by adjusting the model initial parameters.
[0112] In some embodiments, after the server deploys multiple pre-trained information classification models on the information classification platform, it can also obtain the pre-trained information classification model with adjusted parameters by adjusting the model initial parameters. In the implementation process, the server obtains the temperature parameter in the model initial parameters of the pre-trained information classification model; obtains the preset temperature parameter adjustment value corresponding to the temperature parameter; through the information classification platform, based on the preset temperature parameter adjustment value, adjusts the model initial parameters of the deployed pre-trained information classification model to obtain the pre-trained information classification model with adjusted parameters; and constructs the input information of the pre-trained information classification model with adjusted parameters based on the information to be classified and the sample data of each already divided industry.
[0113] Here, the temperature parameter is a parameter used to adjust the probability distribution generated by the model. The role of the temperature parameter is to control the diversity of the samples generated by the model. A higher temperature parameter value will make the generated samples more diverse, and a lower temperature parameter value will make the generated samples more concentrated in the high-probability region of the probability distribution, increasing the accuracy of the samples.
[0114] In step S209, the server trains the pre-trained information classification model to obtain a trained information classification model.
[0115] In some embodiments, after the server deploys multiple pre-trained information classification models on the information classification platform, it can also train the pre-trained information classification models. In the implementation process, the server, through the information classification platform, trains the deployed pre-trained information classification models based on preset training samples to obtain a trained information classification model; and constructs the input information of the trained information classification model based on the information to be classified and the sample data of each classified industry.
[0116] In step S210, the server constructs the input information of the pre-trained information classification model based on the information to be classified and the sample data of each classified industry.
[0117] In some embodiments, referring to Figure 9 , Figure 9 shows that in step S210, the server constructs the input information of the pre-trained information classification model based on the information to be classified and the sample data of each classified industry, which can be implemented through the following steps S2101 to S2103:
[0118] In step S2101, the server constructs the task description information of the pre-trained information classification model based on the information to be classified; the task description information includes: the task content for defining the processing task of information classification processing for the information to be classified.
[0119] In step S2102, the server constructs the reference sample information of the pre-trained information classification model based on the sample data of the classified industries; the reference sample information is used to provide prompt information for the pre-trained information classification model when performing the processing task.
[0120] In some embodiments, the task description information further includes: at least one alternative industry, and the industry definition information of each alternative industry. Referring to Figure 10 , Figure 10 shows that in step S2102, the server constructs the reference sample information of the pre-trained information classification model based on the sample data of the classified industries, which can be implemented through the following steps S21021 to S21023:
[0121] Step S21021, the server determines the target classified industries that belong to the same industry as each alternative industry.
[0122] Step S21022, the server obtains the sample data of the target classified industries.
[0123] Step S21023, the server constructs the reference sample information of the pre-trained information classification model based on the sample data of the target classified industries.
[0124] Step S2103, the server determines the input information of the pre-trained information classification model as the task description information and the reference sample information.
[0125] It should be noted that in some embodiments, after the server deploys multiple pre-trained information classification models on the information classification platform, if the server obtains the pre-trained information classification model with adjusted parameters by adjusting the initial parameters of the model, then when constructing the input information of the pre-trained information classification model, it can be based on the information to be classified and the sample data of each classified industry to construct the input information of the pre-trained information classification model with adjusted parameters.
[0126] In other embodiments, after the server deploys multiple pre-trained information classification models on the information classification platform, if the server trains the pre-trained information classification model to obtain the trained information classification model, then when constructing the input information of the pre-trained information classification model, it can be based on the information to be classified and the sample data of each classified industry to construct the input information of the trained information classification model.
[0127] Step S211, the server determines the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models.
[0128] In some embodiments, referring to Figure 11 , Figure 11 shows that in step S211, the server determines the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models, which can be implemented through the following steps S2111 to S2112:
[0129] Step S2111, the server determines the model prediction result of each pre-trained information classification model based on the multiple model output results respectively output by the multiple pre-trained information classification models.
[0130] In some embodiments, the server determines the model prediction result of each pre-trained information classification model based on the multiple model output results respectively output by the multiple pre-trained information classification models, which can be implemented in the following manner: First, for each pre-trained information classification model, the server obtains the multiple model output results output by the pre-trained information classification model. Then, the server performs a first result classification and statistics on the multiple model output results to obtain at least one output result category of the model output results and the number of model output results in each output result category. Finally, the server determines the model output result of the output result category with the largest number as the model prediction result of the pre-trained information classification model.
[0131] In some embodiments, if the server uses a pre-trained information classification model to classify the theme of a news article, the same news article can be input into the current classification model (i.e., the pre-trained information classification model) multiple times. The results output by the current classification model each time may be different categories such as "entertainment", "economy", "sports", etc. The server counts the number of each category according to the multiple output results of the current classification model. For example, the news article is input into the current classification model 5 times, among which, "entertainment" is output 1 time, "economy" is output 3 times, and "sports" is output 1 time. Therefore, the number of times "economy" is output is the largest, and the server will determine "economy" as the prediction result of the current classification model.
[0132] In some embodiments, the server determines the model prediction result of each pre-trained information classification model based on the multiple model output results respectively output by the multiple pre-trained information classification models, and it can also be implemented through a pre-trained voting model. That is to say, the multiple model output results can be input into the pre-trained voting model, where the voting model can be obtained by training a pre-constructed basic neural network with sample voting data; through the voting model, voting can be performed, that is, the prediction result with the most occurrences is selected as the final result, so as to determine the model prediction result of each pre-trained information classification model. In some other embodiments, the voting model can also be a screening model, and there is a preset screening condition in the screening model. The multiple model output results can be input into the voting model, and through the voting model, according to the preset screening condition, the model prediction result of the pre-trained information classification model is screened out from the multiple model output results. For example, the preset screening condition here can be to screen out the model output result of the output result category with the largest number.
[0133] Step S2112, the server determines the information classification result of the information to be classified based on the model prediction results of the multiple pre-trained information classification models.
[0134] In some embodiments, the server determines the information classification result of the information to be classified based on the model prediction results of multiple pre-trained information classification models, which can be implemented in the following manner: First, the server performs second result classification statistics on the model prediction results of multiple pre-trained information classification models, obtaining at least one prediction result category of the model prediction results and the number of model prediction results for each prediction result category. Then, the server determines the model prediction result of the prediction result category with the largest number as the information classification result of the information to be classified.
[0135] In some embodiments, if the server uses multiple pre-trained information classification models to classify the theme of a news article. The prediction results output by each classification model may be different categories such as "entertainment", "economy", "sports", etc. The server counts the number of each category according to the prediction results of each classification model. For example, a total of 7 pre-trained information classification models are used for classification. Among them, "entertainment" appears 2 times in total, "economy" appears 4 times in total, and "sports" appears 1 time in total. Therefore, the number of times "economy" appears is the largest, and the server will determine "economy" as the theme of the news.
[0136] In some embodiments, if there are at least two groups of model prediction results with the same number of occurrences among the multiple model prediction results, calculations can be performed based on the weights of each pre-trained information classification model. Among them, the weight of the pre-trained information classification model refers to the credibility of the prediction result of the pre-trained information classification model, and the weight of the pre-trained information classification model can be determined according to the performance of the pre-trained information classification model on the public dataset. The public dataset refers to a dataset that can be freely accessed and used.
[0137] In some embodiments, if the server uses multiple pre-trained information classification models to classify the theme of a news article. The prediction results output by each classification model may be different categories such as "entertainment", "economy", "sports", etc. The server counts the number of each category according to the prediction results of each classification model. For example, a total of 7 pre-trained information classification models are used for classification. The model predictions of model A, model B, and model C are "entertainment", the model predictions of model D, model E, and model F are "economy", and the model prediction of model G is "sports". Among them, "entertainment" and "economy" each appear 3 times, and "sports" appears 1 time. At this time, the number of times "entertainment" and "economy" appear is the same, and the final information classification result can be determined by the weights of each pre-trained information classification model. If the total score of the weights of the pre-trained information classification models is 10, and the weight scores of models A to G are 10, 7, 7, 9, 9, 8 respectively, according to the number of times each prediction result appears and the weights of the pre-trained information classification models, the final score of "entertainment" is 10×3 + 7×3 + 7×3 = 72 points, and the final score of "economy" is 9×3 + 9×3 + 8×3 = 78 points. From this, it can be determined that the theme of the news is "economy".
[0138] In some other embodiments, the server determines the information classification result of the information to be classified based on the model prediction results of multiple pre-trained information classification models, and it can also be implemented through a pre-trained voting model. The voting model and the voting model used to determine the model prediction results of each pre-trained information classification model described above can be the same model, that is, the voting model and the voting model used to determine the model prediction results of each pre-trained information classification model described above have the same model structure and model parameters. Of course, the voting model can also be a model different from the voting model used to determine the model prediction results of each pre-trained information classification model described above. For example, the two models can have the same model structure but different model parameters. In the implementation process, the model prediction results of multiple pre-trained information classification models can be input into the pre-trained voting model, where the voting model can be obtained by training a pre-constructed basic neural network with sample voting data; through the voting model, voting can be performed, that is, the model prediction result of the pre-trained information classification model with the most occurrences is selected as the final result, so as to determine the information classification result of the information to be classified. In some other embodiments, the voting model can also be a screening model. There are preset screening conditions in the screening model. The model prediction results of multiple pre-trained information classification models can be input into the voting model, and through the voting model, according to the preset screening conditions, the information classification result of the information to be classified is screened out from the output results of multiple models. For example, the preset screening condition here can be to screen out the model prediction result of the category with the largest number of prediction results.
[0139] Step S212, the server sends the information classification result of the information to be classified to the terminal.
[0140] In some embodiments, after determining the information classification result of the information to be classified, the server may also map the information to be classified and the information classification result and then store them in the sample database, so as to update the sample database. When updating the sample database, the information to be classified and the information classification result may be used as positive samples in the sample database, where the information classification result is used as the label information of the information to be classified. The sample database may be the above-mentioned industry database, and different sample data are stored in the sample database, and the sample data are used to train the pre-trained information classification model.
[0141] Step S213, the terminal displays the information classification result of the information to be classified on the current interface.
[0142] The information classification method provided by the embodiments of the present application can reduce the probability of the model fabricating facts and improve the accuracy of information classification by repeatedly inputting the input information into the pre-trained information classification model for prediction. At the same time, by integrating multiple pre-trained information classification models, the advantages of different pre-trained information classification models can be comprehensively utilized, thereby further improving the accuracy of information classification.
[0143] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0144] The embodiments of the present application improve the accuracy of information classification of the pre-trained information classification model and protect the privacy of data through the self-consistency of the pre-trained information classification model and the fusion of multiple pre-trained information classification models.
[0145] Figure 12 is the schematic diagram of the solution architecture provided by the embodiments of the present application. The server deploys N large language models locally, constructs corresponding prompt information (prompt) for each large language model, repeatedly inputs the prompt information M times into the corresponding large language model to obtain M prediction results, and determines the prediction result of the current large language model among the M prediction results; repeat the above same operation for N large language models to obtain N prediction results, and determine the final prediction result among the N prediction results.
[0146] Figure 13 is the schematic diagram of the implementation process of the information classification method provided by the embodiments of the present application in an actual scenario, as Figure 13 shown, the method includes the following steps S301 to S308:
[0147] Step S301: The server constructs an industry classification system based on the management requirement information of each service and the actual business scenarios of each service.
[0148] In the embodiments of the present application, a good industry classification system is crucial for information classification problems. Sometimes, the classification effect is not good, not because there is a problem with the model or method, but because the definition of the industry classification system is not clear enough.
[0149] Step S302: The server constructs multiple sample data for each classified industry from a preset industry database according to the constructed industry classification system.
[0150] In the embodiments of the present application, only 3 to 5 sample data need to be constructed for each classified industry.
[0151] Step S303: The server deploys N pre-trained information classification models on the information classification platform.
[0152] Step S304: After deploying the pre-trained information classification models, the server adjusts the initial parameters of the models to obtain the pre-trained information classification models with adjusted parameters.
[0153] Step S305: The server constructs model input information for each of the N pre-set pre-trained information classification models.
[0154] In the embodiments of the present application, the construction form of the model input information is as follows:
[0155] Task description: Given the information to be classified, the server needs to determine which industry the information to be classified belongs to from the industries listed below, and list all alternative industries.
[0156] Industry definition: The definition of each alternative industry given.
[0157] Sample data: Hint the model by way of example, such as: Merchant ** belongs to Industry A, Merchant ** belongs to Industry B.
[0158] Problem description: Describe the problem to be solved to the server, such as: Determine which industry Merchant **** belongs to from the above given ones?
[0159] Step S306: After the server constructs the model input information, it repeatedly inputs the model input information into the corresponding pre-trained information classification model M times to obtain M model output results.
[0160] Step S307: The server performs a voting operation on the obtained M model output results, and selects the model output result with the most occurrences as the model prediction result of the current pre-trained information classification model.
[0161] In the embodiments of the present application, the server repeatedly executes steps S304 to S307 on N pre-trained information classification models to obtain N model prediction results.
[0162] Step S308, the server performs a voting operation on the N model prediction results, and selects the model prediction result with the most occurrences as the final classification result of the information to be classified.
[0163] In the embodiments of the present application, by deploying multiple pre-trained information classification models on the information classification platform, and using the self-consistency of the pre-trained information classification models and the fusion of multiple pre-trained information classification models, while improving the accuracy of the pre-trained information classification models for information classification, the privacy of the data is protected. At the same time, only a very small amount of labeled data is required, greatly reducing the labor cost.
[0164] In the embodiments of the present application, through self-consistency and the fusion of multiple pre-trained information classification models, the classification accuracy of the model can be improved from the following two aspects: 1) Through self-consistency, the probability of the pre-trained information classification model fabricating facts can be reduced; 2) Since there are certain differences in the training data and training methods of different pre-trained information classification models, through the fusion of multiple pre-trained information classification models, the advantages of each can be taken to improve the classification accuracy.
[0165] It can be understood that in the embodiments of the present application, for content related to user information, such as the name of a merchant, the information of a merchant, etc., if it involves data related to user information or enterprise information, when the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, or these information need to be blurred to eliminate the corresponding relationship between these information and users; and the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations during actual application, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behaviors within the scope authorized by laws and regulations and the personal information subject.
[0166] The following continues to describe the exemplary structure in which the information classification device 554 provided in the embodiments of the present application is implemented as a software module. In some embodiments, such as Figure 5As shown, the information classification device 554 includes: an acquisition module 5541, configured to acquire information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries; a sample data construction module 5542, configured to construct multiple sample data for each of the classified industries from a preset industry database according to the industry classification system; an input information construction module 5543, configured to construct input information of each pre-trained information classification model in multiple preset pre-trained information classification models based on the information to be classified and the sample data of each classified industry; a classification module 5544, configured to input the input information of each pre-trained information classification model into the corresponding pre-trained information classification model multiple times in a loop for information classification processing, and correspondingly obtain multiple model output results; and a determination module 5545, configured to determine the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models.
[0167] In some embodiments, the device further includes: an industry classification system construction module, configured to acquire management requirement information of each of multiple predefined services, and the actual business scenario of each service; and construct the industry classification system including the multiple classified industries according to the actual business scenario and the management requirement information of each service.
[0168] In some embodiments, the industry database stores merchant information corresponding to multiple different industries, and the number of merchant information corresponding to each industry is at least one; the sample data construction module is further configured to: acquire each classified industry in the industry classification system; for each classified industry, determine at least one target merchant information corresponding to the corresponding classified industry from the industry database; and perform data mapping processing on the target merchant information and the classified industry to obtain the sample data.
[0169] In some embodiments, the input information construction module is further configured to: construct task description information of the pre-trained information classification model based on the information to be classified; the task description information includes: task content for defining a processing task for information classification processing of the information to be classified; construct reference sample information of the pre-trained information classification model based on the sample data of the classified industry; the reference sample information is used to provide prompt information for the pre-trained information classification model when executing the processing task; and determine the task description information and the reference sample information as the input information of the pre-trained information classification model.
[0170] In some embodiments, the task description information further includes: at least one alternative industry, and industry definition information for each of the alternative industries; the input information construction module is further configured to: determine a target classified industry that belongs to the same industry as each of the alternative industries; obtain sample data of the target classified industry; and construct reference sample information for the pre-trained information classification model based on the sample data of the target classified industry.
[0171] In some embodiments, the information classification method is applied to an information classification platform; the apparatus further includes: a model deployment module, configured to obtain initial model parameters of a plurality of pre-trained information classification models before constructing the input information of the pre-trained information classification model; and deploy the plurality of pre-trained information classification models on the information classification platform based on the initial model parameters.
[0172] In some embodiments, the apparatus further includes: a parameter adjustment module, configured to, after deploying the plurality of pre-trained information classification models on the information classification platform, obtain a temperature parameter in the initial model parameters of the pre-trained information classification model; obtain a preset temperature parameter adjustment value corresponding to the temperature parameter; and, through the information classification platform, adjust the initial model parameters of the pre-trained information classification model that has been deployed based on the preset temperature parameter adjustment value to obtain a pre-trained information classification model with adjusted parameters; the input information construction module is further configured to: construct the input information of the pre-trained information classification model with adjusted parameters based on the information to be classified and the sample data of each of the classified industries.
[0173] In some embodiments, the apparatus further includes: a model training module, configured to, after deploying the plurality of pre-trained information classification models on the information classification platform, train the pre-trained information classification model that has been deployed through the information classification platform based on preset training samples to obtain a trained information classification model; the input information construction module is further configured to: construct the input information of the trained information classification model based on the information to be classified and the sample data of each of the classified industries.
[0174] In some embodiments, the determination module is further configured to: determine the model prediction result of each pre-trained information classification model based on the multiple model output results respectively output by the multiple pre-trained information classification models; and determine the information classification result of the information to be classified based on the model prediction results of the multiple pre-trained information classification models.
[0175] In some embodiments, the determining module is further configured to: for each of the pre-trained information classification models, obtain a plurality of model output results output by the pre-trained information classification model; perform a first result classification and statistics on the plurality of model output results to obtain at least one output result category of the model output results and the number of model output results in each output result category; and determine the model output result of the output result category with the largest number as the model prediction result of the pre-trained information classification model.
[0176] In some embodiments, the determining module is further configured to: perform a second result classification and statistics on the model prediction results of the plurality of pre-trained information classification models respectively to obtain at least one prediction result category of the model prediction results and the number of model prediction results in each prediction result category; and determine the model prediction result of the prediction result category with the largest number as the information classification result of the information to be classified.
[0177] It should be noted that the description of the device in the embodiments of the present application is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments, so details will not be repeated. For the technical details not disclosed in the embodiments of the present device, please refer to the description of the method embodiments of the present application for understanding.
[0178] An embodiment of the present application provides an electronic device, including: a memory for storing executable instructions; and a processor for implementing the above information classification method when executing the executable instructions stored in the memory.
[0179] An embodiment of the present application provides a computer program product, which includes executable instructions, and the executable instructions are a kind of computer instructions; the executable instructions are stored in a computer-readable storage medium. When the processor of the electronic device reads the executable instructions from the computer-readable storage medium and the processor executes the executable instructions, the electronic device is caused to execute the method in the embodiments of the present application described above.
[0180] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions are stored, and when the executable instructions are executed by a processor, the processor is caused to execute the method provided in the embodiments of the present application, for example, Figure 6 the method shown.
[0181] In some embodiments, the storage medium may be a computer-readable storage medium, for example, a ferroelectric memory (FRAM, Ferromagnetic Random Access Memory), a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read Only Memory), a flash memory, a magnetic surface memory, an optical disc, or a compact disk-read only memory (CD-ROM), etc.; it may also be various devices including one or any combination of the above memories.
[0182] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0183] As an example, the executable instructions may or may not correspond to a file in the file system, may be stored as a part of a file that stores other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, Hyper Text Markup Language) document, stored in a single file dedicated to the program under discussion, or stored in multiple cooperating files (for example, files that store one or more modules, subroutines, or code portions). As an example, the executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed at multiple locations and interconnected through a communication network.
[0184] As described above, the above are only embodiments of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. An information classification method, characterized in that, The method includes: Obtaining the information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries; According to the industry classification system, constructing multiple sample data for each of the classified industries from a preset industry database; For each pre-trained information classification model among multiple pre-trained information classification models, constructing the input information of the pre-trained information classification model based on the information to be classified and the sample data of each classified industry; Inputting the input information of each pre-trained information classification model into the corresponding pre-trained information classification model in a loop for multiple times for information classification processing, and correspondingly obtaining multiple model output results; Based on the multiple model output results output by each pre-trained information classification model, determining the information classification result of the information to be classified.
2. The method according to claim 1, characterized in that, The method further includes: Obtaining the management requirement information of each of multiple predefined services and the actual business scenarios of each service; According to the actual business scenarios and the management requirement information of each service, constructing the industry classification system including the multiple classified industries.
3. The method according to claim 1, wherein The industry database stores merchant information corresponding to multiple different industries, and the number of merchant information corresponding to each industry is at least one; The step of constructing multiple sample data for each of the classified industries from a preset industry database according to the industry classification system includes: Obtaining each classified industry in the industry classification system; For each classified industry, determining at least one target merchant information corresponding to the corresponding classified industry from the industry database; Performing data mapping processing on the target merchant information and the classified industry to obtain the sample data.
4. The method according to claim 1, wherein The step of constructing the input information of the pre-trained information classification model based on the information to be classified and the sample data of each classified industry includes: Constructing the task description information of the pre-trained information classification model based on the information to be classified; the task description information includes: the task content for defining the processing task of performing information classification processing on the information to be classified; Constructing the reference sample information of the pre-trained information classification model based on the sample data of the classified industry; the reference sample information is used to provide prompt information for the pre-trained information classification model when performing the processing task; Determining the task description information and the reference sample information as the input information of the pre-trained information classification model.
5. The method according to claim 4, characterized in that, The task description information further includes: at least one alternative industry, and the industry definition information of each alternative industry; The step of constructing the reference sample information of the pre-trained information classification model based on the sample data of the classified industry includes: Determining the target classified industries belonging to the same industry as each alternative industry; Obtaining the sample data of the target classified industries; Constructing the reference sample information of the pre-trained information classification model based on the sample data of the target classified industries.
6. The method according to claim 1, characterized in that, The information classification method is applied to an information classification platform; Before constructing the input information of the pre-trained information classification model, the method further includes: Obtain the model initial parameters of multiple pre-trained information classification models; Based on the model initial parameters, deploy the multiple pre-trained information classification models on the information classification platform.
7. The method according to claim 6, characterized in that After deploying the multiple pre-trained information classification models on the information classification platform, the method further includes: Obtain the temperature parameter in the model initial parameters of the pre-trained information classification model; Obtain a preset temperature parameter adjustment value corresponding to the temperature parameter; Through the information classification platform, based on the preset temperature parameter adjustment value, adjust the model initial parameters of the pre-trained information classification model that has been deployed to obtain a pre-trained information classification model with adjusted parameters; The constructing the input information of the pre-trained information classification model based on the information to be classified and the sample data of each of the classified industries includes: Based on the information to be classified and the sample data of each of the classified industries, construct the input information of the pre-trained information classification model with adjusted parameters.
8. The method according to claim 6, characterized in that, After deploying the multiple pre-trained information classification models on the information classification platform, the method further includes: Through the information classification platform, train the pre-trained information classification model that has been deployed based on preset training samples to obtain a trained information classification model; The constructing the input information of the pre-trained information classification model based on the information to be classified and the sample data of each of the classified industries includes: Based on the information to be classified and the sample data of each of the classified industries, construct the input information of the trained information classification model.
9. The method according to any one of claims 1 to 8, characterized in that, The determining the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models includes: Based on the multiple model output results respectively output by the multiple pre-trained information classification models, determine the model prediction result of each pre-trained information classification model; Based on the model prediction results of the multiple pre-trained information classification models, determine the information classification result of the information to be classified.
10. The method according to claim 9, wherein The determining the model prediction result of each pre-trained information classification model based on the multiple model output results respectively output by the multiple pre-trained information classification models includes: For each pre-trained information classification model, obtain the multiple model output results output by the pre-trained information classification model; Perform a first result classification and statistics on the multiple model output results to obtain at least one output result category of the model output results and the quantity of the model output results of each output result category; Determine the model output result of the output result category with the largest quantity as the model prediction result of the pre-trained information classification model.
11. The method according to claim 9, characterized in that, The determining the information classification result of the information to be classified based on the model prediction results of the multiple pre-trained information classification models includes: Perform a second result classification and statistics on the model prediction results of the multiple pre-trained information classification models to obtain at least one prediction result category of the model prediction results and the quantity of the model prediction results of each prediction result category; Determine the information classification result of the information to be classified as the model prediction result with the largest number of predicted result categories.
12. An information classification device, characterized in that, The device includes: An acquisition module, configured to acquire information to be classified and a preset industry classification system, where the industry classification system includes multiple classified industries; A sample data construction module, configured to construct multiple sample data for each of the classified industries from a preset industry database according to the industry classification system; An input information construction module, configured to construct input information for each of multiple preset pre-trained information classification models based on the information to be classified and the sample data of each classified industry; A classification module, configured to repeatedly input the input information of each pre-trained information classification model into the corresponding pre-trained information classification model for information classification processing, and correspondingly obtain multiple model output results; A determination module, configured to determine the information classification result of the information to be classified based on the multiple model output results respectively output by the multiple pre-trained information classification models.
13. An electronic device, characterized in that, It includes: A memory, configured to store executable instructions; A processor, configured to implement the information classification method according to any one of claims 1 to 11 when executing the executable instructions stored in the memory.
14. A computer-readable storage medium, characterized in that, Stored with executable instructions, configured to cause the processor to implement the information classification method according to any one of claims 1 to 11 when executing the executable instructions.