Skip to content

seghiranass/Akinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔮 Akinator - The Mind-Reading AI

Akinator Logo

"I can read your mind... Try me!"

Python Django Prolog Tailwind License

🌟 Features

  • Mind-reading AI that guesses characters/animals/objects
  • Multi-language support (Arabic, English, French, Spanish)
  • Knowledge base with 50+ entities and 200+ attributes
  • Inferences and Self-improving through Prolog logical inference
  • Beautiful UI with TailwindCSS
  • Session tracking for personalized guessing
# Sample Prolog knowledge base
entity(crocodile, [animal, reptile, carnivore, cold_blooded,..., swims, sharp_teeth, armored_skin]).
entity(darth_vader, [character,..., villain, uses_force, has_lightsaber, star_wars_universe]).

🛠️ Tech Stack Breakdown

🌐 Frontend

🎨 Styling 🧩 Components
django-tailwind Django Templates

🖥️ Backend

🐍 Language 🏗️ Framework 🔮 Logic Engine
Python Django 4.x (with i18n) SWI-Prolog via PySwip

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • SWI-Prolog 9.0+
  • PySwip 0.2.10+
  • Django 4.0+
  • django-tailwind (v3.3+)
# Clone and enter repository
git clone https://github.com/johanLib/Akinator.git
cd Akinator

# Create virtual environment (Unix/MacOS)
python3 -m venv venv
source venv/bin/activate

# Windows users use:
# venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt ( Check the Prerequisites section )

# Migrate database
python manage.py migrate

# Run development server
python manage.py runserver

🧠 How It Works (Small Technical Preview)

🔍 Knowledge Representation (Prolog)

% Entity facts database
entity(crocodile, [animal, reptile, carnivore, cold_blooded, lives_in_water, four_legs, swims, sharp_teeth, armored_skin]).
entity(darth_vader, [character, fictional, from_movie, villain, uses_force, has_lightsaber, star_wars_universe]).

% Dynamic rules
ask_attributes(ConfirmedAttrs, EntityList) :-
    EntityList = [_|_],
    select_best_question(EntityList, Question),
    has_attribute(Question),
    filter_entities(EntityList, [Question | ConfirmedAttrs], NewEntityList),
    ask_attributes(ConfirmedAttrs, NewEntityList).

🌍 Multi-language Support

Available Languages

Language Code Example Question Example Answer
العربية ar "هل يعتمد على المهارات بدلاً من القدرات الخارقة؟" "نعم/لا"
English en "Does it rely on skills rather than supernatural abilities?" "Yes/No"
Français fr "Compte-t-il sur des compétences plutôt que des capacités surnaturelles ?" "Oui/Non"
Español es "¿Depende de habilidades en lugar de poderes sobrenaturales?" "Sí/No"

Language Switching Logic

# In views.py
class SetLanguageView(View):
    def post(self, request):
        language = request.POST.get('language')
        activate(language)
        request.session['django_language'] = language
     
        redirect_url = request.POST.get('next') or request.META.get('HTTP_REFERER') or '/'
        return HttpResponseRedirect(redirect_url)

🤝 Contributing

How to Contribute

  1. Fork the repository

  2. Clone your fork:

    git clone https://github.com/your-username/Akinator.git

About

AI-powered guessing game that can determine whatever you're thinking of by asking a series of intelligent questions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages