Abstract
Quantum Computing is envisioned as one of the scientific areas with greater transformative potential. Already there exist applications running in quantum devices for different areas, like cybersecurity, chemistry, or machine learning. One subarea being developed under quantum machine learning is quantum natural language processing. Following the promising results existing in problems like sentiment classification or next-word prediction, this paper presents two proofs of concept to demonstrate how these two tasks can be solved using quantum computing. For the first task showcased, sentiment classification, we employ the removal of caps and cups morphisms to make the string diagrams simpler and more efficient. In the case of next-word prediction, we show how to solve the task for sentences with previously unknown syntactic structures by applying a classical Random Forest machine learning algorithm that classifies the syntactic structure and enables our QNLP algorithm to infer the proper string model.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bauer, C.W., Freytsis, M., Nachman, B.: Simulating collider physics on quantum computers using effective field theories (2021)
Bennett, C.H., Brassard, G.: Quantum cryptography: public key distribution and coin tossing. Theor. Comput. Sci. 560, 7–11 (2014). https://doi.org/10.1016/j.tcs.2014.05.025
Bergholm, V., et al.: Pennylane: automatic differentiation of hybrid quantum-classical computations (2022)
Biamonte, J., Wittek, P., Pancotti, N., Rebentrost, P., Wiebe, N., Lloyd, S.: Quantum machine learning. Nature 549(7671), 195–202 (2017). https://doi.org/10.1038/nature23474
Cherrat, E.A., Kerenidis, I., Mathur, N., Landman, J., Strahm, M., Li, Y.Y.: Quantum vision transformers (2022)
Coecke, B.: The mathematics of text structure (2020)
Coecke, B., Duncan, R.: Interacting quantum observables: categorical algebra and diagrammatics. New J. Phys. 13(4), 043016 (2011). https://doi.org/10.1088/1367-2630/13/4/043016
Developers, C.: Cirq (2022). https://doi.org/10.5281/zenodo.7465577. See full list of authors on Github: https://github.com/quantumlib/Cirq/graphs/contributors
de Felice, G., Toumi, A., Coecke, B.: DisCoPy: monoidal categories in Python. Electr. Proc. Theor. Comput. Sci. 333, 183–197 (2021). https://doi.org/10.4204/eptcs.333.13
García, D.P., Cruz-Benito, J., García-Peñalvo, F.J.: Systematic literature review: quantum machine learning and its applications (2022)
Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, STOC ’96, pp. 212–219. Association for Computing Machinery, New York (1996). https://doi.org/10.1145/237814.237866
Kartsaklis, D., et al.: Lambeq: an efficient high-level python library for quantum NLP. arXiv preprint: arXiv:2110.04236 (2021)
Kim, Y., et al.: Evidence for the utility of quantum computing before fault tolerance. Nature 618, 500–505 (2023). https://doi.org/10.1038/s41586-023-06096-3
Meichanetzidis, K., Gogioso, S., de Felice, G., Chiappori, N., Toumi, A., Coecke, B.: Quantum natural language processing on near-term quantum computers. Electr. Proc. Theor. Comput. Sci. 340, 213–229 (2021). https://doi.org/10.4204/eptcs.340.11
Miranda, E.R., Yeung, R., Pearson, A., Meichanetzidis, K., Coecke, B.: A quantum natural language processing approach to musical intelligence (2021)
Nachman, B., Provasoli, D., de Jong, W.A., Bauer, C.W.: Quantum algorithm for high energy physics simulations. Phys. Rev. Lett. 126(6), 062001 (2021). https://doi.org/10.1103/physrevlett.126.062001
Qiskit contributors: Qiskit: an open-source framework for quantum computing (2023). https://doi.org/10.5281/zenodo.2573505
Scarani, V., Bechmann-Pasquinucci, H., Cerf, N.J., Dušek, M., Lütkenhaus, N., Peev, M.: The security of practical quantum key distribution. Rev. Modern Phys. 81(3), 1301–1350 (2009). https://doi.org/10.1103/revmodphys.81.1301
Schuld, M., Sinayskiy, I., Petruccione, F.: An introduction to quantum machine learning. Contemp. Phys. 56(2), 172–185 (2014). https://doi.org/10.1080/00107514.2014.964942
Shor, P.W.: Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J. Comput. 26(5), 1484–1509 (1997). https://doi.org/10.1137/s0097539795293172
Tacchino, F., Barkoutsos, P., Macchiavello, C., Tavernelli, I., Gerace, D., Bajoni, D.: Quantum implementation of an artificial feed-forward neural network. Quantum Sci. Technol. 5(4) (2020). https://doi.org/10.1088/2058-9565/abb8e4. arXiv:1912.12486
Toumi, A., Koziell-Pipe, A.: Functorial language models (2021)
van de Wetering, J.: ZX-calculus for the working quantum computer scientist (2020)
Zhang, W., Ding, D.S., Sheng, Y.B., Zhou, L., Shi, B.S., Guo, G.C.: Quantum secure direct communication with quantum memory. Phys. Rev. Lett. 118(22), 220501 (2017). https://doi.org/10.1103/physrevlett.118.220501
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Peral-García, D., Cruz-Benito, J., García-Peñalvo, F.J. (2024). Using Quantum Natural Language Processing for Sentiment Classification and Next-Word Prediction in Sentences Without Fixed Syntactic Structure. In: Lopata, A., Gudonienė, D., Butkienė, R. (eds) Information and Software Technologies. ICIST 2023. Communications in Computer and Information Science, vol 1979. Springer, Cham. https://doi.org/10.1007/978-3-031-48981-5_19
Download citation
DOI: https://doi.org/10.1007/978-3-031-48981-5_19
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-48980-8
Online ISBN: 978-3-031-48981-5
eBook Packages: Computer ScienceComputer Science (R0)