Nouvelle publication

Rechercher

Article
· Mai 1 3m de lecture

Ladies and Gentlemen, the amazing Iris-nator

   

The amazing Iris-nator has arrived in town.

He knows what you think, with just a few questions he is able to guess the character you have thought of.

Do you dare?

Some of you may know the game Akinator, where a genie is able to guess the character you have thought of, while you answer “yes” or “no” to a simple question.

No AI analyzing your social networks, no microphones listening in... So how does it do it?

The secret is a simple algorithm and a lot of people playing and feeding the database.

How does it work?

Let's define a term: Node.

A node can be a question or the name of the character.

If it is a question, it will have two answers: Yes or No.

 

Now let's give it a value.

To the question we will give the Id 1, to the affirmative answer, we will give the Id 2 and to the negative answer, the Id 3.

Now let's imagine that both the affirmative and negative answers return another question, with corresponding characters for “yes” and “no”.

 

We can see a pattern between the questions and the answers.

Affirmative answers are twice the question identifier, and negative answers are twice the question identifier plus one.

Then, if we have the node n, the next node to display will be node n*2 if the answer is "yes" or node (n*2)+1 if the anser is "no".

Let's give an example:

 

Suppose I think of Snoopy, and the question is "Is your character fictional?", the answer "yes" will tell us that the character we have thought of is "Superman", but it is not correct.

How do we turn our answer into a question that leads us to Snoopy?

We need a characteristic that differentiates us from Superman, in this case we will ask “Is your character a dog?”, then, the affirmative answer would be ‘Snoopy’ and the negative answer would be “Superman”.

This new question will replace the Id of the node “Superman”, the character “Snoopy” will have the double of the node of the new question and the character "Superman" will have the double of the node of the new question plus one.

 

This way, if we create a lot of questions and answers, our Iris-nator will be able to guess any character you have thought of.

How does Iris-nator works?

Create a table with information of nodes:

Class Irisnator.Data.Nodes Extends %Persistent
{

/// NodeId
Property NodeId As %Numeric;
/// Text of the node
Property Text As %String(MAXLEN = "");
/// Type of node (0 = text, 1 = question)
Property Question As %Boolean [ InitialExpression = 0 ];
/// Verb of the question
Property Verb As %String(MAXLEN = "");
}

Note: Why is there a field called "verb"? because, the question is shown as {verb} your character {text} ? therefore, it needs to know what is the verb (is, had, does, etc...)

The front-end is created with Angular19, to communicate with IRIS, I have created several API methods:

GET localhost:52773/irisnator/api/node/:nodeId

Returns the information about the node, also the NodId for answer Yes and No

{
    "nodeId": 1,
    "text": "a woman",
    "verb": "is",
    "question": true,
    "nodeYes": 2,
    "nodeNo": 3
}

GET localhost:52773/irisnator/api/score/:top

Returns the top score. This top score is the number of times a character has been hit.

{
    "score": [
        {
            "characterName": "Superman",
            "score": 8
        },
        {
            "characterName": "Maddona",
            "score": 3
        },
        {
            "characterName": "Snoopy",
            "score": 1
        }
    ]
}

POST localhost:52773/irisnator/api/node

When Iris-nator has not been able to guess your character, we fill in a form with the data of the new character, and what would be the question to ask to differentiate him/her from the character he/she had arrived at.

Then, move the current character to "no" answer, and put the id to the new question.

{
    "nodeId": 507,
    "newCharacter": "Snoopy",
    "oldCharacter": "Superman",
    "text": "a dog",
    "verb": "is"
}

In addition, it will add Snoopy as a character it has failed.

POST localhost:52773/irisnator/api/score

This method set the score for a character, if it has been success or not.

{
    "characterName": "Snoopy",
    "success": true
}

 

You can watch the following video of how the application works, enjoy it!!!

3 nouveaux commentaires
Discussion (3)2
Connectez-vous ou inscrivez-vous pour continuer
Question
· Mai 1

Zera Packers and movers

Are you looking for trusted packers and movers in Kochi? We are offering affordable house shifting and office shifting services. Our experience staff ensuring safe and secure packing and loading also ensure timely delivery and secure transportation as well. Our Experienced professional movers ensure to provide high level of service to customers. If you are planning to shift inside Kochi or different cities we can help to make you shifting smooth and secure. We have more than 10 years of experience with more than 3500 happy customers. We are committed to providing our customers with affordable and safe moving, packing, and house shifting services. https://zerapackersandmoverscochin.in/

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Annonce
· Mai 1

[Video] Using Embedded Python in the BPL and DTL Editors

Hi, Community!

🐍Great news—you can now use Python to customize your productions and add custom code!

Using Embedded Python in the BPL and DTL Editors

In this video, see how you can use Python with ease in BPL business processes and DTL data transformations.

You can use custom code in the DTL or BPL Editor to:

  • Write conditional logic
  • Modify data formats
  • Perform calculations

...and import Python libraries to use in these fields.

Try it today!

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Annonce
· Mai 1

Récapitulation de la communauté des développeurs, avril 2025

Bonjour et bienvenue à la récapitulation de la Communauté des développeurs d'avril 2025.
Statistiques générales
✓ Nouvelles publications 20 publiées l'avril :
 12 nouveaux articles
 8 nouvelles annonces
✓ Nouveaux membres 1 ayant rejoint l'avril
✓ Publications 1,153 publiées depuis le début
✓ Membres 167 ayant rejoint depuis le début
Meilleures publications
Présentation de l'adaptateur UDP
Par Corentin Blondeau
Bulk FHIR, étape par étape
Par Guillaume Rongier
Les meilleurs auteurs du mois
Articles
#InterSystems IRIS
L'API REST avec Swagger dans InterSystems IRIS
Par Guillaume Rongier
Contourner l'incompatibilité de scikit-learn 1.6.0 dans IRIS 2024.3 AutoML
Par Iryna Mykhailova
Vous rencontrez des difficultés pour connecter votre Visual Studio Code à votre instance IRIS via WebGateway ? Voici quelques conseils !
Par Iryna Mykhailova
Comment créer et intégrer JWT dans InterSystems IRIS
Par Lorenzo Scalese
L'utilisation de DocDB en SQL, quasiment
Par Iryna Mykhailova
Comment identifier les variables globales temporaires qui consomment de l'espace dans la base de données IRISTEMP
Par Sylvain Guilbaud
Sécurisation des interfaces HL7 avec des certificats SSL/TLS (X.509)
Par Sylvain Guilbaud
Présentation de l'adaptateur UDP
Par Corentin Blondeau
SQLAchemy-iris avec la dernière version du pilote Python
Par Lorenzo Scalese
 
#InterSystems IRIS for Health
 
Annonces
#InterSystems IRIS
 
#Communauté des développeurs officielle
 
#Summit
 
#Portail d'apprentissage
 
Avril, 2025Month at a GlanceInterSystems Developer Community
Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Résumé
· Mai 1

Résumé de la communauté des développeurs d'InterSystems, Avril 2025

Bonjour, voici la newsletter de la communauté des développeurs de Avril 2025.
Statistiques générales
✓ Nouvelles publications 20 publiées le Avril :
 12 nouveaux articles
 8 nouvelles annonces
✓ Nouveaux membres 1 ayant rejoint le Avril
✓ Publications 1,153 publiées depuis le début
✓ Membres 167 ayant rejoint depuis le début
Meilleures publications
Bulk FHIR, étape par étape
Par Guillaume Rongier
Les meilleurs auteurs du mois
Articles
#InterSystems IRIS
L'API REST avec Swagger dans InterSystems IRIS
Par Guillaume Rongier
Contourner l'incompatibilité de scikit-learn 1.6.0 dans IRIS 2024.3 AutoML
Par Iryna Mykhailova
Vous rencontrez des difficultés pour connecter votre Visual Studio Code à votre instance IRIS via WebGateway ? Voici quelques conseils !
Par Iryna Mykhailova
Comment créer et intégrer JWT dans InterSystems IRIS
Par Lorenzo Scalese
L'utilisation de DocDB en SQL, quasiment
Par Iryna Mykhailova
Comment identifier les variables globales temporaires qui consomment de l'espace dans la base de données IRISTEMP
Par Sylvain Guilbaud
Sécurisation des interfaces HL7 avec des certificats SSL/TLS (X.509)
Par Sylvain Guilbaud
Présentation de l'adaptateur UDP
Par Corentin Blondeau
SQLAchemy-iris avec la dernière version du pilote Python
Par Lorenzo Scalese
#InterSystems IRIS for Health
Annonces
#InterSystems IRIS
#Communauté des développeurs officielle
#Summit
#Portail d'apprentissage
Avril, 2025Month at a GlanceInterSystems Developer Community