A quantum classifier and a financial public opinion monitoring method for financial public opinion monitoring

The financial public opinion monitoring method designed using qubits and quantum circuits solves the problem of low efficiency and accuracy of traditional algorithms in classifying massive news and public opinion data, and achieves more efficient financial public opinion monitoring and accurate sentiment analysis.

CN120911628BActive Publication Date: 2026-02-10SHANGHAI YUNBEN TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411553163.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2026-02-10
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

Traditional algorithms have low efficiency and accuracy in sentiment classification when processing massive amounts of news and public opinion data, making it difficult to meet the real-time monitoring needs of financial institutions.

Method used

A financial public opinion monitoring method using qubits and quantum circuits is proposed. By using text encoding circuits and quantum parameter circuits, and quantum operations such as RY gates and ROT gates, financial public opinion data is encoded and sentiment is classified. The final result is then output by combining quantum measuring devices.

Benefits of technology

It improves the efficiency and accuracy of sentiment classification, enabling more accurate tracking of changes in market sentiment and providing financial institutions with more timely decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911628B_ABST
    Figure CN120911628B_ABST
Patent Text Reader

Abstract

The application relates to data processing analysis, in particular to a quantum classifier for financial public opinion monitoring and a financial public opinion monitoring method, a text coding circuit, according to the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to text vectorization data, the text vectorization data is converted into corresponding quantum state data; a quantum parameter circuit receives the quantum state data sent by the text coding circuit, and outputs the final result representing the emotional tendency according to the parameters of the ROT gate; the technical scheme provided by the application can effectively overcome the defects of low emotional tendency classification efficiency and accuracy in processing massive news public opinion data in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to data processing and analysis, specifically to a quantum classifier and method for monitoring financial public opinion. Background Technology

[0002] In the financial sector, changes in news and public opinion can influence market sentiment, thereby triggering market volatility. For example, negative news and company announcements can cause fluctuations in company stock prices and bond prices. By monitoring news and public opinion in real time and judging its sentiment, financial institutions can help identify potential risks in a timely manner, hedge risks, or adjust investment strategies. However, traditional algorithms suffer from low efficiency and accuracy in sentiment classification when processing massive amounts of news and public opinion data.

[0003] Quantum computing is a computational method that processes data based on the principles of quantum mechanics. Traditional computers use bits as the basic unit of computation, and each bit can only be in one of two states, "0" or "1", i.e., low or high voltage. Unlike traditional computers, quantum bits can be in a superposition of "0" and "1" states simultaneously; moreover, quantum bits can be interconnected through quantum entanglement, which gives quantum computing powerful parallel computing capabilities. Summary of the Invention

[0004] (a) Technical problems to be solved

[0005] In view of the above-mentioned shortcomings of the existing technology, the present invention provides a quantum classifier and a method for monitoring financial public opinion, which can effectively overcome the shortcomings of the existing technology in terms of low efficiency and accuracy of sentiment classification when processing massive news and public opinion data.

[0006] (II) Technical Solution

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A quantum classifier for monitoring financial public opinion includes a text encoding circuit and a quantum parameter circuit;

[0009] The text encoding circuit converts the text vectorized data into corresponding quantum state data based on the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data.

[0010] The quantum parameter circuit receives quantum state data sent by the text encoding circuit and outputs the final result representing the sentiment tendency based on the parameters of the ROT gate.

[0011] Among them, the text vectorized data is the normalized feature vector of financial public opinion data.

[0012] Preferably, the text encoding circuit includes a first text encoding circuit branch, a second text encoding circuit branch, and a third text encoding circuit branch;

[0013] The first text encoding circuit branch includes an RY gate RY1, wherein the RY gate RY1 inputs the initial qubit in the 0 state |0>;

[0014] The second text encoding circuit branch includes a first single-level controlled RY gate RY2 and a second single-level controlled RY gate RY3 connected in sequence. The first single-level controlled RY gate RY2 inputs the initial 0-state quantum bit |0>. The controlled bits of the first single-level controlled RY gate RY2 and the second single-level controlled RY gate RY3 are both set on the first text encoding circuit branch.

[0015] The third text encoding circuit branch includes a first double-controlled RY gate RY4, a second double-controlled RY gate RY5, a third double-controlled RY gate RY6, and a fourth double-controlled RY gate RY7 connected in sequence. The first double-controlled RY gate RY4 inputs an initial qubit 0> in the 0 state. The two controlled bits of the first double-controlled RY gate RY4, the second double-controlled RY gate RY5, the third double-controlled RY gate RY6, and the fourth double-controlled RY gate RY7 are respectively set on the first text encoding circuit branch and the second text encoding circuit branch.

[0016] Preferably, the initial qubit in state 0, |0>, is represented in two-dimensional Hilbert space as:

[0017]

[0018] The RY gate RY1 is a Y-axis rotation gate, which performs a rotation operation on the Bloch sphere along the Y-axis direction, represented as:

[0019]

[0020] Where θ is the rotation angle of RY gate RY1;

[0021] The controlled RY gate can achieve a quantum entangled state. If the controlled bit of the controlled RY gate is an empty dot, it means that the controlled bit is a 0-state qubit |0> and the controlled RY gate will be activated. If the controlled bit of the controlled RY gate is a solid dot, it means that the controlled bit is a 1-state qubit |1> and the controlled RY gate will be activated.

[0022] Preferably, the quantum parameter circuit includes a first quantum parameter circuit branch, a second quantum parameter circuit branch, a third quantum parameter circuit branch, and a quantum measuring device;

[0023] The first quantum parameter circuit branch includes a first ROT gate ROT1, a second ROT gate ROT2, and a quantum measuring device connected in sequence, with the first ROT gate ROT1 connected to the first text encoding circuit branch;

[0024] The second quantum parameter circuit branch includes a third ROT gate ROT3, a fourth ROT gate ROT4, and a first single-level controlled Pauli X gate X1 connected in sequence. The third ROT gate ROT3 is connected to the second text encoding circuit branch, and the controlled bit of the first single-level controlled Pauli X gate X1 is set on the first quantum parameter circuit branch.

[0025] The third quantum parameter circuit branch includes a fifth ROT gate ROT5, a sixth ROT gate ROT6, a second single-controlled Pauli X gate X2, a third single-controlled Pauli X gate X3, and a double-controlled Pauli X gate X4 connected in sequence. The fifth ROT gate ROT5 is connected to the third text encoding circuit branch. The controlled bit of the second single-controlled Pauli X gate X2 is set on the first quantum parameter circuit branch. The controlled bit of the third single-controlled Pauli X gate X3 is set on the second quantum parameter circuit branch. The two controlled bits of the double-controlled Pauli X gate X4 are respectively set on the first quantum parameter circuit branch and the second quantum parameter circuit branch.

[0026] The quantum measuring device is connected to the first quantum parameter circuit branch to perform measurement operations on the qubits output by the first quantum parameter circuit branch.

[0027] Preferably, the ROT gate is a single-qubit rotation gate, which controls the qubit to rotate along the X, Y, and Z axes on the Bloch sphere, as shown below:

[0028] ROT(ω,ξ,φ)=R X (ω)R Y (ξ)R Z (φ);

[0029] Among them, R X (ω) represents the control qubit to rotate along the X-axis on the Bloch sphere, with a rotation angle of ω, R Y (ξ) represents the control qubit rotating along the Y-axis on the Bloch sphere, with a rotation angle of ξ and R. Z (φ) indicates that the control qubit rotates along the Z-axis on the Bloch sphere by an angle of φ.

[0030] The matrix representation of the Pauli X-gate is as follows:

[0031]

[0032] Preferably, the quantum measuring device performs a measurement operation on the qubits output by the first quantum parameter circuit branch, as follows:

[0033] α0>+β1>;

[0034] The above equation represents that after measurement, the quantum bit will move at an α-value. 2 The probability collapses into a classical qubit 0>, with β 2 The probability collapses into a classical qubit |1>, and α 2 +β 2 =1;

[0035] In this process, the quantum measuring device performs 256 measurement operations on the qubits output by the first quantum parameter circuit branch. If, in the 256 measurements, the qubits output by the first quantum parameter circuit branch collapse into classical qubits |0> more often after the measurement, then the quantum parameter circuit outputs the final result 0, which represents a negative emotional tendency; otherwise, the quantum parameter circuit outputs the final result 1, which represents a positive emotional tendency.

[0036] A method for monitoring financial public opinion includes the following steps:

[0037] S1. Collect financial public opinion data and convert each financial public opinion data into corresponding text vectorized data;

[0038] S2. Input the text vectorized data into the text encoding circuit respectively. The text encoding circuit converts the text vectorized data into the corresponding quantum state data according to the rotation angle of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data.

[0039] S3. The quantum parameter circuit receives the quantum state data sent by the text encoding circuit and outputs the final result representing the sentiment tendency according to the parameters of the ROT gate.

[0040] S4. Determine the sentiment trend of each financial public opinion data based on the final results.

[0041] Preferably, in S1, financial public opinion data is collected, and each piece of financial public opinion data is converted into corresponding text vectorized data, including:

[0042] S11. Collect financial public opinion data;

[0043] S12. Use the bert_base_chinese model to standardize and vectorize the financial public opinion data, converting each financial public opinion data into 512-dimensional vector data;

[0044] S13. Principal Component Analysis (PCA) was used to reduce the dimensionality of the 512-dimensional vector data of each financial public opinion data to obtain the corresponding 8-dimensional text vectorized data.

[0045] Preferably, in step S2, the text vectorized data is input into the text encoding circuit. The text encoding circuit converts the text vectorized data into corresponding quantum state data based on the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data, including:

[0046] S21. Obtain the text vectorized data α1, α2, α3, α4, α5, α6, α7, α8 of a single piece of financial public opinion data;

[0047] S22. Based on the text encoding circuit, the following is calculated:

[0048]

[0049] Wherein, θ1, θ2, θ3, θ4, θ5, θ6, and θ7 are the rotation angles of RY gate RY1, the first single-controlled RY gate RY2, the second single-controlled RY gate RY3, the first double-controlled RY gate RY4, the second double-controlled RY gate RY5, the third double-controlled RY gate RY6, and the fourth double-controlled RY gate RY7, respectively.

[0050] S23. Calculate the rotation angle of the RY gate and the controlled RY gate:

[0051]

[0052] S24. Based on the calculated rotation angles of the RY gate and the controlled RY gate, the text vectorized data α1, α2, α3, α4, α5, α6, α7, and α8 are converted into corresponding quantum state data using a text encoding circuit.

[0053] Preferably, before collecting financial public opinion data and converting each piece of financial public opinion data into corresponding text vectorized data in S1, the process includes:

[0054] S01. Collect historical financial public opinion data, convert each historical financial public opinion data into corresponding text vectorized data, and set sentiment tendency labels for the text vectorized data to construct a historical financial public opinion dataset.

[0055] S02. Divide the historical financial public opinion dataset into a training set and a test set according to a preset ratio;

[0056] S03. Set the loss function and optimizer for the quantum classifier;

[0057] S04. Input the training set into the quantum classifier to train the model;

[0058] S05. The loss value is calculated based on the loss function. The optimizer updates the parameters of the ROT gate according to the loss value and gradient information, so that the final result of the quantum parameter circuit that represents the sentiment tendency continuously approaches the real sentiment tendency label.

[0059] S06. If the loss value is less than the preset threshold, the model training ends and the current quantum classifier is the trained quantum classifier; otherwise, return to S04 and continue to train the model using the training set.

[0060] S07. Input the test set into the trained quantum classifier and evaluate the model performance.

[0061] (III) Beneficial Effects

[0062] Compared with existing technologies, the quantum classifier and method for financial public opinion monitoring provided by this invention have the following advantages:

[0063] 1) Effective monitoring of financial public opinion can be achieved using qubits and quantum circuits, and text encoding circuits can be used to re-encode vectorized text data, enabling the representation of 2... using n qubits. n More text vectorization data effectively improves text encoding efficiency, and more text vectorization data can also ensure the accuracy of sentiment classification.

[0064] 2) The quantum classifier for financial public opinion monitoring proposed in this invention can accurately track important changes in market sentiment and hot events from massive news and public opinion data, providing financial institutions with more accurate and timely decision support. Attached Figure Description

[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0066] Figure 1 This is a schematic diagram of the text encoding circuit in this invention;

[0067] Figure 2 This is a schematic diagram of the quantum parameter circuit in this invention;

[0068] Figure 3 This is a schematic diagram of the process of the present invention;

[0069] Figure 4 This is a portion of the historical financial public opinion data collected in this invention;

[0070] Figure 5 This is a graph showing the loss function during the model training process of the quantum classifier in this invention.

[0071] Figure 6 This is a graph showing the accuracy curve during the model training process of the quantum classifier in this invention.

[0072] Figure 7 This is an industry public opinion ranking list obtained by using the quantum classifier of this invention for financial public opinion monitoring. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0074] A quantum classifier for monitoring financial public opinion includes a text encoding circuit and a quantum parameter circuit;

[0075] The text encoding circuit converts the text vectorized data into corresponding quantum state data based on the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data.

[0076] The quantum parameter circuit receives quantum state data sent by the text encoding circuit and outputs the final result representing the sentiment tendency based on the parameters of the ROT gate.

[0077] Among them, the text vectorized data is the normalized feature vector of financial public opinion data.

[0078] like Figure 1 As shown, the text encoding circuit includes a first text encoding circuit branch, a second text encoding circuit branch, and a third text encoding circuit branch;

[0079] The first text encoding circuit branch includes RY gate RY1, and RY gate RY1 inputs the initial qubit in the 0 state |0>.

[0080] The second text encoding circuit branch includes a first single-level controlled RY gate RY2 and a second single-level controlled RY gate RY3 connected in sequence. The first single-level controlled RY gate RY2 inputs the initial quantum bit in the 0 state |0>. The controlled bits of the first single-level controlled RY gate RY2 and the second single-level controlled RY gate RY3 are both set on the first text encoding circuit branch.

[0081] The third text encoding circuit branch includes a first double-controlled RY gate RY4, a second double-controlled RY gate RY5, a third double-controlled RY gate RY6, and a fourth double-controlled RY gate RY7 connected in sequence. The first double-controlled RY gate RY4 inputs the initial qubit in the 0 state |0>. The two controlled bits of the first double-controlled RY gate RY4, the second double-controlled RY gate RY5, the third double-controlled RY gate RY6, and the fourth double-controlled RY gate RY7 are respectively set on the first text encoding circuit branch and the second text encoding circuit branch.

[0082] In text encoding circuits:

[0083] 1) The initial qubit in state 0, |0>, is represented in two-dimensional Hilbert space as:

[0084]

[0085] 2) RY gate RY1 is a Y-axis rotary gate that performs a rotation operation on the Bloch sphere along the Y-axis, represented as:

[0086]

[0087] Where θ is the rotation angle of RY gate RY1;

[0088] 3) Controlled RY gates can achieve quantum entanglement. If the controlled bit of the controlled RY gate is an empty point, it means that the controlled bit is a 0-state qubit |0> and the controlled RY gate will be activated. If the controlled bit of the controlled RY gate is a solid point, it means that the controlled bit is a 1-state qubit |1> and the controlled RY gate will be activated.

[0089] like Figure 2 As shown, the quantum parameter circuit includes a first quantum parameter circuit branch, a second quantum parameter circuit branch, a third quantum parameter circuit branch, and a quantum measuring device;

[0090] The first quantum parameter circuit branch includes a first ROT gate ROT1, a second ROT gate ROT2, and a quantum meter connected in sequence. The first ROT gate ROT1 is connected to the first text encoding circuit branch.

[0091] The second quantum parameter circuit branch includes a third ROT gate ROT3, a fourth ROT gate ROT4, and a first single-controlled Pauli X gate X1 connected in sequence. The third ROT gate ROT3 is connected to the second text encoding circuit branch, and the controlled bit of the first single-controlled Pauli X gate X1 is set on the first quantum parameter circuit branch.

[0092] The third quantum parameter circuit branch includes a fifth ROT gate ROT5, a sixth ROT gate ROT6, a second single-controlled Pauli X gate X2, a third single-controlled Pauli X gate X3, and a double-controlled Pauli X gate X4 connected in sequence. The fifth ROT gate ROT5 is connected to the third text encoding circuit branch. The controlled bit of the second single-controlled Pauli X gate X2 is set on the first quantum parameter circuit branch. The controlled bit of the third single-controlled Pauli X gate X3 is set on the second quantum parameter circuit branch. The two controlled bits of the double-controlled Pauli X gate X4 are respectively set on the first quantum parameter circuit branch and the second quantum parameter circuit branch.

[0093] The quantum measuring device is connected to the first quantum parameter circuit branch to perform measurement operations on the qubits output by the first quantum parameter circuit branch.

[0094] In quantum parameter circuits:

[0095] 1) The ROT gate is a single-qubit rotation gate that controls the rotation of the qubit on the Bloch sphere along the X, Y, and Z axes, respectively, as follows:

[0096] ROT(ω,ξ,φ)=R X (ω)R Y (ξ)R Z (φ);

[0097] Among them, R X (ω) represents the control qubit to rotate along the X-axis on the Bloch sphere, with a rotation angle of ω, R Y (ξ) represents the control qubit rotating along the Y-axis on the Bloch sphere, with a rotation angle of ξ and R. Z (φ) indicates that the control qubit rotates along the Z-axis on the Bloch sphere by an angle of φ.

[0098] 2) The matrix representation of the Pauli X-gate is:

[0099]

[0100] 3) The quantum measuring device performs a measurement operation on the qubits output from the first quantum parameter circuit branch, as shown below:

[0101] α0>+β1>;

[0102] The above equation represents that after measurement, the quantum bit will move at an α-value. 2 The probability collapses into a classical qubit 0>, with β 2 The probability collapses into a classical qubit |1>, and α 2 +β 2 =1;

[0103] In this process, the quantum measuring device performs 256 measurement operations on the qubits output by the first quantum parameter circuit branch. If, in the 256 measurements, the qubits output by the first quantum parameter circuit branch collapse into classical qubits |0> more often after the measurement, then the quantum parameter circuit outputs the final result 0, which represents a negative emotional tendency; otherwise, the quantum parameter circuit outputs the final result 1, which represents a positive emotional tendency.

[0104] In this application's technical solution, based on the aforementioned disclosed quantum classifier for financial public opinion monitoring, a method for monitoring financial public opinion is also disclosed, such as... Figure 3 As shown, it includes the following steps:

[0105] S1. Collect financial public opinion data and convert each financial public opinion data into corresponding text vectorized data;

[0106] S2. Input the text vectorized data into the text encoding circuit respectively. The text encoding circuit converts the text vectorized data into the corresponding quantum state data according to the rotation angle of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data.

[0107] S3. The quantum parameter circuit receives the quantum state data sent by the text encoding circuit and outputs the final result representing the sentiment tendency according to the parameters of the ROT gate.

[0108] S4. Determine the sentiment trend of each financial public opinion data based on the final results.

[0109] 1) Before collecting financial public opinion data in S1 and converting each piece of financial public opinion data into corresponding text vectorized data, the following steps are included:

[0110] S01. Collect historical financial public opinion data, convert each historical financial public opinion data into corresponding text vectorized data, and set sentiment tendency labels for the text vectorized data to construct a historical financial public opinion dataset.

[0111] S02. Divide the historical financial public opinion dataset into a training set and a test set according to a preset ratio;

[0112] S03. Set the loss function and optimizer for the quantum classifier;

[0113] S04. Input the training set into the quantum classifier to train the model;

[0114] S05. The loss value is calculated based on the loss function. The optimizer updates the parameters of the ROT gate according to the loss value and gradient information, so that the final result of the quantum parameter circuit that represents the sentiment tendency continuously approaches the real sentiment tendency label.

[0115] S06. If the loss value is less than the preset threshold, the model training ends and the current quantum classifier is the trained quantum classifier; otherwise, return to S04 and continue to train the model using the training set.

[0116] S07. Input the test set into the trained quantum classifier and evaluate the model performance.

[0117] 2) In S1, financial public opinion data is collected and converted into corresponding text vectorized data, including:

[0118] S11. Collect financial public opinion data;

[0119] S12. Use the bert_base_chinese model to standardize and vectorize the financial public opinion data, converting each financial public opinion data into 512-dimensional vector data;

[0120] S13. Principal Component Analysis (PCA) was used to reduce the dimensionality of the 512-dimensional vector data of each financial public opinion data to obtain the corresponding 8-dimensional text vectorized data.

[0121] 3) In S2, the vectorized text data is input into the text encoding circuit. The text encoding circuit converts the vectorized text data into corresponding quantum state data based on the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to the vectorized text data, including:

[0122] S21. Obtain the text vectorized data α1, α2, α3, α4, α5, α6, α7, α8 of a single piece of financial public opinion data;

[0123] S22. Based on the text encoding circuit, the following is calculated:

[0124]

[0125] Wherein, θ1, θ2, θ3, θ4, θ5, θ6, and θ7 are the rotation angles of RY gate RY1, the first single-controlled RY gate RY2, the second single-controlled RY gate RY3, the first double-controlled RY gate RY4, the second double-controlled RY gate RY5, the third double-controlled RY gate RY6, and the fourth double-controlled RY gate RY7, respectively.

[0126] S23. Calculate the rotation angle of the RY gate and the controlled RY gate:

[0127]

[0128] S24. Based on the calculated rotation angles of the RY gate and the controlled RY gate, the text vectorized data α1, α2, α3, α4, α5, α6, α7, and α8 are converted into corresponding quantum state data using a text encoding circuit.

[0129] To better illustrate the technical effects of the proposed solution, the quantum classifier, traditional support vector machine, and traditional random forest model proposed in this invention are applied to the news sentiment released by Cailian Press to classify the sentiment of the news sentiment, thereby verifying the superiority of the quantum classifier proposed in this invention.

[0130] Some news and public opinion released by Cailian Press, such as Figure 4 As shown (that is, the historical financial public opinion data collected for model training of the quantum classifier in this application's technical solution), a total of 1000 news public opinion messages were collected. The bert_base_chinese model was used to standardize the 1000 news public opinion messages into vectors, converting each of the 1000 news public opinion messages into 512-dimensional vector data, resulting in a total of 1000*512 vector data.

[0131] Considering the excessive size of the 512-dimensional vector data, Principal Component Analysis (PCA) is used to reduce the dimensionality of the 512-dimensional vector data for each news item, resulting in corresponding 8-dimensional text vectorized data (i.e., corresponding to the three initial 0-state qubits |0> of the input text encoding circuit in this application's technical solution, which can represent 2...). 3 (1000*8 vectorized text data), and use "0" to represent negative sentiment and "1" to represent positive sentiment. Sentiment labels are set for the resulting 1000*8 vector data, and finally a historical financial public opinion dataset containing 1000*9 vector data is obtained.

[0132] 70% of the vector data from the historical financial public opinion dataset was selected as the training set for training the three types of models. The remaining 30% of the vector data was used as the test set for performance comparison of the three types of models. The loss function curve during the training process of the quantum classifier using the training set is shown in the figure below. Figure 5 As shown in the figure, the accuracy curve of the quantum classifier during model training using the training set is as follows: Figure 6 As shown.

[0133] The performance of the trained quantum classifier was evaluated using a test set, and compared with the performance of traditional support vector machines and traditional random forest models. The results are shown in the table below:

[0134] Table 1. Performance Evaluation Comparison of the Three Types of Models

[0135] Quantum classifier Traditional Support Vector Machine Traditional Random Forest Model Inference accuracy 98.45% 96.78% 92.21%

[0136] As can be seen from the table above, the quantum classifier proposed in this invention has higher accuracy in classifying sentiment tendencies for massive amounts of news and public opinion data.

[0137] To better illustrate the technical effects of the present application's technical solution, the advantages of the quantum classifier proposed in this invention will be further explained below in conjunction with industry public opinion ranking applications.

[0138] Taking 17:13 on October 23, 2024 as an example, news and public opinion data released by Cailian Press, Sina Finance, and Jiuyan Commune were collected. The collected news and public opinion data were categorized by industry. For each news and public opinion data point, the quantum classifier proposed in this invention was used to classify its sentiment tendency. The final results of the quantum parameter circuits corresponding to all news and public opinion data points in each industry were summed to obtain the news and public opinion index for each industry. After sorting, an industry public opinion ranking was obtained, such as... Figure 7 As shown.

[0139] Figure 7 In the news sentiment index, the positive public opinion score represents the industry's overall popularity; a higher index indicates greater industry attention. Taking the power equipment sector, which ranks first in the news sentiment index, as an example, the U.S. Department of Commerce initiated a change of circumstances review on October 21, considering partially lifting anti-dumping and countervailing duties on Chinese crystalline silicon photovoltaic cells. Therefore, the power equipment industry currently enjoys the highest level of attention, and the market response has been relatively positive.

[0140] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A quantum classifier for monitoring financial public opinion, characterized in that: Including text encoding circuits and quantum parameter circuits; The text encoding circuit converts the text vectorized data into corresponding quantum state data based on the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data. The quantum parameter circuit receives quantum state data sent by the text encoding circuit and outputs the final result representing the sentiment tendency based on the parameters of the ROT gate. Among them, the text vectorized data is a normalized feature vector of financial public opinion data; The quantum parameter circuit includes a first quantum parameter circuit branch, a second quantum parameter circuit branch, a third quantum parameter circuit branch, and a quantum measuring device; The first quantum parameter circuit branch includes a first ROT gate ROT1, a second ROT gate ROT2, and a quantum measuring device connected in sequence, with the first ROT gate ROT1 connected to the first text encoding circuit branch; The second quantum parameter circuit branch includes a third ROT gate ROT3, a fourth ROT gate ROT4, and a first single-level controlled Pauli X gate X1 connected in sequence. The third ROT gate ROT3 is connected to the second text encoding circuit branch, and the controlled bit of the first single-level controlled Pauli X gate X1 is set on the first quantum parameter circuit branch. The third quantum parameter circuit branch includes a fifth ROT gate ROT5, a sixth ROT gate ROT6, a second single-controlled Pauli X gate X2, a third single-controlled Pauli X gate X3, and a double-controlled Pauli X gate X4 connected in sequence. The fifth ROT gate ROT5 is connected to the third text encoding circuit branch. The controlled bit of the second single-controlled Pauli X gate X2 is set on the first quantum parameter circuit branch. The controlled bit of the third single-controlled Pauli X gate X3 is set on the second quantum parameter circuit branch. The two controlled bits of the double-controlled Pauli X gate X4 are respectively set on the first quantum parameter circuit branch and the second quantum parameter circuit branch. The quantum measuring device is connected to the first quantum parameter circuit branch to perform measurement operations on the qubits output by the first quantum parameter circuit branch.

2. The quantum classifier for financial public opinion monitoring according to claim 1, characterized in that: The text encoding circuit includes a first text encoding circuit branch, a second text encoding circuit branch, and a third text encoding circuit branch; The first text encoding circuit branch includes an RY gate RY1, wherein the RY gate RY1 inputs an initial qubit in the 0 state. ; The second text encoding circuit branch includes a first controlled RY gate RY2 and a second controlled RY gate RY3 connected in sequence. The first controlled RY gate RY2 inputs a 0-state initial qubit. The controlled bits of the first controlled RY gate RY2 and the second controlled RY gate RY3 are both set on the first text encoding circuit branch; The third text encoding circuit branch includes a first double-controlled RY gate RY4, a second double-controlled RY gate RY5, a third double-controlled RY gate RY6, and a fourth double-controlled RY gate RY7 connected in sequence. The first double-controlled RY gate RY4 inputs a 0-state initial qubit. The two controlled bits of the first double-controlled RY gate RY4, the second double-controlled RY gate RY5, the third double-controlled RY gate RY6, and the fourth double-controlled RY gate RY7 are respectively set on the first text encoding circuit branch and the second text encoding circuit branch.

3. The quantum classifier for financial public opinion monitoring according to claim 2, characterized in that: The initial qubit in state 0 In two-dimensional Hilbert space, it is represented as: ; The RY gate RY1 is a Y-axis rotation gate, which performs a rotation operation on the Bloch sphere along the Y-axis direction, represented as: ; in, Let RY be the rotation angle of RY gate RY1; A controlled RY gate can achieve quantum entanglement. If the controlled bit of the controlled RY gate is a hollow point, it means that the controlled bit is a 0-state qubit. Only when the controlled RY gate is in operation; if the controlled bit of the controlled RY gate is a solid dot, it means that the controlled bit is a 1-state qubit. Only then can the controlled RY gate function.

4. The quantum classifier for financial public opinion monitoring according to claim 1, characterized in that: The ROT gate is a single-qubit rotation gate that controls the rotation of the qubit on the Bloch sphere along the X, Y, and Z axes, respectively. It is represented as: ; in, This indicates that the control qubit is rotated along the X-axis on the Bloch sphere by an angle of θ. , This indicates that the control qubit is rotated along the Y-axis on the Bloch sphere, with a rotation angle of θ. , This indicates that the control qubit rotates along the Z-axis on the Bloch sphere, with a rotation angle of θ. ; The matrix representation of the Pauli X-gate is as follows: 。 5. The quantum classifier for financial public opinion monitoring according to claim 4, characterized in that: The quantum measuring device performs a measurement operation on the qubits output from the first quantum parameter circuit branch, which is represented as follows: ; The above formula represents the quantum bit's behavior after measurement. The probability collapses into a classical qubit. ,by The probability collapses into a classical qubit. ,and ; In this process, the quantum measuring device performs 256 measurement operations on the qubit output from the first quantum parameter circuit branch. If, during these 256 measurements, the qubit output from the first quantum parameter circuit branch collapses into a classical qubit after the measurement... If the number of occurrences is greater, the quantum parameter circuit outputs a final result of 0, representing a negative emotional tendency; otherwise, the quantum parameter circuit outputs a final result of 1, representing a positive emotional tendency.

6. A method for monitoring financial public opinion, employing the quantum classifier for monitoring financial public opinion as described in claim 1, characterized in that: Includes the following steps: S1. Collect financial public opinion data and convert each financial public opinion data into corresponding text vectorized data; S2. Input the text vectorized data into the text encoding circuit respectively. The text encoding circuit converts the text vectorized data into the corresponding quantum state data according to the rotation angle of all RY gates and controlled RY gates in the circuit corresponding to the text vectorized data. S3. The quantum parameter circuit receives the quantum state data sent by the text encoding circuit and outputs the final result representing the sentiment tendency according to the parameters of the ROT gate. S4. Determine the sentiment trend of each financial public opinion data based on the final results.

7. The financial public opinion monitoring method according to claim 6, characterized in that: S1 collects financial public opinion data and converts each piece of financial public opinion data into corresponding text vectorized data, including: S11. Collect financial public opinion data; S12. Use the bert_base_chinese model to standardize and vectorize the financial public opinion data, converting each financial public opinion data into 512-dimensional vector data; S13. Principal Component Analysis (PCA) was used to reduce the dimensionality of the 512-dimensional vector data of each financial public opinion data to obtain the corresponding 8-dimensional text vectorized data.

8. The financial public opinion monitoring method according to claim 7, characterized in that: In S2, the vectorized text data is input into the text encoding circuit. The text encoding circuit converts the vectorized text data into corresponding quantum state data based on the rotation angles of all RY gates and controlled RY gates in the circuit corresponding to the vectorized text data. S21. Obtain the text vectorized data of a single piece of financial public opinion data. ; S22. Based on the text encoding circuit, the following is calculated: ; in, The rotation angles of RY gate RY1, first single-controlled RY gate RY2, second single-controlled RY gate RY3, first double-controlled RY gate RY4, second double-controlled RY gate RY5, third double-controlled RY gate RY6, and fourth double-controlled RY gate RY7 are respectively. S23. Calculate the rotation angle of the RY gate and the controlled RY gate: ; S24. Based on the calculated rotation angles of the RY gate and the controlled RY gate, the text is vectorized using a text encoding circuit. Converted into corresponding quantum state data.

9. The financial public opinion monitoring method according to claim 8, characterized in that: Before collecting financial public opinion data in S1 and converting each piece of financial public opinion data into corresponding text vectorized data, the following steps are included: S01. Collect historical financial public opinion data, convert each historical financial public opinion data into corresponding text vectorized data, and set sentiment tendency labels for the text vectorized data to construct a historical financial public opinion dataset. S02. Divide the historical financial public opinion dataset into a training set and a test set according to a preset ratio; S03, Set the loss function and optimizer for the quantum classifier; S04. Input the training set into the quantum classifier to train the model; S05. The loss value is calculated based on the loss function. The optimizer updates the parameters of the ROT gate according to the loss value and gradient information, so that the final result of the quantum parameter circuit that represents the sentiment tendency continuously approaches the real sentiment tendency label. S06. If the loss value is less than the preset threshold, the model training ends and the current quantum classifier is the trained quantum classifier; otherwise, return to S04 and continue to train the model using the training set. S07. Input the test set into the trained quantum classifier and evaluate the model performance.

Citation Information

Patent Citations

  • Financial public opinion recognition method and system based on text data

    CN113495959A

  • Parameterization quantum circuit and linear equation set solving method based on variable component

    CN117520721A

  • Text classification method and device, computer equipment and storage medium

    CN117909503A