Professional Documents
Culture Documents
Akinator is an artificial intelligence program that can guess any real or fictional
character you're thinking of through a series of questions.
Akinator uses a decision tree algorithm to narrow down the possibilities based on
the user's responses to a series of questions.
Question-Response System:
aki = akinator.Akinator()
q = aki.start_game()
def take_chance(answer, property): if answer == "y": ans = True else: ans = False
to_remove=[]
for d in database:
Logic behind the guessing game ?
• Root Node: Is the topmost in a tree data structure.
• Internal Nodes : Test for the value of a certain attribute or feature.
• Branch : Correspond to the outcome of a test and connect to the next Internal Node or Leaf Node (black
straight line in the figure).
• Leaf Nodes : Terminal nodes that predict the outcome (represent class labels or class distribution).
how to choose the best attribute to replace in the Root Node of the previous figure?
Suppose that we have a set of instances data set called S. We split this set into S_1 and S_2 and also assume that we
have two classes denoted by C+ and C-. For instances, the best situation is when S_1(+)= C+ and S_1(-)=∅ or
S_1(+)= ∅ and S_1(-)=C-. In this case, the two children of the division are said to be Pure.
To know the impurity or purity of a data set, We can measure the impurity of a set of n+ labelled positives and n−
labelled negatives and then compute the Empirical Probability:
Conclusion: Unveiling the Python Magic in
Akinator
In conclusion, the impact of Python in the creation of Akinator is nothing short of magical. Python's versatility and
adaptability have shaped Akinator into the enchanting guessing game millions around the world have come to love.
Python as the Architect of Logic: At the heart of Akinator's intelligence lies Python, orchestrating the intricate
dance of algorithms that captivate users. Python's readability and expressive syntax make it not just a programming
language but the architect of Akinator's logical prowess.
The Backbone of Backend Brilliance: Python's role in the backend development of Akinator cannot be
overstated. From managing user sessions to processing the guessing algorithm, Python ensures the seamless
orchestration of the game's mechanics. Its scalability features contribute to the robustness that allows Akinator to
gracefully handle the ebb and flow of user traffic.
The Canvas for Web Masterpieces: In crafting the user interface and ensuring an interactive web experience,
Python, in tandem with frameworks like Flask or Django, acts as the canvas for web masterpieces. Akinator's
frontend, shaped by Python's web development capabilities, provides users with an immersive and delightful
journey.
Citations
1. https://pypi.org/project/akinator.py/
2. https://en.akinator.com/
3. akinator.py — akinator.py 1.1.1 documentation
4. https://medium.com/analytics-vidhya/building-akinator-with-python-usin
g-bayes-theorem-216253c98daa