Method for checking and judging whether screening content is negative message or not in automatic network
By using LLM on small batch template data to generate training data and combining nonlinear support vector machines and logistic regression models, the training set is automatically generated, which solves the problem of high cost of large language models and realizes low-cost automated judgment of negative messages.
Patent Information
- Application Number
- CN202311746639.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-08-01
AI Technical Summary
The existing language model with high accuracy is a super-large-scale model. The cost of calling APIs is too high, and a lower cost technical solution is required to determine whether the content of the network screening is negative news.
Use LLM's propt engineering technology to automatically label and generate large amounts of data on small batch template data, train a numerical training set based on TextEmbeddingAPI, combine nonlinear support vector machines and binary logistic regression models for classification, automatically generate training data and automatically label them, reducing dependence on large language model APIs.
Through autonomous training and deployment of large language models, the cost of automated network verification is reduced and efficient and low-cost negative message judgment is achieved.
Smart Images

Figure CN120407798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network screening, and particularly to a method for automatically verifying and determining whether the screened content is negative news in a network. Background Art
[0002] In the information age, the network has become an important platform for people to express opinions and transmit information. However, with the infinite expansion of the network space, the risk of negative network public opinion has become increasingly prominent. They are like a sudden storm, sweeping across the whole society, bringing serious troubles and challenges to relevant entities. The risks of negative network public opinion are diverse. First of all, they may trigger public panic and uneasiness. The rapid spread of network information makes public opinion spread rapidly in a short time, and the emergence of a large number of negative information is likely to make people anxious and worried. Secondly, negative network public opinion may damage social trust and lead to social instability. The spread of doubts, criticism and dissatisfaction will make people distrust entities such as the government, enterprises and the media, and then lead to tense social relations.
[0003] In the network verification task, an important job is to determine whether the searched content is negative news of relevant entities. Recently, with the rise of large language models, it is possible to directly input a prompt in a conversational large language model and ask whether the queried content is negative news of a specific entity. The large language model can give a correct judgment. However, the large language models with high accuracy are all ultra-large-scale models, and the cost of calling the API is too high. A technical solution with lower cost is needed. Therefore, the present application provides a method for automatically verifying and determining whether the screened content is negative news in a network to meet the demand. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method for automatically verifying and determining whether the screened content is negative news in a network, so as to solve the problem that the existing large language models with high accuracy are all ultra-large-scale models, and the cost of calling the API is too high, and a technical solution with lower cost is needed.
[0005] To solve the above technical problem, the present invention provides the following technical solutions:
[0006] A method for automatically verifying and determining whether the screened content is negative news in a network, comprising the following steps:
[0007] S1. Using the prompt engineering technology of the LLM, based on a small batch of template data, automatically label and generate a large amount of data;
[0008] S2. Training: Based on the training set generated in the previous step, sequentially call the TextEmbedding API of ChatGLM to convert {T} into a numerical set {X} and a label set {Y}, forming a numerical training set {X, Y}.
[0009] S3. Prediction: Record the queried text information.
[0010] S4. Calculate the confidence using Platt scaling.
[0011] Preferably, in S1, the specific steps are as follows:
[0012] a. Manually obtain 10 pieces of data from various common websites. The obtained data is denoted as, where represents a certain website, and is the abstract information in the list queried on the website. For example: Market Ban, Decision Letter of the China Securities Regulatory Commission (Ren Moumou). After investigation, Ren Moumou has the following illegal facts: 1. The situation of Ren Moumou's control and use of accounts. From April 2015 to December 2015, Ren Liangcheng successively controlled and used Chen Mouhua. To a certain extent, Chen Mouhua cooperated with the investigation by our Commission and the situation of Ren Liangcheng's involvement in criminal cases.
[0013] b. Use prompt engineering technology to traverse and call the chat API of ChatGLM to automatically generate 1000 times more new training data. The prompt template is: "Using as a template, randomly generate a person's name, randomly generate other illegal information, and generate 1 new sentence."
[0014] c. Use prompt engineering technology to traverse and call the chat API of ChatGLM to automatically label. The prompt template is: "Whether the following {{text}} is negative information, only answer one word, 'yes' or 'no'", and finally form a labeled training set.
[0015] 3. The method for automatically verifying and determining whether the screened content is negative news according to claim 2, characterized in that the specific steps of expanding the data in the second step are as follows:
[0016] a. Use PromptTemplate of LangChain to construct a prompt template, where the template is
[0017] "Using as a template, randomly generate a person's name, randomly generate other illegal information, and generate 1 new sentence"
[0018] b. Call the chatglm-turbo model of the Zhipu Open Platform. When calling, the content in a will be replaced with the actual text.
[0019] c. The content returned by the API is the new training data;
[0020] d. Repeat b and c until 1000 texts are generated.
[0021] Preferably, the specific steps for automatically labeling the dataset in the third step are as follows:
[0022] a. Use PromptTemplate of LangChain to construct a Prompt template, where template is
[0023] "Judge whether the following text "{content}"
[0024] is negative information;
[0025] Output strictly according to the following JSON format: {format_instructions};
[0026] Among them, 'Result' is fixed to use 'Yes' and 'No', and 'Basis' is the key reasoning process, limited to within 20 characters;
[0027] Please output strictly according to the above JSON format, and do not output any text outside the JSON format;
[0028] The output result is, for example:
[0029] {examples}”;
[0030] Among them, content will be replaced by the actual text during actual execution, format_instructions is {"Result": "", "Basis": ""}, and examples are {"Result": "Yes", "Basis": "The above text involves multiple cases and may contain negative information"}, {"Result": "No", "Basis": "The above text does not contain any negative words, so it is normal information"};
[0031] b. Call the chatglm-turbo model of the Zhipu Open Platform;
[0032] c. The content returned by the API is in the form of a json result. Parse it in json and generate a labeled training set after parsing;
[0033] d. Repeat b and c to traverse all the data.
[0034] Preferably, in S2,
[0035] Use a non-linear support vector machine as the classifier, and {X, Y} as the training set for training. The goal is to find a hyperplane ω T· ωφ(X) + b = 0, where ω is the weight vector, φ(X) is the feature vector after the input X is mapped by the kernel function, and b is the bias term. This hyperplane divides the data into two categories, the positive category and the negative category;
[0036] Use the HingeLoss objective function:
[0037] Initialize the parameters with small random values, including the weight vector w and the bias b;
[0038] Iteratively solve the Lagrange multipliers.
[0039] Preferably, the steps for iteratively solving the Lagrange multipliers are as follows:
[0040] a. Initialize the Lagrange multiplier α i as a small positive number;
[0041] b. Calculate the Lagrangian function, where N is the number of training samples, α i is the Lagrange multiplier, y i is the class label of the sample, K(X i , X j ) is the value of the kernel function, and the kernel function used is the radial basis function;
[0042] c. Calculate the weight vector w,
[0043] d. Calculate the bias, calculate the bias b, where S is the set of support vectors, and K(X i , X j ) is the value of the kernel function;
[0044] e. Update the slack variable ξ i , ξ i = max(0, 1 - y i (w T φ(X i )));
[0045] f. Use a heuristic method to select a pair of multipliers α i , α j with the maximum error;
[0046] g. Calculate the gradient of the objective function and update all multipliers;
[0047] h. Judge the change of the multipliers and the maximum number of iterations to determine whether to stop the iteration. If the conditions are not met, repeat steps c, d, e, f, and g.
[0048] Preferably, in S3, call Zhipu AI to obtain the numerical vector. The principle of TextEmbedding is to calculate the numerical vector of each token based on all training data;
[0049] Use the trained classifier Cls to classify x to obtain the classification label l and probability p;
[0050] Determine whether p is lower than 0.8. If it is lower, directly use the prompt of ChatGLM to obtain the determination result; otherwise, use the classification label l as the result;
[0051] The process of querying text information records is as follows:
[0052] a. Use RPA technology to open the web page of a certain website with a Headless browser;
[0053] b. According to the html selectors of the search input box and search button found manually in advance, use the Headless browser code to control the input of the company name to be queried and search;
[0054] c. According to the html selector of the search results found manually in advance, use the Headless browser to obtain each piece of search text, and each piece of text is the data for the next determination.
[0055] Preferably, in S4, 1. Use the decision function of the trained SVM to calculate the unscaled value f(x);
[0056] 2. Use the training set, with the original output of the SVM as the feature and the actual class label as the target value, to train a binary logistic regression model;
[0057] 3. The output of the logistic regression model is transformed by the sigmoid function to map real numbers to the range of 0 to 1. The formula of the sigmoid function is: where P(y = 1|f) is the probability that the sample belongs to the positive class, and Af(x)+B is the output of the logistic regression;
[0058] Among them, the training of binary logistic regression is implemented using the gradient descent algorithm:
[0059] The loss function of the logistic regression for binary classification problems can be expressed as:
[0060]
[0061] where N is the number of samples, y i is the true class label of sample i, f i is the original output of the SVM decision function of sample i, and the optimization goal is to find the optimal parameters A and B.
[0062] Preferably, to minimize L(A, B), the process of gradient descent optimization is as follows:
[0063] a. Randomly initialize the parameters A and B;
[0064] b. Calculate the gradients, calculate the partial derivatives of L(A, B) with respect to the parameters A and B, i.e., the gradients;
[0065] c. Update the parameters, use the gradients to update the parameters A and B;
[0066] d. Repeat steps b and c until a predetermined number of iterations is reached or the loss function converges.
[0067] Compared with the prior art, the present invention has at least the following beneficial effects:
[0068] In the above solution, it is too costly to train and deploy a large language model with a parameter scale of at least 130B for the automated network core. The API call price of the Text Embedding of the large language model is usually 1 / 20 or even lower than that of the API call of the large model itself. For example, the price of ChatGLM. The traditional SVM requires very few resources and can be shared with the APIServer, etc., without marginal cost. Therefore, under the same effect, the cost can be reduced. For the specific task of automated network verification, by combining the numerical vectors output by ChangLM and the traditional SVM classifier, the cost can be reduced. Using ChatGLM, according to the text information of each website, training data can be automatically generated and automatically labeled to replace manual creation of the training set. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The drawings incorporated herein and constituting a part of the specification illustrate embodiments of the present disclosure and, together with the specification, are further used to explain the principles of the present disclosure and enable those skilled in the relevant art to implement and use the present disclosure.
[0070] Figure 1 Schematic diagram for preparing the training set;
[0071] Figure 2 Schematic diagram for training the classifier;
[0072] Figure 3 Schematic diagram for the prediction process.
[0073] As shown in the figure, in order to clearly show the structure of the embodiments of the present invention, specific structures and devices are labeled in the figure. However, this is only for illustrative purposes and is not intended to limit the present invention to this specific structure, device, and environment. According to specific needs, those of ordinary skill in the art can adjust or modify these devices and environments, and such adjustments or modifications are still included within the scope of the appended claims. Detailed Description of the Invention
[0074] The following describes in detail a method provided by the present invention for automatically verifying and determining whether the content in a network is negative news in combination with the accompanying drawings and specific embodiments. It should be noted here that in order to make the embodiments more detailed, the following embodiments are the best and preferred embodiments. For some well-known technologies, those skilled in the art can also adopt other alternative methods for implementation; moreover, the accompanying drawings are only for more specifically describing the embodiments and are not intended to specifically limit the present invention.
[0075] It should be noted that when the specification mentions "an embodiment", "embodiment", "exemplary embodiment", "some embodiments", etc., it indicates that the described embodiment may include specific features, structures, or characteristics, but not necessarily every embodiment includes such specific features, structures, or characteristics. Additionally, when combining an embodiment to describe a specific feature, structure, or characteristic, implementing such feature, structure, or characteristic in combination with other embodiments (whether explicitly described or not) should be within the knowledge of those skilled in the relevant art.
[0076] Generally, terms can be understood at least in part from their use in context. For example, at least in part depending on the context, the term "one or more" used herein can be used to describe any feature, structure, or characteristic in a singular sense, or can be used to describe a combination of features, structures, or characteristics in a plural sense. Additionally, the term "based on" can be understood as not necessarily intended to convey a set of exclusive factors, but rather, at least in part depending on the context, can allow for the existence of other factors that may not be explicitly described.
[0077] It can be understood that the meanings of "on", "above", and "over" in this disclosure should be interpreted in the broadest manner, such that "on" not only means "directly on" something, but also includes the meaning of being "on" something with intervening features or layers therebetween, and "above" or "over" not only means "above" or "over" something, but also can include the meaning of being "above" or "over" something with no intervening features or layers therebetween.
[0078] In addition, spatial relative terms such as "under", "below", "lower part", "above", "upper part", etc. may be used in this text for convenience of description to describe the relationship between one element or feature and another or more elements or features, as shown in the accompanying drawings. The spatial relative terms are intended to cover different orientations in the use or operation of the device other than the orientation depicted in the drawings. The device may be oriented in other ways, and the spatial relative descriptors used in this text may be interpreted accordingly. As Figures 1-3 shown, an embodiment of the present invention provides a method for automatically verifying and determining whether the screened content in an automated network is negative news, including the following steps:
[0079] S1. Using the prompt engineering technology of LLM, based on a small batch of template data, automatically label and generate a large amount of data;
[0080] S2. Training, based on the training set generated in the previous step, sequentially call the TextEmbedding API of ChatGLM, transform T into a numerical set {X}, and a label set {Y}, to form a numerical training set {X, Y};
[0081] S3. Prediction, record the text information queried;
[0082] S4. Use Platt scaling to calculate the confidence level.
[0083] In S1, the specific steps are:
[0084] a. Manually obtain 10 pieces of data from each common website, and the obtained data is recorded as, where represents a certain website, and is the abstract information in the list queried on the website. For example: Market Ban, Decision Letter of the China Securities Regulatory Commission (Ren Moumou). After investigation, Ren Moumou has the following illegal facts: I. The situation of Ren Moumou's control and use of accounts. From April 2015 to December 2015, Ren Liangcheng successively controlled and used Chen Mouhua. To a certain extent, Ren Liangcheng cooperated with the investigation of our Commission and the situation of Ren Liangcheng's involvement in criminal cases;
[0085] b. Using the prompt engineering technology, traverse, call the chat API of ChatGLM, and automatically generate new training data by 1000 times. The prompt template is: "Using as a template, randomly generate a person's name, randomly generate other illegal information, and generate 1 new sentence";
[0086] c. Use prompt engineering techniques to traverse and call the chat API of ChatGLM to automatically tag it. The "prompt template" is: "Is the following text negative information? Just answer one word, 'yes' or 'no'.", and finally form a training set with tags;
[0087] The specific steps for the second step of data expansion are as follows:
[0088] a. Use PromptTemplate of LangChain to construct a prompt template, where the template is
[0089] "Using [template] as a template, randomly generate a person's name and other illegal information to generate 1 new sentence"
[0090] b. Call the chatglm-turbo model on the Zhipu open platform. When calling, the content in a will be replaced with the actual text;
[0091] c. The content returned by this API is the new training data;
[0092] d. Repeat b and c until 1000 texts are generated.
[0093] The specific steps for automatically tagging the dataset in the third step are as follows:
[0094] a. Use PromptTemplate of LangChain to construct a prompt template, where the template is
[0095] "Judge the following text "{content}";
[0096] Is it negative information;
[0097] Strictly output in the following JSON format: {format_instructions};
[0098] Among them, 'Result' is fixed to use 'yes' and 'no', and 'Basis' is the key reasoning process, limited within 20 characters;
[0099] Please strictly output in the above JSON format without outputting any text outside the JSON format;
[0100] The output result is as follows:
[0101] {examples}”;
[0102] Among them, content will be replaced by the actual text during actual execution, format_instructions is {"result": "", "basis": ""}, examples are {"result": "Yes", "basis": "The above text involves multiple cases and may contain negative information"}, {"result": "No", "basis": "The above text does not contain any negative words, so it is normal information"};
[0103] b. Call the chatglm-turbo model of the Zhipu Open Platform;
[0104] c. The content returned by the API is in the form of a json result. Parse it in json and generate a labeled training set after parsing;
[0105] d. Repeat steps b and c to traverse all the data.
[0106] In S2,
[0107] Use a non-linear support vector machine as the classifier and {X, Y} as the training set for training. The goal is to find a hyperplane ω T ·φ(X)+b = 0, where ω is the weight vector, φ(X) is the feature vector after the input X is mapped by the kernel function, and b is the bias term. This hyperplane divides the data into two categories, the positive category and the negative category;
[0108] Use the HingeLoss objective function:
[0109] Initialize the parameters with small random values, including the weight vector w and the bias b;
[0110] Iteratively solve the Lagrange multipliers.
[0111] The steps for iteratively solving the Lagrange multipliers are as follows:
[0112] [[ID=3a. Initialize the Lagrange multiplier α i as a small positive number;
[0113] b. Calculate the Lagrangian function, where N is the number of training samples, α i is the Lagrange multiplier, y i is the class label of the sample, K(X i , X j ) is the value of the kernel function, and the kernel function used is the radial basis function;
[0114] c. Calculate the weight vector w,
[0115] d. Calculate the bias, calculate the bias b, where S is the set of support vectors, and K(X i , X j ) is the value of the kernel function;
[0116] e. Update the slack variable ξ i , ξ i = max(0, 1 - y i (w T φ(X i )));
[0117] f. Use a heuristic method to select a pair of multipliers α i , α j ;
[0118] g. Calculate the gradient of the objective function and update all multipliers;
[0119] h. Judge the change of the multipliers and the maximum number of iterations to decide whether to stop the iteration. If the conditions are not met, repeat steps c, d, e, f, and g.
[0120] In S3, call Zhipu AI to obtain a numerical vector. The principle of TextEmbedding is to calculate the numerical vector of each token based on all training data;
[0121] Use the trained classifier Cls to classify x to obtain the classification label l and probability p;
[0122] Determine whether p is lower than 0.8. If it is lower, directly use the prompt of ChatGLM to obtain the determination result. Otherwise, use the classification label l as the result;
[0123] The process of querying text information records is as follows:
[0124] a. Use RPA technology and use a Headless browser to open the web page of a certain website;
[0125] b. According to the html selectors of the search input box and search button found manually in advance, use the Headless browser code to control the input of the company name to be queried and search;
[0126] c. According to the html selector of the search results found manually in advance, use the Headless browser to obtain each piece of search text, and each piece of text is the data for the next determination.
[0127] In S4, 1. Use the decision function of the trained SVM to calculate the unscaled value f(x);
[0128] 2. Using the training set, with the original output of SVM as features and the actual class labels as target values, train a binary logistic regression model;
[0129] 3. The output of the logistic regression model is transformed through the sigmoid function, mapping real numbers to the range of 0 to 1. The formula of the sigmoid function is: where P(y = 1|f) is the probability that the sample belongs to the positive class, and Af(x)+B is the output of the logistic regression;
[0130] Among them, the training of binary logistic regression is implemented using the gradient descent algorithm:
[0131] The loss function of logistic regression for binary classification problems can be expressed as:
[0132]
[0133] where N is the number of samples, y i is the true class label of sample i, and f i is the original output of the SVM decision function of sample i. The optimization objective is to find the optimal parameters A and B.
[0134] To minimize L(A,B), the process of gradient descent optimization is as follows:
[0135] a. Randomly initialize the parameters A and B;
[0136] b. Calculate the gradient, calculate the partial derivatives of L(A,B) with respect to the parameters A and B, that is, the gradient;
[0137] c. Update the parameters, use the gradient to update the parameters A and B;
[0138] d. Repeat steps b and c until the predetermined number of iterations is reached or the loss function converges.
[0139] This invention covers any substitutions, modifications, equivalent methods, and solutions made within the essence and scope of this invention. To enable the public to have a thorough understanding of this invention, specific details are elaborated in the following preferred embodiments of this invention. However, those skilled in the art can fully understand this invention even without the description of these details. Additionally, to avoid unnecessary confusion to the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0140] Those of ordinary skill in the art can understand that all or part of the steps in implementing the above-mentioned embodiment methods can be completed by instructing relevant hardware through a program, and this program can be stored in a computer-readable storage medium, such as: ROM / RAM, magnetic disks, optical discs, etc.
[0141] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A method for automatically verifying and determining whether the screened content is negative news, characterized in that, It includes the following steps: S1. Use the prompt engineering technology of LLM to automatically label and generate a large amount of data based on a small batch of template data; S2. Training. Based on the training set generated in the previous step, sequentially call the TextEmbedding API of ChatGLM, convert T into a numerical set {X}, and a label set {Y} to form a numerical training set {X, Y}; S3. Prediction. Record the queried text information; S4. Use Platt scaling to calculate the confidence level.
2. The method for automatically verifying and determining whether the screened content is negative news according to claim 1, characterized in that, In S1, the specific steps are as follows: a. Manually obtain 10 pieces of data from various common websites. The obtained data is denoted as, where represents a certain website, and is the abstract information in the list queried on the website. For example: Market Ban, Decision Letter of the China Securities Regulatory Commission (Ren Moumou). After investigation, Ren Moumou has the following illegal facts:
1. The situation of Ren Moumou controlling and using accounts. From April 2015 to December 2015, Ren Liangcheng successively controlled and used Chen Mouhua. To a certain extent, Chen Mouhua cooperated with the investigation by the CSRC and the situation of Ren Liangcheng being involved in criminal cases; b. Use the prompt engineering technology to traverse, call the chat API of ChatGLM, and automatically generate new training data by 1000 times. The prompt template is: "Using as a template, randomly generate a person's name, randomly generate other illegal information, and generate 1 new sentence"; c. Use the prompt engineering technology to traverse, call the chat API of ChatGLM, and automatically label, with the prompt template: "Whether the following text is negative information, only answer one word, 'yes' or 'no'", and finally form a labeled training set.
3. The method for automatically verifying and determining whether the screened content is negative news according to claim 2, characterized in that, Among them, the specific steps for expanding data in the second step are as follows: a. Use PromptTemplate of LangChain to construct a Prompt template, where the template is "Using as a template, randomly generate a person's name, randomly generate other illegal information, and generate 1 new sentence" b. Call the chatglm-turbo model of the Zhipu Open Platform. When calling, the content in a will be replaced with the actual text; c. The content returned by this API is the new training data; d. Repeat b and c until 1000 pieces of text are generated.
4. The method for automatically verifying and determining whether the screened content is negative news according to claim 3, characterized in that, The specific steps for automatically labeling the dataset in the third step are as follows: a. Use PromptTemplate of LangChain to construct a Prompt template, where the template is "Judge whether the following text"{content}" is negative information; Output strictly according to the following JSON format: {format_instructions}; Among them, 'Result' must use 'yes' and 'no' fixedly, and 'Basis' is the key reasoning process, limited within 20 characters; Please output strictly according to the above JSON format, and do not output any text outside the JSON format; The output result is for example: {examples}” Among them, content will be replaced by the actual text during actual execution, format_instructions is {"result": "", "basis": ""}, examples are {"result": "Yes", "basis": "The above text involves multiple cases and may contain negative information"}, {"result": "No", "basis": "The above text does not contain any negative words, so it is normal information"}; b. Call the chatglm-turbo model of the Zhipu Open Platform; c. The content returned by the API is in the form of a json result. Parse it in json and generate a labeled training set after parsing; d. Repeat b and c to traverse all the data.
5. The method for automatically verifying and determining whether the screened content is negative news according to claim 1, characterized in that, In S2, Using a non-linear support vector machine as the classifier, training is carried out with {X, Y} as the training set, and the goal is to find a hyperplane ω T ·φ(X)+b = 0, where ω is the weight vector, φ(X) is the feature vector after the input X is mapped by the kernel function, and b is the bias term. This hyperplane divides the data into two classes, the positive class and the negative class; Use the HingeLoss objective function: Initialize the parameters with random small values, including the weight vector w and the bias b; Iteratively solve the Lagrange multipliers.
6. The method for automatically verifying and determining whether the screened content is negative news according to claim 5, characterized in that, The steps for iteratively solving the Lagrange multipliers are as follows: a. Initialize the Lagrange multiplier α i as a small positive number; b. Calculate the Lagrangian function, where N is the number of training samples, α i is the Lagrange multiplier, y i is the class label of the sample, K(X i , X j ) is the value of the kernel function, and the kernel function used is the radial basis function; c. Calculate the weight vector w, d. Calculate the bias, calculate the bias b, where S is the set of support vectors, K(X i , X j ) is the value of the kernel function; e. Update the slack variable ξ i , ξ i = max(0, 1 - y i (w T φ(X i )) + b)); f. Select a pair of multipliers α with the largest error using a heuristic method i , α j ; g. Calculate the gradient of the objective function and update all multipliers; h. Judge the change of the multipliers and the maximum number of iterations to decide whether to stop the iteration. If the conditions are not met, repeat c, d, e, f, g.
7. The method for automatically verifying and determining whether the screened content is negative news according to claim 1, characterized in that, In S3, call Zhipu AI to obtain a numerical vector. The principle of TextEmbedding is to calculate the numerical vector of each token based on all the training data; Use the trained classifier Cls to classify x to obtain the classification label l and the probability p; Determine whether p is lower than 0.
8. If it is lower, directly use the prompt of chatglm to obtain the judgment result. Otherwise, use the classification label l as the result; The process of querying the text information record is as follows: a. Use RPA technology to open the web page of a certain website with a Headless browser; b. According to the html selectors of the search input box and the search button found manually in advance, use the headless browser code to control the input of the company name to be queried and search; c. According to the html selector of the search results found manually in advance, use the Headless browser to obtain each piece of search text, and each piece of text is the data for the next judgment.
8. The method for automatically verifying and determining whether the screened content is negative news according to claim 1, wherein In S4, 1. Use the decision function of the trained SVM to calculate the unscaled value f(x); 2. Use the training set, use the original output of the SVM as the feature, and the actual class label as the target value to train a binary logistic regression model; 3. The output of the logistic regression model is transformed by the sigmoid function, which maps real numbers to the range of 0 to 1. The formula of the sigmoid function is: where P(y = 1|f) is the probability that the sample belongs to the positive class, and Af(x) + B is the output of the logistic regression; The training of the binary logistic regression is implemented using the gradient descent algorithm: where N is the number of samples, and y i is the true class label of sample i, and f i is the original output of the SVM decision function for sample i. The optimization objective is to find the optimal parameters A and B.
9. According to the method for automatically verifying and determining whether the screened content is negative news described in claim 8, characterized in that Minimize L(A,B), and the process of gradient descent optimization is as follows: a. Randomly initialize the parameters A and B; b. Calculate the gradient, calculate the partial derivatives of L(A,B) with respect to the parameters A and B, that is, the gradient; c. Update the parameters, use the gradient to update the parameters A and B; d. Repeat steps b and c until the predetermined number of iterations is reached or the loss function converges.