@huggingface/tasks 0.13.1-test → 0.13.1-test2
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.
- package/package.json +4 -2
- package/src/dataset-libraries.ts +89 -0
- package/src/default-widget-inputs.ts +718 -0
- package/src/gguf.ts +40 -0
- package/src/hardware.ts +482 -0
- package/src/index.ts +59 -0
- package/src/library-to-tasks.ts +76 -0
- package/src/local-apps.ts +412 -0
- package/src/model-data.ts +149 -0
- package/src/model-libraries-downloads.ts +18 -0
- package/src/model-libraries-snippets.ts +1128 -0
- package/src/model-libraries.ts +820 -0
- package/src/pipelines.ts +698 -0
- package/src/snippets/common.ts +39 -0
- package/src/snippets/curl.spec.ts +94 -0
- package/src/snippets/curl.ts +120 -0
- package/src/snippets/index.ts +7 -0
- package/src/snippets/inputs.ts +167 -0
- package/src/snippets/js.spec.ts +148 -0
- package/src/snippets/js.ts +305 -0
- package/src/snippets/python.spec.ts +144 -0
- package/src/snippets/python.ts +321 -0
- package/src/snippets/types.ts +16 -0
- package/src/tasks/audio-classification/about.md +86 -0
- package/src/tasks/audio-classification/data.ts +81 -0
- package/src/tasks/audio-classification/inference.ts +52 -0
- package/src/tasks/audio-classification/spec/input.json +35 -0
- package/src/tasks/audio-classification/spec/output.json +11 -0
- package/src/tasks/audio-to-audio/about.md +56 -0
- package/src/tasks/audio-to-audio/data.ts +70 -0
- package/src/tasks/automatic-speech-recognition/about.md +90 -0
- package/src/tasks/automatic-speech-recognition/data.ts +82 -0
- package/src/tasks/automatic-speech-recognition/inference.ts +160 -0
- package/src/tasks/automatic-speech-recognition/spec/input.json +35 -0
- package/src/tasks/automatic-speech-recognition/spec/output.json +38 -0
- package/src/tasks/chat-completion/inference.ts +322 -0
- package/src/tasks/chat-completion/spec/input.json +350 -0
- package/src/tasks/chat-completion/spec/output.json +206 -0
- package/src/tasks/chat-completion/spec/stream_output.json +213 -0
- package/src/tasks/common-definitions.json +100 -0
- package/src/tasks/depth-estimation/about.md +45 -0
- package/src/tasks/depth-estimation/data.ts +70 -0
- package/src/tasks/depth-estimation/inference.ts +35 -0
- package/src/tasks/depth-estimation/spec/input.json +25 -0
- package/src/tasks/depth-estimation/spec/output.json +16 -0
- package/src/tasks/document-question-answering/about.md +53 -0
- package/src/tasks/document-question-answering/data.ts +85 -0
- package/src/tasks/document-question-answering/inference.ts +110 -0
- package/src/tasks/document-question-answering/spec/input.json +85 -0
- package/src/tasks/document-question-answering/spec/output.json +36 -0
- package/src/tasks/feature-extraction/about.md +72 -0
- package/src/tasks/feature-extraction/data.ts +57 -0
- package/src/tasks/feature-extraction/inference.ts +40 -0
- package/src/tasks/feature-extraction/spec/input.json +47 -0
- package/src/tasks/feature-extraction/spec/output.json +15 -0
- package/src/tasks/fill-mask/about.md +51 -0
- package/src/tasks/fill-mask/data.ts +79 -0
- package/src/tasks/fill-mask/inference.ts +62 -0
- package/src/tasks/fill-mask/spec/input.json +38 -0
- package/src/tasks/fill-mask/spec/output.json +29 -0
- package/src/tasks/image-classification/about.md +50 -0
- package/src/tasks/image-classification/data.ts +88 -0
- package/src/tasks/image-classification/inference.ts +52 -0
- package/src/tasks/image-classification/spec/input.json +35 -0
- package/src/tasks/image-classification/spec/output.json +11 -0
- package/src/tasks/image-feature-extraction/about.md +23 -0
- package/src/tasks/image-feature-extraction/data.ts +59 -0
- package/src/tasks/image-segmentation/about.md +63 -0
- package/src/tasks/image-segmentation/data.ts +99 -0
- package/src/tasks/image-segmentation/inference.ts +69 -0
- package/src/tasks/image-segmentation/spec/input.json +45 -0
- package/src/tasks/image-segmentation/spec/output.json +26 -0
- package/src/tasks/image-text-to-text/about.md +76 -0
- package/src/tasks/image-text-to-text/data.ts +102 -0
- package/src/tasks/image-to-3d/about.md +62 -0
- package/src/tasks/image-to-3d/data.ts +75 -0
- package/src/tasks/image-to-image/about.md +129 -0
- package/src/tasks/image-to-image/data.ts +101 -0
- package/src/tasks/image-to-image/inference.ts +68 -0
- package/src/tasks/image-to-image/spec/input.json +55 -0
- package/src/tasks/image-to-image/spec/output.json +12 -0
- package/src/tasks/image-to-text/about.md +61 -0
- package/src/tasks/image-to-text/data.ts +82 -0
- package/src/tasks/image-to-text/inference.ts +143 -0
- package/src/tasks/image-to-text/spec/input.json +34 -0
- package/src/tasks/image-to-text/spec/output.json +14 -0
- package/src/tasks/index.ts +312 -0
- package/src/tasks/keypoint-detection/about.md +57 -0
- package/src/tasks/keypoint-detection/data.ts +50 -0
- package/src/tasks/mask-generation/about.md +65 -0
- package/src/tasks/mask-generation/data.ts +55 -0
- package/src/tasks/object-detection/about.md +37 -0
- package/src/tasks/object-detection/data.ts +86 -0
- package/src/tasks/object-detection/inference.ts +75 -0
- package/src/tasks/object-detection/spec/input.json +31 -0
- package/src/tasks/object-detection/spec/output.json +50 -0
- package/src/tasks/placeholder/about.md +15 -0
- package/src/tasks/placeholder/data.ts +21 -0
- package/src/tasks/placeholder/spec/input.json +35 -0
- package/src/tasks/placeholder/spec/output.json +17 -0
- package/src/tasks/question-answering/about.md +56 -0
- package/src/tasks/question-answering/data.ts +75 -0
- package/src/tasks/question-answering/inference.ts +99 -0
- package/src/tasks/question-answering/spec/input.json +67 -0
- package/src/tasks/question-answering/spec/output.json +29 -0
- package/src/tasks/reinforcement-learning/about.md +167 -0
- package/src/tasks/reinforcement-learning/data.ts +75 -0
- package/src/tasks/sentence-similarity/about.md +97 -0
- package/src/tasks/sentence-similarity/data.ts +101 -0
- package/src/tasks/sentence-similarity/inference.ts +32 -0
- package/src/tasks/sentence-similarity/spec/input.json +40 -0
- package/src/tasks/sentence-similarity/spec/output.json +12 -0
- package/src/tasks/summarization/about.md +58 -0
- package/src/tasks/summarization/data.ts +76 -0
- package/src/tasks/summarization/inference.ts +57 -0
- package/src/tasks/summarization/spec/input.json +42 -0
- package/src/tasks/summarization/spec/output.json +14 -0
- package/src/tasks/table-question-answering/about.md +43 -0
- package/src/tasks/table-question-answering/data.ts +59 -0
- package/src/tasks/table-question-answering/inference.ts +61 -0
- package/src/tasks/table-question-answering/spec/input.json +44 -0
- package/src/tasks/table-question-answering/spec/output.json +40 -0
- package/src/tasks/tabular-classification/about.md +65 -0
- package/src/tasks/tabular-classification/data.ts +68 -0
- package/src/tasks/tabular-regression/about.md +87 -0
- package/src/tasks/tabular-regression/data.ts +57 -0
- package/src/tasks/text-classification/about.md +173 -0
- package/src/tasks/text-classification/data.ts +103 -0
- package/src/tasks/text-classification/inference.ts +51 -0
- package/src/tasks/text-classification/spec/input.json +35 -0
- package/src/tasks/text-classification/spec/output.json +11 -0
- package/src/tasks/text-generation/about.md +154 -0
- package/src/tasks/text-generation/data.ts +114 -0
- package/src/tasks/text-generation/inference.ts +200 -0
- package/src/tasks/text-generation/spec/input.json +219 -0
- package/src/tasks/text-generation/spec/output.json +179 -0
- package/src/tasks/text-generation/spec/stream_output.json +103 -0
- package/src/tasks/text-to-3d/about.md +62 -0
- package/src/tasks/text-to-3d/data.ts +56 -0
- package/src/tasks/text-to-audio/inference.ts +143 -0
- package/src/tasks/text-to-audio/spec/input.json +31 -0
- package/src/tasks/text-to-audio/spec/output.json +17 -0
- package/src/tasks/text-to-image/about.md +96 -0
- package/src/tasks/text-to-image/data.ts +100 -0
- package/src/tasks/text-to-image/inference.ts +75 -0
- package/src/tasks/text-to-image/spec/input.json +63 -0
- package/src/tasks/text-to-image/spec/output.json +13 -0
- package/src/tasks/text-to-speech/about.md +63 -0
- package/src/tasks/text-to-speech/data.ts +79 -0
- package/src/tasks/text-to-speech/inference.ts +145 -0
- package/src/tasks/text-to-speech/spec/input.json +31 -0
- package/src/tasks/text-to-speech/spec/output.json +7 -0
- package/src/tasks/text-to-video/about.md +41 -0
- package/src/tasks/text-to-video/data.ts +102 -0
- package/src/tasks/text2text-generation/inference.ts +55 -0
- package/src/tasks/text2text-generation/spec/input.json +55 -0
- package/src/tasks/text2text-generation/spec/output.json +14 -0
- package/src/tasks/token-classification/about.md +76 -0
- package/src/tasks/token-classification/data.ts +92 -0
- package/src/tasks/token-classification/inference.ts +85 -0
- package/src/tasks/token-classification/spec/input.json +65 -0
- package/src/tasks/token-classification/spec/output.json +37 -0
- package/src/tasks/translation/about.md +65 -0
- package/src/tasks/translation/data.ts +70 -0
- package/src/tasks/translation/inference.ts +67 -0
- package/src/tasks/translation/spec/input.json +50 -0
- package/src/tasks/translation/spec/output.json +14 -0
- package/src/tasks/unconditional-image-generation/about.md +50 -0
- package/src/tasks/unconditional-image-generation/data.ts +72 -0
- package/src/tasks/video-classification/about.md +37 -0
- package/src/tasks/video-classification/data.ts +84 -0
- package/src/tasks/video-classification/inference.ts +59 -0
- package/src/tasks/video-classification/spec/input.json +42 -0
- package/src/tasks/video-classification/spec/output.json +10 -0
- package/src/tasks/video-text-to-text/about.md +98 -0
- package/src/tasks/video-text-to-text/data.ts +66 -0
- package/src/tasks/visual-question-answering/about.md +48 -0
- package/src/tasks/visual-question-answering/data.ts +97 -0
- package/src/tasks/visual-question-answering/inference.ts +62 -0
- package/src/tasks/visual-question-answering/spec/input.json +41 -0
- package/src/tasks/visual-question-answering/spec/output.json +21 -0
- package/src/tasks/zero-shot-classification/about.md +40 -0
- package/src/tasks/zero-shot-classification/data.ts +70 -0
- package/src/tasks/zero-shot-classification/inference.ts +67 -0
- package/src/tasks/zero-shot-classification/spec/input.json +50 -0
- package/src/tasks/zero-shot-classification/spec/output.json +11 -0
- package/src/tasks/zero-shot-image-classification/about.md +75 -0
- package/src/tasks/zero-shot-image-classification/data.ts +84 -0
- package/src/tasks/zero-shot-image-classification/inference.ts +61 -0
- package/src/tasks/zero-shot-image-classification/spec/input.json +45 -0
- package/src/tasks/zero-shot-image-classification/spec/output.json +10 -0
- package/src/tasks/zero-shot-object-detection/about.md +45 -0
- package/src/tasks/zero-shot-object-detection/data.ts +67 -0
- package/src/tasks/zero-shot-object-detection/inference.ts +66 -0
- package/src/tasks/zero-shot-object-detection/spec/input.json +40 -0
- package/src/tasks/zero-shot-object-detection/spec/output.json +47 -0
- package/src/tokenizer-data.ts +32 -0
- package/src/widget-example.ts +125 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
## Use Cases
|
|
2
|
+
|
|
3
|
+
### Sentiment Analysis on Customer Reviews
|
|
4
|
+
|
|
5
|
+
You can track the sentiments of your customers from the product reviews using sentiment analysis models. This can help understand churn and retention by grouping reviews by sentiment, to later analyze the text and make strategic decisions based on this knowledge.
|
|
6
|
+
|
|
7
|
+
## Task Variants
|
|
8
|
+
|
|
9
|
+
### Natural Language Inference (NLI)
|
|
10
|
+
|
|
11
|
+
In NLI the model determines the relationship between two given texts. Concretely, the model takes a premise and a hypothesis and returns a class that can either be:
|
|
12
|
+
|
|
13
|
+
- **entailment**, which means the hypothesis is true.
|
|
14
|
+
- **contraction**, which means the hypothesis is false.
|
|
15
|
+
- **neutral**, which means there's no relation between the hypothesis and the premise.
|
|
16
|
+
|
|
17
|
+
The benchmark dataset for this task is GLUE (General Language Understanding Evaluation). NLI models have different variants, such as Multi-Genre NLI, Question NLI and Winograd NLI.
|
|
18
|
+
|
|
19
|
+
### Multi-Genre NLI (MNLI)
|
|
20
|
+
|
|
21
|
+
MNLI is used for general NLI. Here are som examples:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Example 1:
|
|
25
|
+
Premise: A man inspects the uniform of a figure in some East Asian country.
|
|
26
|
+
Hypothesis: The man is sleeping.
|
|
27
|
+
Label: Contradiction
|
|
28
|
+
|
|
29
|
+
Example 2:
|
|
30
|
+
Premise: Soccer game with multiple males playing.
|
|
31
|
+
Hypothesis: Some men are playing a sport.
|
|
32
|
+
Label: Entailment
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### Inference
|
|
36
|
+
|
|
37
|
+
You can use the 🤗 Transformers library `text-classification` pipeline to infer with NLI models.
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from transformers import pipeline
|
|
41
|
+
|
|
42
|
+
classifier = pipeline("text-classification", model = "roberta-large-mnli")
|
|
43
|
+
classifier("A soccer game with multiple males playing. Some men are playing a sport.")
|
|
44
|
+
## [{'label': 'ENTAILMENT', 'score': 0.98}]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Question Natural Language Inference (QNLI)
|
|
48
|
+
|
|
49
|
+
QNLI is the task of determining if the answer to a certain question can be found in a given document. If the answer can be found the label is “entailment”. If the answer cannot be found the label is “not entailment".
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Question: What percentage of marine life died during the extinction?
|
|
53
|
+
Sentence: It is also known as the “Great Dying” because it is considered the largest mass extinction in the Earth’s history.
|
|
54
|
+
Label: not entailment
|
|
55
|
+
|
|
56
|
+
Question: Who was the London Weekend Television’s Managing Director?
|
|
57
|
+
Sentence: The managing director of London Weekend Television (LWT), Greg Dyke, met with the representatives of the "big five" football clubs in England in 1990.
|
|
58
|
+
Label: entailment
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Inference
|
|
62
|
+
|
|
63
|
+
You can use the 🤗 Transformers library `text-classification` pipeline to infer with QNLI models. The model returns the label and the confidence.
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from transformers import pipeline
|
|
67
|
+
|
|
68
|
+
classifier = pipeline("text-classification", model = "cross-encoder/qnli-electra-base")
|
|
69
|
+
classifier("Where is the capital of France?, Paris is the capital of France.")
|
|
70
|
+
## [{'label': 'entailment', 'score': 0.997}]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Sentiment Analysis
|
|
74
|
+
|
|
75
|
+
In Sentiment Analysis, the classes can be polarities like positive, negative, neutral, or sentiments such as happiness or anger.
|
|
76
|
+
|
|
77
|
+
#### Inference
|
|
78
|
+
|
|
79
|
+
You can use the 🤗 Transformers library with the `sentiment-analysis` pipeline to infer with Sentiment Analysis models. The model returns the label with the score.
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from transformers import pipeline
|
|
83
|
+
|
|
84
|
+
classifier = pipeline("sentiment-analysis")
|
|
85
|
+
classifier("I loved Star Wars so much!")
|
|
86
|
+
## [{'label': 'POSITIVE', 'score': 0.99}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Quora Question Pairs
|
|
90
|
+
|
|
91
|
+
Quora Question Pairs models assess whether two provided questions are paraphrases of each other. The model takes two questions and returns a binary value, with 0 being mapped to “not paraphrase” and 1 to “paraphrase". The benchmark dataset is [Quora Question Pairs](https://huggingface.co/datasets/glue/viewer/qqp/test) inside the [GLUE benchmark](https://huggingface.co/datasets/glue). The dataset consists of question pairs and their labels.
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Question1: “How can I increase the speed of my internet connection while using a VPN?”
|
|
95
|
+
Question2: How can Internet speed be increased by hacking through DNS?
|
|
96
|
+
Label: Not paraphrase
|
|
97
|
+
|
|
98
|
+
Question1: “What can make Physics easy to learn?”
|
|
99
|
+
Question2: “How can you make physics easy to learn?”
|
|
100
|
+
Label: Paraphrase
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Inference
|
|
104
|
+
|
|
105
|
+
You can use the 🤗 Transformers library `text-classification` pipeline to infer with QQPI models.
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from transformers import pipeline
|
|
109
|
+
|
|
110
|
+
classifier = pipeline("text-classification", model = "textattack/bert-base-uncased-QQP")
|
|
111
|
+
classifier("Which city is the capital of France?, Where is the capital of France?")
|
|
112
|
+
## [{'label': 'paraphrase', 'score': 0.998}]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
You can use [huggingface.js](https://github.com/huggingface/huggingface.js) to infer text classification models on Hugging Face Hub.
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
import { HfInference } from "@huggingface/inference";
|
|
119
|
+
|
|
120
|
+
const inference = new HfInference(HF_TOKEN);
|
|
121
|
+
await inference.conversational({
|
|
122
|
+
model: "distilbert-base-uncased-finetuned-sst-2-english",
|
|
123
|
+
inputs: "I love this movie!",
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Grammatical Correctness
|
|
128
|
+
|
|
129
|
+
Linguistic Acceptability is the task of assessing the grammatical acceptability of a sentence. The classes in this task are “acceptable” and “unacceptable”. The benchmark dataset used for this task is [Corpus of Linguistic Acceptability (CoLA)](https://huggingface.co/datasets/glue/viewer/cola/test). The dataset consists of texts and their labels.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Example: Books were sent to each other by the students.
|
|
133
|
+
Label: Unacceptable
|
|
134
|
+
|
|
135
|
+
Example: She voted for herself.
|
|
136
|
+
Label: Acceptable.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### Inference
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
from transformers import pipeline
|
|
143
|
+
|
|
144
|
+
classifier = pipeline("text-classification", model = "textattack/distilbert-base-uncased-CoLA")
|
|
145
|
+
classifier("I will walk to home when I went through the bus.")
|
|
146
|
+
## [{'label': 'unacceptable', 'score': 0.95}]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Useful Resources
|
|
150
|
+
|
|
151
|
+
Would you like to learn more about the topic? Awesome! Here you can find some curated resources that you may find helpful!
|
|
152
|
+
|
|
153
|
+
- [SetFitABSA: Few-Shot Aspect Based Sentiment Analysis using SetFit](https://huggingface.co/blog/setfit-absa)
|
|
154
|
+
- [Course Chapter on Fine-tuning a Text Classification Model](https://huggingface.co/course/chapter3/1?fw=pt)
|
|
155
|
+
- [Getting Started with Sentiment Analysis using Python](https://huggingface.co/blog/sentiment-analysis-python)
|
|
156
|
+
- [Sentiment Analysis on Encrypted Data with Homomorphic Encryption](https://huggingface.co/blog/sentiment-analysis-fhe)
|
|
157
|
+
- [Leveraging Hugging Face for complex text classification use cases](https://huggingface.co/blog/classification-use-cases)
|
|
158
|
+
|
|
159
|
+
### Notebooks
|
|
160
|
+
|
|
161
|
+
- [PyTorch](https://github.com/huggingface/notebooks/blob/master/examples/text_classification.ipynb)
|
|
162
|
+
- [TensorFlow](https://github.com/huggingface/notebooks/blob/master/examples/text_classification-tf.ipynb)
|
|
163
|
+
- [Flax](https://github.com/huggingface/notebooks/blob/master/examples/text_classification_flax.ipynb)
|
|
164
|
+
|
|
165
|
+
### Scripts for training
|
|
166
|
+
|
|
167
|
+
- [PyTorch](https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-classification)
|
|
168
|
+
- [TensorFlow](https://github.com/huggingface/transformers/tree/main/examples/tensorflow/text-classification)
|
|
169
|
+
- [Flax](https://github.com/huggingface/transformers/tree/main/examples/flax/text-classification)
|
|
170
|
+
|
|
171
|
+
### Documentation
|
|
172
|
+
|
|
173
|
+
- [Text classification task guide](https://huggingface.co/docs/transformers/tasks/sequence_classification)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { TaskDataCustom } from "../index.js";
|
|
2
|
+
|
|
3
|
+
const taskData: TaskDataCustom = {
|
|
4
|
+
datasets: [
|
|
5
|
+
{
|
|
6
|
+
description: "A widely used dataset used to benchmark multiple variants of text classification.",
|
|
7
|
+
id: "nyu-mll/glue",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
description: "A text classification dataset used to benchmark natural language inference models",
|
|
11
|
+
id: "stanfordnlp/snli",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
demo: {
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
label: "Input",
|
|
18
|
+
content: "I love Hugging Face!",
|
|
19
|
+
type: "text",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
outputs: [
|
|
23
|
+
{
|
|
24
|
+
type: "chart",
|
|
25
|
+
data: [
|
|
26
|
+
{
|
|
27
|
+
label: "POSITIVE",
|
|
28
|
+
score: 0.9,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "NEUTRAL",
|
|
32
|
+
score: 0.1,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "NEGATIVE",
|
|
36
|
+
score: 0.0,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
metrics: [
|
|
43
|
+
{
|
|
44
|
+
description: "",
|
|
45
|
+
id: "accuracy",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
description: "",
|
|
49
|
+
id: "recall",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
description: "",
|
|
53
|
+
id: "precision",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
description:
|
|
57
|
+
"The F1 metric is the harmonic mean of the precision and recall. It can be calculated as: F1 = 2 * (precision * recall) / (precision + recall)",
|
|
58
|
+
id: "f1",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
models: [
|
|
62
|
+
{
|
|
63
|
+
description: "A robust model trained for sentiment analysis.",
|
|
64
|
+
id: "distilbert/distilbert-base-uncased-finetuned-sst-2-english",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
description: "A sentiment analysis model specialized in financial sentiment.",
|
|
68
|
+
id: "ProsusAI/finbert",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
description: "A sentiment analysis model specialized in analyzing tweets.",
|
|
72
|
+
id: "cardiffnlp/twitter-roberta-base-sentiment-latest",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: "A model that can classify languages.",
|
|
76
|
+
id: "papluca/xlm-roberta-base-language-detection",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
description: "A model that can classify text generation attacks.",
|
|
80
|
+
id: "meta-llama/Prompt-Guard-86M",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
spaces: [
|
|
84
|
+
{
|
|
85
|
+
description: "An application that can classify financial sentiment.",
|
|
86
|
+
id: "IoannisTr/Tech_Stocks_Trading_Assistant",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
description: "A dashboard that contains various text classification tasks.",
|
|
90
|
+
id: "miesnerjacob/Multi-task-NLP",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
description: "An application that analyzes user reviews in healthcare.",
|
|
94
|
+
id: "spacy/healthsea-demo",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
summary:
|
|
98
|
+
"Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language inference, and assessing grammatical correctness.",
|
|
99
|
+
widgetModels: ["distilbert/distilbert-base-uncased-finetuned-sst-2-english"],
|
|
100
|
+
youtubeId: "leNG9fN9FQU",
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default taskData;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Text Classification inference
|
|
8
|
+
*/
|
|
9
|
+
export interface TextClassificationInput {
|
|
10
|
+
/**
|
|
11
|
+
* The text to classify
|
|
12
|
+
*/
|
|
13
|
+
inputs: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: TextClassificationParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Text Classification
|
|
24
|
+
*/
|
|
25
|
+
export interface TextClassificationParameters {
|
|
26
|
+
function_to_apply?: ClassificationOutputTransform;
|
|
27
|
+
/**
|
|
28
|
+
* When specified, limits the output to the top K most probable classes.
|
|
29
|
+
*/
|
|
30
|
+
top_k?: number;
|
|
31
|
+
[property: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The function to apply to the model outputs in order to retrieve the scores.
|
|
35
|
+
*/
|
|
36
|
+
export type ClassificationOutputTransform = "sigmoid" | "softmax" | "none";
|
|
37
|
+
export type TextClassificationOutput = TextClassificationOutputElement[];
|
|
38
|
+
/**
|
|
39
|
+
* Outputs of inference for the Text Classification task
|
|
40
|
+
*/
|
|
41
|
+
export interface TextClassificationOutputElement {
|
|
42
|
+
/**
|
|
43
|
+
* The predicted class label.
|
|
44
|
+
*/
|
|
45
|
+
label: string;
|
|
46
|
+
/**
|
|
47
|
+
* The corresponding probability.
|
|
48
|
+
*/
|
|
49
|
+
score: number;
|
|
50
|
+
[property: string]: unknown;
|
|
51
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "/inference/schemas/text-classification/input.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
4
|
+
"description": "Inputs for Text Classification inference",
|
|
5
|
+
"title": "TextClassificationInput",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"inputs": {
|
|
9
|
+
"description": "The text to classify",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"parameters": {
|
|
13
|
+
"description": "Additional inference parameters",
|
|
14
|
+
"$ref": "#/$defs/TextClassificationParameters"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"$defs": {
|
|
18
|
+
"TextClassificationParameters": {
|
|
19
|
+
"title": "TextClassificationParameters",
|
|
20
|
+
"description": "Additional inference parameters for Text Classification",
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"function_to_apply": {
|
|
24
|
+
"title": "TextClassificationOutputTransform",
|
|
25
|
+
"$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"
|
|
26
|
+
},
|
|
27
|
+
"top_k": {
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"description": "When specified, limits the output to the top K most probable classes."
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["inputs"]
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "/inference/schemas/text-classification/output.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
4
|
+
"description": "Outputs of inference for the Text Classification task",
|
|
5
|
+
"title": "TextClassificationOutput",
|
|
6
|
+
"type": "array",
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutput"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
This task covers guides on both [text-generation](https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads) and [text-to-text generation](https://huggingface.co/models?pipeline_tag=text2text-generation&sort=downloads) models. Popular large language models that are used for chats or following instructions are also covered in this task. You can find the list of selected open-source large language models [here](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard), ranked by their performance scores.
|
|
2
|
+
|
|
3
|
+
## Use Cases
|
|
4
|
+
|
|
5
|
+
### Instruction Models
|
|
6
|
+
|
|
7
|
+
A model trained for text generation can be later adapted to follow instructions. You can try some of the most powerful instruction-tuned open-access models like Mixtral 8x7B, Cohere Command R+, and Meta Llama3 70B [at Hugging Chat](https://huggingface.co/chat).
|
|
8
|
+
|
|
9
|
+
### Code Generation
|
|
10
|
+
|
|
11
|
+
A Text Generation model, also known as a causal language model, can be trained on code from scratch to help the programmers in their repetitive coding tasks. One of the most popular open-source models for code generation is StarCoder, which can generate code in 80+ languages. You can try it [here](https://huggingface.co/spaces/bigcode/bigcode-playground).
|
|
12
|
+
|
|
13
|
+
### Stories Generation
|
|
14
|
+
|
|
15
|
+
A story generation model can receive an input like "Once upon a time" and proceed to create a story-like text based on those first words. You can try [this application](https://huggingface.co/spaces/mosaicml/mpt-7b-storywriter) which contains a model trained on story generation, by MosaicML.
|
|
16
|
+
|
|
17
|
+
If your generative model training data is different than your use case, you can train a causal language model from scratch. Learn how to do it in the free transformers [course](https://huggingface.co/course/chapter7/6?fw=pt)!
|
|
18
|
+
|
|
19
|
+
## Task Variants
|
|
20
|
+
|
|
21
|
+
### Completion Generation Models
|
|
22
|
+
|
|
23
|
+
A popular variant of Text Generation models predicts the next word given a bunch of words. Word by word a longer text is formed that results in for example:
|
|
24
|
+
|
|
25
|
+
- Given an incomplete sentence, complete it.
|
|
26
|
+
- Continue a story given the first sentences.
|
|
27
|
+
- Provided a code description, generate the code.
|
|
28
|
+
|
|
29
|
+
The most popular models for this task are GPT-based models, [Mistral](mistralai/Mistral-7B-v0.1) or [Llama series](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). These models are trained on data that has no labels, so you just need plain text to train your own model. You can train text generation models to generate a wide variety of documents, from code to stories.
|
|
30
|
+
|
|
31
|
+
### Text-to-Text Generation Models
|
|
32
|
+
|
|
33
|
+
These models are trained to learn the mapping between a pair of texts (e.g. translation from one language to another). The most popular variants of these models are [NLLB](facebook/nllb-200-distilled-600M), [FLAN-T5](https://huggingface.co/google/flan-t5-xxl), and [BART](https://huggingface.co/docs/transformers/model_doc/bart). Text-to-Text models are trained with multi-tasking capabilities, they can accomplish a wide range of tasks, including summarization, translation, and text classification.
|
|
34
|
+
|
|
35
|
+
## Language Model Variants
|
|
36
|
+
|
|
37
|
+
When it comes to text generation, the underlying language model can come in several types:
|
|
38
|
+
|
|
39
|
+
- **Base models:** refers to plain language models like [Mistral 7B](https://huggingface.co/mistralai/Mistral-7B-v0.3) and [Meta Llama-3-70b](https://huggingface.co/meta-llama/Meta-Llama-3-70B). These models are good for fine-tuning and few-shot prompting.
|
|
40
|
+
|
|
41
|
+
- **Instruction-trained models:** these models are trained in a multi-task manner to follow a broad range of instructions like "Write me a recipe for chocolate cake". Models like [Qwen 2 7B](https://huggingface.co/Qwen/Qwen2-7B-Instruct), [Yi 1.5 34B Chat](https://huggingface.co/01-ai/Yi-1.5-34B-Chat), and [Meta Llama 70B Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct) are examples of instruction-trained models. In general, instruction-trained models will produce better responses to instructions than base models.
|
|
42
|
+
|
|
43
|
+
- **Human feedback models:** these models extend base and instruction-trained models by incorporating human feedback that rates the quality of the generated text according to criteria like [helpfulness, honesty, and harmlessness](https://arxiv.org/abs/2112.00861). The human feedback is then combined with an optimization technique like reinforcement learning to align the original model to be closer with human preferences. The overall methodology is often called [Reinforcement Learning from Human Feedback](https://huggingface.co/blog/rlhf), or RLHF for short. [Zephyr ORPO 141B A35B](https://huggingface.co/HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1) is an open-source model aligned through human feedback.
|
|
44
|
+
|
|
45
|
+
## Text Generation from Image and Text
|
|
46
|
+
|
|
47
|
+
There are language models that can input both text and image and output text, called vision language models. [IDEFICS 2](https://huggingface.co/HuggingFaceM4/idefics2-8b) and [MiniCPM Llama3 V](https://huggingface.co/openbmb/MiniCPM-Llama3-V-2_5) are good examples. They accept the same generation parameters as other language models. However, since they also take images as input, you have to use them with the `image-to-text` pipeline. You can find more information about this in the [image-to-text task page](https://huggingface.co/tasks/image-to-text).
|
|
48
|
+
|
|
49
|
+
## Inference
|
|
50
|
+
|
|
51
|
+
You can use the 🤗 Transformers library `text-generation` pipeline to do inference with Text Generation models. It takes an incomplete text and returns multiple outputs with which the text can be completed.
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from transformers import pipeline
|
|
55
|
+
generator = pipeline('text-generation', model = 'HuggingFaceH4/zephyr-7b-beta')
|
|
56
|
+
generator("Hello, I'm a language model", max_length = 30, num_return_sequences=3)
|
|
57
|
+
## [{'generated_text': "Hello, I'm a language modeler. So while writing this, when I went out to meet my wife or come home she told me that my"},
|
|
58
|
+
## {'generated_text': "Hello, I'm a language modeler. I write and maintain software in Python. I love to code, and that includes coding things that require writing"}, ...
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
[Text-to-Text generation models](https://huggingface.co/models?pipeline_tag=text2text-generation&sort=downloads) have a separate pipeline called `text2text-generation`. This pipeline takes an input containing the sentence including the task and returns the output of the accomplished task.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from transformers import pipeline
|
|
65
|
+
|
|
66
|
+
text2text_generator = pipeline("text2text-generation")
|
|
67
|
+
text2text_generator("question: What is 42 ? context: 42 is the answer to life, the universe and everything")
|
|
68
|
+
[{'generated_text': 'the answer to life, the universe and everything'}]
|
|
69
|
+
|
|
70
|
+
text2text_generator("translate from English to French: I'm very happy")
|
|
71
|
+
[{'generated_text': 'Je suis très heureux'}]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
You can use [huggingface.js](https://github.com/huggingface/huggingface.js) to infer text classification models on Hugging Face Hub.
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
import { HfInference } from "@huggingface/inference";
|
|
78
|
+
|
|
79
|
+
const inference = new HfInference(HF_TOKEN);
|
|
80
|
+
await inference.conversational({
|
|
81
|
+
model: "distilbert-base-uncased-finetuned-sst-2-english",
|
|
82
|
+
inputs: "I love this movie!",
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Text Generation Inference
|
|
87
|
+
|
|
88
|
+
[Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is an open-source toolkit for serving LLMs tackling challenges such as response time. TGI powers inference solutions like [Inference Endpoints](https://huggingface.co/inference-endpoints) and [Hugging Chat](https://huggingface.co/chat/), as well as multiple community projects. You can use it to deploy any supported open-source large language model of your choice.
|
|
89
|
+
|
|
90
|
+
## ChatUI Spaces
|
|
91
|
+
|
|
92
|
+
Hugging Face Spaces includes templates to easily deploy your own instance of a specific application. [ChatUI](https://github.com/huggingface/chat-ui) is an open-source interface that enables serving conversational interface for large language models and can be deployed with few clicks at Spaces. TGI powers these Spaces under the hood for faster inference. Thanks to the template, you can deploy your own instance based on a large language model with only a few clicks and customize it. Learn more about it [here](https://huggingface.co/docs/hub/spaces-sdks-docker-chatui) and create your large language model instance [here](https://huggingface.co/new-space?template=huggingchat/chat-ui-template).
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
## Useful Resources
|
|
97
|
+
|
|
98
|
+
Would you like to learn more about the topic? Awesome! Here you can find some curated resources that you may find helpful!
|
|
99
|
+
|
|
100
|
+
### Tools within Hugging Face Ecosystem
|
|
101
|
+
|
|
102
|
+
- You can use [PEFT](https://github.com/huggingface/peft) to adapt large language models in efficient way.
|
|
103
|
+
- [ChatUI](https://github.com/huggingface/chat-ui) is the open-source interface to conversate with Large Language Models.
|
|
104
|
+
- [text-generation-inferface](https://github.com/huggingface/text-generation-inference)
|
|
105
|
+
- [HuggingChat](https://huggingface.co/chat/) is a chat interface powered by Hugging Face to chat with powerful models like Meta Llama 3 70B, Mixtral 8x7B, etc.
|
|
106
|
+
|
|
107
|
+
### Documentation
|
|
108
|
+
|
|
109
|
+
- [PEFT documentation](https://huggingface.co/docs/peft/index)
|
|
110
|
+
- [ChatUI Docker Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker-chatui)
|
|
111
|
+
- [Causal language modeling task guide](https://huggingface.co/docs/transformers/tasks/language_modeling)
|
|
112
|
+
- [Text generation strategies](https://huggingface.co/docs/transformers/generation_strategies)
|
|
113
|
+
- [Course chapter on training a causal language model from scratch](https://huggingface.co/course/chapter7/6?fw=pt)
|
|
114
|
+
|
|
115
|
+
### Model Inference & Deployment
|
|
116
|
+
|
|
117
|
+
- [Optimizing your LLM in production](https://huggingface.co/blog/optimize-llm)
|
|
118
|
+
- [Open-Source Text Generation & LLM Ecosystem at Hugging Face](https://huggingface.co/blog/os-llms)
|
|
119
|
+
- [Introducing RWKV - An RNN with the advantages of a transformer](https://huggingface.co/blog/rwkv)
|
|
120
|
+
- [Llama 2 is at Hugging Face](https://huggingface.co/blog/llama2)
|
|
121
|
+
- [Guiding Text Generation with Constrained Beam Search in 🤗 Transformers](https://huggingface.co/blog/constrained-beam-search)
|
|
122
|
+
- [Code generation with Hugging Face](https://huggingface.co/spaces/codeparrot/code-generation-models)
|
|
123
|
+
- [Assisted Generation: a new direction toward low-latency text generation](https://huggingface.co/blog/assisted-generation)
|
|
124
|
+
- [How to generate text: using different decoding methods for language generation with Transformers](https://huggingface.co/blog/how-to-generate)
|
|
125
|
+
- [Faster Text Generation with TensorFlow and XLA](https://huggingface.co/blog/tf-xla-generate)
|
|
126
|
+
|
|
127
|
+
### Model Fine-tuning/Training
|
|
128
|
+
|
|
129
|
+
- [Non-engineers guide: Train a LLaMA 2 chatbot](https://huggingface.co/blog/Llama2-for-non-engineers)
|
|
130
|
+
- [Training CodeParrot 🦜 from Scratch](https://huggingface.co/blog/codeparrot)
|
|
131
|
+
- [Creating a Coding Assistant with StarCoder](https://huggingface.co/blog/starchat-alpha)
|
|
132
|
+
|
|
133
|
+
### Advanced Concepts Explained Simply
|
|
134
|
+
|
|
135
|
+
- [Mixture of Experts Explained](https://huggingface.co/blog/moe)
|
|
136
|
+
|
|
137
|
+
### Advanced Fine-tuning/Training Recipes
|
|
138
|
+
|
|
139
|
+
- [Fine-tuning Llama 2 70B using PyTorch FSDP](https://huggingface.co/blog/ram-efficient-pytorch-fsdp)
|
|
140
|
+
- [The N Implementation Details of RLHF with PPO](https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo)
|
|
141
|
+
- [Preference Tuning LLMs with Direct Preference Optimization Methods](https://huggingface.co/blog/pref-tuning)
|
|
142
|
+
- [Fine-tune Llama 2 with DPO](https://huggingface.co/blog/dpo-trl)
|
|
143
|
+
|
|
144
|
+
### Notebooks
|
|
145
|
+
|
|
146
|
+
- [Training a CLM in Flax](https://github.com/huggingface/notebooks/blob/master/examples/causal_language_modeling_flax.ipynb)
|
|
147
|
+
- [Training a CLM in TensorFlow](https://github.com/huggingface/notebooks/blob/master/examples/language_modeling_from_scratch-tf.ipynb)
|
|
148
|
+
- [Training a CLM in PyTorch](https://github.com/huggingface/notebooks/blob/master/examples/language_modeling_from_scratch.ipynb)
|
|
149
|
+
|
|
150
|
+
### Scripts for training
|
|
151
|
+
|
|
152
|
+
- [Training a CLM in PyTorch](https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling)
|
|
153
|
+
- [Training a CLM in TensorFlow](https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling)
|
|
154
|
+
- [Text Generation in PyTorch](https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-generation)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { TaskDataCustom } from "../index.js";
|
|
2
|
+
|
|
3
|
+
const taskData: TaskDataCustom = {
|
|
4
|
+
datasets: [
|
|
5
|
+
{
|
|
6
|
+
description: "A large multilingual dataset of text crawled from the web.",
|
|
7
|
+
id: "mc4",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
description:
|
|
11
|
+
"Diverse open-source data consisting of 22 smaller high-quality datasets. It was used to train GPT-Neo.",
|
|
12
|
+
id: "the_pile",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
description: "Truly open-source, curated and cleaned dialogue dataset.",
|
|
16
|
+
id: "HuggingFaceH4/ultrachat_200k",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: "An instruction dataset with preference ratings on responses.",
|
|
20
|
+
id: "openbmb/UltraFeedback",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "A large synthetic dataset for alignment of text generation models.",
|
|
24
|
+
id: "argilla/magpie-ultra-v0.1",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
demo: {
|
|
28
|
+
inputs: [
|
|
29
|
+
{
|
|
30
|
+
label: "Input",
|
|
31
|
+
content: "Once upon a time,",
|
|
32
|
+
type: "text",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
outputs: [
|
|
36
|
+
{
|
|
37
|
+
label: "Output",
|
|
38
|
+
content:
|
|
39
|
+
"Once upon a time, we knew that our ancestors were on the verge of extinction. The great explorers and poets of the Old World, from Alexander the Great to Chaucer, are dead and gone. A good many of our ancient explorers and poets have",
|
|
40
|
+
type: "text",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
metrics: [
|
|
45
|
+
{
|
|
46
|
+
description:
|
|
47
|
+
"Cross Entropy is a metric that calculates the difference between two probability distributions. Each probability distribution is the distribution of predicted words",
|
|
48
|
+
id: "Cross Entropy",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
description:
|
|
52
|
+
"The Perplexity metric is the exponential of the cross-entropy loss. It evaluates the probabilities assigned to the next word by the model. Lower perplexity indicates better performance",
|
|
53
|
+
id: "Perplexity",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
models: [
|
|
57
|
+
{
|
|
58
|
+
description: "A text-generation model trained to follow instructions.",
|
|
59
|
+
id: "google/gemma-2-2b-it",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
description: "Very powerful text generation model trained to follow instructions.",
|
|
63
|
+
id: "meta-llama/Meta-Llama-3.1-8B-Instruct",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
description: "Small yet powerful text generation model.",
|
|
67
|
+
id: "microsoft/Phi-3-mini-4k-instruct",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
description: "A very powerful model that can solve mathematical problems.",
|
|
71
|
+
id: "AI-MO/NuminaMath-7B-TIR",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
description: "Strong text generation model to follow instructions.",
|
|
75
|
+
id: "Qwen/Qwen2.5-7B-Instruct",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
description: "Very strong open-source large language model.",
|
|
79
|
+
id: "nvidia/Llama-3.1-Nemotron-70B-Instruct",
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
spaces: [
|
|
83
|
+
{
|
|
84
|
+
description: "A leaderboard to compare different open-source text generation models based on various benchmarks.",
|
|
85
|
+
id: "open-llm-leaderboard/open_llm_leaderboard",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
description: "A leaderboard for comparing chain-of-thought performance of models.",
|
|
89
|
+
id: "logikon/open_cot_leaderboard",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
description: "An text generation based application based on a very powerful LLaMA2 model.",
|
|
93
|
+
id: "ysharma/Explore_llamav2_with_TGI",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
description: "An text generation based application to converse with Zephyr model.",
|
|
97
|
+
id: "HuggingFaceH4/zephyr-chat",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
description: "A leaderboard that ranks text generation models based on blind votes from people.",
|
|
101
|
+
id: "lmsys/chatbot-arena-leaderboard",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
description: "An chatbot to converse with a very powerful text generation model.",
|
|
105
|
+
id: "mlabonne/phixtral-chat",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
summary:
|
|
109
|
+
"Generating text is the task of generating new text given another text. These models can, for example, fill in incomplete text or paraphrase.",
|
|
110
|
+
widgetModels: ["mistralai/Mistral-Nemo-Instruct-2407"],
|
|
111
|
+
youtubeId: "e9gNEAlsOvU",
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default taskData;
|