ldwang commited on
Commit
56b0029
1 Parent(s): 1c825d2
Files changed (1) hide show
  1. README.md +34 -16
README.md CHANGED
@@ -28,25 +28,36 @@ FlagEmbedding can map any text to a low-dimensional dense vector which can be us
28
  And it also can be used in vector databases for LLMs.
29
 
30
  ************* 🌟**Updates**🌟 *************
31
- - 09/15/2023: Release [paper](https://arxiv.org/pdf/2309.07597.pdf) and [dataset](https://data.baai.ac.cn/details/BAAI-MTP).
32
- - 09/12/2023: New Release:
 
 
33
  - **New reranker model**: release cross-encoder models `BAAI/bge-reranker-base` and `BAAI/bge-reranker-large`, which are more powerful than embedding model. We recommend to use/fine-tune them to re-rank top-k documents returned by embedding models.
34
  - **update embedding model**: release `bge-*-v1.5` embedding model to alleviate the issue of the similarity distribution, and enhance its retrieval ability without instruction.
35
- - 09/07/2023: Update [fine-tune code](https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/baai_general_embedding/README.md): Add script to mine hard negatives and support adding instruction during fine-tuning.
 
 
 
 
 
 
36
  - 08/09/2023: BGE Models are integrated into **Langchain**, you can use it like [this](#using-langchain); C-MTEB **leaderboard** is [available](https://huggingface.co/spaces/mteb/leaderboard).
37
- - 08/05/2023: Release base-scale and small-scale models, **best performance among the models of the same size 🤗**
38
- - 08/02/2023: Release `bge-large-*`(short for BAAI General Embedding) Models, **rank 1st on MTEB and C-MTEB benchmark!** :tada: :tada:
39
- - 08/01/2023: We release the [Chinese Massive Text Embedding Benchmark](https://github.com/FlagOpen/FlagEmbedding/blob/master/C_MTEB) (**C-MTEB**), consisting of 31 test dataset.
 
 
40
 
41
 
42
  ## Model List
43
 
44
  `bge` is short for `BAAI general embedding`.
45
 
46
- | Model | Language | | Description | query instruction for retrieval\* |
47
  |:-------------------------------|:--------:| :--------:| :--------:|:--------:|
48
- | [BAAI/bge-reranker-large](https://huggingface.co/BAAI/bge-reranker-large) | Chinese and English | [Inference](#usage-for-reranker) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/reranker) | a cross-encoder model which is more accurate but less efficient \** | |
49
- | [BAAI/bge-reranker-base](https://huggingface.co/BAAI/bge-reranker-base) | Chinese and English | [Inference](#usage-for-reranker) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/reranker) | a cross-encoder model which is more accurate but less efficient \** | |
 
50
  | [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) | English | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | version 1.5 with more reasonable similarity distribution | `Represent this sentence for searching relevant passages: ` |
51
  | [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) | English | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | version 1.5 with more reasonable similarity distribution | `Represent this sentence for searching relevant passages: ` |
52
  | [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) | English | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | version 1.5 with more reasonable similarity distribution | `Represent this sentence for searching relevant passages: ` |
@@ -61,11 +72,15 @@ And it also can be used in vector databases for LLMs.
61
  | [BAAI/bge-small-zh](https://huggingface.co/BAAI/bge-small-zh) | Chinese | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | a small-scale model but with competitive performance | `为这个句子生成表示以用于检索相关文章:` |
62
 
63
 
64
- \*: If you need to search the relevant passages to a query, we suggest to add the instruction to the query; in other cases, no instruction is needed, just use the original query directly. In all cases, **no instruction** needs to be added to passages.
65
 
66
- \**: Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. To balance the accuracy and time cost, cross-encoder is widely used to re-rank top-k documents retrieved by other simple models.
67
  For examples, use bge embedding model to retrieve top 100 relevant documents, and then use bge reranker to re-rank the top 100 document to get the final top-3 results.
68
 
 
 
 
 
69
  ## Frequently asked questions
70
 
71
  <details>
@@ -102,7 +117,11 @@ please select an appropriate similarity threshold based on the similarity distri
102
  <summary>3. When does the query instruction need to be used</summary>
103
 
104
  <!-- ### When does the query instruction need to be used -->
105
-
 
 
 
 
106
  For a retrieval task that uses short queries to find long related documents,
107
  it is recommended to add instructions for these short queries.
108
  **The best method to decide whether to add instructions for queries is choosing the setting that achieves better performance on your task.**
@@ -362,7 +381,7 @@ which is more accurate than embedding model (i.e., bi-encoder) but more time-con
362
  Therefore, it can be used to re-rank the top-k documents returned by embedding model.
363
  We train the cross-encoder on a multilingual pair data,
364
  The data format is the same as embedding model, so you can fine-tune it easily following our [example](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/reranker).
365
- More details pelease refer to [./FlagEmbedding/reranker/README.md](https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/reranker)
366
 
367
 
368
  ## Contact
@@ -372,7 +391,8 @@ You also can email Shitao Xiao([email protected]) and Zheng Liu([email protected]
372
 
373
  ## Citation
374
 
375
- If you find our work helpful, please cite us:
 
376
  ```
377
  @misc{bge_embedding,
378
  title={C-Pack: Packaged Resources To Advance General Chinese Embedding},
@@ -387,5 +407,3 @@ If you find our work helpful, please cite us:
387
  ## License
388
  FlagEmbedding is licensed under the [MIT License](https://github.com/FlagOpen/FlagEmbedding/blob/master/LICENSE). The released models can be used for commercial purposes free of charge.
389
 
390
-
391
-
 
28
  And it also can be used in vector databases for LLMs.
29
 
30
  ************* 🌟**Updates**🌟 *************
31
+ - 10/12/2023: Release [LLM-Embedder](./FlagEmbedding/llm_embedder/README.md), a unified embedding model to support diverse retrieval augmentation needs for LLMs. [Paper](https://arxiv.org/pdf/2310.07554.pdf) :fire:
32
+ - 09/15/2023: The [technical report](https://arxiv.org/pdf/2309.07597.pdf) of BGE has been released
33
+ - 09/15/2023: The [masive training data](https://data.baai.ac.cn/details/BAAI-MTP) of BGE has been released
34
+ - 09/12/2023: New models:
35
  - **New reranker model**: release cross-encoder models `BAAI/bge-reranker-base` and `BAAI/bge-reranker-large`, which are more powerful than embedding model. We recommend to use/fine-tune them to re-rank top-k documents returned by embedding models.
36
  - **update embedding model**: release `bge-*-v1.5` embedding model to alleviate the issue of the similarity distribution, and enhance its retrieval ability without instruction.
37
+
38
+
39
+ <details>
40
+ <summary>More</summary>
41
+ <!-- ### More -->
42
+
43
+ - 09/07/2023: Update [fine-tune code](https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/baai_general_embedding/README.md): Add script to mine hard negatives and support adding instruction during fine-tuning.
44
  - 08/09/2023: BGE Models are integrated into **Langchain**, you can use it like [this](#using-langchain); C-MTEB **leaderboard** is [available](https://huggingface.co/spaces/mteb/leaderboard).
45
+ - 08/05/2023: Release base-scale and small-scale models, **best performance among the models of the same size 🤗**
46
+ - 08/02/2023: Release `bge-large-*`(short for BAAI General Embedding) Models, **rank 1st on MTEB and C-MTEB benchmark!** :tada: :tada:
47
+ - 08/01/2023: We release the [Chinese Massive Text Embedding Benchmark](https://github.com/FlagOpen/FlagEmbedding/blob/master/C_MTEB) (**C-MTEB**), consisting of 31 test dataset.
48
+
49
+ </details>
50
 
51
 
52
  ## Model List
53
 
54
  `bge` is short for `BAAI general embedding`.
55
 
56
+ | Model | Language | | Description | query instruction for retrieval [1] |
57
  |:-------------------------------|:--------:| :--------:| :--------:|:--------:|
58
+ | [BAAI/llm-embedder](https://huggingface.co/BAAI/llm-embedder) | English | [Inference](./FlagEmbedding/llm_embedder/README.md) [Fine-tune](./FlagEmbedding/llm_embedder/README.md) | a unified embedding model to support diverse retrieval augmentation needs for LLMs | See [README](./FlagEmbedding/llm_embedder/README.md) |
59
+ | [BAAI/bge-reranker-large](https://huggingface.co/BAAI/bge-reranker-large) | Chinese and English | [Inference](#usage-for-reranker) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/reranker) | a cross-encoder model which is more accurate but less efficient [2] | |
60
+ | [BAAI/bge-reranker-base](https://huggingface.co/BAAI/bge-reranker-base) | Chinese and English | [Inference](#usage-for-reranker) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/reranker) | a cross-encoder model which is more accurate but less efficient [2] | |
61
  | [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) | English | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | version 1.5 with more reasonable similarity distribution | `Represent this sentence for searching relevant passages: ` |
62
  | [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) | English | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | version 1.5 with more reasonable similarity distribution | `Represent this sentence for searching relevant passages: ` |
63
  | [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) | English | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | version 1.5 with more reasonable similarity distribution | `Represent this sentence for searching relevant passages: ` |
 
72
  | [BAAI/bge-small-zh](https://huggingface.co/BAAI/bge-small-zh) | Chinese | [Inference](#usage-for-embedding-model) [Fine-tune](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune) | a small-scale model but with competitive performance | `为这个句子生成表示以用于检索相关文章:` |
73
 
74
 
75
+ [1\]: If you need to search the relevant passages to a query, we suggest to add the instruction to the query; in other cases, no instruction is needed, just use the original query directly. In all cases, **no instruction** needs to be added to passages.
76
 
77
+ [2\]: Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. To balance the accuracy and time cost, cross-encoder is widely used to re-rank top-k documents retrieved by other simple models.
78
  For examples, use bge embedding model to retrieve top 100 relevant documents, and then use bge reranker to re-rank the top 100 document to get the final top-3 results.
79
 
80
+ All models have been uploaded to Huggingface Hub, and you can see them at https://huggingface.co/BAAI.
81
+ If you cannot open the Huggingface Hub, you also can download the models at https://model.baai.ac.cn/models .
82
+
83
+
84
  ## Frequently asked questions
85
 
86
  <details>
 
117
  <summary>3. When does the query instruction need to be used</summary>
118
 
119
  <!-- ### When does the query instruction need to be used -->
120
+
121
+ For the `bge-*-v1.5`, we improve its retrieval ability when not using instruction.
122
+ No instruction only has a slight degradation in retrieval performance compared with using instruction.
123
+ So you can generate embedding without instruction in all cases for convenience.
124
+
125
  For a retrieval task that uses short queries to find long related documents,
126
  it is recommended to add instructions for these short queries.
127
  **The best method to decide whether to add instructions for queries is choosing the setting that achieves better performance on your task.**
 
381
  Therefore, it can be used to re-rank the top-k documents returned by embedding model.
382
  We train the cross-encoder on a multilingual pair data,
383
  The data format is the same as embedding model, so you can fine-tune it easily following our [example](https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/reranker).
384
+ More details please refer to [./FlagEmbedding/reranker/README.md](https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/reranker)
385
 
386
 
387
  ## Contact
 
391
 
392
  ## Citation
393
 
394
+ If you find this repository useful, please consider giving a star :star: and citation
395
+
396
  ```
397
  @misc{bge_embedding,
398
  title={C-Pack: Packaged Resources To Advance General Chinese Embedding},
 
407
  ## License
408
  FlagEmbedding is licensed under the [MIT License](https://github.com/FlagOpen/FlagEmbedding/blob/master/LICENSE). The released models can be used for commercial purposes free of charge.
409