Dataset Viewer
Auto-converted to Parquet Duplicate
type_
stringclasses
1 value
block
dict
block
{ "html_tag": "p", "id": "cc9a574253b14981b955cba05cd965bd", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.015691867, -0.028552534, 0.019892402, 0.00020962195, -0.043929823, -0.002613769, 0.01952231, 0.009548352, 0.007818176...
block
{ "html_tag": "p", "id": "9fa17ee40c5c4bb9a2e0524ef22d9644", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.04181491, -0.01446223, 0.024032412, -0.0025739048, -0.031249577, 0.000896914, -0.025074065, 0.042558946, 0.024516037,...
block
{ "html_tag": "p", "id": "a89736e34a5644499cf5dc7add69a1ac", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.0092110615, -0.008001815, 0.0038214095, 0.03113811, -0.0321962, -0.0029758813, -0.0063816123, 0.010288047, -0.0092394...
block
{ "html_tag": "p", "id": "5de21d4b3165441b931f98e2e7e200c7", "order": 0, "origin_type": "document_content", "text": { "embedding": [ -0.008111423, -0.010285013, -0.027312223, -0.024438204, -0.008558794, -0.046454277, -0.021979922, 0.050973177, 0.024185...
block
{ "html_tag": "p", "id": "526c6ec76b39429182dd062f8956162a", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.03287808, -0.027584312, 0.036281217, 0.0062958025, -0.030741666, -0.033142768, -0.01694951, 0.024748364, 0.036300123,...
block
{ "html_tag": "p", "id": "f4407f46ac544d558f00da50ac98edf2", "order": 0, "origin_type": "document_content", "text": { "embedding": [ -0.0027637894, -0.025598457, 0.023704357, 0.0038655545, -0.031430777, 0.0036873966, -0.0024004413, 0.010098732, 0.03143...
block
{ "html_tag": "p", "id": "a03232342e92455489397089eec2c055", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.01651654, -0.026138734, -0.0060956124, 0.0050773416, -0.039236125, 0.0012856838, 0.018767947, 0.043421313, 0.03271545...
block
{ "html_tag": "p", "id": "262f4d3568db4c1b963ec1da50ab2891", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.051153187, 0.0013066303, 0.010712515, -0.0030696546, -0.021072889, -0.027819179, 0.006106875, 0.016142908, 0.00396854...
block
{ "html_tag": "p", "id": "39824d8db954416b96d217240bb5f55e", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.009553355, 0.033808418, -0.0082135, 0.049262643, -0.029128097, 0.004260466, -0.023107924, 0.04728039, 0.0108840335, ...
block
{ "html_tag": "p", "id": "63378d94ca4c4680aaf044f04848f00a", "order": 0, "origin_type": "document_content", "text": { "embedding": [ -0.016198415, 0.031839505, -0.036118332, 0.024666177, 0.0007910436, -0.013240991, -0.03290022, 0.046635617, 0.030832723...
block
{ "html_tag": "p", "id": "c5fe6003f90b4a2a949a52b4d890f130", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.042605836, -0.0010822993, 0.01305994, 0.0033863424, -0.009157828, 0.0015776482, 0.010987526, 0.004868305, 0.017251443...
block
{ "html_tag": "p", "id": "87fcbf7218ee4ec1ab22c8dad99f3679", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.03847866, 0.0022266482, -0.003442732, -0.048143744, -0.039568707, -0.0037947264, 0.011245652, 0.027759865, 0.00091972...
block
{ "html_tag": "p", "id": "1517bba5bae242569d312852b541352f", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.060488205, 0.02545371, 0.009884936, 0.024218094, -0.051135536, 0.026404185, 0.02435116, 0.031536747, 0.022127049, ...
block
{ "html_tag": "p", "id": "122f50be89214c46bef39e6f30af5785", "order": 0, "origin_type": "document_content", "text": { "embedding": [ 0.008669495, -0.016324427, 0.03937605, -0.028627157, -0.022247287, 0.014724888, -0.059703894, 0.01689112, 0.04610325, ...
End of preview. Expand in Data Studio

Dataset Card for "es_indexing_benchmark"

Here is a code on how to pull and index this dataset to elasticsearch:

import datasets
from tqdm import tqdm

from src.store.es.search import ESBaseClient
from src.store.es.model import ESNode

ds = datasets.load_dataset('stellia/es_indexing_benchmark', split='train', ignore_verifications=True)
client = ESBaseClient()


index_name = "tmp_es_index"
nodes = []
for row in tqdm(ds):
    esnode = ESNode(**row)
    esnode.meta.id = esnode.block.id
    nodes.append(esnode)


client.delete_index(index_name)
client.init_index(index_name)

batch_size = 5000
for i in tqdm(range(0, len(nodes), batch_size)):
    client.save(index_name, nodes[i:i+batch_size], refresh=False)

Consider empty ~/.cache/huggingface/datasets with rm -rf ~/.cache/huggingface/datasets if you have problem loading the dataset.

Dataset for "Inference Benchmark"

The dataset can also be used to test our api endpoints for inference models (retrieval, reranker, disambiguation model).

To note that reranker and disambiguation model are finetuned on the same base model, meaning that it has slightly difference on inference time.
However, the input length distributions differs for the two models.

Here is the code to test on (in asyncio mode to be closer the real case):

import asyncio

import datasets
from tqdm import tqdm

from src.utils.stage.stage_utils import AppConfig
from src.api_client.embed_ import async_encode
from src.api_client.disambig import async_disambig


ds = datasets.load_dataset('stellia/es_indexing_benchmark', split='train', ignore_verifications=True)

texts = []

for row in tqdm(ds):
    texts.append(row['block']['text']['text'])  # extract pure text

# Encoding with embed model:

config = AppConfig(stage='dev')
tasks = []

batch_size = 10
for i in range(0, len(texts), batch_size):
    tasks.append(asyncio.create_task(async_encode(texts[i: i+ batch_size])))

res = await asyncio.gather(*tasks)


# Test on reranker/disambiguation
tasks = []
num_rerank = 10

for i in range(0, len(texts), num_rerank+1):
    if len(texts[i+1: i+1+num_rerank]) == 0:
        break
    tasks.append(
        asyncio.create_task(
            async_disambig(
                texts[i],
                texts[i+1: i+1+num_rerank]
            )
        )
    )

res = await asyncio.gather(*tasks)
Downloads last month
4