Basketball Question Answering Using Knowledge Graphs and Large Language Models
摘要
There is a recent trend of using LLMs for generating SPARQL queries from natural questions, in order to exploit the generated query for retrieving the answer over a Knowledge Graph (KG). This can be quite challenging for popular domains, such as sports, that include billions of fans worldwide that are not familiar with KGs and query languages, and they typically express their questions in natural language. In this paper, we focus on basketball games which are complex events including several factors and participants, such as teams, players, statistics and others. However, all this information is usually given in separate HTML tables or JSON files, thereby, it is not trivial to be combined. The objective is to show a generic pipeline including the following steps: i) data collection, ii) the definition of competency questions, iii) the creation of an event-based ontology and the KG, and iv) the exploitation of the KG through the LLMs, for enabling natural QA through a text-to-SPARQL method based on ontology and literals path patterns. As a use case, we construct a KG including 5 million triples from the EuroLeague games from 2000–01 until 2024–25, a web application, and an evaluation benchmark with 100 natural questions in 3 languages (English, Greek, Chinese). Finally, we present an experimental evaluation for the QA task; indicatively by using the proposed method, we reached 0.79 accuracy through GPT-4 and 0.71 accuracy through DeepSeek, for the English benchmark, instead of 0.3 for the baseline method.