Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
[ACL 2023] One Embedder, Any Task: Instruction-Finetuned Text Embeddings
| Date | Stars |
|---|---|
| 2026-07-24 | 2024 |
| 2026-07-25 | 2024 |
| 2026-07-28 | 2024 |
| 2026-07-30 | 2024 |
| 2026-08-06 | 2024 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# One Embedder, Any Task: Instruction-Finetuned Text Embeddings
This repository contains the code and pre-trained models for our paper [One Embedder, Any Task: Instruction-Finetuned Text Embeddings](https://arxiv.org/abs/2212.09741). Please refer to our [project page](https://instructor-embedding.github.io/) for a quick project overview.
We introduce **Instructor**👨🏫, an instruction-finetuned text embedding model that can generate text embeddings tailored to any task (e.g., classification, retrieval, clustering, text evaluation, etc.) and domains (e.g., science, finance, etc.) ***by simply providing the task instruction, without any finetuning***. Instructor👨 achieves sota on 70 diverse embedding tasks!
**************************** **Updates** ****************************
* 01/21: We updated the code structure, which supports easy package installation.
* 12/28: We updated the [checkpoint](https://huggingface.co/hkunlp/instructor-large) with hard negatives.
* 12/20: We released [our paper](https://arxiv.org/abs/2212.09741), [code](https://github.com/HKUNLP/instructor-embedding), [project page](https://instructor-embedding.github.io/) and [checkpoint](https://huggingface.co/hkunlp/instructor-large). Check them out!
## Quick Links
- [One Embedder, Any Task: Instruction-Finetuned Text Embeddings](#one-embedder-any-task-instruction-finetuned-text-embeddings)
- [Quick Links](#quick-links)
- [Installation](#installation)
- [Environment setup](#environment-setup)
- [Getting Started](#getting-started)
- [The `encode` function](#the-encode-function)
- [Model List](#model-list)
- [Use Cases](#use-cases)
- [Calculate embeddings for your customized texts](#calculate-embeddings-for-your-customized-texts)
- [Compute similarities between texts](#compute-similarities-between-texts)
- [Use customized embeddings for information retrieval](#use-customized-embeddings-for-information-retrieval)
- [Use customized embeddings for clustering](#use-customized-embeddings-for-clustering)
- [Training](#training)
- [Data](#data)
- [Train INSTRUCTOR](#train-instructor)
- [Evaluation](#evaluation)
- [MTEB](#mteb)
- [Billboard](#billboard)
- [Prompt Retrieval](#prompt-retrieval)
- [Quantization](#quantization)
- [Bugs or questions?](#bugs-or-questions)
- [Citation](#citation)
- [INSTRUCTOR Elsewhere](#instructor-elsewhere)
## Installation
It is very easy to use INSTRUCTOR for any text embeddings. You can easily try it out in [Colab notebook](https://colab.research.google.com/drive/1P7ivNLMosHyG7XOHmoh7CoqpXryKy3Qt?usp=sharing). In your local machine, we recommend to first create a virtual environment:
```bash
conda env create -n instructor python=3.7
git clone https://github.com/HKUNLP/instructor-embedding
pip install -r requirements.txt
```
That will create the environment `instructor` we used. To use the embedding tool, first install the `InstructorEmbedding` package from PyPI
```bash
pip install InstructorEmbedding
```
or directly install it from our code
```bash
pip install -e .
```
### Environment setup
Activate the environment by running
```bash
conda activate instructor
```
## Getting Started
First download a pretrained model (See [model list](#model-list) for a full list of available models)
```python
from InstructorEmbedding import INSTRUCTOR
model = INSTRUCTOR('hkunlp/instructor-large')
```
Then provide the sentence and customized instruction to the model.
```python
# prepare texts with instructions
text_instruction_pairs = [
{"instruction": "Represent the Science title:", "text": "3D ActionSLAM: wearable person tracking in multi-floor environments"},
{"instruction": "Represent the Medicine sentence for retrieving a duplicate sentence:", "text": "Recent studies have suggested that statins, an established drug group in the prevention of cardiovascular mortality, could delay or prevent breast cancer recurrence but the effect on disease-specific mortality remains unExcerpt of 23,683 characters
Read on GitHub54
Tao Yu · NLPer@XLANG Lab
20
19
Chintella-Esq · Blair Chintella, Esq. · United States
11
5
Yuxi Liu
3
3
3
1
Tuana Çelik · @PriorLabs · Netherlands
1
Tom Aarsen · @huggingface · Netherlands
1
1
Silas Marvin · Rippling · United States
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:d38f36bc4b5577d9, topic:embeddings, readme:embedding model, desc:text embeddings
matched fp:d38f36bc4b5577d9, topic:language-model, readme:pretrained model
matched fp:d38f36bc4b5577d9, topic:text-classification