Entangled Meanings: Classification and Ambiguity Resolution in QNLP
Chi Zhang, Akriti Kumari, Damir Ćavar · 2024
We discuss experiments involving two tasks in Quantum Natural Language Processing (QNLP): text classification and disambiguation. In the classification task, we utilized an amplitude encoding algorithm and achieved perfect accuracy on the lambeq dataset discussed in literature. We obtained accuracy from 55% to 72.5% on the more complex and realistic Amazon review dataset. This is a reasonable result given the current state-of-the-art results in QNLP. Additionally, when using vector dimension reduction for embeddings, we found that UMAP leads to the best results in our experiment setting. All classification results were done on the default. qubit simulator in pennylane 0. 36 python library. Our classification results highlight the potential of quantum algorithms in practical applications. In the disambiguation task, we selected 18 ambiguous nouns, 32 unambiguous nouns, and 18 different verbs. Our experiments using the QASM simulator within the qiskit Python library demonstrated that the simulator could perfectly differentiate between the various meanings of ambiguous nouns in different contexts. Furthermore, we extended our study to a real quantum device, the ibm_kyoto quantum computer. There, we tested our disambiguation approach on a subset of 4 random nouns (2 ambiguous and 2 unambiguous) and observed that ibm_kyoto could achieve an accuracy range of 82.1% to 98.9% in disambiguation tasks, extending the datasets and improving the results of existing ambiguity resolution experiments [1]. Our work demonstrates the capability of quantum computing in dealing with real-world NLP tasks, hence contributing to the advancement of both OML and NLP.