Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
60 REPLIES 60

geek
Participant

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
1,095

It is what I had in mind, perhaps not the political aspect, but definitely the query aspect.  🤓

asm_sapdev
Explorer
1,059

My submission for week 2 challenge (Screenshot it at the bottom of the reply).

I don't know anything about this topic and I am trying to learn as I go, so here is my question (maybe too simple to ask) - I got the same answer for all three combinations I tried. Aby idea why it happened ? OR should I ask this question on the other thread?

Both the challenges so far were very well written and executing them was not difficult. Thanks for your detailed instructions. I am planning to go back and complete older challenges too.

  • curry, potato, zucchini
  • cauliflower, potato, zucchini
  • onion, potato, zucchini

asm_sapdev_0-1718760567738.png

 

0 Kudos
1,026

As all words you are using are vegetable names and are in the same category, so the distance between them should be quite short in the latent space and might influence the answers.

I would suggest using words from two different categories, as you can see in other submissions.

Cocquerel
Active Contributor
0 Kudos
1,024

I have tried an alternative method for the analogy search. At least, for the king/man/queen, it provides woman as expected. Let me know what you think about.
Here is my coding

 

import struct
from hdbcli import dbapi
def parseFvecs(fvecs):
    dim = struct.unpack_from("<I", fvecs, 0)[0]
    return list(struct.unpack_from("<%sf" % str(dim), fvecs, 4))
word1='king'
related_word1='man'
word2='queen'
conn = dbapi.connect(userkey='myDevChallenger')
sql = """SELECT TOP 1 WV FROM "DEVCHALLENGER"."GOOGLE_NEWS" WHERE "WORD"=?"""
cursor = conn.cursor()
cursor.execute(sql,(word1))
word1_vector= parseFvecs(cursor.fetchall()[0][0]) 
cursor.execute(sql,(related_word1))
related_word1_vector= parseFvecs(cursor.fetchall()[0][0]) 
cursor.execute(sql,(word2))
word2_vector= parseFvecs(cursor.fetchall()[0][0]) 
related_word2_vector = []
for word1_item, related_word1_item, word2_item in zip(word1_vector, related_word1_vector,word2_vector):
    related_word2_item = related_word1_item - word1_item + word2_item
    related_word2_vector.append(related_word2_item)
sql = """SELECT "WORD" FROM "DEVCHALLENGER"."GOOGLE_NEWS" ORDER BY COSINE_SIMILARITY(TO_REAL_VECTOR(?),"WV") DESC LIMIT 1"""
cursor.execute(sql,(str(related_word2_vector)))
cursor.fetchall()[0][0] 

 

 

Cocquerel_0-1718805298446.png

 


 

Cocquerel
Active Contributor
0 Kudos
994

This method is working fine for capitals while the previous was failing

Cocquerel_0-1718814538427.png

 

 

raulruiz
Explorer
918

Cool! Quite curious the distance and analogies

raulruiz_0-1718913580830.png

I have played with different options and not always founding what I expected (but normally I have to admit they were related). Probably, as mentioned in some reply, due to the partial load

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
860

I like your example with the past and the future @raulruiz !

sabarna17
Contributor
843

Awesome idea @Vitaliy-R, to make the participant read other's comments.

Here is my execution (supporting England and Germany in eurocup)

sabarna17_0-1719174800038.png

 

Vitaliy-R
Developer Advocate
Developer Advocate
780

I am glad you did not decide to support Poland in this Euro 2024 Cup ️ like I did @sabarna17 

😭

ceedee666
Active Contributor
819

I had to increase the number of records to find something interesting. With 500.000 records i got out of memory errors, 250.000 worked. Here is what I found:

ceedee666_0-1719214676071.png

 

ceedee666_1-1719214689274.png

 

ceedee666_3-1719214849870.png

 

ceedee666_2-1719214834590.png

 

ceedee666_4-1719214935367.png

 

ceedee666_5-1719214948323.png

 

mvinci
Product and Topic Expert
Product and Topic Expert
812

Hello there

I fixed the "cannot allocate enough memory..." error by increasing the statement_memory_limit_threshold up to 80% in the global.ini file, section: memorymanager. 

jpenninkhof
Product and Topic Expert
Product and Topic Expert
764

Smart guy. Knows about the crown jewels of each company...

jpenninkhof_0-1719257294868.png

and 

jpenninkhof_1-1719257399061.png

 

0 Kudos
763

As I kept repeating:

There is no magic in AI...
There is only the math that works surprisingly well!

reachdebopriya
Active Participant
0 Kudos
622

Hello, 

I have little confusion. I have completed till Step 6.

But I am not able to understand from step 7 as below.

  1. Open and execute week2* notebooks from the challenges folder

Do I need to execute this in step 7 ?

reachdebopriya_0-1719992805003.png

Regards,

Debopriya Ghosh

 

0 Kudos
560

I assume it is a bottle of milk for a baby 🍼