What kind of algorithm is behind the Akinator game?

余生长醉 提交于 2019-12-02 18:19:30

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.

ziggystar

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

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 it's have no mistakes-indulgence.

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

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!