change embedding dimensions
This commit is contained in:
parent
6d7954806a
commit
3b37ded49c
1 changed files with 2 additions and 2 deletions
|
|
@ -350,7 +350,7 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"hypothetical_answer_embedding = embeddings(hypothetical_answer)\n",
|
||||
"hypothetical_answer_embedding = embeddings(hypothetical_answer)[0]\n",
|
||||
"article_embeddings = embeddings(\n",
|
||||
" [\n",
|
||||
" f\"{article['title']} {article['description']} {article['content'][0:100]}\"\n",
|
||||
|
|
@ -361,7 +361,7 @@
|
|||
"# Calculate cosine similarity\n",
|
||||
"cosine_similarities = []\n",
|
||||
"for article_embedding in article_embeddings:\n",
|
||||
" cosine_similarities.append(dot(hypothetical_answer_embedding, article_embedding)[0])\n",
|
||||
" cosine_similarities.append(dot(hypothetical_answer_embedding, article_embedding))\n",
|
||||
"\n",
|
||||
"cosine_similarities[0:10]"
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue