一种用于自然语言处理的量子核的设计与实现
Design and Implementation of a Quantum Kernel for Natural Language Processing
摘要:
自然语言处理(NLP)是试图使计算机能够访问人类语言的领域,它依赖于应用数学模型来表达符号语言的含义。一个这样的模型,DisCoCat,定义了如何表达单个单词的含义以及它们的组成性质。这个模型可以自然地在量子计算机上实现,从而产生场量子NLP(QNLP)。最近的实验工作使用量子机器学习技术,使用量子编码句子的期望值从文本映射到类别标签。计算句子相似度的理论工作已经完成,但依赖于未实现的量子存储器。本论文的主要目的是利用DiscoCat模型设计一个量子核函数,用于支持向量机(SVM)的NLP任务。研究了两种相似性度量:(i)过渡幅度方法和(ii)SWAP检验。一个简单的NLP意义分类任务,从以前的工作是用来训练的词嵌入和评估两个模型的性能。Python模块lambeq及其相关软件堆栈用于实现。将前面工作中的显式模型用于训练词嵌入,并取得了$93.09 \pm 0.01$ %的测试精度。结果表明,两种SVM变体都实现了方法(i)的$95.72 \pm 0.01$ %和方法(ii)的$97.14 \pm 0.01$ %的更高测试准确度。然后,在由真实量子设备ibmq_guadaltron定义的噪声模型下模拟SWAP测试。显式模型实现了$91.94 \pm 0.01$ %的准确率,而SWAP测试SVM在测试数据集上实现了96.7%,这表明核化分类器对噪声具有弹性。这些都是令人鼓舞的结果,并激励我们提出的内核化QNLP范式的进一步调查。
英文摘要:
Natural language processing (NLP) is the field that attempts to make human language accessible to computers, and it relies on applying a mathematical model to express the meaning of symbolic language. One such model, DisCoCat, defines how to express both the meaning of individual words as well as their compositional nature. This model can be naturally implemented on quantum computers, leading to the field quantum NLP (QNLP). Recent experimental work used quantum machine learning techniques to map from text to class label using the expectation value of the quantum encoded sentence. Theoretical work has been done on computing the similarity of sentences but relies on an unrealized quantum memory store. The main goal of this thesis is to leverage the DisCoCat model to design a quantum-based kernel function that can be used by a support vector machine (SVM) for NLP tasks. Two similarity measures were studied: (i) the transition amplitude approach and (ii) the SWAP test. A simple NLP meaning classification task from previous work was used to train the word embeddings and evaluate the performance of both models. The Python module lambeq and its related software stack was used for implementation. The explicit model from previous work was used to train word embeddings and achieved a testing accuracy of $93.09 \pm 0.01$%. It was shown that both the SVM variants achieved a higher testing accuracy of $95.72 \pm 0.01$% for approach (i) and $97.14 \pm 0.01$% for (ii). The SWAP test was then simulated under a noise model defined by the real quantum device, ibmq_guadalupe. The explicit model achieved an accuracy of $91.94 \pm 0.01$% while the SWAP test SVM achieved 96.7% on the testing dataset, suggesting that the kernelized classifiers are resilient to noise. These are encouraging results and motivate further investigations of our proposed kernelized QNLP paradigm.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。