openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

Customise Embeddings

Open sadanyh opened this issue 2 years ago • 4 comments
trafficstars

Hi,

I have managed to successfully follow the notebook Customizing_embeddings.ipynb . It has improved my similarity classification accuracy significantly. However, I cannot understand exactly how the trained matrix is created. Is the weight matrix the one we get from training the classification model? If you point to the reference in literature to this method, that would be greatly appreciated.

Thanks

sadanyh avatar Mar 06 '23 17:03 sadanyh

Hi sadanyh,

I am also trying to do this for my usecase. How did you manage to create positive and negative samples for your dataset as is specified in the Customizing_embeddings.ipynb notebook?

savinay avatar Mar 29 '23 17:03 savinay

Hi

I have a labelled dataset.

sadanyh avatar Mar 30 '23 05:03 sadanyh

Hi @sadanyh , I'm getting

ValueError: Cannot set a DataFrame with multiple columns to the single column text_1_embedding

Error, after following that file.

It happens in this line:

# create column of embeddings
for column in ["text_1", "text_2"]:
    df[f"{column}_embedding"] = df[column].apply(get_embedding_with_cache)

Do you have any idea?

musabgultekin avatar Mar 30 '23 10:03 musabgultekin

Okay I solved it by doing this:

for column in ["text_1", "text_2"]:
    df[f"{column}_embedding"] = df[column].apply(lambda x: pd.Series([get_embedding_with_cache(x)]))

musabgultekin avatar Mar 30 '23 10:03 musabgultekin

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Nov 26 '23 01:11 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Dec 07 '23 01:12 github-actions[bot]