Wikidata and ChatGPT integration failure

Posted on

Integration of knowledge graphs with large language models (e.g., Wikidata and ChatGPT) is an interesting topic that might help gain better grounding in reality and less confabulation/hallucination often seen with large language models alone.

I have implemented a ChatGPT called Wikibåt and which is configured via “actions” and OpenAPI configuration to query the Wikidata API. My initial impression of this system was quite good, see my blog post Multihub question answering with ChatGPT and Wikidata from November 2023.

But now I have run into a simple example where it fails. I entered “Can you give a list of supervised students of Lars Kai Hansen?” and Wikibåt identifies and looks up the correct Wikidata entity fine, but then fails to use the entity data correctly, listing two wrong students as supervised by Lars Kai Hansen even though such information is ready available as “first order data” in the entity requiring no multihub processing.

(The reason why there is a link to Scholia is due to the prompt, i.e., the “Instructions” field in the configuration)

4 thoughts on “Wikidata and ChatGPT integration failure

    derenrich said:
    January 15, 2024 at 6:15 pm

    I’m guessing the OpenAI client is not returning the answers in the proper format (just QIDs?)? Though I cannot be sure without seeing what was communicated between OpenAI and Wikidata.

    This happens to work using my langchain/wikidata integration https://nbviewer.org/urls/d.erenrich.net/upload/Wikidata_Lars_Kai_Hansen.ipynb (well I don’t know if the answer is actually right but it returns something reasonable)

      Finn Årup Nielsen responded:
      January 15, 2024 at 8:41 pm

      Yes, I believe the second call only returns what is in the Lars Kai Hansen entity and ChatGPT does not bother to look up the labels of the other items.

        derenrich said:
        January 15, 2024 at 8:46 pm

        yeah I think any wikidata/LLM integration should return the labels (maybe in addition to QIDs). expecting it to do a million lookups is not gonna work

        Finn Årup Nielsen responded:
        January 15, 2024 at 8:49 pm

        I suppose that the use of Wikdata Query Service and the label service could be an alternative to the entity lookup.

Leave a comment