Skip to content

DOC Add get_ken_embeddings example - #602

Merged
GaelVaroquaux merged 17 commits into
skrub-data:mainfrom
jovan-stojanovic:add_ken_fetch_example
Jun 15, 2023
Merged

DOC Add get_ken_embeddings example#602
GaelVaroquaux merged 17 commits into
skrub-data:mainfrom
jovan-stojanovic:add_ken_fetch_example

Conversation

@jovan-stojanovic

Copy link
Copy Markdown
Member

Fix for #578

@GaelVaroquaux GaelVaroquaux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments

Comment thread skrub/datasets/_ken_embeddings.py Outdated
>>> games_embedding = get_ken_embeddings(types="video_games")
>>> games_embedding.head()
Entity Type ... X198 X199
0 <The_Mysterious_Island> <wikicat_novels_adapted_into_video_games> ... -0.072814 -0.156973

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand: we still have the "<" here, it seems

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, corrected, after I merged with #601

Comment thread skrub/datasets/_ken_embeddings.py Outdated
search_result = unique_types.X[unique_types.X["Type"].str.contains(search)]
if exclude is not None:
search_result = search_result[~search_result["Type"].str.contains(exclude)]
search_result["Type"] = search_result["Type"].str.replace("<", "").str.replace(">", "")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to do ".str[1:-1]": what if there was a "<" inside the string (maybe it's impossible?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are extracted from Wikipedia URL's, thus we have the "_" instead of spaces.
And having ">" or "<" symbols is apparently not possible:
https://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid#1547940

@GaelVaroquaux

GaelVaroquaux commented Jun 15, 2023 via email

Copy link
Copy Markdown
Member

@jovan-stojanovic

Copy link
Copy Markdown
Member Author

I also have a doubt about the name of the types parameter of the get_ken_embeddings function. People may not understand that we are actually performing a search. I would rather rename it to types_search or search.
I guess it's now or never after the release :)
WDYT?

@GaelVaroquaux

GaelVaroquaux commented Jun 15, 2023 via email

Copy link
Copy Markdown
Member

@GaelVaroquaux

Copy link
Copy Markdown
Member

There's a conflict :(

Also: don't we need to do the renaming also in the api docs?

@GaelVaroquaux

Copy link
Copy Markdown
Member

LGTM. Merging

@GaelVaroquaux
GaelVaroquaux merged commit 8c83949 into skrub-data:main Jun 15, 2023
@jovan-stojanovic
jovan-stojanovic deleted the add_ken_fetch_example branch July 21, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants