Risk control method and device based on memory unit, equipment and storage medium
Through the memory unit-based risk control method, the intelligent model retrieves and stores new knowledge through the network, solving the problem of its insufficient review ability on new topics, achieving more accurate and efficient risk control results, and enhancing its ability to learn new knowledge. ability.
Patent Information
- Application Number
- CN202410353066.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-09-10
AI Technical Summary
When intelligent models deal with the latest topics, they lack the latest knowledge, resulting in insufficient risk judgment and review capabilities. Existing technologies fail to effectively solve the problem of their ability to learn new knowledge.
Introducing a risk control method based on memory units, by obtaining input information, retrieving the network to obtain new knowledge, and storing and updating data in memory units, ensuring that large models can actively learn and understand new information, thereby improving the accuracy of risk control results .
Through real-time updating of memory units and network retrieval, intelligent models can keep up with the times, improve their review accuracy and response speed on new topics, avoid erroneous output caused by knowledge lag, and enhance their ability to learn new knowledge.
Smart Images

Figure CN118626602A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a risk control method, device, equipment and storage medium based on a memory unit. Background Art
[0002] The diversity and richness of the Internet have led to the increasing complexity and scale of data, which poses a severe challenge to the security identification and risk control capabilities of network platforms. In order to improve risk control capabilities, network platforms are moving towards intelligent security services. However, when intelligent models process user information or review requests, the lag of their information is an issue that cannot be ignored.
[0003] At present, when dealing with the latest topics, traditional intelligent models lack the latest knowledge, which leads to deficiencies in their ability to judge and review risk topics, thus seriously affecting the accuracy of security audits. However, the existing technology has not yet found an effective solution to enable intelligent models with risk control capabilities to learn and update new knowledge. Summary of the invention
[0004] The problem solved by the present invention is how to enable the intelligent model to have the ability to learn new knowledge.
[0005] In order to solve the above problems, in a first aspect, the present invention provides a risk control method based on a memory unit, comprising:
[0006] Get input information;
[0007] Obtain matching data in a preset memory unit;
[0008] When the matching data does not exist in the memory unit, extracting the corpus of the input information, performing a network search based on the corpus to obtain a search result, and storing the search result that meets the preset storage condition in the memory unit;
[0009] Constructing a risk control prompt text based on the matching data and the input information;
[0010] The risk control prompt text is processed by a large model to obtain a risk control result.
[0011] When enabling the large model to have the ability to learn new knowledge, it is necessary to ensure that the knowledge is "new" and "accurate". Therefore, compared with the prior art, the present invention introduces a cache mechanism. When the input information contains new knowledge that has not been processed by the large model, that is, when there is no matching data in the cache library, the large model is used to perform network retrieval, so that the large model can actively retrieve and learn when processing new knowledge, and prevent the erroneous output caused by the lag of the large model knowledge base. The large model is guided to process the input information through network retrieval, ensuring that the large model can more accurately understand the problems contained in the input information, thereby obtaining matching data with learning significance, and constructing risk control prompt text based on matching data and input information, so as to obtain more accurate risk control results, classify the retrieval results, and store the retrieval results that are helpful for subsequent use in the memory unit, which can be used as memory data for subsequent use, to ensure that the content in the memory unit has a high learning value, and further guide the subsequent input information through the memory unit, so that the large model has the ability to learn new knowledge.
[0012] Optionally, when the matching data does not exist in the memory unit, extracting the corpus of the input information, performing a network search based on the corpus, and obtaining the search results includes:
[0013] Call external network search tools through long chain framework;
[0014] The corpus is searched through the external network search tool to obtain search results.
[0015] Optionally, storing the search results meeting a preset storage condition into the memory unit comprises:
[0016] Preliminarily classify the search results by using a first classification model to obtain a first classification result, wherein the first classification model is a binary classifier model, and the first classification result includes a safety category and an unsafe category;
[0017] Using a second classification model, fine-grained classification is performed on the search results of the security category to obtain a second classification result, wherein the second classification model is a multi-classifier model;
[0018] The search result of the security category and the input information corresponding to the search result are used as a question-answer pair;
[0019] According to the second classification result, the question-answer pairs are stored in the memory units respectively.
[0020] Optionally, constructing the risk control prompt text based on the matching data and the input information includes:
[0021] Selecting a prompt text template corresponding to the second classification result;
[0022] Construct a risk control prompt text based on the matching data, the prompt text template and the input information.
[0023] Optionally, acquiring the matching data in a preset memory unit includes:
[0024] Establishing a similarity algorithm library, and determining a similarity algorithm in the similarity algorithm library according to the modality type of the input information, wherein the similarity algorithm includes a Pearson correlation coefficient, an Euclidean distance, a cosine similarity, or a Jaccard similarity coefficient;
[0025] Calculating the similarity between the input information and the memory data by using the similarity algorithm, wherein the memory data includes the data stored in the memory unit;
[0026] The memory data higher than the preset threshold is used as the matching data.
[0027] Optionally, calculating the similarity between the input information and the memory data by using the similarity algorithm includes:
[0028] Processing the input information through the second classification model to obtain a third classification result;
[0029] In the memory unit, data of the same type as the third classification result is selected as the memory data.
[0030] Optionally, before obtaining the input information, the method further includes:
[0031] Crawl popular data from the Internet at preset intervals;
[0032] The hot data is classified, and the hot data classified as a security category is stored in the memory unit.
[0033] In a second aspect, the present invention provides a wind control device based on a memory unit, comprising:
[0034] An input module, used to obtain input information;
[0035] A matching module, used for acquiring matching data in a preset memory unit;
[0036] A retrieval module, for extracting the corpus of the input information when the matching data does not exist in the memory unit, performing a network search based on the corpus to obtain a retrieval result, and storing the retrieval result that meets a preset storage condition in the memory unit;
[0037] A prompt text construction module, used to construct a risk control prompt text based on the matching data and the input information;
[0038] The output module is used to process the risk control prompt text through a large model to obtain a risk control result.
[0039] The beneficial effects of the wind control device based on the memory unit relative to the prior art are the same as those of the wind control method based on the memory unit, and will not be described in detail here.
[0040] In a third aspect, the present invention further provides a computer device, comprising a memory and a processor;
[0041] The memory is used to store computer programs;
[0042] The processor is used to implement the risk control method based on the memory unit as described above when executing the computer program.
[0043] The beneficial effects of the computer device relative to the prior art are the same as those of the memory unit-based risk control method, which will not be repeated here.
[0044] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the risk control method based on the memory unit as described above is implemented.
[0045] The beneficial effects of the computer-readable storage medium relative to the prior art are the same as those of the memory unit-based risk control method, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Schematic diagram of a flow chart of a risk control method based on a memory unit according to an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of a detailed flow chart of step S300 of the risk control method based on a memory unit according to an embodiment of the present invention;
[0048] Figure 3 Another flowchart diagram of the memory unit-based risk control method after step S300 is refined according to an embodiment of the present invention;
[0049] Figure 4 is a flowchart of a risk control method based on a memory unit according to an embodiment of the present invention;
[0050] Figure 5 is a system block diagram of a computer device according to an embodiment of the present invention;
[0051] Figure 6 A system block diagram of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0053] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0054] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". Relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0055] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0056] like Figure 1 and Figure 4 As shown, an embodiment of the present invention provides a risk control method based on a memory unit, comprising:
[0057] Step S100, obtaining input information.
[0058] With the development of Internet technology, thanks to the improvement of network speed, the presentation of user-generated content (UGC) has flourished, and its data volume has also increased exponentially with the popularization of Internet technology. Users can share content in various forms on the network platform, including text, audio, video, images and other media. In order to ensure the safe and stable operation of the network platform, it poses a severe challenge to the security and risk control capabilities of the network platform.
[0059] In one embodiment, the input information may be the user's request information, that is, the information input to the intelligent model when the user interacts with the intelligent model with risk control capabilities; the input information may also be the pending information that needs to be reviewed by the network platform. The input information is input into the intelligent model, and the intelligent model conducts the review and obtains the output result.
[0060] In another embodiment, the input information includes one or more of text, audio, video, and image.
[0061] Step S200, obtaining matching data in a preset memory unit.
[0062] Specifically, the memory unit is used to improve the accuracy of the risk control review of the intelligent model with risk control function on new topics. By establishing a memory unit and storing new knowledge in it, the intelligent model can use this new knowledge to conduct risk control review, or guide the intelligent model's response to user requests based on the new knowledge. At the same time, it can also ensure that the output of the model not only refers to the new knowledge, but also does not generate prohibited content due to the introduction of new knowledge. This method ensures the accuracy and stability of the intelligent model when processing new topics.
[0063] In one embodiment, the memory unit is used as an external knowledge base of the intelligent model, and the intelligent model is guided to respond to input information through the information cached in the external knowledge base.
[0064] In another embodiment, the hot topics and new things on the current network are stored as memory data in a special memory unit as a plug-in knowledge base of the intelligent model, providing powerful information support for the intelligent model. When the questions input by the user involve these hot topics or new things, the information in this memory unit can be used to guide the intelligent model to answer. In this way, the output of the intelligent model can be based on the latest knowledge and information, thereby avoiding the problem of inaccurate model judgment or chaotic model output due to the inability to obtain and synchronize the latest network information in real time. This method effectively solves the hysteresis problem of the intelligent model in the learning process, enables the model to keep up with the pace of the times, and provides users with more accurate and efficient answer services. The advantage of establishing a memory unit is that it can update the knowledge base of the model in real time, so that the model can keep abreast of the latest information and dynamics at any time. At the same time, this method can also improve the response speed and accuracy of the model, so that users can get a better service experience.
[0065] Step S300, when the matching data does not exist in the memory unit, extract the corpus of the input information, perform a network search based on the corpus, obtain a search result, and store the search result that meets the preset storage condition into the memory unit.
[0066] Specifically, after the input information is obtained, the memory data stored in the memory unit is retrieved to determine whether the memory unit has memory data matching the input information.
[0067] In one embodiment, it is determined whether the memory unit contains memory data that matches the input information. The purpose is that, since the memory unit contains content that was not present when the model was trained, the memory data can be used to match the input information, so as to determine whether the input information is content that the intelligent model has never been exposed to, thereby further guiding the intelligent model to respond through the memory unit. When the input information is content that the intelligent model has been exposed to before, the intelligent model is guided to respond through the memory unit; when the input information is not content that the intelligent model has been exposed to before, the learning process of the model is triggered to ensure that the model has the ability to learn new knowledge.
[0068] Specifically, when the memory unit is searched and it is determined that the cache content in the memory unit does not match the input information, the learning process of the model is triggered, the input information is searched through the large model, and the processing process is entered.
[0069] In one embodiment, the network platform uses the large model as an intelligent model for risk control.
[0070] In one embodiment, the input information is semantically identified through the big model to obtain the input semantics, and the input semantics are data enhanced to obtain at least one word or sentence consistent with the input semantics, and the enhanced word or sentence is retrieved to obtain network information related to the word or sentence. For example, if the input information is "today's weather conditions", the input information is semantically identified through the big model to obtain the corresponding "weather condition query" semantics as the input semantics, and the input semantics are data enhanced to obtain words similar to the input semantics such as "weather", "climate", "temperature", "specific temperature of each time period today", etc., and the words are retrieved to obtain real-time weather information from the network.
[0071] In another embodiment, data enhancement is performed on the semantics of the input to obtain multiple words or sentences that are consistent with the input semantics. These enhanced corpora are regarded as independent texts and are independently retrieved. In this way, we can obtain a variety of retrieval results related to the input semantics. Since these retrieval results may come from web pages, and web pages may contain a variety of information, such as text, images, videos, audio, etc., it is necessary to extract and process the retrieval results. This process involves extracting useful information from the retrieval results, such as extracting relevant text, images or other multimedia resources from web pages. The extracted results are used as the knowledge basis of the large model to guide the large model to process the input information more comprehensively. It helps to ensure that the large model can learn new knowledge more comprehensively and avoid the situation of taking things out of context. In specific implementation, data enhancement technology may include but is not limited to natural language processing technologies such as synonym replacement, random insertion, and random deletion to generate multiple corpora consistent with the input semantics. After these corpora are independently retrieved, a variety of retrieval results related to the input semantics can be obtained. By extracting and processing these results, the large model can learn more comprehensive knowledge from them, so as to understand and process the input information more accurately. This approach not only improves the performance of large models, but also avoids one-sided or incomplete processing of information.
[0072] Specifically, the capacity of the memory unit must be maintained within a preset range. If the capacity of the memory unit is too large, it may lead to reduced efficiency in data processing because a large amount of data may slow down the operation. On the contrary, if the capacity of the memory unit is too small, it may not be able to fully store and process the required data, which may reduce the ability of the memory unit to guide the intelligent model.
[0073] In order to ensure the risk control ability of the intelligent model, a classification mechanism is introduced. This mechanism automatically identifies the results in the preset categories and stores the classification results of the preset categories in the memory unit. In this way, only the information that can improve the risk control ability of the intelligent model will be stored in the memory unit, and the information that cannot provide improvement will be automatically filtered out. This classification mechanism not only improves the quality of information in the memory unit, but also ensures that the intelligent model can receive the most relevant web page information as guidance information, so as to learn and predict more effectively.
[0074] Step S400: constructing a risk control prompt text based on the matching data and the input information.
[0075] Specifically, when there is matching data in the memory unit, the risk control prompt text is constructed based on the matching data and input information, and the content of the matching data is used as new knowledge of the big model, so that the big model can make reasonable judgments on the input information.
[0076] Step S500, processing the risk control prompt text through a large model to obtain a risk control result.
[0077] In one embodiment, when the large model processes content that it has not learned, the risk control results obtained often have poor accuracy. By allowing the large model to process prompt text with matching data, it is ensured that when the large model has not learned the content, it can learn new knowledge related to the input information from the prompt text, thereby ensuring that the large model can make more reasonable judgments on the input information and obtain more accurate risk control results.
[0078] Alternatively, if Figure 2 As shown, when the matching data does not exist in the memory unit, extracting the corpus of the input information, performing a network search based on the corpus, and obtaining the search results includes:
[0079] Step S310, calling an external network search tool through a long chain framework.
[0080] Step S311, searching the corpus through the external network search tool to obtain search results.
[0081] Specifically, after determining that the memory unit does not contain memory data that matches the input information, the large model needs to understand and learn the new content. By calling external network retrieval tools, it can ensure that the large model can obtain new information in real time, rather than reasoning based on existing old knowledge, to prevent the large model from producing erroneous outputs.
[0082] In one embodiment, the long chain framework (langchain) enables the large model to have the ability to call external tools. By calling the external network search tool (web search), the input semantics obtained by processing the input information are searched to obtain the search results based on the input semantics. After the content in the web page is extracted, the extracted content is obtained, and the extracted content is used as one of the processing bases of the large model. Through natural language, the search results are spliced with the input information, and the large model is guided by the extracted text to process and obtain the processing results.
[0083] For example, when the input information is "What clothes should I wear today to keep warm?", its corresponding input semantics include obtaining the weather conditions, temperature chart, and recommended clothing at the corresponding temperature on the current date. A network search is performed based on the input semantics to obtain extracted content such as temperature and barometer as one of the processing bases of the large model. The weather conditions, temperature chart, and recommended clothing obtained through the network search are used as one of the information input to the large model to assist the large model in processing the input information.
[0084] Alternatively, if Figure 3 and Figure 4As shown, storing the search results that meet the preset storage conditions into the memory unit includes:
[0085] Step S320, preliminarily classify the search results through a first classification model to obtain a first classification result, wherein the first classification model is a binary classifier model, and the first classification result includes a safety category and an unsafe category.
[0086] Step S321, fine-grained classification is performed on the search results of the security category through a second classification model to obtain a second classification result, wherein the second classification model is a multi-classifier model.
[0087] Step S322: the search result of the security category and the input information corresponding to the search result are used as a question-answer pair.
[0088] Step S323: store the question-answer pairs into the memory units respectively according to the second classification result.
[0089] In one embodiment, after the large model acquires and learns new knowledge, it processes the input information and obtains the processing results. In order to ensure the storage of new knowledge and the rapid response to subsequent similar input information, the new knowledge needs to be stored in the memory unit. The processing results are preliminarily classified by the first classification model, and the processing results of the security category are screened out and the corresponding retrieval results and input information are stored together as a knowledge base to guide the large model to perform reasoning. This not only ensures the security of the new knowledge, but also ensures that the memory unit has a reasonable capacity.
[0090] In one embodiment, the first classification model is a neural network model, which is trained by a preset training set to have a binary classification capability, wherein the classification results include security categories and non-security categories. In order to ensure that the memory data in the memory unit are all information related to security risk control, classification is performed through a binary classification model, and the processing results related to the security category and its corresponding retrieval results and input information are stored in the memory unit for subsequent retrieval and call.
[0091] In another embodiment, security-related processing results and retrieval results include information that has guiding capabilities during risk control audits, such as information involving illegal content. This type of information has a guiding role in subsequent processing of the large model, so it is stored in the memory unit to enhance the risk control capabilities of the large model.
[0092] In one embodiment, before storing the processing result related to the security category and the corresponding retrieval result into the memory unit, it also includes determining the fine-grained category of the processing result and the corresponding retrieval result through a second classification model.
[0093] In another embodiment, the application scenarios of the large model cover risk control scenarios, so the fine-grained categories include categories containing sensitive keywords. When the large model receives new input information related to a sensitive keyword, it uses the memory data about the sensitive keyword in the memory unit as new knowledge to enhance its own risk control recognition capabilities. For example, after the retrieval and processing of step S400, after discovering the relevant vocabulary of the new sensitive keyword, the new vocabulary is stored in the memory unit as one of the retrieval results, input information or processing results according to the actual situation as a new knowledge reserve. In this way, when the large model is exposed to input information related to the vocabulary again, it can ensure that the large model can accurately recognize and process the vocabulary.
[0094] Optionally, constructing the risk control prompt text based on the matching data and the input information includes:
[0095] Selecting a prompt text template corresponding to the second classification result;
[0096] Construct a risk control prompt text based on the matching data, the prompt text template and the input information.
[0097] In one embodiment, since the processing capabilities of the large model for different requests are different and are greatly affected by the prompt text, it is necessary to use the corresponding prompt text for retrieval to ensure that the large model can accurately process input information as requests of different types, and can ensure a certain audit accuracy when facing different types of input information. When the memory unit has matching data that matches the input information, the fine-grained category of the matching data is obtained, and the prompt text template, matching data and input information corresponding to the fine-grained category are spliced in natural language to obtain spliced information. When the spliced information is processed by the large model, the audit accuracy can be guaranteed.
[0098] For example, when the input information is about a certain sensitive keyword, if the memory unit has memory data similar to the input information, the fine-grained category in which the matching data and the input information are located is further determined. In this embodiment, the fine-grained category is a subdivided category of the above-mentioned sensitive keyword, and the prompt text template matching the subdivided category is selected, and the input information, the prompt text template related to the subdivided category and the matching data are spliced, and the spliced information is processed by the large model to obtain the processing result. For example, if the input information is "Has anyone done + (subdivided category keyword)", it is determined whether there is matching data related to someone + subdivided category keyword in the memory unit. If so, the information (news, articles, recordings or videos) is extracted, and the prompt text template related to the sensitive keyword is selected. Through natural language, "Has anyone done + (subdivided category keyword)" + "sensitive keyword prompt text template" + "news" are spliced, and the spliced information is processed by the large model to obtain the final output information.
[0099] Optionally, the determining the similarity between the input information and the memory data according to a preset similarity algorithm includes:
[0100] Establishing a similarity algorithm library, and determining a similarity algorithm in the similarity algorithm library according to the modality type of the input information, wherein the similarity algorithm includes a Pearson correlation coefficient, an Euclidean distance, a cosine similarity, or a Jaccard similarity coefficient;
[0101] Calculating the similarity between the input information and the memory data by using the similarity algorithm, wherein the memory data includes the data stored in the memory unit;
[0102] The memory data higher than the preset threshold is used as the matching data.
[0103] In one embodiment, since the input information and memory data have various forms, it is necessary to use a preset similarity algorithm to mathematically measure the similarity between the input information and the memory data to determine the similarity between the input information and the memory data. When the similarity exceeds the similarity threshold, it is considered that there is a certain correlation between the input information and the memory data, and the memory data can be used to guide the large model to reason and answer, and the memory data is used as matching data and input into the large model together with the input information to assist the large model in reasoning.
[0104] In one embodiment, a similarity algorithm library with multiple similarity algorithms is established, and the modal type of information is mapped to the algorithm through a preset mapping table. For example, the Pearson correlation coefficient has a better measurement effect on the similarity of text content, so the Pearson correlation coefficient is calculated with the input information whose modality type is text.
[0105] Optionally, calculating the similarity between the input information and the memory data by using the similarity algorithm includes:
[0106] Processing the input information through the second classification model to obtain a third classification result;
[0107] In the memory unit, data of the same type as the third classification result is selected as the memory data.
[0108] When determining the matching data in the memory unit based on the input information, the input information is processed through the second classification model to obtain a fine-grained classification result of the input information, that is, a third classification result, and the same type of memory data is selected according to the third classification result, and the matching data with the third classification result under the same fine-grained category is calculated to improve the matching efficiency and prevent interference from different types of memory data.
[0109] Optionally, before accessing the memory unit, the method further includes:
[0110] Crawl popular data from the Internet at preset intervals.
[0111] The hot data is classified, and the hot data classified as the safety category is stored in the memory unit. In one embodiment, the hot data can also be obtained according to the hot list on the network platform.
[0112] Optionally, the memory data includes previous search results, search questions and previous input information.
[0113] In one embodiment, there are two ways to obtain memory data. One is to trigger a network search with a preset timing trigger to obtain the search result. When it is determined that it belongs to the security category through the first classification model, the search result is cached. The second is to retrieve the input information through a network search tool when it is determined that the input information cannot match the memory data to obtain the search result, and process the splicing information including the search result through a large model to obtain the processing result. After processing by the first classification model, the processing result of the security category, the search result, and the input information are stored as a data group in the memory unit to facilitate subsequent retrieval and call.
[0114] like Figure 4 As shown, the specific implementation process of the risk control method based on the memory unit of the present invention includes: a user (platform auditor or individual user) initiates a request (including an audit request or an ordinary question and answer request), obtains input information in the request, such as "please describe the latest (someone) (some) event", calculates and determines whether the input information and the memory data in the memory unit are matched, that is, calculates the similarity between the two. When the similarity is higher than the preset similarity threshold, it means that relevant data is stored in the memory unit, such as "a well-known event" recently disclosed on the Internet. In this embodiment, the fine-grained category of the cached data is "a first fine-grained category", and a first fine-grained category prompt text template corresponding to the first fine-grained category is selected. The first fine-grained category prompt text template in this embodiment is: "You are now a content security audit expert. The following request content may have problems in (the first fine-grained category) and other aspects. Please analyze carefully in combination with the context and give a reasonable answer." Then, "a well-known event", "please describe the latest well-known event" and "first fine-grained category prompt text template" in the memory unit are spliced and processed through a large model. The large model can better understand and reason based on the information provided by the memory unit.
[0115] On the other hand, if there is no memory data matching the input information in the memory unit, the long chain framework in the large model is used to call the external network search tool for retrieval, crawl the real-time information on the network, splice the crawled content with the input information, process the spliced information through the large model, and output the processing results to the user. After obtaining the processing results, the security category is classified through the first classification model. If the processing result is a result about the security category, the result and its corresponding input information, retrieval results, retrieval questions, etc. are stored in the memory unit as a set of cache data to guide the next similar input information. Before storing in the memory unit, fine-grained classification is performed through the second classification model to ensure that the cache data can better guide the large model for processing when it is used again.
[0116] Another embodiment of the present invention provides a wind control device based on a memory unit, comprising:
[0117] Input module, used to obtain input information.
[0118] The matching module is used to obtain matching data in a preset memory unit.
[0119] The retrieval module is used to extract the corpus of the input information when the matching data does not exist in the memory unit, perform a network search based on the corpus, obtain the retrieval results, and store the retrieval results that meet the preset storage conditions into the memory unit.
[0120] A prompt text construction module is used to construct a risk control prompt text based on the matching data and the input information.
[0121] The output module is used to process the risk control prompt text through a large model to obtain a risk control result.
[0122] The beneficial effects of the wind control device based on the memory unit relative to the prior art are the same as those of the wind control method based on the memory unit, and will not be described in detail here.
[0123] like Figure 5 As shown, another embodiment of the present invention provides a computer device, including a memory and a processor;
[0124] The memory is used to store computer programs;
[0125] The processor is used to implement the risk control method based on the memory unit as described above when executing the computer program.
[0126] The beneficial effects of the computer device relative to the prior art are the same as those of the memory unit-based risk control method, which will not be repeated here.
[0127] like Figure 6As shown, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the risk control method based on the memory unit as described above is implemented.
[0128] The beneficial effects of the computer-readable storage medium relative to the prior art are the same as those of the memory unit-based risk control method, and will not be repeated here.
[0129] An electronic device that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0130] The electronic device includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM and RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0131] A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on the respective computers and having a client-server relationship to each other.
[0132] A person of ordinary skill in the art can understand that the implementation of all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. In the present application, the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, which may be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present invention. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0133] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A risk control method based on a memory unit, characterized in that: include: Get input information; Obtain matching data in a preset memory unit; When the matching data does not exist in the memory unit, extracting the corpus of the input information, performing a network search based on the corpus to obtain a search result, and storing the search result that meets the preset storage condition in the memory unit; Constructing a risk control prompt text based on the matching data and the input information; The risk control prompt text is processed by a large model to obtain a risk control result.
2. The risk control method based on the memory unit according to claim 1, characterized in that: When the matching data does not exist in the memory unit, extracting the corpus of the input information, performing a network search based on the corpus, and obtaining the search results comprises: Call external network search tools through long chain framework; The corpus is searched through the external network search tool to obtain search results.
3. The risk control method based on the memory unit according to claim 2, characterized in that: The step of storing the search results meeting the preset storage condition into the memory unit comprises: Preliminarily classify the search results by using a first classification model to obtain a first classification result, wherein the first classification model is a binary classifier model, and the first classification result includes a safety category and an unsafe category; Using a second classification model, fine-grained classification is performed on the search results of the security category to obtain a second classification result, wherein the second classification model is a multi-classifier model; The search result of the security category and the input information corresponding to the search result are used as a question-answer pair; According to the second classification result, the question-answer pairs are stored in the memory units respectively.
4. The risk control method based on the memory unit according to claim 3, characterized in that: The step of constructing the risk control prompt text based on the matching data and the input information includes: Selecting a prompt text template corresponding to the second classification result; Construct a risk control prompt text based on the matching data, the prompt text template and the input information.
5. The risk control method based on the memory unit according to any one of claims 1 to 4, characterized in that: The step of acquiring matching data in a preset memory unit includes: Establishing a similarity algorithm library, and determining a similarity algorithm in the similarity algorithm library according to the modality type of the input information, wherein the similarity algorithm includes a Pearson correlation coefficient, an Euclidean distance, a cosine similarity, or a Jaccard similarity coefficient; Calculating the similarity between the input information and the memory data by using the similarity algorithm, wherein the memory data includes the data stored in the memory unit; The memory data higher than the preset threshold is used as the matching data.
6. The risk control method based on the memory unit according to claim 5, characterized in that: Calculating the similarity between the input information and the memory data by the similarity algorithm includes: Processing the input information through the second classification model to obtain a third classification result; In the memory unit, data of the same type as the third classification result is selected as the memory data.
7. The risk control method based on the memory unit according to claim 1, characterized in that: Before obtaining the input information, the method further includes: Crawl popular data from the Internet at preset intervals; The hot data is classified, and the hot data classified as a security category is stored in the memory unit.
8. A wind control device based on a memory unit, characterized in that: include: An input module, used to obtain input information; A matching module, used for acquiring matching data in a preset memory unit; A retrieval module, for extracting the corpus of the input information when the matching data does not exist in the memory unit, performing a network search based on the corpus to obtain a retrieval result, and storing the retrieval result that meets a preset storage condition in the memory unit; A prompt text construction module, used to construct a risk control prompt text based on the matching data and the input information; The output module is used to process the risk control prompt text through a large model to obtain a risk control result.
9. A computer device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the memory unit-based risk control method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the memory unit-based risk control method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Internet user behavior analyzing and early-warning system and method
CN103763124A
Incremental learning multi-level binary-classification method of scientific news
CN105205163A
Public opinion early warning realization method and device
CN110347830A
Risk text extraction method and device, electronic equipment and storage medium
CN112861511A
Object classification method and device, equipment and storage medium
CN113449725A
