i need help with coding. i have a list i embed then i want to find cosine similarities…
Jump to turn (13)
- 1i need help with coding. i have a list i embed then i want to find cosine simila
- 2pd.DataFrame({"Index": range(len(df)), "CosineSimilarity": cosinesimilarities[0]
- 3convert the column titles to the value in inquiryid column in df
- 4can the text"comparedto" be added to the inquiryid
- 5merge df and resultdf on index
- 6data looks like: {'i': [72172, 72144, 72144, 72362, 72388, 72388, 72388, 72388,
- 7in mergedf keep the lower value between columns qx1 and qx2 put in column cosine
- 8how do i do this: columntouse='searchable' Make df of all columns df2 = pd.conca
- 9temp is a df. I want to do this: temp[['inquiryid', columntouse, 'cosinesimilari
- 10how do i concat the items in a list with between values
- 11temp.drop(columns=['cosinesimilarity','inquiryid']).T.resetindex(drop=True) rena
- 12fix this sql SELECT inquiryid, searchable, cleantext FROM i2ms-debug.inquiryanal
- 13in sql i have FROM i2ms-debug.inquiryanalyticsvw update type for id to TINQ
- User
i need help with coding. i have a list i embed then i want to find cosine similarities between each embedding then make a pd. something like embedding = encoder.encode(df.searchable.tolist(), show_progress_bar=True, device=torch_device,)
cosine_similarities = cosine_similarity(embedding, embedding)
then something like: pd.DataFrame({"Index": I[0], "CosineSimilarity": cosine_similarities,}).set_index("Index")
- Assistant