The collaboration between quantum computing and classical machine learning offers potential advantages in natural language processing, particularly in the sentiment analysis of human emotions and opinions expressed in large-scale datasets. In this work, we propose a methodology for sentiment analysis using hybrid quantum-classical machine learning algorithms. We investigate quantum kernel approaches and variational quantum circuit-based classifiers and integrate them with classical dimension reduction techniques such as PCA and Haar wavelet transform. The proposed methodology is evaluated using two distinct datasets, based on English and Bengali languages. Experimental results show that after dimensionality reduction of the data, performance of the quantum-based hybrid algorithms were consistent and better than classical methods.
The collaboration between quantum computing and classical machine learning offers potential advantages in natural language processing, particularly in the sentiment analysis of human emotions and opinions expressed in large-scale datasets. In this work, we propose a methodology for sentiment analysis using hybrid quantum-classical machine learning algorithms. We investigate quantum kernel approaches and variational quantum circuit-based classifiers and integrate them with classical dimension reduction techniques such as PCA and Haar wavelet transform. The proposed methodology is evaluated using two distinct datasets, based on English and Bengali languages. Experimental results show that after dimensionality reduction of the data, performance of the quantum-based hybrid algorithms were consistent and better than classical methods.
Abstract This paper studies the performance of classical and quantum machine learning models for sentiment analysis task. Here, popular machine learning algorithms viz support vector machine (SVM), gradient boosting (GB) and random forest (RF) are compared with variational quantum classifier (VQC) using two sets of parameterized circuits viz EfficientSU2 and RealAmplitudes. For experimenting with VQC, IBM Quantum Experience and IBM Qiskit were used while for classical machine learning models, scikit-learn was used. It was found that the performance of the VQC was slightly better than popular machine learning algorithms. For our experiments, we have used popular restaurant sentiment analysis dataset. The extracted features from this dataset and then after applying PCA reduced the feature set into 5 features. Quantum ML models were trained using 100 epochs and 150 epochs. Overall, four Quantum ML models were trained and three Classical ML models were trained. The performance of the trained models was evaluated using standard evaluation measures viz, Accuracy, Precision, Recall, F-Score etc. In all the cases EfficientSU2 based model with 100 Epochs performed better than all other models. Efficient SU2 model with 100 epochs produced an accuracy of 74.5% and an F-Score of 0.7605 which were highest across all the trained models.
This research paper primarily investigates the application and performance of traditional machine learning and quantum computing in Natural Language Processing (NLP), with a focus on sentiment analysis tasks. By comparing the accuracy, efficiency, and scalability of these two technologies, the study aims to reveal the potential of quantum computing in handling complex NLP tasks and to provide data support for future technology choices and research directions. The paper also details the use of 1M DB and NLTK movie review datasets for experiments and discusses the experimental design, performance evaluation results, and technical challenges faced by both methods.
Quantum machine learning has recently emerged as a promising paradigm that leverages the expressive power of quantum circuits to address complex learning tasks. In this work, we investigate the applicability of hybrid quantum-classical neural networks to sentiment analysis, a central problem in natural language processing. We focus on a dataset of tweets related to COVID-19, where the textual content is vectorized using TF-IDF and fed into both classical feedforward networks and hybrid architectures incorporating parameterized quantum circuits. Our results show that hybrid models can achieve accuracy comparable to the classical baseline, while exhibiting distinct learning dynamics, especially in terms of validation loss and accuracy, that suggest a richer representational capacity. Moreover, when applying transfer learning to an SMS spam classification task, the hybrid models consistently outperform the classical counterpart, achieving an accuracy increase of 15 percentage points (from 66% to 81%) on the spam class, demonstrating enhanced generalization. These findings highlight the feasibility of employing QML for natural language processing and point toward the potential advantages of hybrid models as quantum hardware continues to advance.
Exploiting quantum properties to improve performance of different tasks in Natural Language Processing (NLP) and other domains has increasingly becoming a successful trend to deal complex language phenomena or to fill task or domain-specific gaps with an approach that needs less data and minor computational resources. The field that has, to date, yielded more quantum-based attention is the retrieval and classification of textual data. This work aims to replicate the excellent results of hybrid quantum approaches for syntactic tasks on semantic classification tasks. In detail, a quantum machine learning algorithm, namely, the Variational Quantum Classifier (VQC), is used to perform sentiment analysis classification tasks. This algorithm can deduce the relationships between input features and their corresponding class affiliations using a parametrized quantum circuit and an encoding layer that translates classical data into quantum states. The approach has been tested on a well-known benchmark annotated dataset used for the Italian language, and the results have been compared to existing baselines, pointing out state-of-the-art scores.
Sentiment analysis (SA) is an essential component of natural language processing (NLP) and is used to analyze sentiments, attitudes, and emotional tones in various contexts. It provides valuable insights into public opinion, customer feedback, and user experiences. Researchers have developed various classical machine learning (ML) and neuro-fuzzy approaches to address the exponential growth of data and the complexity of language structures in SA. However, these approaches often fail to determine the optimal number of clusters, interpret results accurately, handle noise or outliers efficiently, and scale effectively to high-dimensional data. In addition, they are frequently insensitive to input variations. In this article, we propose a novel hybrid approach for SA called the quantum fuzzy neural network (QFNN), which leverages quantum properties and incorporates a fuzzy layer to overcome the limitations of classical SA algorithms. In this study, we test the proposed approach on two Twitter datasets: the Coronavirus Tweets Dataset (CVTD) and the General Sentimental Tweets Dataset (GSTD), and compare it with classical and hybrid algorithms. The results show that QFNN outperforms all classical, quantum, and hybrid algorithms, achieving 100% and 90% accuracy in the case of CVTD and GSTD, respectively. Furthermore, QFNN demonstrates its robustness against six different noise models, providing the potential to tackle the computational complexity associated with SA on a large scale in a noisy environment. The proposed approach expedites sentiment data processing and precisely analyzes different forms of textual data, thus improving sentiment classification and insights associated with SA.
Combining variational quantum circuits with classical neural network models is a potential direction for quantum natural language processing (QNLP) in the NISQ (Noisy Intermediate-Scale Quantum) era. We propose a hybrid classical-quantum neural network that enhances a transformer architecture in two key ways: first, by incorporating optimized variational quantum circuits into the self-attention and multilayer perceptron components, and second, by integrating a hybrid convolutional module for effective dimensionality reduction which can reduce the quantum resources required for subsequent layers and enhances the model’s trainability by mitigating issues like the barren plateau phenomenon, thus making it feasible to construct a deeper and more powerful network architecture. Our experiments on three widely-used sentiment analysis datasets demonstrate that the proposed model achieves comparable or even superior performance in terms of accuracy and F1 score compared to classical transformer-based sentiment classification models with similar structures, while reducing the number of parameters through the utilization of quantum advantages.