What kind of algorithm is behind the Akinator game?

46,187

Solution 1

Yes, there is a name for these class of algorithms - it is called classification algorithms in the field of machine learning. Decision trees is one example for classification algorithm.

In this classification problem, the features for the algorithm are the answers to the question.

Deciding which question should be asked next can be done in various ways - for example by trying to maximize the predicted (or mean) entropy from the next question.

Solution 2

This game is sometimes known as 20 Questions. There are some questions on SO on it, e.g.:

Solution 3

Main characteristics of algorithm:

  • Self-educating
  • Mistakes-indulgence
  • Intelligent system of next question choose

Akinator game algorithm model is called "Expert system based on Fuzzy logic".

And this is NOT Decision trees, because Decision trees have no mistakes-indulgence.

I had wrote one some time ago on C#, you can find it by link: https://github.com/ukushu/AkinatorEngine

additional info you can read on wiki:

https://en.wikipedia.org/wiki/Expert_system

https://ru.wikipedia.org/wiki/Экспертная_система

Solution 4

I don't know what exactly algorithm Akinator uses, but here I have put open-source an algorithm that achieves the same effect: https://github.com/srogatch/ProbQA

Basically we use a cube of N(Questions) times N(Answer Options) times N(Targets) , see https://github.com/srogatch/ProbQA/blob/master/ProbQA/PqaCore/CpuEngine.decl.h .

We train the cube by applying Bayesian formula with independence assumption, see https://github.com/srogatch/ProbQA/blob/master/ProbQA/PqaCore/CEEvalQsSubtaskConsider.cpp

Because the code is highly optimized for AVX2 and multi-threading, it may be hard to read. It may be easier to read the CUDA code for the same: https://github.com/srogatch/ProbQA/blob/master/ProbQA/PqaCore/CudaEngineGpu.cu

An application of this algorithm is also available as a website to recommend a game.

Solution 5

I think this is like an expert system, with B-Tree structure.

Share:
46,187
Desmond Hume
Author by

Desmond Hume

Updated on July 24, 2022

Comments

  • Desmond Hume
    Desmond Hume almost 2 years

    It always amazed me how the Akinator app could guess a character by asking just several questions. So I wonder what kind of algorithm or method let it do that? Is there a name for that class of algorithms and where can I read more about them?