File size: 3,326 Bytes
73cc8d2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | from __future__ import annotations
from mteb.abstasks.AbsTaskClustering import AbsTaskClustering
from mteb.abstasks.AbsTaskClusteringFast import AbsTaskClusteringFast
from mteb.abstasks.TaskMetadata import TaskMetadata
NUM_SAMPLES = 2048
class BigPatentClustering(AbsTaskClustering):
superseeded_by = "BigPatentClustering.v2"
metadata = TaskMetadata(
name="BigPatentClustering",
description="Clustering of documents from the Big Patent dataset. Test set only includes documents"
"belonging to a single category, with a total of 9 categories.",
reference="https://www.kaggle.com/datasets/big_patent",
dataset={
"path": "jinaai/big-patent-clustering",
"revision": "62d5330920bca426ce9d3c76ea914f15fc83e891",
},
type="Clustering",
category="s2s",
eval_splits=["test"],
eval_langs=["eng-Latn"],
main_score="v_measure",
date=None,
form=None,
domains=None,
task_subtypes=None,
license=None,
socioeconomic_status=None,
annotations_creators=None,
dialect=None,
text_creation=None,
bibtex_citation=None,
n_samples=None,
avg_character_length=None,
)
class BigPatentClusteringFast(AbsTaskClusteringFast):
max_depth = 1
metadata = TaskMetadata(
name="BigPatentClustering.v2",
description="Clustering of documents from the Big Patent dataset. Test set only includes documents"
"belonging to a single category, with a total of 9 categories.",
reference="https://huggingface.co/datasets/NortheasternUniversity/big_patent",
dataset={
"path": "mteb/big-patent",
"revision": "58a863a958586a5d6ba51088b94ac74a46aa864f",
},
type="Clustering",
category="p2p",
eval_splits=["test"],
eval_langs=["eng-Latn"],
main_score="v_measure",
date=(
"1971-01-01",
"2019-06-10",
), # start date from paper, end date - paper publication
form=["written"],
domains=["Legal"],
task_subtypes=["Thematic clustering"],
license="cc-by-4.0",
socioeconomic_status="high",
annotations_creators="derived",
dialect=[],
text_creation="found",
bibtex_citation="""@article{DBLP:journals/corr/abs-1906-03741,
author = {Eva Sharma and
Chen Li and
Lu Wang},
title = {{BIGPATENT:} {A} Large-Scale Dataset for Abstractive and Coherent
Summarization},
journal = {CoRR},
volume = {abs/1906.03741},
year = {2019},
url = {http://arxiv.org/abs/1906.03741},
eprinttype = {arXiv},
eprint = {1906.03741},
timestamp = {Wed, 26 Jun 2019 07:14:58 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1906-03741.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}""",
n_samples={"test": NUM_SAMPLES},
avg_character_length={"test": 30995.5},
)
def dataset_transform(self):
self.dataset = self.stratified_subsampling(
self.dataset,
self.seed,
self.metadata.eval_splits,
label="labels",
n_samples=NUM_SAMPLES,
)
|