@huggingface/tasks 0.17.5 → 0.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -309,6 +309,11 @@ export declare const PIPELINE_DATA: {
309
309
  color: "blue";
310
310
  hideInModels: true;
311
311
  };
312
+ "text-ranking": {
313
+ name: string;
314
+ modality: "nlp";
315
+ color: "red";
316
+ };
312
317
  "text-retrieval": {
313
318
  name: string;
314
319
  subtasks: {
@@ -433,5 +438,5 @@ export type PipelineType = keyof typeof PIPELINE_DATA;
433
438
  export type WidgetType = PipelineType | "conversational";
434
439
  export declare const PIPELINE_TYPES: PipelineType[];
435
440
  export declare const SUBTASK_TYPES: string[];
436
- export declare const PIPELINE_TYPES_SET: Set<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "feature-extraction" | "text-generation" | "text2text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "audio-text-to-text" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "image-to-video" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "image-text-to-text" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml" | "mask-generation" | "zero-shot-object-detection" | "text-to-3d" | "image-to-3d" | "image-feature-extraction" | "video-text-to-text" | "keypoint-detection" | "visual-document-retrieval" | "any-to-any">;
441
+ export declare const PIPELINE_TYPES_SET: Set<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "feature-extraction" | "text-generation" | "text2text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "audio-text-to-text" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "image-to-video" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-ranking" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "image-text-to-text" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml" | "mask-generation" | "zero-shot-object-detection" | "text-to-3d" | "image-to-3d" | "image-feature-extraction" | "video-text-to-text" | "keypoint-detection" | "visual-document-retrieval" | "any-to-any">;
437
442
  //# sourceMappingURL=pipelines.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../src/pipelines.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,yEAA0E,CAAC;AAElG,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,eAAe;;;;;;;;CAQQ,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;IACjE;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAcD,e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AAE,QAAQ,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;IACjE;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAcD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAunBc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEzD,eAAO,MAAM,cAAc,EAAiC,YAAY,EAAE,CAAC;AAE3E,eAAO,MAAM,aAAa,UAEN,CAAC;AAErB,eAAO,MAAM,kBAAkB,utCAA0B,CAAC"}
@@ -504,6 +504,11 @@ exports.PIPELINE_DATA = {
504
504
  color: "blue",
505
505
  hideInModels: true,
506
506
  },
507
+ "text-ranking": {
508
+ name: "Text Ranking",
509
+ modality: "nlp",
510
+ color: "red",
511
+ },
507
512
  "text-retrieval": {
508
513
  name: "Text Retrieval",
509
514
  subtasks: [
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks/index.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,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,YAAY,CAAC;IACjB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC"}
@@ -83,6 +83,7 @@ exports.TASKS_MODEL_LIBRARIES = {
83
83
  "tabular-to-text": ["transformers"],
84
84
  "text-classification": ["adapter-transformers", "setfit", "spacy", "transformers", "transformers.js"],
85
85
  "text-generation": ["transformers", "transformers.js"],
86
+ "text-ranking": ["sentence-transformers", "transformers"],
86
87
  "text-retrieval": [],
87
88
  "text-to-image": ["diffusers"],
88
89
  "text-to-speech": ["espnet", "tensorflowtts", "transformers", "transformers.js"],
@@ -166,6 +167,7 @@ exports.TASKS_DATA = {
166
167
  "tabular-to-text": undefined,
167
168
  "text-classification": getData("text-classification", data_js_28.default),
168
169
  "text-generation": getData("text-generation", data_js_29.default),
170
+ "text-ranking": getData("text-ranking", data_js_16.default),
169
171
  "text-retrieval": undefined,
170
172
  "text-to-image": getData("text-to-image", data_js_24.default),
171
173
  "text-to-speech": getData("text-to-speech", data_js_25.default),
@@ -4,7 +4,7 @@ const taskData = {
4
4
  datasets: [
5
5
  {
6
6
  description: "Bing queries with relevant passages from various web sources.",
7
- id: "ms_marco",
7
+ id: "microsoft/ms_marco",
8
8
  },
9
9
  ],
10
10
  demo: {
@@ -0,0 +1,4 @@
1
+ import type { TaskDataCustom } from "../index.js";
2
+ declare const taskData: TaskDataCustom;
3
+ export default taskData;
4
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-ranking/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsFf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const taskData = {
4
+ datasets: [
5
+ {
6
+ description: "Bing queries with relevant passages from various web sources.",
7
+ id: "microsoft/ms_marco",
8
+ },
9
+ ],
10
+ demo: {
11
+ inputs: [
12
+ {
13
+ label: "Source sentence",
14
+ content: "Machine learning is so easy.",
15
+ type: "text",
16
+ },
17
+ {
18
+ label: "Sentences to compare to",
19
+ content: "Deep learning is so straightforward.",
20
+ type: "text",
21
+ },
22
+ {
23
+ label: "",
24
+ content: "This is so difficult, like rocket science.",
25
+ type: "text",
26
+ },
27
+ {
28
+ label: "",
29
+ content: "I can't believe how much I struggled with this.",
30
+ type: "text",
31
+ },
32
+ ],
33
+ outputs: [
34
+ {
35
+ type: "chart",
36
+ data: [
37
+ {
38
+ label: "Deep learning is so straightforward.",
39
+ score: 2.2006407,
40
+ },
41
+ {
42
+ label: "This is so difficult, like rocket science.",
43
+ score: -6.2634873,
44
+ },
45
+ {
46
+ label: "I can't believe how much I struggled with this.",
47
+ score: -10.251488,
48
+ },
49
+ ],
50
+ },
51
+ ],
52
+ },
53
+ metrics: [
54
+ {
55
+ description: "Discounted Cumulative Gain (DCG) measures the gain, or usefulness, of search results discounted by their position. The normalization is done by dividing the DCG by the ideal DCG, which is the DCG of the perfect ranking.",
56
+ id: "Normalized Discounted Cumulative Gain",
57
+ },
58
+ {
59
+ description: "Reciprocal Rank is a measure used to rank the relevancy of documents given a set of documents. Reciprocal Rank is the reciprocal of the rank of the document retrieved, meaning, if the rank is 3, the Reciprocal Rank is 0.33. If the rank is 1, the Reciprocal Rank is 1",
60
+ id: "Mean Reciprocal Rank",
61
+ },
62
+ {
63
+ description: "Mean Average Precision (mAP) is the overall average of the Average Precision (AP) values, where AP is the Area Under the PR Curve (AUC-PR)",
64
+ id: "Mean Average Precision",
65
+ },
66
+ ],
67
+ models: [
68
+ {
69
+ description: "An extremely efficient text ranking model trained on a web search dataset.",
70
+ id: "cross-encoder/ms-marco-MiniLM-L6-v2",
71
+ },
72
+ {
73
+ description: "A strong multilingual text reranker model.",
74
+ id: "Alibaba-NLP/gte-multilingual-reranker-base",
75
+ },
76
+ {
77
+ description: "An efficient text ranking model that punches above its weight.",
78
+ id: "Alibaba-NLP/gte-reranker-modernbert-base",
79
+ },
80
+ ],
81
+ spaces: [],
82
+ summary: "Text Ranking is the task of ranking a set of texts based on their relevance to a query. Text ranking models are trained on large datasets of queries and relevant documents to learn how to rank documents based on their relevance to the query. This task is particularly useful for search engines and information retrieval systems.",
83
+ widgetModels: ["cross-encoder/ms-marco-MiniLM-L6-v2"],
84
+ youtubeId: "",
85
+ };
86
+ exports.default = taskData;
@@ -309,6 +309,11 @@ export declare const PIPELINE_DATA: {
309
309
  color: "blue";
310
310
  hideInModels: true;
311
311
  };
312
+ "text-ranking": {
313
+ name: string;
314
+ modality: "nlp";
315
+ color: "red";
316
+ };
312
317
  "text-retrieval": {
313
318
  name: string;
314
319
  subtasks: {
@@ -433,5 +438,5 @@ export type PipelineType = keyof typeof PIPELINE_DATA;
433
438
  export type WidgetType = PipelineType | "conversational";
434
439
  export declare const PIPELINE_TYPES: PipelineType[];
435
440
  export declare const SUBTASK_TYPES: string[];
436
- export declare const PIPELINE_TYPES_SET: Set<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "feature-extraction" | "text-generation" | "text2text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "audio-text-to-text" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "image-to-video" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "image-text-to-text" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml" | "mask-generation" | "zero-shot-object-detection" | "text-to-3d" | "image-to-3d" | "image-feature-extraction" | "video-text-to-text" | "keypoint-detection" | "visual-document-retrieval" | "any-to-any">;
441
+ export declare const PIPELINE_TYPES_SET: Set<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "feature-extraction" | "text-generation" | "text2text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "audio-text-to-text" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "image-to-video" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-ranking" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "image-text-to-text" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml" | "mask-generation" | "zero-shot-object-detection" | "text-to-3d" | "image-to-3d" | "image-feature-extraction" | "video-text-to-text" | "keypoint-detection" | "visual-document-retrieval" | "any-to-any">;
437
442
  //# sourceMappingURL=pipelines.d.ts.map
@@ -1 +1 @@
1
- {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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAunBc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEzD,eAAO,MAAM,cAAc,EAAiC,YAAY,EAAE,CAAC;AAE3E,eAAO,MAAM,aAAa,UAEN,CAAC;AAErB,eAAO,MAAM,kBAAkB,utCAA0B,CAAC"}
@@ -501,6 +501,11 @@ export const PIPELINE_DATA = {
501
501
  color: "blue",
502
502
  hideInModels: true,
503
503
  },
504
+ "text-ranking": {
505
+ name: "Text Ranking",
506
+ modality: "nlp",
507
+ color: "red",
508
+ },
504
509
  "text-retrieval": {
505
510
  name: "Text Retrieval",
506
511
  subtasks: [
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA4CpD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,6CAA6C,CAAC;AACjE,YAAY,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,+BAA+B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,mBAAmB,4CAA4C,CAAC;AAChE,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,0BAA0B,CAAC;AAC9C,YAAY,EACX,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,GAC7B,MAAM,qCAAqC,CAAC;AAC7C,mBAAmB,+BAA+B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C;CACnB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC"}
@@ -77,6 +77,7 @@ export const TASKS_MODEL_LIBRARIES = {
77
77
  "tabular-to-text": ["transformers"],
78
78
  "text-classification": ["adapter-transformers", "setfit", "spacy", "transformers", "transformers.js"],
79
79
  "text-generation": ["transformers", "transformers.js"],
80
+ "text-ranking": ["sentence-transformers", "transformers"],
80
81
  "text-retrieval": [],
81
82
  "text-to-image": ["diffusers"],
82
83
  "text-to-speech": ["espnet", "tensorflowtts", "transformers", "transformers.js"],
@@ -160,6 +161,7 @@ export const TASKS_DATA = {
160
161
  "tabular-to-text": undefined,
161
162
  "text-classification": getData("text-classification", textClassification),
162
163
  "text-generation": getData("text-generation", textGeneration),
164
+ "text-ranking": getData("text-ranking", placeholder),
163
165
  "text-retrieval": undefined,
164
166
  "text-to-image": getData("text-to-image", textToImage),
165
167
  "text-to-speech": getData("text-to-speech", textToSpeech),
@@ -2,7 +2,7 @@ const taskData = {
2
2
  datasets: [
3
3
  {
4
4
  description: "Bing queries with relevant passages from various web sources.",
5
- id: "ms_marco",
5
+ id: "microsoft/ms_marco",
6
6
  },
7
7
  ],
8
8
  demo: {
@@ -0,0 +1,4 @@
1
+ import type { TaskDataCustom } from "../index.js";
2
+ declare const taskData: TaskDataCustom;
3
+ export default taskData;
4
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-ranking/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsFf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,84 @@
1
+ const taskData = {
2
+ datasets: [
3
+ {
4
+ description: "Bing queries with relevant passages from various web sources.",
5
+ id: "microsoft/ms_marco",
6
+ },
7
+ ],
8
+ demo: {
9
+ inputs: [
10
+ {
11
+ label: "Source sentence",
12
+ content: "Machine learning is so easy.",
13
+ type: "text",
14
+ },
15
+ {
16
+ label: "Sentences to compare to",
17
+ content: "Deep learning is so straightforward.",
18
+ type: "text",
19
+ },
20
+ {
21
+ label: "",
22
+ content: "This is so difficult, like rocket science.",
23
+ type: "text",
24
+ },
25
+ {
26
+ label: "",
27
+ content: "I can't believe how much I struggled with this.",
28
+ type: "text",
29
+ },
30
+ ],
31
+ outputs: [
32
+ {
33
+ type: "chart",
34
+ data: [
35
+ {
36
+ label: "Deep learning is so straightforward.",
37
+ score: 2.2006407,
38
+ },
39
+ {
40
+ label: "This is so difficult, like rocket science.",
41
+ score: -6.2634873,
42
+ },
43
+ {
44
+ label: "I can't believe how much I struggled with this.",
45
+ score: -10.251488,
46
+ },
47
+ ],
48
+ },
49
+ ],
50
+ },
51
+ metrics: [
52
+ {
53
+ description: "Discounted Cumulative Gain (DCG) measures the gain, or usefulness, of search results discounted by their position. The normalization is done by dividing the DCG by the ideal DCG, which is the DCG of the perfect ranking.",
54
+ id: "Normalized Discounted Cumulative Gain",
55
+ },
56
+ {
57
+ description: "Reciprocal Rank is a measure used to rank the relevancy of documents given a set of documents. Reciprocal Rank is the reciprocal of the rank of the document retrieved, meaning, if the rank is 3, the Reciprocal Rank is 0.33. If the rank is 1, the Reciprocal Rank is 1",
58
+ id: "Mean Reciprocal Rank",
59
+ },
60
+ {
61
+ description: "Mean Average Precision (mAP) is the overall average of the Average Precision (AP) values, where AP is the Area Under the PR Curve (AUC-PR)",
62
+ id: "Mean Average Precision",
63
+ },
64
+ ],
65
+ models: [
66
+ {
67
+ description: "An extremely efficient text ranking model trained on a web search dataset.",
68
+ id: "cross-encoder/ms-marco-MiniLM-L6-v2",
69
+ },
70
+ {
71
+ description: "A strong multilingual text reranker model.",
72
+ id: "Alibaba-NLP/gte-multilingual-reranker-base",
73
+ },
74
+ {
75
+ description: "An efficient text ranking model that punches above its weight.",
76
+ id: "Alibaba-NLP/gte-reranker-modernbert-base",
77
+ },
78
+ ],
79
+ spaces: [],
80
+ summary: "Text Ranking is the task of ranking a set of texts based on their relevance to a query. Text ranking models are trained on large datasets of queries and relevant documents to learn how to rank documents based on their relevance to the query. This task is particularly useful for search engines and information retrieval systems.",
81
+ widgetModels: ["cross-encoder/ms-marco-MiniLM-L6-v2"],
82
+ youtubeId: "",
83
+ };
84
+ export default taskData;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@huggingface/tasks",
3
3
  "packageManager": "pnpm@8.10.5",
4
- "version": "0.17.5",
4
+ "version": "0.17.6",
5
5
  "description": "List of ML tasks for huggingface.co/tasks",
6
6
  "repository": "https://github.com/huggingface/huggingface.js.git",
7
7
  "publishConfig": {
package/src/pipelines.ts CHANGED
@@ -550,6 +550,11 @@ export const PIPELINE_DATA = {
550
550
  color: "blue",
551
551
  hideInModels: true,
552
552
  },
553
+ "text-ranking": {
554
+ name: "Text Ranking",
555
+ modality: "nlp",
556
+ color: "red",
557
+ },
553
558
  "text-retrieval": {
554
559
  name: "Text Retrieval",
555
560
  subtasks: [
@@ -147,6 +147,7 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]> = {
147
147
  "tabular-to-text": ["transformers"],
148
148
  "text-classification": ["adapter-transformers", "setfit", "spacy", "transformers", "transformers.js"],
149
149
  "text-generation": ["transformers", "transformers.js"],
150
+ "text-ranking": ["sentence-transformers", "transformers"],
150
151
  "text-retrieval": [],
151
152
  "text-to-image": ["diffusers"],
152
153
  "text-to-speech": ["espnet", "tensorflowtts", "transformers", "transformers.js"],
@@ -232,6 +233,7 @@ export const TASKS_DATA: Record<PipelineType, TaskData | undefined> = {
232
233
  "tabular-to-text": undefined,
233
234
  "text-classification": getData("text-classification", textClassification),
234
235
  "text-generation": getData("text-generation", textGeneration),
236
+ "text-ranking": getData("text-ranking", placeholder),
235
237
  "text-retrieval": undefined,
236
238
  "text-to-image": getData("text-to-image", textToImage),
237
239
  "text-to-speech": getData("text-to-speech", textToSpeech),
@@ -8,7 +8,7 @@ You can extract information from documents using Sentence Similarity models. The
8
8
 
9
9
  The [Sentence Transformers](https://www.sbert.net/) library is very powerful for calculating embeddings of sentences, paragraphs, and entire documents. An embedding is just a vector representation of a text and is useful for finding how similar two texts are.
10
10
 
11
- You can find and use [hundreds of Sentence Transformers](https://huggingface.co/models?library=sentence-transformers&sort=downloads) models from the Hub by directly using the library, playing with the widgets in the browser or using Inference Endpoints.
11
+ You can find and use [thousands of Sentence Transformers](https://huggingface.co/models?library=sentence-transformers&sort=downloads) models from the Hub by directly using the library, playing with the widgets in the browser or using Inference Endpoints.
12
12
 
13
13
  ## Task Variants
14
14
 
@@ -79,8 +79,8 @@ sentences = ["I'm happy", "I'm full of happiness"]
79
79
 
80
80
  model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
81
81
 
82
- #Compute embedding for both lists
83
- embedding_1= model.encode(sentences[0], convert_to_tensor=True)
82
+ # Compute embedding for both lists
83
+ embedding_1 = model.encode(sentences[0], convert_to_tensor=True)
84
84
  embedding_2 = model.encode(sentences[1], convert_to_tensor=True)
85
85
 
86
86
  util.pytorch_cos_sim(embedding_1, embedding_2)
@@ -4,7 +4,7 @@ const taskData: TaskDataCustom = {
4
4
  datasets: [
5
5
  {
6
6
  description: "Bing queries with relevant passages from various web sources.",
7
- id: "ms_marco",
7
+ id: "microsoft/ms_marco",
8
8
  },
9
9
  ],
10
10
  demo: {
@@ -0,0 +1,74 @@
1
+ ## Use Cases 🔍
2
+
3
+ ### Information Retrieval
4
+
5
+ You can improve Information Retrieval search stacks by applying a Text Ranking model as a Reranker in the common "[Retrieve and Rerank pipeline](https://sbert.net/examples/applications/retrieve_rerank/README.html)". First, you can use a [Sentence Similarity](https://huggingface.co/tasks/sentence-similarity) or [Feature Extraction](https://huggingface.co/tasks/feature-extraction) model as a Retriever to find the (for example) 100 most relevant documents for a query. Afterwards, you can rerank each of these 100 documents with a Text Ranking model to select an updated top 10. Often times, this results in improved retrieval performance than only using a Retriever model.
6
+
7
+ ## The Sentence Transformers library
8
+
9
+ The [Sentence Transformers](https://www.sbert.net/) library is very powerful for using and training both Sentence Transformer (a.k.a. embedding or retriever) models as well as Cross Encoder (a.k.a. reranker) models.
10
+
11
+ You can find and use [Sentence Transformers](https://huggingface.co/models?library=sentence-transformers&sort=downloads) models from the Hub by directly using the library, playing with the widgets in the browser or using Inference Endpoints.
12
+
13
+ ## Task Variants
14
+
15
+ ### Passage Ranking
16
+
17
+ Passage Ranking is the task of ranking documents based on their relevance to a given query. The task is evaluated on Normalized Discounted Cumulative Gain, Mean Reciprocal Rank, or Mean Average Precision. These models take one query and multiple documents and return ranked documents according to the relevancy to the query. 📄
18
+
19
+ You can use it via the [Sentence Transformers library](https://sbert.net/docs/cross_encoder/usage/usage.html) like so:
20
+
21
+ ```python
22
+ from sentence_transformers import CrossEncoder
23
+
24
+ # 1. Load a pre-trained CrossEncoder model
25
+ model = CrossEncoder("cross-encoder/ms-marco-MiniLM-L6-v2")
26
+
27
+ query = "How many people live in Berlin?"
28
+ passages = [
29
+ "Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.",
30
+ "Berlin is well known for its museums.",
31
+ "In 2014, the city state Berlin had 37,368 live births (+6.6%), a record number since 1991.",
32
+ "The urban area of Berlin comprised about 4.1 million people in 2014, making it the seventh most populous urban area in the European Union.",
33
+ "The city of Paris had a population of 2,165,423 people within its administrative city limits as of January 1, 2019",
34
+ "An estimated 300,000-420,000 Muslims reside in Berlin, making up about 8-11 percent of the population.",
35
+ "Berlin is subdivided into 12 boroughs or districts (Bezirke).",
36
+ "In 2015, the total labour force in Berlin was 1.85 million.",
37
+ "In 2013 around 600,000 Berliners were registered in one of the more than 2,300 sport and fitness clubs.",
38
+ "Berlin has a yearly total of about 135 million day visitors, which puts it in third place among the most-visited city destinations in the European Union.",
39
+ ]
40
+
41
+ # 2a. Either: predict scores for all pairs of sentences involved in the query
42
+ scores = model.predict([(query, passage) for passage in passages])
43
+ # => [ 8.607138 -4.320077 7.5978117 8.915804 -4.237982 8.2359 0.33119553 3.4510403 6.352979 5.416662 ]
44
+
45
+ # 2b. Or rank a list of passages for a query
46
+ ranks = model.rank(query, passages, return_documents=True)
47
+
48
+ # Print the reranked passages
49
+ print("Query:", query)
50
+ for rank in ranks:
51
+ print(f"- #{rank['corpus_id']} ({rank['score']:.2f}): {rank['text']}")
52
+ """
53
+ Query: How many people live in Berlin?
54
+ - #3 (8.92): The urban area of Berlin comprised about 4.1 million people in 2014, making it the seventh most populous urban area in the European Union.
55
+ - #0 (8.61): Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.
56
+ - #5 (8.24): An estimated 300,000-420,000 Muslims reside in Berlin, making up about 8-11 percent of the population.
57
+ - #2 (7.60): In 2014, the city state Berlin had 37,368 live births (+6.6%), a record number since 1991.
58
+ - #8 (6.35): In 2013 around 600,000 Berliners were registered in one of the more than 2,300 sport and fitness clubs.
59
+ - #9 (5.42): Berlin has a yearly total of about 135 million day visitors, which puts it in third place among the most-visited city destinations in the European Union.
60
+ - #7 (3.45): In 2015, the total labour force in Berlin was 1.85 million.
61
+ - #6 (0.33): Berlin is subdivided into 12 boroughs or districts (Bezirke).
62
+ - #4 (-4.24): The city of Paris had a population of 2,165,423 people within its administrative city limits as of January 1, 2019
63
+ - #1 (-4.32): Berlin is well known for its museums.
64
+ """
65
+ ```
66
+
67
+ Rerankers often outperform [Sentence Similarity](https://huggingface.co/tasks/sentence-similarity) or [Feature Extraction](https://huggingface.co/tasks/feature-extraction) models, but they're too slow to rank a query against all documents. This is why they're commonly used to perform a final reranking of the top documents from a retriever: you can get the efficiency of a retriever model with the performance of a reranker.
68
+
69
+ ## Useful Resources
70
+
71
+ Would you like to learn more about Text Ranking? Here is a curated resource that you may find helpful!
72
+
73
+ - [Sentence Transformers > Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html)
74
+ - [Sentence Transformers > Usage > Retrieve & Re-Rank](https://www.sbert.net/examples/applications/retrieve_rerank/README.html)
@@ -0,0 +1,91 @@
1
+ import type { TaskDataCustom } from "../index.js";
2
+
3
+ const taskData: TaskDataCustom = {
4
+ datasets: [
5
+ {
6
+ description: "Bing queries with relevant passages from various web sources.",
7
+ id: "microsoft/ms_marco",
8
+ },
9
+ ],
10
+ demo: {
11
+ inputs: [
12
+ {
13
+ label: "Source sentence",
14
+ content: "Machine learning is so easy.",
15
+ type: "text",
16
+ },
17
+ {
18
+ label: "Sentences to compare to",
19
+ content: "Deep learning is so straightforward.",
20
+ type: "text",
21
+ },
22
+ {
23
+ label: "",
24
+ content: "This is so difficult, like rocket science.",
25
+ type: "text",
26
+ },
27
+ {
28
+ label: "",
29
+ content: "I can't believe how much I struggled with this.",
30
+ type: "text",
31
+ },
32
+ ],
33
+ outputs: [
34
+ {
35
+ type: "chart",
36
+ data: [
37
+ {
38
+ label: "Deep learning is so straightforward.",
39
+ score: 2.2006407,
40
+ },
41
+ {
42
+ label: "This is so difficult, like rocket science.",
43
+ score: -6.2634873,
44
+ },
45
+ {
46
+ label: "I can't believe how much I struggled with this.",
47
+ score: -10.251488,
48
+ },
49
+ ],
50
+ },
51
+ ],
52
+ },
53
+ metrics: [
54
+ {
55
+ description:
56
+ "Discounted Cumulative Gain (DCG) measures the gain, or usefulness, of search results discounted by their position. The normalization is done by dividing the DCG by the ideal DCG, which is the DCG of the perfect ranking.",
57
+ id: "Normalized Discounted Cumulative Gain",
58
+ },
59
+ {
60
+ description:
61
+ "Reciprocal Rank is a measure used to rank the relevancy of documents given a set of documents. Reciprocal Rank is the reciprocal of the rank of the document retrieved, meaning, if the rank is 3, the Reciprocal Rank is 0.33. If the rank is 1, the Reciprocal Rank is 1",
62
+ id: "Mean Reciprocal Rank",
63
+ },
64
+ {
65
+ description:
66
+ "Mean Average Precision (mAP) is the overall average of the Average Precision (AP) values, where AP is the Area Under the PR Curve (AUC-PR)",
67
+ id: "Mean Average Precision",
68
+ },
69
+ ],
70
+ models: [
71
+ {
72
+ description: "An extremely efficient text ranking model trained on a web search dataset.",
73
+ id: "cross-encoder/ms-marco-MiniLM-L6-v2",
74
+ },
75
+ {
76
+ description: "A strong multilingual text reranker model.",
77
+ id: "Alibaba-NLP/gte-multilingual-reranker-base",
78
+ },
79
+ {
80
+ description: "An efficient text ranking model that punches above its weight.",
81
+ id: "Alibaba-NLP/gte-reranker-modernbert-base",
82
+ },
83
+ ],
84
+ spaces: [],
85
+ summary:
86
+ "Text Ranking is the task of ranking a set of texts based on their relevance to a query. Text ranking models are trained on large datasets of queries and relevant documents to learn how to rank documents based on their relevance to the query. This task is particularly useful for search engines and information retrieval systems.",
87
+ widgetModels: ["cross-encoder/ms-marco-MiniLM-L6-v2"],
88
+ youtubeId: "",
89
+ };
90
+
91
+ export default taskData;