nomic-ai / nomic-embed-text-v1-ablated

huggingface.co
Total runs: 118
24-hour runs: -1
7-day runs: -18
30-day runs: -65
Model's Last Updated: August 02 2024
sentence-similarity

Introduction of nomic-embed-text-v1-ablated

Model Details of nomic-embed-text-v1-ablated

nomic-embed-text-v1-ablated: A Reproducible Long Context (8192) Text Embedder

nomic-embed-text-v1-ablated is 8192 context length text encoder that surpasses OpenAI text-embedding-ada-002 performance on short and long tasks. .

Name SeqLen MTEB LoCo Jina Long Context Open Weights Open Training Code Open Data
nomic-embed-text-v1 8192 62.39 85.53 54.16
jina-embeddings-v2-base-en 8192 60.39 85.45 51.90
text-embedding-3-small 8191 62.26 82.40 58.20
text-embedding-ada-002 8191 60.99 52.7 55.25

If you would like to finetune a model on more data, you can use this model as an initialization

Hosted Inference API

The easiest way to get started with Nomic Embed is through the Nomic Embedding API.

Generating embeddings with the nomic Python client is as easy as

from nomic import embed

output = embed.text(
    texts=['Nomic Embedding API', '#keepAIOpen'],
    model='nomic-embed-text-v1',
    task_type='search_document'
)

print(output)

For more information, see the API reference

Data Visualization

Click the Nomic Atlas map below to visualize a 5M sample of our contrastive pretraining data!

image/webp

Training Details

We train our embedder using a multi-stage training pipeline. Starting from a long-context BERT model , the first unsupervised contrastive stage trains on a dataset generated from weakly related text pairs, such as question-answer pairs from forums like StackExchange and Quora, title-body pairs from Amazon reviews, and summarizations from news articles.

In the second finetuning stage, higher quality labeled datasets such as search queries and answers from web searches are leveraged. Data curation and hard-example mining is crucial in this stage.

For more details, see the Nomic Embed Technical Report and corresponding blog post .

Training data to train the models is released in its entirety. For more details, see the contrastors repository

Usage

Note nomic-embed-text requires prefixes! We support the prefixes [search_query, search_document, classification, clustering] . For retrieval applications, you should prepend search_document for all your documents and search_query for your queries.

Sentence Transformers
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("nomic-ai/nomic-embed-text-v1-ablated", trust_remote_code=True)
sentences = ['search_query: What is TSNE?', 'search_query Who is Laurens van der Maaten?']
embeddings = model.encode(sentences)
print(embeddings)
Transformers
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModel

def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0]
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)

sentences = ['search_query: What is TSNE?', 'search_query: Who is Laurens van der Maaten?']

tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
model = AutoModel.from_pretrained('nomic-ai/nomic-embed-text-v1-ablated', trust_remote_code=True)
model.eval()

encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

with torch.no_grad():
    model_output = model(**encoded_input)

embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
embeddings = F.normalize(embeddings, p=2, dim=1)
print(embeddings)

The model natively supports scaling of the sequence length past 2048 tokens. To do so,

- tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
+ tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased', model_max_length=8192)


- model = AutoModel.from_pretrained('nomic-ai/nomic-embed-text-v1-ablated', trust_remote_code=True)
+ model = AutoModel.from_pretrained('nomic-ai/nomic-embed-text-v1-ablated', trust_remote_code=True, rotary_scaling_factor=2)

Join the Nomic Community

Runs of nomic-ai nomic-embed-text-v1-ablated on huggingface.co

118
Total runs
-1
24-hour runs
-2
3-day runs
-18
7-day runs
-65
30-day runs

More Information About nomic-embed-text-v1-ablated huggingface.co Model

nomic-embed-text-v1-ablated huggingface.co

nomic-embed-text-v1-ablated huggingface.co is an AI model on huggingface.co that provides nomic-embed-text-v1-ablated's model effect (), which can be used instantly with this nomic-ai nomic-embed-text-v1-ablated model. huggingface.co supports a free trial of the nomic-embed-text-v1-ablated model, and also provides paid use of the nomic-embed-text-v1-ablated. Support call nomic-embed-text-v1-ablated model through api, including Node.js, Python, http.

nomic-embed-text-v1-ablated huggingface.co Url

https://huggingface.co/nomic-ai/nomic-embed-text-v1-ablated

nomic-ai nomic-embed-text-v1-ablated online free

nomic-embed-text-v1-ablated huggingface.co is an online trial and call api platform, which integrates nomic-embed-text-v1-ablated's modeling effects, including api services, and provides a free online trial of nomic-embed-text-v1-ablated, you can try nomic-embed-text-v1-ablated online for free by clicking the link below.

nomic-ai nomic-embed-text-v1-ablated online free url in huggingface.co:

https://huggingface.co/nomic-ai/nomic-embed-text-v1-ablated

nomic-embed-text-v1-ablated install

nomic-embed-text-v1-ablated is an open source model from GitHub that offers a free installation service, and any user can find nomic-embed-text-v1-ablated on GitHub to install. At the same time, huggingface.co provides the effect of nomic-embed-text-v1-ablated install, users can directly use nomic-embed-text-v1-ablated installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

nomic-embed-text-v1-ablated install url in huggingface.co:

https://huggingface.co/nomic-ai/nomic-embed-text-v1-ablated

Url of nomic-embed-text-v1-ablated

nomic-embed-text-v1-ablated huggingface.co Url

Provider of nomic-embed-text-v1-ablated huggingface.co

nomic-ai
ORGANIZATIONS

Other API from nomic-ai

huggingface.co

Total runs: 2.0K
Run Growth: -110
Growth Rate: -5.42%
Updated:April 08 2024
huggingface.co

Total runs: 833
Run Growth: -253
Growth Rate: -30.37%
Updated:May 25 2023