Text Classification
setfit
Safetensors
sentence-transformers
English
mpnet
mtg
multilabel
magic
generated_from_setfit_trainer
Eval Results (legacy)
text-embeddings-inference
Instructions to use joshuasundance/mtg-coloridentity-multilabel-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use joshuasundance/mtg-coloridentity-multilabel-classification with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("joshuasundance/mtg-coloridentity-multilabel-classification") - sentence-transformers
How to use joshuasundance/mtg-coloridentity-multilabel-classification with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("joshuasundance/mtg-coloridentity-multilabel-classification") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
---
|
| 2 |
library_name: setfit
|
| 3 |
tags:
|
|
|
|
|
|
|
|
|
|
| 4 |
- setfit
|
| 5 |
- sentence-transformers
|
| 6 |
- text-classification
|
|
@@ -8,34 +11,37 @@ tags:
|
|
| 8 |
metrics:
|
| 9 |
- accuracy
|
| 10 |
widget:
|
| 11 |
-
- text:
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
-
When Stoic Farmer enters the battlefield, search your library for a basic
|
| 15 |
-
card and reveal it. If an opponent controls more lands than you, put
|
| 16 |
-
battlefield tapped. Otherwise put it into your hand. Then
|
|
|
|
| 17 |
|
| 18 |
-
Foretell {1}{W} (During your turn, you may pay {2} and exile this card from
|
| 19 |
-
hand face down. Cast it on a later turn for its foretell cost.)
|
| 20 |
-
- text:
|
|
|
|
| 21 |
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
- text:
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
Target creature gets +1/+1 and gains first strike until end of turn.'
|
| 32 |
-
- text: 'Voldaren Duelist
|
| 33 |
|
| 34 |
|
| 35 |
Haste
|
| 36 |
|
| 37 |
-
When Voldaren Duelist enters the battlefield, target creature can'
|
| 38 |
-
turn.
|
| 39 |
pipeline_tag: text-classification
|
| 40 |
inference: false
|
| 41 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
@@ -46,15 +52,32 @@ model-index:
|
|
| 46 |
type: text-classification
|
| 47 |
name: Text Classification
|
| 48 |
dataset:
|
| 49 |
-
name:
|
| 50 |
-
type:
|
| 51 |
split: test
|
| 52 |
metrics:
|
| 53 |
- type: accuracy
|
| 54 |
value: 0.7145687016027372
|
| 55 |
name: Accuracy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
---
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
# SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
| 59 |
|
| 60 |
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) as the Sentence Transformer embedding model. A OneVsRestClassifier instance is used for classification.
|
|
@@ -89,6 +112,48 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
| 89 |
|:--------|:---------|
|
| 90 |
| **all** | 0.7146 |
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
## Uses
|
| 93 |
|
| 94 |
### Direct Use for Inference
|
|
@@ -105,7 +170,7 @@ Then you can load this model and run inference.
|
|
| 105 |
from setfit import SetFitModel
|
| 106 |
|
| 107 |
# Download from the 🤗 Hub
|
| 108 |
-
model = SetFitModel.from_pretrained("
|
| 109 |
# Run inference
|
| 110 |
preds = model("Scattershot Archer
|
| 111 |
|
|
|
|
| 1 |
---
|
| 2 |
library_name: setfit
|
| 3 |
tags:
|
| 4 |
+
- mtg
|
| 5 |
+
- multilabel
|
| 6 |
+
- magic
|
| 7 |
- setfit
|
| 8 |
- sentence-transformers
|
| 9 |
- text-classification
|
|
|
|
| 11 |
metrics:
|
| 12 |
- accuracy
|
| 13 |
widget:
|
| 14 |
+
- text: >-
|
| 15 |
+
Stoic Farmer
|
| 16 |
|
| 17 |
|
| 18 |
+
When Stoic Farmer enters the battlefield, search your library for a basic
|
| 19 |
+
Plains card and reveal it. If an opponent controls more lands than you, put
|
| 20 |
+
it onto the battlefield tapped. Otherwise put it into your hand. Then
|
| 21 |
+
shuffle.
|
| 22 |
|
| 23 |
+
Foretell {1}{W} (During your turn, you may pay {2} and exile this card from
|
| 24 |
+
your hand face down. Cast it on a later turn for its foretell cost.)
|
| 25 |
+
- text: |-
|
| 26 |
+
Hibernation Sliver
|
| 27 |
|
| 28 |
+
All Slivers have "Pay 2 life: Return this permanent to its owner's hand."
|
| 29 |
+
- text: |-
|
| 30 |
+
Scattershot Archer
|
| 31 |
|
| 32 |
+
{T}: Scattershot Archer deals 1 damage to each creature with flying.
|
| 33 |
+
- text: |-
|
| 34 |
+
Seize the Initiative
|
| 35 |
|
| 36 |
+
Target creature gets +1/+1 and gains first strike until end of turn.
|
| 37 |
+
- text: >-
|
| 38 |
+
Voldaren Duelist
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
Haste
|
| 42 |
|
| 43 |
+
When Voldaren Duelist enters the battlefield, target creature can't block
|
| 44 |
+
this turn.
|
| 45 |
pipeline_tag: text-classification
|
| 46 |
inference: false
|
| 47 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
|
| 52 |
type: text-classification
|
| 53 |
name: Text Classification
|
| 54 |
dataset:
|
| 55 |
+
name: mtg-coloridentity-multilabel-classification
|
| 56 |
+
type: joshuasundance/mtg-coloridentity-multilabel-classification
|
| 57 |
split: test
|
| 58 |
metrics:
|
| 59 |
- type: accuracy
|
| 60 |
value: 0.7145687016027372
|
| 61 |
name: Accuracy
|
| 62 |
+
license: mit
|
| 63 |
+
datasets:
|
| 64 |
+
- joshuasundance/mtg-coloridentity-multilabel-classification
|
| 65 |
+
language:
|
| 66 |
+
- en
|
| 67 |
---
|
| 68 |
|
| 69 |
+
This is a proof-of-concept model trained on `datasets/joshuasundance/mtg-coloridentity-multilabel-classification`.
|
| 70 |
+
|
| 71 |
+
It takes card name + text as a single str as input and outputs color identity as an encoding:
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
colors = ['B', 'G', 'R', 'U', 'W']
|
| 75 |
+
b = [1, 0, 0, 0, 0]
|
| 76 |
+
bw = [1, 0, 0, 0, 1]
|
| 77 |
+
gru = [0, 1, 1, 1, 0]
|
| 78 |
+
# and so on
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
# SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
| 82 |
|
| 83 |
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) as the Sentence Transformer embedding model. A OneVsRestClassifier instance is used for classification.
|
|
|
|
| 112 |
|:--------|:---------|
|
| 113 |
| **all** | 0.7146 |
|
| 114 |
|
| 115 |
+
### Classification Report
|
| 116 |
+
```text
|
| 117 |
+
precision recall f1-score support
|
| 118 |
+
|
| 119 |
+
0.80 0.77 0.78 594
|
| 120 |
+
B 0.81 0.76 0.78 821
|
| 121 |
+
BG 0.42 0.56 0.48 63
|
| 122 |
+
BGR 0.46 0.55 0.50 22
|
| 123 |
+
BGRU 0.00 0.00 0.00 0
|
| 124 |
+
BGRUW 0.73 0.33 0.46 24
|
| 125 |
+
BGRW 0.00 0.00 0.00 0
|
| 126 |
+
BGU 0.27 0.38 0.32 8
|
| 127 |
+
BGUW 0.12 1.00 0.22 1
|
| 128 |
+
BGW 0.14 0.33 0.19 9
|
| 129 |
+
BR 0.41 0.59 0.48 80
|
| 130 |
+
BRU 0.55 0.50 0.52 24
|
| 131 |
+
BRUW 0.00 0.00 0.00 0
|
| 132 |
+
BRW 0.29 0.36 0.32 14
|
| 133 |
+
BU 0.53 0.56 0.54 91
|
| 134 |
+
BUW 0.29 0.43 0.34 14
|
| 135 |
+
BW 0.36 0.37 0.37 73
|
| 136 |
+
G 0.77 0.76 0.77 791
|
| 137 |
+
GR 0.42 0.46 0.44 85
|
| 138 |
+
GRU 0.14 0.22 0.17 9
|
| 139 |
+
GRUW 0.00 0.00 0.00 0
|
| 140 |
+
GRW 0.27 0.50 0.35 18
|
| 141 |
+
GU 0.48 0.49 0.49 69
|
| 142 |
+
GUW 0.15 0.27 0.20 15
|
| 143 |
+
GW 0.40 0.43 0.41 89
|
| 144 |
+
R 0.81 0.77 0.79 803
|
| 145 |
+
RU 0.43 0.51 0.47 68
|
| 146 |
+
RUW 0.20 0.43 0.27 7
|
| 147 |
+
RW 0.47 0.49 0.48 80
|
| 148 |
+
U 0.83 0.81 0.82 818
|
| 149 |
+
UW 0.37 0.43 0.40 86
|
| 150 |
+
W 0.77 0.72 0.74 777
|
| 151 |
+
|
| 152 |
+
accuracy 0.71 5553
|
| 153 |
+
macro avg 0.40 0.46 0.41 5553
|
| 154 |
+
weighted avg 0.73 0.71 0.72 5553
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
## Uses
|
| 158 |
|
| 159 |
### Direct Use for Inference
|
|
|
|
| 170 |
from setfit import SetFitModel
|
| 171 |
|
| 172 |
# Download from the 🤗 Hub
|
| 173 |
+
model = SetFitModel.from_pretrained("joshuasundance/mtg-coloridentity-multilabel-classification")
|
| 174 |
# Run inference
|
| 175 |
preds = model("Scattershot Archer
|
| 176 |
|