The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

Contextualized Embeddings Benchmark

This repository contains evaluation code for the "Contextualized Embeddings" project.

Installation

pip install -e .
pip install git+https://github.com/jina-ai/late-chunking --no-deps  # for late-chunking with jina

Usage

Refer to scripts/evaluation.py for an example of how to use the code.

from datasets import load_dataset
from cde_benchmark.embedders.sentence_transformer_embedder import SentenceTransformerEmbedder
from cde_benchmark.embedders.naive_contextual_embedder import NaiveContextualEmbedder
from cde_benchmark.formatters.data_formatter import DataFormatter

# Datasets should be correctly formatted
formatter = DataFormatter("illuin-cde/chunked-mldr", split="test")

# Non-nested example
embedder = SentenceTransformerEmbedder("intfloat/e5-base-v2")
metrics = embedder.compute_metrics_e2e(formatter)
print(metrics)

# Nested example (for conxtualized embeddings models)
embedder = NaiveContextualEmbedder("intfloat/e5-base-v2")
metrics = embedder.compute_metrics_e2e(formatter)
print(metrics)
Downloads last month
0