Using Gemini to generate some data.

35 views
Skip to first unread message

Mahmoud Fayed

unread,
Feb 14, 2024, 3:36:42 AMFeb 14
to The Ring Programming Language
Hello

This is a simple example about using Gemini to generate some data

v1.png1

Note: To get this result, Gemini in the background, used Python & Pandas to generate the code and executed it too.

We can ask about the source code and see it, Also, we can request changing it to other programming languages like Ring (And here we see the drop in accuracy and mistakes in converting the code to Ring, maybe this will be improved in the future).

Greetings,
Mahmoud

Mansour Ayouni

unread,
Feb 14, 2024, 5:10:14 AMFeb 14
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Yes! Data manipulation is one of the practical aspects programmers need a lot and AI can help save time with.

In Unicode support in Softanza, I do a lot of data preparation and transformation of the raw Unicode data. What took me a week to accomplish one year ago, can be made with AI in minutes! And I'll give an example...

Unicode brute data, as borrowed from the official unicode database, always uses hex numbers for chars codepoints. But Softanza prefers decimals because they are more intuitive and more easily memorable for the rest of us.

So, each time I need to support a unicode data set from Unicode, I must transform it manually to decimal code inside the local Softanza Unicode database.

Another issue I deal with is the structure of these data. My goal is to organize them in an efficient way, so the chars are found quickly, both by their names and their unicode code points. In particular, the decimal code point allows as to get any char by simply feeding it to the StzCharQ() function, like that:

image.png

To solve these issues, data transformation is necessary. The example I'll show here, refers to including the names of all Unicode Blocks of chars in Softanza, which are helpful for finding a specific set set of chars, so it will be possible to say for example :

? Some( UnicodeBlocks() ) # and we get:
#--> [ "Osage", "Manichaean", "Dives Akuru" ]

Softanza can also provide us with the range of unicode codepoints of each block. Hence, we say:

? Some( UnicodeBlocksXT() ) # and we get:
#--> [
#      [ "Osage", [66736, 66815] ],
#      [ "Manichaean", [68288, 68351 ] ],
#      [ "Dives Akuru", [72272, 72367] ]
# ]


And it can search for some blocks containing a given word in their name:


? Some( UnicodeBlocksContainingXT("box") )
#--> [ "Box Drawing", [9472, 9599] ]

and, from that, by using the information about the [9472, 95599] range we got, we can get a list of some box chars along with their names:


? CharsAndNames( Some( UnicodesToChars(9472 : 9599) )
#--> [
#      [ "┖", "BOX DRAWINGS UP HEAVY AND RIGHT LIGHT" ],
#      [ "╸", "BOX DRAWINGS HEAVY LEFT" ],
#      [ "╏", "BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL" ],
#      [ "╚", "BOX DRAWINGS DOUBLE UP AND RIGHT" ],
#      [ "┺", "BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY" ]
# ]


And so on.


To make all that possible, a more convenient data structure, that is different from the one provided as-is by the Unicode foundation, is necessary.


ChatGPT helped me to it quickly using this prompt:


image.png


PS: In your conversation with Gemini above, try to give it more context about Ring, how it can be used to make transformations of data, and how it differs from Python in terms of syntax, along with some examples, and you will get a better Ring code. As you see, prompting engineering becomes a requirement and a real challenge for all of us !


Sorry for being long and thanks for your time.


Best,

Mansour


--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/cafff3a4-8fb3-4689-b2ce-e3b6b05927abn%40googlegroups.com.

Mahmoud Fayed

unread,
Feb 14, 2024, 5:54:46 AMFeb 14
to The Ring Programming Language
Hello Mansour

Interesting example and nice use-case
Thanks for sharing :D

Greetings',
Mahmoud

Bert Mariani

unread,
Feb 14, 2024, 3:01:04 PMFeb 14
to The Ring Programming Language
Hello Mansour,

In your interactions with Gemini ...
Feed it the 
  -  Fayed_RingDoc_1.19.pdf 
  - Along with everything in  C:\Ring
  - "Applications" and "Samples" etc

It might learn something, and  dig out the info requested when queried.
After all its just a fancy search engine.

Mansour Ayouni

unread,
Feb 15, 2024, 1:38:19 PMFeb 15
to Bert Mariani, The Ring Programming Language
Hello Bert,

What you are referring to is called in the  AI research domain: Complex reasoning about vast amounts of information.

Google announced today its next version of Gemini large model that supports up to 1 million tokens to be processed in one shot. This is the equivalent of a code base with 30K lines and more than 700K words.

Compared to other models in use today, this is a tremendous step forward:

image.png

Back to your suggestion: yes, we should do it and feed the AI with every thing we have about the Ring. But then, we have a lot to do other than using it as a search engine.

AI tools aren't simply search engines. They process data, construct a model about the knowledge contained in that data, and provide us with useful conversation, synthesis, extraction, and transformation tools.

All the best,
Mansour

Reply all
Reply to author
Forward
0 new messages