Instruction fine-tuned embedding models
A single text-representation model can be trained on a specific task. For example, a model that is trained on the semantic representation of the given text might not be a very good choice for representing scientific texts, because the nature of similarity in this scope is different from semantic similarity. Instruction fine-tuning is one of the approaches that has been proposed in recent years and many new methods have adapted this approach to solve diverse sets of problems in a single model. The Instructor model is one of these models. In this section, we will show a few examples of how this model works.
To import the model, you can either use Hugging Face transformers or the InstructEmbedding
library. Both provide the same results, but the latter is much more convenient.
To install it, simply use the pip
command:
pip install InstructorEmbedding
Please note that the sentence-transformers library also must be installed:
pip install...