hf_mirrors/jina-embedding-t-en-v1
Model Introduction
Files & versions
Analysis



Finetuner logo: Finetuner helps you to create experiments in order to improve embeddings on search tasks. It accompanies you to deliver the last mile of performance-tuning for neural search applications.

The text embedding set trained by Jina AI, Finetuner team.

Intented Usage & Model Info

jina-embedding-t-en-v1 is a tiny language model that has been trained using Jina AI's Linnaeus-Clean dataset. This dataset consists of 380 million pairs of sentences, which include both query-document pairs. These pairs were obtained from various domains and were carefully selected through a thorough cleaning process. The Linnaeus-Full dataset, from which the Linnaeus-Clean dataset is derived, originally contained 1.6 billion sentence pairs.

The model has a range of use cases, including information retrieval, semantic textual similarity, text reranking, and more.

With a tiny small parameter size of just 14 million parameters, the model enables lightning-fast inference on CPU, while still delivering impressive performance. Additionally, we provide the following options:

  • jina-embedding-1b-en-v1: 1.2 billion parameters, 10 times bert-base (soon).
  • jina-embedding-6b-en-v1: 6 billion parameters, 30 times bert-base (soon).

Data & Parameters

Please checkout our technical blog.

Metrics

We compared the model against all-minilm-l6-v2/all-mpnet-base-v2 from sbert and text-embeddings-ada-002 from OpenAI:

Nameparamdimension
all-minilm-l6-v223m384
all-mpnet-base-v2110m768
ada-embedding-002Unknown/OpenAI API1536
jina-embedding-t-en-v114m312
jina-embedding-s-en-v135m512
jina-embedding-b-en-v1110m768
jina-embedding-l-en-v1330m1024
NameSTS12STS13STS14STS15STS16STS17TRECOVIDQuoraSciFact
all-minilm-l6-v20.7240.8060.7560.8540.790.8760.4730.8760.645
all-mpnet-base-v20.7260.8350.780.8570.80.9060.5130.8750.656
ada-embedding-0020.6980.8330.7610.8610.860.9030.6850.8760.726
jina-embedding-t-en-v10.7170.7730.7310.8290.7770.8600.4820.8400.522
jina-embedding-s-en-v10.7430.7860.7380.8370.800.8750.5230.8570.524
jina-embedding-b-en-v10.7510.8090.7610.8560.8120.8900.6060.8760.594
jina-embedding-l-en-v10.7450.8320.7810.8690.8370.9020.5730.8810.598

Inference Speed

We encoded a single sentence "What is the current weather like today?" 10k times on:

  1. cpu: MacBook Pro 2020, 2 GHz Quad-Core Intel Core i5
  2. gpu: 1 Nvidia 3090

And recorded time spent to demonstrate the embedding speed:

Nameparamdimensiontime@cputime@gpu
jina-embedding-t-en-v114m3125.78s2.36s
all-minilm-l6-v223m38411.95s2.70s
jina-embedding-s-en-v135m51217.25s2.81s

Usage

Use with Jina AI Finetuner

# coding = utf-8
import os
import torch
import torch_npu

from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim

import argparse
from openmind import pipeline, is_torch_npu_available
parser = argparse.ArgumentParser(description='manual to this script')
parser.add_argument("--model_name_or_path", type=str, default="./")
args = parser.parse_args()
model_path = args.model_name_or_path
device = None
if is_torch_npu_available():
    device = "npu:0"
else:
    device = "cpu"

sentences_1 = ['how is the weather today']
sentences_2 = [ 'What is the current weather like today?']

model = SentenceTransformer(model_path)
model = model.to(device)
embeddings_1 = model.encode(sentences_1)
embeddings_2 = model.encode(sentences_2)


cosine_scores = cos_sim(embeddings_1, embeddings_2)
print(f"cosine_scores: {cosine_scores}")

Fine-tuning

Please consider Finetuner.

Plans

  1. The development of jina-embedding-s-en-v2 is currently underway with two main objectives: improving performance and increasing the maximum sequence length.
  2. We are currently working on a bilingual embedding model that combines English and X language. The upcoming model will be called jina-embedding-s/b/l-de-v1.

Contact

Join our Discord community and chat with other community members about ideas.

Citation

If you find Jina Embeddings useful in your research, please cite the following paper:

@misc{günther2023jina,
      title={Jina Embeddings: A Novel Set of High-Performance Sentence Embedding Models}, 
      author={Michael Günther and Louis Milliken and Jonathan Geuter and Georgios Mastrapas and Bo Wang and Han Xiao},
      year={2023},
      eprint={2307.11224},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}