Nouvelle publication

Rechercher

Article
· Mai 1 4m de lecture

Señoras y señores, el asombroso Iris-nator

   

El asombroso Iris-nator ha llegado a la ciudad.

Sabe lo que piensas, con sólo unas preguntas es capaz de adivinar el personaje en el que has pensado.

¿Te atreves?

Algunos conoceréis el juego Akinator, en el que un genio es capaz de adivinar el personaje en el que has pensado, mientras respondes «sí» o «no» a unas simples preguntas.

No hay una IA analizando tus redes sociales, No hay micrófonos escuchando... ¿Y cómo lo hace?

El secreto es un sencillo algoritmo y mucha gente jugando y alimentando la base de datos.

 

¿Cómo funciona?

Definamos un término: Nodo.

Un nodo puede ser una pregunta o el nombre del personaje.

Si es una pregunta, tendrá dos respuestas: Sí o No.

Ahora vamos a darle un valor.

A la pregunta le daremos el Id 1, a la respuesta afirmativa, le daremos el Id 2 y a la respuesta negativa, el Id 3.

Ahora imaginemos que tanto la respuesta afirmativa como la negativa devuelven otra pregunta, con los personajes correspondientes para «sí» y «no».

Podemos ver un patrón entre las preguntas y las respuestas.

Las respuestas afirmativas son el doble del identificador de la pregunta, y las negativas son el doble del identificador de la pregunta más uno.

Entonces, si tenemos el nodo n, el siguiente nodo a mostrar será el nodo n*2 si la respuesta es "sí" o el nodo (n*2)+1 si la respuesta es "no".

Pongamos un ejemplo:

 

Supongamos que pienso en Snoopy, y la pregunta es «¿Tu personaje es ficticio?», la respuesta “sí” nos dirá que el personaje en el que hemos pensado es «Superman», pero no es correcta.

¿Cómo convertimos nuestra respuesta en una pregunta que nos lleve a Snoopy?

Necesitamos una característica que nos diferencie de Superman, en este caso preguntaremos «¿Tu personaje es un perro?», entonces, la respuesta afirmativa sería “Snoopy” y la negativa «Superman».

Esta nueva pregunta sustituirá el Id del nodo «Superman», el personaje “Snoopy” tendrá el doble del nodo de la nueva pregunta y el personaje «Superman» tendrá el doble del nodo de la nueva pregunta más uno.

 

De este modo, si creamos muchas preguntas y respuestas, nuestro Iris-nator podrá adivinar cualquier personaje que se te haya ocurrido.

¿Cómo funciona Iris-nator?

Crear una tabla con información de los nodos:

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 = "");
}

Nota: ¿Por qué hay un campo llamado «verbo»? porque está pensado para responder en inglés, la pregunta se muestra como {verbo} su personaje {texto} ? por lo tanto, necesita saber cual es el verbo (is, had, does, etc...) que va al inicio de la frase.

El front-end está creado con Angular19, para comunicarme con IRIS, he creado varios métodos API:

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

Devuelve la información sobre el nodo, también el NodId para la respuesta Sí y No

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

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

Devuelve la puntuación máxima. Esta puntuación máxima es el número de veces que un personaje ha sido acertado.

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

POST localhost:52773/irisnator/api/node

Cuando Iris-nator no ha sido capaz de adivinar tu personaje, rellenamos un formulario con los datos del nuevo personaje, y cuál sería la pregunta a realizar para diferenciarlo del personaje al que había llegado.

Entonces, movemos el personaje actual a respuesta «no», y ponemos el id a la nueva pregunta.

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

Además, añadirá a Snoopy como personaje que ha fallado.

POST localhost:52773/irisnator/api/score

Este método establece la puntuación de un personaje, si ha tenido éxito o no.

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


Puedes ver el siguiente vídeo de cómo funciona la aplicación, ¡¡¡disfrútalo!!!

1 nouveau commentaire
Discussion (1)2
Connectez-vous ou inscrivez-vous pour continuer
Résumé
· Mai 1

InterSystems Developer Community Digest, April 2025

Hello and welcome to the April 2025 Developer Community Newsletter.
General Stats
143 new posts published in April:
 33 new articles
 35 new announcements
 66 new questions
 9 new discussions
316 new members joined in April
14,851 posts published all time
16,004 members joined all time
Top posts
Top authors of the month
Articles
#InterSystems IRIS
Hey chat, what's up with my Interoperability
By Dmitry Maslennikov
How to get server/instance info
By Kurro Lopez
Ask your IRIS classes with Ollama, IRIS VectorDB and Langchain
By Yuri Marx Pereira Gomes
Command the Crew
By Henry Pereira
Note about the StayConnected setting for TCP adapters
By Hiroshi Sato
Part I: Studying for IRIS Developer Professional Certification with the "Ask Developer Community AI"
By Yuri Marx Pereira Gomes
Part IV: Studying for IRIS Developer Professional Certification with the "Ask Developer Community AI"
By Yuri Marx Pereira Gomes
Part III: Studying for IRIS Developer Professional Certification with the "Ask Developer Community AI"
By Yuri Marx Pereira Gomes
Part II: Studying for IRIS Developer Professional Certification with the "Ask Developer Community AI"
By Yuri Marx Pereira Gomes
SQL statistics with Grafana, InfluxDB, and Telegraf
By Lorenzo Scalese
Lifting InterSystems IRIS to the Cloud: Migration Options
By Developer Community Admin
Setting Up an ODBC/JDBC Linked Table Connection to MySQL from Iris
By Dimitri Olchanyi
InterSystems for dummies – Machine learning
By Kurro Lopez
When to account for useIrisFsGroup in your IKO Deployments
By Ariel Glikman
Thoughts on Coding with GenAI
By Timothy Leavitt
Mini Tip of the Day - Preloading the License into the Docker IRIS Image
By Luis Angel Pérez Ramos
GPG Interoperability Adapter for InterSystems IRIS
By Eduard Lebedyuk
Considerations when Migrating from Oracle, MSSQL etc to IRIS
By Irene Mykhailova
Testing Metadata Inconsistencies in InterSystems IRIS Using the DATATYPE_SAMPLE Database
By Andreas Schneider
Set, Get, and Don't Fret with JSON
By David Hockenbroch
Generating an ObjectScript Class from JSON Response Using ChatGPT
By Jean Millette
Testing Metadata Inconsistencies in InterSystems IRIS Using the DATATYPE_SAMPLE Database (Part II) - Silent Corruption
By Andreas Schneider
Response times when using Dynamic and Embedded SQL
By Irene Mykhailova
Minimum IRIS container footprint
By Jose Ruperez
#InterSystems IRIS for Health
#Other
#HealthShare
Announcements
#InterSystems IRIS
Langchain IRIS Tool - YouTube Video
By Yuri Marx Pereira Gomes
Alert: InterSystems IRIS 2024.3 – AIX JSON Parsing Issue & IntegratedML Incompatibilities
By Daniel Palevski
[Video] Building Smarter Applications with InterSystems IRIS
By Anastasia Dyubaylo
[Video] Embedded Python Best Practices and News
By Anastasia Dyubaylo
[Video] Integrating DBT and Apache Airflow with InterSystems IRIS
By Anastasia Dyubaylo
Code Your Way to InterSystems READY 2025
By Anastasia Dyubaylo
Python developers, be heard!
By Raj Singh
[Webinar] SQL Cloud Services
By Anastasia Dyubaylo
Early Access Program: OAuth2 improvements
By Andreas Dieckow
Maintenance Releases 2024.1.4 and 2023.1.6 of InterSystems IRIS, IRIS for Health, & HealthShare HealthConnect are now available
By Daniel Palevski
[Video] A Whirlwind Tour of the Analytics Buffet
By Anastasia Dyubaylo
[Video] Modern Observability with InterSystems IRIS & Open Telemetry
By Anastasia Dyubaylo
#Developer Community Official
#Open Exchange
#Learning Portal
#IRIS contest
#Global Masters
#InterSystems IRIS for Health
#Summit
#Supply Chain Orchestrator
#HealthShare
#InterSystems Ideas Portal
InterSystems Ideas News #21
By Irène Mykhailova
Questions
#InterSystems IRIS
S3
By Touggourt
GENERATE JWT / OAUTH2.0 SIGNATURE
By Sanjib Pandey
How to create a custom scheduler
By Saman Marasinghe
IRIS Terminal remote connection
By Touggourt
Trying to add #include %occErrors at the beginning of a class declaration fails because VS Code flags it as an error and won't save it
By Nuno Almeida
Query variable column names
By Touggourt
Go to Definition or Go to Declaration - what's the difference in VSCode?
By Evgeny Shvarov
How to convert persistent object to dynamic object
By Evgeny Shvarov
Best Practices for Git Integration with Developer Namespaces in IRIS
By Alex Efa
Validate XML message against XSD schema
By José Francisco Jodar
One property crashes IRIS query
By Jerry Petrole
Performant SQL For Paging Results (DataTables, Select2, etc.)
By Michael Davidovich
Subroutine execution issues in WorkMgr
By Ashok Kumar T
IRIS xDBC protocol is not compatible error while python execution
By Ashok Kumar T
Assigning a business host setting to a section
By Otto Medin
MAXSTRING %ToJSON()
By Michael Davidovich
SourceControl errors
By Patrik Spisak
Error in iris-rag-demo
By Oliver Wilms
Global mapping priority
By Touggourt
Tasks to production
By Touggourt
My AI use case - need help with Ollama and / or Langchain
By Oliver Wilms
Field Validation on INSERT error installing git-source-control
By Steve Pisani
What the heck is a "Reentrant request"?
By Julius Kavay
Linked Stored Procedure Call - Need Results to populate further logic
By Scott Roth
Confusing container tags on containers.intersystems.com
By Andreas Schneider
IntegratedML
By Touggourt
Debugging %Net.HttpRequest
By Michael Davidovich
Using CCR with Angular Applications
By Ali Nasser
web applications definitions syncing between primary and backup nodes
By Feng Wang
Setting Python
By Touggourt
Which DB Resource to provide to a web application related role for a deployed app?
By Evgeny Shvarov
I want to use ollama and IRIS for my AI use case - How do I connect to ollama?
By Oliver Wilms
Struggling with a SQL SELECT that is returning multiple searchable rows
By Scott Roth
Code Tables vs Cache SQL Tables in HealthShare Provider Directory
By Scott Roth
SQLCODE 25 - Input Encountered after end of query
By Touggourt
WorkMgr execution issues
By Ashok Kumar T
How to access a stream property in a SQL trigger
By Pravin Barton
What is the REAL content of $THIS (because it seems, $THIS is not always the expected $THIS)?
By Julius Kavay
Clearing Web Sessions from Terminal
By Jeffrey Drumm
#InterSystems IRIS for Health
ErrException: zOutputToIOStream+^EnsLib.HL7.Message
By Scott Roth
%OSCertificateStore use windows- Trusted root only
By Mark OReilly
REST application gets 403 Forbidden
By Oliver Wilms
OAuth2: Retrieve access_token and prevent login if it's valid
By Laura Blázquez García
Download intersystems IRIS 2024 releae software
By Amit Gandhi
HL7 add OBX segment at specific locations - Resolved
By Gary M Lusso
Business Rule Editor - Using Foreach Action and how to account for the counter
By Scott Roth
HL7 control characters showing up - resolved
By Gary Lusso
Does deleting a StreamContainer delete the contained Stream Object?
By Julian Matthews
Setup IRIS for Health (HL7 & FHIR)
By Rushi Chandel
How to Output from a DTL Transformation in EnsLib.EDI.XML.Document?
By Nimisha Joseph
HL7 , renumber the OBX 4 -resolved
By Gary Lusso
FTP Inbound Errors
By Thembelani Mlalazi
HL7 DTL formatting
By Gary M Lusso
Error when trying langchain-iris-tool
By Oliver Wilms
Problem with ollama container in langchain-iris-tool
By Oliver Wilms
Connection URL from Python to IRIS
By Oliver Wilms
DTL help - resolved, great help
By Gary Lusso
Special character appearing in downstream system but not seen in HL7 message.
By Martin Browne
In the rule's when condition(), how can I get the EffectiveEndDateTime of the parent ruleset?
By Will
#HealthShare
#Other
#Ensemble
#Caché
Discussions
April, 2025Month at a GlanceInterSystems Developer Community
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