Skip to content

Commit

Permalink
Update 2.使用 Embedding API.md
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-zou authored Dec 29, 2024
1 parent cace919 commit d3a4b39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/C3/2.使用 Embedding API.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
本文对应源代码在[此处](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/2.%E4%BD%BF%E7%94%A8%20Embedding%20API.ipynb),如需复现可下载运行源代码。
## 一、使用OpenAI API
GPT有封装好的接口,我们简单封装即可。目前GPT embedding mode有三种,性能如下所示:

|模型 | 每美元页数 | [MTEB](https://github.com/embeddings-benchmark/mteb)得分 | [MIRACL](https://github.com/project-miracl/miracl)得分|
| --- | --- | --- | --- |
|text-embedding-3-large|9,615|54.9|64.6|
Expand Down Expand Up @@ -212,4 +213,4 @@ print(f'embedding(前10)为: {response.data[0].embedding[:10]}')
生成的embedding长度为:1024
embedding(前10)为: [0.017892399802803993, 0.0644201710820198, -0.009342825971543789, 0.02707476168870926, 0.004067837726324797, -0.05597858875989914, -0.04223804175853729, -0.03003198653459549, -0.016357755288481712, 0.06777040660381317]

本文对应源代码在[此处](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/2.%E4%BD%BF%E7%94%A8%20Embedding%20API.ipynb),如需复现可下载运行源代码。
本文对应源代码在[此处](https://github.com/datawhalechina/llm-universe/blob/main/notebook/C3%20%E6%90%AD%E5%BB%BA%E7%9F%A5%E8%AF%86%E5%BA%93/2.%E4%BD%BF%E7%94%A8%20Embedding%20API.ipynb),如需复现可下载运行源代码。

0 comments on commit d3a4b39

Please sign in to comment.