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

MioYasutake
Active Contributor
3,650

My submission for week 2. I tried several sets of words because the query did not always return my expected results.

MioYasutake_0-1718226613943.png

 

0 Kudos
3,475

Thank you for trying it out @MioYasutake 

How did you find this week's content? Was it helpful to learn anything new?

3,446

@Vitaliy-R 
Executing the scripts was straightforward, and I didn't encounter any obstacles. However, I believe it would be more beneficial for learning if there were elements that required us to think and implement solutions on our own.

3,420

Thank you for your feedback @MioYasutake and @Cocquerel !

It seems I overestimated the difficulty of running this, as I assumed many people would be trying different aspects of this exercise for the very first time and I wanted to make it easier.

I see it has become too easy and resulted in a tutorial instead of a challenge...

Ok, I will try to make it more challenging next week 🤓

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
3,479

Thank you for giving it a try @Cocquerel 

How did you find this week's content? Was it helpful to learn anything new?

Cocquerel
Active Contributor
3,459

The task was extremely guided; the only difficulty was finding words that yielded a meaningful result. I would have preferred a slightly less guided exercise because I retain information better when I have to search a bit on my own rather than simply executing tasks without any reflection. I would have preferred something that looks more to a real challenge.

Vitaliy-R
Developer Advocate
Developer Advocate
3,414

Point taken. On top of what I replied to you and @MioYasutake below already, I must confess it took me 4 hours to make the 3CosMul calculation work:

 

((1+ COSINE_SIMILARITY("V4"."WV", "V3"."WV"))/2 * (1+COSINE_SIMILARITY("V4"."WV", "V2"."WV"))/2) / ((1+COSINE_SIMILARITY("V4"."WV", "V1"."WV"))/2 + 0.000001) AS "3COSMUL_SCORE"

 

for the analogy queries.

Sounds, I should have left it to your next time as a challenge 🤓

sagarsv
Explorer

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
3,493

Have you considered a career in medicine @sagarsv ? 🩺

How did you find this week's content? Was it helpful to learn anything new?

3,320

HAHA, NO @Vitaliy-R 
I felt the same , It's was too straight forward.
For me " COSINE_SIMILARITY " is very new , I understood what it does a bit , I need to deep dive. which I will 🙂 

 

mvinci
Product and Topic Expert
Product and Topic Expert

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
3,495

Your last example made me scratch my head, and then smile @mvinci 

I checked that EDE is the NYSE's "Empire District Electric Company". So, this is where "Empire" is coming from 🙂 

Maybe you should have tried what is there in "Athens" similar to "pasta" in "Rome"? 😋

How did you find this week's content? Was it helpful to learn anything new?

 

mvinci
Product and Topic Expert
Product and Topic Expert
0 Kudos
3,475

Excellent exercise - maybe too easy as the notebooks were super cool and prompt (too perfect) 😀

Only one query had an error (i am investigating the error in my account). I loaded 3m records on my BTP internal tenant (not trial... )

workspaces-ws-476rm
 
 
* hana://userkey=myDevChallenger (hdbcli.dbapi.OperationalError) (4, 'cannot allocate enough memory: Allocation failed; Reason: configured statement memory limit from global configuration reached (SAP Note 3191224)') [SQL: SELECT RN, WORD, RELATED_WORD, SIMILARITY_SCORE, L2DISTANCE FROM ( SELECT B.WORD AS WORD, A.WORD AS RELATED_WORD, COSINE_SIMILARITY(A.WV, B.WV) AS SIMILARITY_SCORE, L2DISTANCE(A.WV, B.WV) AS L2DISTANCE, ROW_NUMBER() OVER (PARTITION BY B.WORD ORDER BY COSINE_SIMILARITY(A.WV, B.WV) DESC) AS RN FROM "DEVCHALLENGER"."GOOGLE_NEWS" A, (SELECT WV, WORD FROM "DEVCHALLENGER"."GOOGLE_NEWS" WHERE WORD IN ('cat', 'CAT')) B WHERE A.WORD <> B.WORD ) AS RankedWords WHERE RN <= 5 ORDER BY WORD DESC, SIMILARITY_SCORE DESC;] (Background on this error at: https://sqlalche.me/e/20/e3q8)

Vitaliy-R
Developer Advocate
Developer Advocate
3,447

Thank you for your feedback @mvinci and it is in line with what @MioYasutake and @Cocquerel wrote. Note taken: https://community.sap.com/t5/application-development-discussions/submissions-for-quot-sap-hana-cloud...

I reduced the number of loaded records from 3000000 to 100000 because, for 3 million records, I used a HANA instance bigger than what we all have in the Trial. Plus, it takes quite a long time for single-threaded processing to work with a 3M dataset. It was at the pick of BAS trial dev spaces as well, when it comes to disk and RAM.

Maybe that can be taken as a challenge now, how to tune the environment to work with 3M complete dataset in Trial 🤓

mvinci
Product and Topic Expert
Product and Topic Expert
3,282

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. 

mvinci
Product and Topic Expert
Product and Topic Expert

moh_ali_square
Participant
3,263

Hi, 

Week2 submission, but I was expecting different relationships 😄 submission week2.png

3,230

Your result:

sky --> cloud
ground --> VMs

made my day! 🤓

 

DirkO
Participant
3,183

My submission for week 2

I tried several sets of words because the query did not always returned results. And some outcome I did not understand. By increasing the number of results the some of them became a bit more reasonable.



word1='Car'

related_word1='mobility'

word2='Train'

 

lookup_wordrelated_word3COSMUL_SCORE

Train

fluidity

0.8257285345399955

Train

transport

0.8233577046806748

Train

movement

0.79910186795009

Train

disabilities

0.7945178072857146

Train

train

0.7854194316740297

Дякую!

Have a nice weekend,

Dirk

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
3,165

Thanks for joining @DirkO 

It seems "mobility" semantically represents the medical term of "being able to move", plus "train" might be taken as a verb for "training" 🙂 

But when I changed "mobility" to "Mobility" then related words were:

VitaliyR_0-1718481046224.png

 

emiliocampo
Explorer
3,116

Week 2 Submission! Having fun trying different words!

emiliocampo_0-1718551047828.png

 

emiliocampo_1-1718551076895.png

 

emiliocampo_2-1718551119327.png

 

emiliocampo_3-1718551150999.pngSPOILER ALERT! It looks like Grogu is not Yoda's son!!! Nick is 😮

 

emiliocampo_4-1718551299793.png

 

emiliocampo_5-1718551324383.png

 

emiliocampo_6-1718551676426.png

 

emiliocampo_7-1718551700833.png

🤔

0 Kudos
3,040

Funny examples indeed.

In the case of Jupiter, it referred to the city in Florida, whose neighbor is Palm Beach. This is where SAP TechEd on Tour takes place alongside ASUG Tech Connect in November https://events.asug.com/event/9a5f27ca-d742-45bb-85e7-a6597b952900/summary, but who knows, maybe we will have it on the Moon still during our lifetime 🤓

And in the case of name+surename for Luke, it might related to the name+surename of the music producer Nick Yoda.

M-K
Participant

mwn
Participant
3,047

My week 2 submission:

word1='Australia'
related_word1='Canberra'
word2='USA'
 
Result:
USAWashington_DC0.7220002249341672

 

which is the correct capital city

But when word2 = 'Spain'

We get


SpainCatalan0.865680415938654

M

tobiasz_h
Active Participant

0 Kudos
2,851

Hi @Leela_Sankar_PV Have you tried any other combinations of words to come up with your own analogy questions? This is what was asked at the end of the challenge for the Week 2: to replace these values:

word1='king'
related_word1='man'
word2='queen'

and post a screenshot with your example.

2,718

Hi @Vitaliy-R , Yes i was using different combination. Now i have replaced with below one and result is,

word1='king'
related_word1='man'
word2='queen'

 

Leela_Sankar_PV_1-1718778357252.png

 

Leela_Sankar_PV_0-1718778334656.png

christof_m
Explorer
2,928

Hi Vitaliy, all worked fine, also with using 500000 words, also interesting: showing more than LIMIT 1 results.

christof_m_0-1718657755880.pngchristof_m_1-1718657783525.png

A little bit stranger:

word1='Munich'

related_word1='Oktoberfest'

word2='Stuttgart'

christof_m_2-1718657818131.png

(It is not "Septemberfest", but "Cannstatter Wwasen" - but it usually takes playe in september)


Experimenting with capitals worked for Brasil, Braslilia -> Australia, Canberra, but not for Suisse, Bern. 

 

SushmitaG
Product and Topic Expert
Product and Topic Expert

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
2,775

I never heard about taco 🌮 in Spain 🇪🇸
...but maybe it is similar to kebab 🥙 in Poland 🇵🇱 these days.

🤓

2,702

I would say, the answer is completely matches reality, as taco is very common in Spain. In any restaurant, you will be offered tacos at every corner.

In Spain, "taco" refer to a small, thick slice of food, such as a slice of ham, cheese, or other types of cured meats. These are commonly served as tapas, which are small dishes or snacks

Best-tacos-in-Madrid