• Hybrid quantum-classical model for Spanish hate speech detection. • Two-phase training stabilizes quantum circuit optimization. • Competitive with transformers; best results on HaterNet dataset. • Consistently outperforms classical and recurrent baselines. • Demonstrates viability of quantum NLP in real-world tasks. Hate speech detection in social media remains a pressing challenge in natural language processing, particularly for languages such as Spanish where annotated resources are limited. This work proposes a hybrid quantum-classical neural architecture that combines bidirectional gated recurrent units with attention and a variational quantum circuit used as a non-linear classifier. The model is trained in two phases: first the recurrent and attention-based layers are optimized to produce stable representations, then these are frozen and a quantum circuit is fine-tuned for classification. Evaluation on two benchmark corpora, HatEval and HaterNet, shows that the proposed hybrid approach achieves competitive performance with strong transformer baselines such as BETO and XLM-R, while consistently outperforming traditional machine learning and recurrent neural models. On HaterNet, the proposed model performs on par with, and in some metrics slightly better than, the transformer baselines, whereas on HatEval it attains slightly lower scores. Its strength lies in detecting hate speech under class imbalance, as reflected in solid F1 scores for the hate speech class. These findings provide an initial empirical assessment of quantum-enhanced NLP in a realistic hate speech detection scenario and suggest promising directions for further study as quantum hardware matures, without constituting evidence of quantum advantage.
• Hybrid quantum-classical model for Spanish hate speech detection. • Two-phase training stabilizes quantum circuit optimization. • Competitive with transformers; best results on HaterNet dataset. • Consistently outperforms classical and recurrent baselines. • Demonstrates viability of quantum NLP in real-world tasks. Hate speech detection in social media remains a pressing challenge in natural language processing, particularly for languages such as Spanish where annotated resources are limited. This work proposes a hybrid quantum-classical neural architecture that combines bidirectional gated recurrent units with attention and a variational quantum circuit used as a non-linear classifier. The model is trained in two phases: first the recurrent and attention-based layers are optimized to produce stable representations, then these are frozen and a quantum circuit is fine-tuned for classification. Evaluation on two benchmark corpora, HatEval and HaterNet, shows that the proposed hybrid approach achieves competitive performance with strong transformer baselines such as BETO and XLM-R, while consistently outperforming traditional machine learning and recurrent neural models. On HaterNet, the proposed model performs on par with, and in some metrics slightly better than, the transformer baselines, whereas on HatEval it attains slightly lower scores. Its strength lies in detecting hate speech under class imbalance, as reflected in solid F1 scores for the hate speech class. These findings provide an initial empirical assessment of quantum-enhanced NLP in a realistic hate speech detection scenario and suggest promising directions for further study as quantum hardware matures, without constituting evidence of quantum advantage.
This study proposes a hybrid quantum-classical framework for depression detection from social media text, integrating a frozen DistilBERT encoder with a variational quantum circuit (VQC)-based classification layer. The motivation stems from challenges in clinical NLP, including overfitting on limited datasets and high parameter overhead in conventional deep learning classifiers. Experiments are conducted on a balanced subset of the Reddit Self-Reported Depression Diagnosis (RSDD) dataset comprising 6,000 users. The proposed model is evaluated against classical baselines, including TF-IDF with logistic regression and a fine-tuned DistilBERT model. Results indicate that the hybrid approach achieves competitive performance, with an F1-score of 0.925 (±0.009) and improved recall (0.942 ± 0.015) compared to the classical DistilBERT baseline. Additionally, the quantum classification layer requires significantly fewer trainable parameters (72) compared to the classical dense head, demonstrating improved parameter efficiency at the classification stage. While the results suggest that variational quantum circuits can serve as an alternative non-linear classifier in low-data settings, the findings are based on simulation and require further validation on real quantum hardware. This work contributes to the emerging area of quantum natural language processing by providing an empirical evaluation of hybrid architectures on a real-world clinical text dataset.
Abstract Sarcasm detection is a challenging task in Natural Language Processing (NLP) due to its reliance on subtle and implicit linguistic cues that are often not explicitly expressed in text. Designing models capable of capturing such nuanced patterns remains an open problem. In this work, we investigate hybrid quantum–classical recurrent architectures for sarcasm detection by conducting a comparative study of classical and quantum-enhanced sequence models, including Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and their quantum counterparts, Quantum LSTM (QLSTM) and Quantum GRU (QGRU).We employ a pre-trained BERT model to extract contextualized token embeddings, which are subsequently compressed through classical neural layers to ensure compatibility with Noisy Intermediate-Scale Quantum (NISQ) devices. In the proposed quantum-enhanced models, classical linear transformations within recurrent gates are replaced by Variational Quantum Circuits (VQCs), enabling the exploitation of quantum properties such as superposition and entanglement within a hybrid learning framework.Experimental results on a balanced sarcasm-labeled dataset indicate that both QLSTM and QGRU achieve performance levels comparable to their classical counterparts, despite utilizing significantly fewer trainable parameters. Notably, the quantum-enhanced models require approximately 10% of the parameters used by their classical equivalents while maintaining similar macro F1 scores. These findings suggest that hybrid quantum recurrent architectures can serve as compact and parameter-efficient alternatives to classical sequence models, highlighting their potential applicability in quantum natural language processing under near-term hardware constraints.
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.
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.
Abstract Quantum Machine Learning (QML) is a promising field that combines the power of quantum computing with machine learning. Variational quantum circuits, where parameters of circuits are learned classically, have been widely used in many recent applications of QML. This is an instance of a hybrid quantum-classical framework, where both classical and quantum components are present. However, applying these techniques to applications involving massive data is a challenging task. One way to overcome this, is using the concept of classical-quantum transfer learning with the help of dressed quantum circuit, introduced recently, where the underlying neural architecture is pre-trained classically, but at the final steps (decision layer), a quantum circuit is used, followed by quantum measurements and post-processing to classify images with high precision. In this paper, we applied hybrid classical-quantum transfer learning to another task of massive data processing, i.e. Natural Language Processing (NLP). We show how to (binary) classify short texts (e.g., SMS) with classical-quantum transfer learning, which was originally applied to image processing only. Our quantum network was pre-trained by Bidirectional Encoder Representations from the Transformers (BERT) model, and its variational quantum circuit is fine-tuned for text processing. We evaluated the performance of our hybrid neural architecture using the Receiver Operating Characteristic (ROC) curve, which is typically used in the evaluation of classification problems. The results indicate high precision as well as lower loss function. To our knowledge, our work is the first application of quantum transfer learning to the area of NLP. Finally a comparison with a tool that uses learning but in a different way than transfer learning is presented
Paraphrase Detection is a core task in natural language processing (NLP) that aims to determine whether two sentences convey equivalent meanings.This work proposes a hybrid quantum-classical framework that integrates Sentence-BERT embeddings, simulated quantum feature encoding, and classical machine learning models to enhance semantic similarity detection.Initially, sentence pairs are embedded using Sentence-BERT and standardized through feature scaling.These representations are then transformed via rotation-based quantum circuits to capture higher-order feature interactions and non-linear dependencies.The resulting hybrid feature space, combining classical and quantum-inspired components are evaluated using LightGBM and deep neural network classifiers.Experimental results shows that the hybrid model incorporating quantuminspired features achieved superior classification performance, yielding a 10% improvement in overall accuracy outperforming standalone deep learning baselines.These findings demonstrate that quantum-classical fusion enhances semantic feature extraction and significantly improves paraphrase detection performance.