Daniel Vila
commited on
Commit
•
7167911
1
Parent(s):
2d63739
Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,864 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Comparing model predictions and ground truth labels with Rubrix and Hugging Face
|
2 |
+
|
3 |
+
## Build dataset
|
4 |
+
|
5 |
+
You skip this step if you run:
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
```python
|
10 |
+
from datasets import load_dataset
|
11 |
+
import rubrix as rb
|
12 |
+
|
13 |
+
ds = rb.DatasetForTextClassification.from_datasets(load_dataset("rubrix/sst2_with_predictions", split="train"))
|
14 |
+
```
|
15 |
+
|
16 |
+
Otherwise, the following cell will run the pipeline over the training set and store labels and predictions.
|
17 |
+
|
18 |
+
|
19 |
+
```python
|
20 |
+
from datasets import load_dataset
|
21 |
+
from transformers import pipeline, AutoModelForSequenceClassification
|
22 |
+
|
23 |
+
import rubrix as rb
|
24 |
+
|
25 |
+
name = "distilbert-base-uncased-finetuned-sst-2-english"
|
26 |
+
|
27 |
+
# Need to define id2label because surprisingly the pipeline has uppercase label names
|
28 |
+
model = AutoModelForSequenceClassification.from_pretrained(name, id2label={0: 'negative', 1: 'positive'})
|
29 |
+
nlp = pipeline("sentiment-analysis", model=model, tokenizer=name, return_all_scores=True)
|
30 |
+
|
31 |
+
dataset = load_dataset("glue", "sst2", split="train")
|
32 |
+
|
33 |
+
# batch predict
|
34 |
+
def predict(example):
|
35 |
+
return {"prediction": nlp(example["sentence"])}
|
36 |
+
|
37 |
+
# add predictions to the dataset
|
38 |
+
dataset = dataset.map(predict, batched=True).rename_column("sentence", "text")
|
39 |
+
|
40 |
+
# build rubrix dataset from hf dataset
|
41 |
+
ds = rb.DatasetForTextClassification.from_datasets(dataset, annotation="label")
|
42 |
+
```
|
43 |
+
|
44 |
+
|
45 |
+
```python
|
46 |
+
# Install Rubrix and start exploring and sharing URLs with interesting subsets, etc.
|
47 |
+
rb.log(ds, "sst2")
|
48 |
+
```
|
49 |
+
|
50 |
+
|
51 |
+
```python
|
52 |
+
ds.to_datasets().push_to_hub("rubrix/sst2_with_predictions")
|
53 |
+
```
|
54 |
+
|
55 |
+
|
56 |
+
Pushing dataset shards to the dataset hub: 0%| | 0/1 [00:00<?, ?it/s]
|
57 |
+
|
58 |
+
|
59 |
+
## Analize misspredictions and ambiguous labels
|
60 |
+
|
61 |
+
### With the UI
|
62 |
+
|
63 |
+
With Rubrix UI you can:
|
64 |
+
|
65 |
+
- Combine filters and full-text/DSL queries to quickly find important samples
|
66 |
+
- All URLs contain the state so you can share with collaborator and annotator specific dataset regions to work on.
|
67 |
+
- Sort examples by score, as well as custom metadata fields.
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
![example.png](example.png)
|
72 |
+
|
73 |
+
|
74 |
+
### Programmatically
|
75 |
+
|
76 |
+
Let's find all wrong predictions from Python. This useful for bulk operations (relabelling, discarding, etc.)
|
77 |
+
|
78 |
+
|
79 |
+
```python
|
80 |
+
import pandas as pd
|
81 |
+
|
82 |
+
# Get dataset slice with wrong predictions
|
83 |
+
df = rb.load("sst2", query="predicted:ko").to_pandas()
|
84 |
+
|
85 |
+
# display first 20 examples
|
86 |
+
with pd.option_context('display.max_colwidth', None):
|
87 |
+
display(df[["text", "prediction", "annotation"]].head(20))
|
88 |
+
```
|
89 |
+
|
90 |
+
|
91 |
+
<div>
|
92 |
+
<style scoped>
|
93 |
+
.dataframe tbody tr th:only-of-type {
|
94 |
+
vertical-align: middle;
|
95 |
+
}
|
96 |
+
|
97 |
+
.dataframe tbody tr th {
|
98 |
+
vertical-align: top;
|
99 |
+
}
|
100 |
+
|
101 |
+
.dataframe thead th {
|
102 |
+
text-align: right;
|
103 |
+
}
|
104 |
+
</style>
|
105 |
+
<table border="1" class="dataframe">
|
106 |
+
<thead>
|
107 |
+
<tr style="text-align: right;">
|
108 |
+
<th></th>
|
109 |
+
<th>text</th>
|
110 |
+
<th>prediction</th>
|
111 |
+
<th>annotation</th>
|
112 |
+
</tr>
|
113 |
+
</thead>
|
114 |
+
<tbody>
|
115 |
+
<tr>
|
116 |
+
<th>0</th>
|
117 |
+
<td>this particular , anciently demanding métier</td>
|
118 |
+
<td>[(negative, 0.9386059045791626), (positive, 0.06139408051967621)]</td>
|
119 |
+
<td>positive</td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<th>1</th>
|
123 |
+
<td>under our skin</td>
|
124 |
+
<td>[(positive, 0.7508484721183777), (negative, 0.24915160238742828)]</td>
|
125 |
+
<td>negative</td>
|
126 |
+
</tr>
|
127 |
+
<tr>
|
128 |
+
<th>2</th>
|
129 |
+
<td>evokes a palpable sense of disconnection , made all the more poignant by the incessant use of cell phones .</td>
|
130 |
+
<td>[(negative, 0.6634528636932373), (positive, 0.3365470767021179)]</td>
|
131 |
+
<td>positive</td>
|
132 |
+
</tr>
|
133 |
+
<tr>
|
134 |
+
<th>3</th>
|
135 |
+
<td>plays like a living-room war of the worlds , gaining most of its unsettling force from the suggested and the unknown .</td>
|
136 |
+
<td>[(positive, 0.9968075752258301), (negative, 0.003192420583218336)]</td>
|
137 |
+
<td>negative</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<th>4</th>
|
141 |
+
<td>into a pulpy concept that , in many other hands would be completely forgettable</td>
|
142 |
+
<td>[(positive, 0.6178210377693176), (negative, 0.3821789622306824)]</td>
|
143 |
+
<td>negative</td>
|
144 |
+
</tr>
|
145 |
+
<tr>
|
146 |
+
<th>5</th>
|
147 |
+
<td>transcends ethnic lines .</td>
|
148 |
+
<td>[(positive, 0.9758220314979553), (negative, 0.024177948012948036)]</td>
|
149 |
+
<td>negative</td>
|
150 |
+
</tr>
|
151 |
+
<tr>
|
152 |
+
<th>6</th>
|
153 |
+
<td>is barely</td>
|
154 |
+
<td>[(negative, 0.9922297596931458), (positive, 0.00777028314769268)]</td>
|
155 |
+
<td>positive</td>
|
156 |
+
</tr>
|
157 |
+
<tr>
|
158 |
+
<th>7</th>
|
159 |
+
<td>a pulpy concept that , in many other hands would be completely forgettable</td>
|
160 |
+
<td>[(negative, 0.9738760590553284), (positive, 0.026123959571123123)]</td>
|
161 |
+
<td>positive</td>
|
162 |
+
</tr>
|
163 |
+
<tr>
|
164 |
+
<th>8</th>
|
165 |
+
<td>of hollywood heart-string plucking</td>
|
166 |
+
<td>[(positive, 0.9889695644378662), (negative, 0.011030420660972595)]</td>
|
167 |
+
<td>negative</td>
|
168 |
+
</tr>
|
169 |
+
<tr>
|
170 |
+
<th>9</th>
|
171 |
+
<td>a minimalist beauty and the beast</td>
|
172 |
+
<td>[(positive, 0.9100378751754761), (negative, 0.08996208757162094)]</td>
|
173 |
+
<td>negative</td>
|
174 |
+
</tr>
|
175 |
+
<tr>
|
176 |
+
<th>10</th>
|
177 |
+
<td>the intimate , unguarded moments of folks who live in unusual homes --</td>
|
178 |
+
<td>[(positive, 0.9967381358146667), (negative, 0.0032618637196719646)]</td>
|
179 |
+
<td>negative</td>
|
180 |
+
</tr>
|
181 |
+
<tr>
|
182 |
+
<th>11</th>
|
183 |
+
<td>steals the show</td>
|
184 |
+
<td>[(negative, 0.8031412363052368), (positive, 0.1968587338924408)]</td>
|
185 |
+
<td>positive</td>
|
186 |
+
</tr>
|
187 |
+
<tr>
|
188 |
+
<th>12</th>
|
189 |
+
<td>enough</td>
|
190 |
+
<td>[(positive, 0.7941301465034485), (negative, 0.2058698982000351)]</td>
|
191 |
+
<td>negative</td>
|
192 |
+
</tr>
|
193 |
+
<tr>
|
194 |
+
<th>13</th>
|
195 |
+
<td>accept it as life and</td>
|
196 |
+
<td>[(positive, 0.9987508058547974), (negative, 0.0012492131209000945)]</td>
|
197 |
+
<td>negative</td>
|
198 |
+
</tr>
|
199 |
+
<tr>
|
200 |
+
<th>14</th>
|
201 |
+
<td>this is the kind of movie that you only need to watch for about thirty seconds before you say to yourself , ` ah , yes ,</td>
|
202 |
+
<td>[(negative, 0.7889454960823059), (positive, 0.21105451881885529)]</td>
|
203 |
+
<td>positive</td>
|
204 |
+
</tr>
|
205 |
+
<tr>
|
206 |
+
<th>15</th>
|
207 |
+
<td>plunges you into a reality that is , more often then not , difficult and sad ,</td>
|
208 |
+
<td>[(positive, 0.967541515827179), (negative, 0.03245845437049866)]</td>
|
209 |
+
<td>negative</td>
|
210 |
+
</tr>
|
211 |
+
<tr>
|
212 |
+
<th>16</th>
|
213 |
+
<td>overcomes the script 's flaws and envelops the audience in his character 's anguish , anger and frustration .</td>
|
214 |
+
<td>[(positive, 0.9953157901763916), (negative, 0.004684178624302149)]</td>
|
215 |
+
<td>negative</td>
|
216 |
+
</tr>
|
217 |
+
<tr>
|
218 |
+
<th>17</th>
|
219 |
+
<td>troubled and determined homicide cop</td>
|
220 |
+
<td>[(negative, 0.6632784008979797), (positive, 0.33672159910202026)]</td>
|
221 |
+
<td>positive</td>
|
222 |
+
</tr>
|
223 |
+
<tr>
|
224 |
+
<th>18</th>
|
225 |
+
<td>human nature is a goofball movie , in the way that malkovich was , but it tries too hard</td>
|
226 |
+
<td>[(positive, 0.5959018468856812), (negative, 0.40409812331199646)]</td>
|
227 |
+
<td>negative</td>
|
228 |
+
</tr>
|
229 |
+
<tr>
|
230 |
+
<th>19</th>
|
231 |
+
<td>to watch too many barney videos</td>
|
232 |
+
<td>[(negative, 0.9909896850585938), (positive, 0.00901023019105196)]</td>
|
233 |
+
<td>positive</td>
|
234 |
+
</tr>
|
235 |
+
</tbody>
|
236 |
+
</table>
|
237 |
+
</div>
|
238 |
+
|
239 |
+
|
240 |
+
|
241 |
+
```python
|
242 |
+
df.annotation.hist()
|
243 |
+
```
|
244 |
+
|
245 |
+
|
246 |
+
|
247 |
+
|
248 |
+
<AxesSubplot:>
|
249 |
+
|
250 |
+
|
251 |
+
|
252 |
+
|
253 |
+
|
254 |
+
![png](output_9_1.png)
|
255 |
+
|
256 |
+
|
257 |
+
|
258 |
+
|
259 |
+
```python
|
260 |
+
# Get dataset slice with wrong predictions
|
261 |
+
df = rb.load("sst2", query="predicted:ko and annotated_as:negative").to_pandas()
|
262 |
+
|
263 |
+
# display first 20 examples
|
264 |
+
with pd.option_context('display.max_colwidth', None):
|
265 |
+
display(df[["text", "prediction", "annotation"]].head(20))
|
266 |
+
```
|
267 |
+
|
268 |
+
|
269 |
+
<div>
|
270 |
+
<style scoped>
|
271 |
+
.dataframe tbody tr th:only-of-type {
|
272 |
+
vertical-align: middle;
|
273 |
+
}
|
274 |
+
|
275 |
+
.dataframe tbody tr th {
|
276 |
+
vertical-align: top;
|
277 |
+
}
|
278 |
+
|
279 |
+
.dataframe thead th {
|
280 |
+
text-align: right;
|
281 |
+
}
|
282 |
+
</style>
|
283 |
+
<table border="1" class="dataframe">
|
284 |
+
<thead>
|
285 |
+
<tr style="text-align: right;">
|
286 |
+
<th></th>
|
287 |
+
<th>text</th>
|
288 |
+
<th>prediction</th>
|
289 |
+
<th>annotation</th>
|
290 |
+
</tr>
|
291 |
+
</thead>
|
292 |
+
<tbody>
|
293 |
+
<tr>
|
294 |
+
<th>0</th>
|
295 |
+
<td>plays like a living-room war of the worlds , gaining most of its unsettling force from the suggested and the unknown .</td>
|
296 |
+
<td>[(positive, 0.9968075752258301), (negative, 0.003192420583218336)]</td>
|
297 |
+
<td>negative</td>
|
298 |
+
</tr>
|
299 |
+
<tr>
|
300 |
+
<th>1</th>
|
301 |
+
<td>a minimalist beauty and the beast</td>
|
302 |
+
<td>[(positive, 0.9100378751754761), (negative, 0.08996208757162094)]</td>
|
303 |
+
<td>negative</td>
|
304 |
+
</tr>
|
305 |
+
<tr>
|
306 |
+
<th>2</th>
|
307 |
+
<td>accept it as life and</td>
|
308 |
+
<td>[(positive, 0.9987508058547974), (negative, 0.0012492131209000945)]</td>
|
309 |
+
<td>negative</td>
|
310 |
+
</tr>
|
311 |
+
<tr>
|
312 |
+
<th>3</th>
|
313 |
+
<td>plunges you into a reality that is , more often then not , difficult and sad ,</td>
|
314 |
+
<td>[(positive, 0.967541515827179), (negative, 0.03245845437049866)]</td>
|
315 |
+
<td>negative</td>
|
316 |
+
</tr>
|
317 |
+
<tr>
|
318 |
+
<th>4</th>
|
319 |
+
<td>overcomes the script 's flaws and envelops the audience in his character 's anguish , anger and frustration .</td>
|
320 |
+
<td>[(positive, 0.9953157901763916), (negative, 0.004684178624302149)]</td>
|
321 |
+
<td>negative</td>
|
322 |
+
</tr>
|
323 |
+
<tr>
|
324 |
+
<th>5</th>
|
325 |
+
<td>and social commentary</td>
|
326 |
+
<td>[(positive, 0.7863275408744812), (negative, 0.2136724889278412)]</td>
|
327 |
+
<td>negative</td>
|
328 |
+
</tr>
|
329 |
+
<tr>
|
330 |
+
<th>6</th>
|
331 |
+
<td>we do n't get williams ' usual tear and a smile , just sneers and bile , and the spectacle is nothing short of refreshing .</td>
|
332 |
+
<td>[(positive, 0.9982783794403076), (negative, 0.0017216014675796032)]</td>
|
333 |
+
<td>negative</td>
|
334 |
+
</tr>
|
335 |
+
<tr>
|
336 |
+
<th>7</th>
|
337 |
+
<td>before pulling the plug on the conspirators and averting an american-russian armageddon</td>
|
338 |
+
<td>[(positive, 0.6992855072021484), (negative, 0.30071452260017395)]</td>
|
339 |
+
<td>negative</td>
|
340 |
+
</tr>
|
341 |
+
<tr>
|
342 |
+
<th>8</th>
|
343 |
+
<td>in tight pants and big tits</td>
|
344 |
+
<td>[(positive, 0.7850217819213867), (negative, 0.2149781733751297)]</td>
|
345 |
+
<td>negative</td>
|
346 |
+
</tr>
|
347 |
+
<tr>
|
348 |
+
<th>9</th>
|
349 |
+
<td>that it certainly does n't feel like a film that strays past the two and a half mark</td>
|
350 |
+
<td>[(positive, 0.6591460108757019), (negative, 0.3408539891242981)]</td>
|
351 |
+
<td>negative</td>
|
352 |
+
</tr>
|
353 |
+
<tr>
|
354 |
+
<th>10</th>
|
355 |
+
<td>actress-producer and writer</td>
|
356 |
+
<td>[(positive, 0.8167378306388855), (negative, 0.1832621842622757)]</td>
|
357 |
+
<td>negative</td>
|
358 |
+
</tr>
|
359 |
+
<tr>
|
360 |
+
<th>11</th>
|
361 |
+
<td>gives devastating testimony to both people 's capacity for evil and their heroic capacity for good .</td>
|
362 |
+
<td>[(positive, 0.8960123062133789), (negative, 0.10398765653371811)]</td>
|
363 |
+
<td>negative</td>
|
364 |
+
</tr>
|
365 |
+
<tr>
|
366 |
+
<th>12</th>
|
367 |
+
<td>deep into the girls ' confusion and pain as they struggle tragically to comprehend the chasm of knowledge that 's opened between them</td>
|
368 |
+
<td>[(positive, 0.9729612469673157), (negative, 0.027038726955652237)]</td>
|
369 |
+
<td>negative</td>
|
370 |
+
</tr>
|
371 |
+
<tr>
|
372 |
+
<th>13</th>
|
373 |
+
<td>a younger lad in zen and the art of getting laid in this prickly indie comedy of manners and misanthropy</td>
|
374 |
+
<td>[(positive, 0.9875985980033875), (negative, 0.012401451356709003)]</td>
|
375 |
+
<td>negative</td>
|
376 |
+
</tr>
|
377 |
+
<tr>
|
378 |
+
<th>14</th>
|
379 |
+
<td>get on a board and , uh , shred ,</td>
|
380 |
+
<td>[(positive, 0.5352609753608704), (negative, 0.46473899483680725)]</td>
|
381 |
+
<td>negative</td>
|
382 |
+
</tr>
|
383 |
+
<tr>
|
384 |
+
<th>15</th>
|
385 |
+
<td>so preachy-keen and</td>
|
386 |
+
<td>[(positive, 0.9644021391868591), (negative, 0.035597823560237885)]</td>
|
387 |
+
<td>negative</td>
|
388 |
+
</tr>
|
389 |
+
<tr>
|
390 |
+
<th>16</th>
|
391 |
+
<td>there 's an admirable rigor to jimmy 's relentless anger , and to the script 's refusal of a happy ending ,</td>
|
392 |
+
<td>[(positive, 0.9928517937660217), (negative, 0.007148175034672022)]</td>
|
393 |
+
<td>negative</td>
|
394 |
+
</tr>
|
395 |
+
<tr>
|
396 |
+
<th>17</th>
|
397 |
+
<td>` christian bale 's quinn ( is ) a leather clad grunge-pirate with a hairdo like gandalf in a wind-tunnel and a simply astounding cor-blimey-luv-a-duck cockney accent . '</td>
|
398 |
+
<td>[(positive, 0.9713286757469177), (negative, 0.028671346604824066)]</td>
|
399 |
+
<td>negative</td>
|
400 |
+
</tr>
|
401 |
+
<tr>
|
402 |
+
<th>18</th>
|
403 |
+
<td>passion , grief and fear</td>
|
404 |
+
<td>[(positive, 0.9849751591682434), (negative, 0.015024829655885696)]</td>
|
405 |
+
<td>negative</td>
|
406 |
+
</tr>
|
407 |
+
<tr>
|
408 |
+
<th>19</th>
|
409 |
+
<td>to keep the extremes of screwball farce and blood-curdling family intensity on one continuum</td>
|
410 |
+
<td>[(positive, 0.8838250637054443), (negative, 0.11617499589920044)]</td>
|
411 |
+
<td>negative</td>
|
412 |
+
</tr>
|
413 |
+
</tbody>
|
414 |
+
</table>
|
415 |
+
</div>
|
416 |
+
|
417 |
+
|
418 |
+
|
419 |
+
```python
|
420 |
+
# Get dataset slice with wrong predictions
|
421 |
+
df = rb.load("sst2", query="predicted:ko and score:{0.99 TO *}").to_pandas()
|
422 |
+
|
423 |
+
# display first 20 examples
|
424 |
+
with pd.option_context('display.max_colwidth', None):
|
425 |
+
display(df[["text", "prediction", "annotation"]].head(20))
|
426 |
+
```
|
427 |
+
|
428 |
+
|
429 |
+
<div>
|
430 |
+
<style scoped>
|
431 |
+
.dataframe tbody tr th:only-of-type {
|
432 |
+
vertical-align: middle;
|
433 |
+
}
|
434 |
+
|
435 |
+
.dataframe tbody tr th {
|
436 |
+
vertical-align: top;
|
437 |
+
}
|
438 |
+
|
439 |
+
.dataframe thead th {
|
440 |
+
text-align: right;
|
441 |
+
}
|
442 |
+
</style>
|
443 |
+
<table border="1" class="dataframe">
|
444 |
+
<thead>
|
445 |
+
<tr style="text-align: right;">
|
446 |
+
<th></th>
|
447 |
+
<th>text</th>
|
448 |
+
<th>prediction</th>
|
449 |
+
<th>annotation</th>
|
450 |
+
</tr>
|
451 |
+
</thead>
|
452 |
+
<tbody>
|
453 |
+
<tr>
|
454 |
+
<th>0</th>
|
455 |
+
<td>plays like a living-room war of the worlds , gaining most of its unsettling force from the suggested and the unknown .</td>
|
456 |
+
<td>[(positive, 0.9968075752258301), (negative, 0.003192420583218336)]</td>
|
457 |
+
<td>negative</td>
|
458 |
+
</tr>
|
459 |
+
<tr>
|
460 |
+
<th>1</th>
|
461 |
+
<td>accept it as life and</td>
|
462 |
+
<td>[(positive, 0.9987508058547974), (negative, 0.0012492131209000945)]</td>
|
463 |
+
<td>negative</td>
|
464 |
+
</tr>
|
465 |
+
<tr>
|
466 |
+
<th>2</th>
|
467 |
+
<td>overcomes the script 's flaws and envelops the audience in his character 's anguish , anger and frustration .</td>
|
468 |
+
<td>[(positive, 0.9953157901763916), (negative, 0.004684178624302149)]</td>
|
469 |
+
<td>negative</td>
|
470 |
+
</tr>
|
471 |
+
<tr>
|
472 |
+
<th>3</th>
|
473 |
+
<td>will no doubt rally to its cause , trotting out threadbare standbys like ` masterpiece ' and ` triumph ' and all that malarkey ,</td>
|
474 |
+
<td>[(negative, 0.9936562180519104), (positive, 0.006343740504235029)]</td>
|
475 |
+
<td>positive</td>
|
476 |
+
</tr>
|
477 |
+
<tr>
|
478 |
+
<th>4</th>
|
479 |
+
<td>we do n't get williams ' usual tear and a smile , just sneers and bile , and the spectacle is nothing short of refreshing .</td>
|
480 |
+
<td>[(positive, 0.9982783794403076), (negative, 0.0017216014675796032)]</td>
|
481 |
+
<td>negative</td>
|
482 |
+
</tr>
|
483 |
+
<tr>
|
484 |
+
<th>5</th>
|
485 |
+
<td>somehow manages to bring together kevin pollak , former wrestler chyna and dolly parton</td>
|
486 |
+
<td>[(negative, 0.9979034662246704), (positive, 0.002096540294587612)]</td>
|
487 |
+
<td>positive</td>
|
488 |
+
</tr>
|
489 |
+
<tr>
|
490 |
+
<th>6</th>
|
491 |
+
<td>there 's an admirable rigor to jimmy 's relentless anger , and to the script 's refusal of a happy ending ,</td>
|
492 |
+
<td>[(positive, 0.9928517937660217), (negative, 0.007148175034672022)]</td>
|
493 |
+
<td>negative</td>
|
494 |
+
</tr>
|
495 |
+
<tr>
|
496 |
+
<th>7</th>
|
497 |
+
<td>the bottom line with nemesis is the same as it has been with all the films in the series : fans will undoubtedly enjoy it , and the uncommitted need n't waste their time on it</td>
|
498 |
+
<td>[(positive, 0.995850682258606), (negative, 0.004149340093135834)]</td>
|
499 |
+
<td>negative</td>
|
500 |
+
</tr>
|
501 |
+
<tr>
|
502 |
+
<th>8</th>
|
503 |
+
<td>is genial but never inspired , and little</td>
|
504 |
+
<td>[(negative, 0.9921030402183533), (positive, 0.007896988652646542)]</td>
|
505 |
+
<td>positive</td>
|
506 |
+
</tr>
|
507 |
+
<tr>
|
508 |
+
<th>9</th>
|
509 |
+
<td>heaped upon a project of such vast proportions need to reap more rewards than spiffy bluescreen technique and stylish weaponry .</td>
|
510 |
+
<td>[(negative, 0.9958089590072632), (positive, 0.004191054962575436)]</td>
|
511 |
+
<td>positive</td>
|
512 |
+
</tr>
|
513 |
+
<tr>
|
514 |
+
<th>10</th>
|
515 |
+
<td>than recommended -- as visually bland as a dentist 's waiting room , complete with soothing muzak and a cushion of predictable narrative rhythms</td>
|
516 |
+
<td>[(negative, 0.9988711476325989), (positive, 0.0011287889210507274)]</td>
|
517 |
+
<td>positive</td>
|
518 |
+
</tr>
|
519 |
+
<tr>
|
520 |
+
<th>11</th>
|
521 |
+
<td>spectacle and</td>
|
522 |
+
<td>[(positive, 0.9941601753234863), (negative, 0.005839805118739605)]</td>
|
523 |
+
<td>negative</td>
|
524 |
+
</tr>
|
525 |
+
<tr>
|
526 |
+
<th>12</th>
|
527 |
+
<td>groan and</td>
|
528 |
+
<td>[(negative, 0.9987359642982483), (positive, 0.0012639997294172645)]</td>
|
529 |
+
<td>positive</td>
|
530 |
+
</tr>
|
531 |
+
<tr>
|
532 |
+
<th>13</th>
|
533 |
+
<td>'re not likely to have seen before , but beneath the exotic surface ( and exotic dancing ) it 's surprisingly old-fashioned .</td>
|
534 |
+
<td>[(positive, 0.9908103942871094), (negative, 0.009189637377858162)]</td>
|
535 |
+
<td>negative</td>
|
536 |
+
</tr>
|
537 |
+
<tr>
|
538 |
+
<th>14</th>
|
539 |
+
<td>its metaphors are opaque enough to avoid didacticism , and</td>
|
540 |
+
<td>[(negative, 0.990602970123291), (positive, 0.00939704105257988)]</td>
|
541 |
+
<td>positive</td>
|
542 |
+
</tr>
|
543 |
+
<tr>
|
544 |
+
<th>15</th>
|
545 |
+
<td>by kevin bray , whose crisp framing , edgy camera work , and wholesale ineptitude with acting , tone and pace very obviously mark him as a video helmer making his feature debut</td>
|
546 |
+
<td>[(positive, 0.9973387122154236), (negative, 0.0026612314395606518)]</td>
|
547 |
+
<td>negative</td>
|
548 |
+
</tr>
|
549 |
+
<tr>
|
550 |
+
<th>16</th>
|
551 |
+
<td>evokes the frustration , the awkwardness and the euphoria of growing up , without relying on the usual tropes .</td>
|
552 |
+
<td>[(positive, 0.9989104270935059), (negative, 0.0010896018939092755)]</td>
|
553 |
+
<td>negative</td>
|
554 |
+
</tr>
|
555 |
+
<tr>
|
556 |
+
<th>17</th>
|
557 |
+
<td>, incoherence and sub-sophomoric</td>
|
558 |
+
<td>[(negative, 0.9962475895881653), (positive, 0.003752368036657572)]</td>
|
559 |
+
<td>positive</td>
|
560 |
+
</tr>
|
561 |
+
<tr>
|
562 |
+
<th>18</th>
|
563 |
+
<td>seems intimidated by both her subject matter and the period trappings of this debut venture into the heritage business .</td>
|
564 |
+
<td>[(negative, 0.9923072457313538), (positive, 0.007692818529903889)]</td>
|
565 |
+
<td>positive</td>
|
566 |
+
</tr>
|
567 |
+
<tr>
|
568 |
+
<th>19</th>
|
569 |
+
<td>despite downplaying her good looks , carries a little too much ai n't - she-cute baggage into her lead role as a troubled and determined homicide cop to quite pull off the heavy stuff .</td>
|
570 |
+
<td>[(negative, 0.9948075413703918), (positive, 0.005192441400140524)]</td>
|
571 |
+
<td>positive</td>
|
572 |
+
</tr>
|
573 |
+
</tbody>
|
574 |
+
</table>
|
575 |
+
</div>
|
576 |
+
|
577 |
+
|
578 |
+
|
579 |
+
```python
|
580 |
+
# Get dataset slice with wrong predictions
|
581 |
+
df = rb.load("sst2", query="predicted:ko and score:{* TO 0.6}").to_pandas()
|
582 |
+
|
583 |
+
# display first 20 examples
|
584 |
+
with pd.option_context('display.max_colwidth', None):
|
585 |
+
display(df[["text", "prediction", "annotation"]].head(20))
|
586 |
+
```
|
587 |
+
|
588 |
+
|
589 |
+
<div>
|
590 |
+
<style scoped>
|
591 |
+
.dataframe tbody tr th:only-of-type {
|
592 |
+
vertical-align: middle;
|
593 |
+
}
|
594 |
+
|
595 |
+
.dataframe tbody tr th {
|
596 |
+
vertical-align: top;
|
597 |
+
}
|
598 |
+
|
599 |
+
.dataframe thead th {
|
600 |
+
text-align: right;
|
601 |
+
}
|
602 |
+
</style>
|
603 |
+
<table border="1" class="dataframe">
|
604 |
+
<thead>
|
605 |
+
<tr style="text-align: right;">
|
606 |
+
<th></th>
|
607 |
+
<th>text</th>
|
608 |
+
<th>prediction</th>
|
609 |
+
<th>annotation</th>
|
610 |
+
</tr>
|
611 |
+
</thead>
|
612 |
+
<tbody>
|
613 |
+
<tr>
|
614 |
+
<th>0</th>
|
615 |
+
<td>get on a board and , uh , shred ,</td>
|
616 |
+
<td>[(positive, 0.5352609753608704), (negative, 0.46473899483680725)]</td>
|
617 |
+
<td>negative</td>
|
618 |
+
</tr>
|
619 |
+
<tr>
|
620 |
+
<th>1</th>
|
621 |
+
<td>is , truly and thankfully , a one-of-a-kind work</td>
|
622 |
+
<td>[(positive, 0.5819814801216125), (negative, 0.41801854968070984)]</td>
|
623 |
+
<td>negative</td>
|
624 |
+
</tr>
|
625 |
+
<tr>
|
626 |
+
<th>2</th>
|
627 |
+
<td>starts as a tart little lemon drop of a movie and</td>
|
628 |
+
<td>[(negative, 0.5641832947731018), (positive, 0.4358167052268982)]</td>
|
629 |
+
<td>positive</td>
|
630 |
+
</tr>
|
631 |
+
<tr>
|
632 |
+
<th>3</th>
|
633 |
+
<td>between flaccid satire and what</td>
|
634 |
+
<td>[(negative, 0.5532692074775696), (positive, 0.44673076272010803)]</td>
|
635 |
+
<td>positive</td>
|
636 |
+
</tr>
|
637 |
+
<tr>
|
638 |
+
<th>4</th>
|
639 |
+
<td>it certainly does n't feel like a film that strays past the two and a half mark</td>
|
640 |
+
<td>[(negative, 0.5386656522750854), (positive, 0.46133431792259216)]</td>
|
641 |
+
<td>positive</td>
|
642 |
+
</tr>
|
643 |
+
<tr>
|
644 |
+
<th>5</th>
|
645 |
+
<td>who liked there 's something about mary and both american pie movies</td>
|
646 |
+
<td>[(negative, 0.5086333751678467), (positive, 0.4913666248321533)]</td>
|
647 |
+
<td>positive</td>
|
648 |
+
</tr>
|
649 |
+
<tr>
|
650 |
+
<th>6</th>
|
651 |
+
<td>many good ideas as bad is the cold comfort that chin 's film serves up with style and empathy</td>
|
652 |
+
<td>[(positive, 0.557632327079773), (negative, 0.44236767292022705)]</td>
|
653 |
+
<td>negative</td>
|
654 |
+
</tr>
|
655 |
+
<tr>
|
656 |
+
<th>7</th>
|
657 |
+
<td>about its ideas and</td>
|
658 |
+
<td>[(positive, 0.518638551235199), (negative, 0.48136141896247864)]</td>
|
659 |
+
<td>negative</td>
|
660 |
+
</tr>
|
661 |
+
<tr>
|
662 |
+
<th>8</th>
|
663 |
+
<td>of a sick and evil woman</td>
|
664 |
+
<td>[(negative, 0.5554516315460205), (positive, 0.4445483684539795)]</td>
|
665 |
+
<td>positive</td>
|
666 |
+
</tr>
|
667 |
+
<tr>
|
668 |
+
<th>9</th>
|
669 |
+
<td>though this rude and crude film does deliver a few gut-busting laughs</td>
|
670 |
+
<td>[(positive, 0.5045541524887085), (negative, 0.4954459071159363)]</td>
|
671 |
+
<td>negative</td>
|
672 |
+
</tr>
|
673 |
+
<tr>
|
674 |
+
<th>10</th>
|
675 |
+
<td>to squeeze the action and our emotions into the all-too-familiar dramatic arc of the holocaust escape story</td>
|
676 |
+
<td>[(negative, 0.5050069093704224), (positive, 0.49499306082725525)]</td>
|
677 |
+
<td>positive</td>
|
678 |
+
</tr>
|
679 |
+
<tr>
|
680 |
+
<th>11</th>
|
681 |
+
<td>that throws a bunch of hot-button items in the viewer 's face and asks to be seen as hip , winking social commentary</td>
|
682 |
+
<td>[(negative, 0.5873904228210449), (positive, 0.41260960698127747)]</td>
|
683 |
+
<td>positive</td>
|
684 |
+
</tr>
|
685 |
+
<tr>
|
686 |
+
<th>12</th>
|
687 |
+
<td>'s soulful and unslick</td>
|
688 |
+
<td>[(positive, 0.5931627750396729), (negative, 0.40683719515800476)]</td>
|
689 |
+
<td>negative</td>
|
690 |
+
</tr>
|
691 |
+
</tbody>
|
692 |
+
</table>
|
693 |
+
</div>
|
694 |
+
|
695 |
+
|
696 |
+
|
697 |
+
```python
|
698 |
+
from rubrix.metrics.commons import *
|
699 |
+
```
|
700 |
+
|
701 |
+
|
702 |
+
```python
|
703 |
+
text_length("sst2", query="predicted:ko").visualize()
|
704 |
+
```
|
705 |
+
|
706 |
+
|
707 |
+
<div> <div id="69fd8db0-ad05-4a8f-b29a-74d01faccda8" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("69fd8db0-ad05-4a8f-b29a-74d01faccda8")) { Plotly.newPlot( "69fd8db0-ad05-4a8f-b29a-74d01faccda8", [{"type":"bar","x":[5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0],"y":[9,3,5,9,11,17,20,15,17,10,14,14,10,15,16,13,13,17,15,11,14,8,11,9,9,17,11,16,11,11,7,15,6,12,5,5,5,10,5,7,7,4,8,5,5,6,5,5,6,7,5,5,7,6,8,5,5,5,7,2,2,1,4,1,4,4,4,2,4,2,4,6,4,4,5,9,4,1,2,2,1,0,1,5,2,3,4,4,3,3,1,0,1,2,3,2,4,1,3,1,2,3,3,4,1,2,1,3,2,0,1,2,1,1,3,1,3,1,2,2,3,1,2,0,4,1,1,1,0,1,1,1,0,1,1,0,3,1,0,1,2,0,1,0,2,0,0,1,0,2,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,0,0,0,1,2,0,0,2,0,0,1,0,0,1,1,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]}], {"template":{"data":{"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"#E5ECF6","showlakes":true,"showland":true,"subunitcolor":"white"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2}}},"title":{"text":"Computes the input text length distribution"},"xaxis":{"title":{"text":""}},"yaxis":{"title":{"text":""}}}, {"responsive": true} ).then(function(){
|
708 |
+
|
709 |
+
var gd = document.getElementById('69fd8db0-ad05-4a8f-b29a-74d01faccda8');
|
710 |
+
var x = new MutationObserver(function (mutations, observer) {{
|
711 |
+
var display = window.getComputedStyle(gd).display;
|
712 |
+
if (!display || display === 'none') {{
|
713 |
+
console.log([gd, 'removed!']);
|
714 |
+
Plotly.purge(gd);
|
715 |
+
observer.disconnect();
|
716 |
+
}}
|
717 |
+
}});
|
718 |
+
|
719 |
+
// Listen for the removal of the full notebook cells
|
720 |
+
var notebookContainer = gd.closest('#notebook-container');
|
721 |
+
if (notebookContainer) {{
|
722 |
+
x.observe(notebookContainer, {childList: true});
|
723 |
+
}}
|
724 |
+
|
725 |
+
// Listen for the clearing of the current output cell
|
726 |
+
var outputEl = gd.closest('.output');
|
727 |
+
if (outputEl) {{
|
728 |
+
x.observe(outputEl, {childList: true});
|
729 |
+
}}
|
730 |
+
|
731 |
+
}) }; }); </script> </div>
|
732 |
+
|
733 |
+
|
734 |
+
|
735 |
+
```python
|
736 |
+
text_length("sst2", query="predicted:ok").visualize()
|
737 |
+
```
|
738 |
+
|
739 |
+
|
740 |
+
<div> <div id="74d4b898-a8ff-4acd-baac-4ba913de0ec8" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("74d4b898-a8ff-4acd-baac-4ba913de0ec8")) { Plotly.newPlot( "74d4b898-a8ff-4acd-baac-4ba913de0ec8", [{"type":"bar","x":[2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0],"y":[3,10,80,247,413,590,722,917,1053,1054,1092,1106,1188,1173,1243,1202,1255,1274,1239,1303,1208,1188,1137,1052,1031,984,965,921,904,875,834,808,857,736,811,721,723,714,652,650,612,652,606,612,603,546,550,554,472,536,506,490,473,480,526,471,434,423,389,434,417,403,401,380,381,371,391,353,341,328,340,339,334,291,310,325,296,292,313,290,308,297,257,279,295,265,258,270,239,250,243,247,246,215,220,237,203,199,219,204,209,212,201,197,189,184,185,181,178,183,178,182,157,159,143,153,143,155,146,147,138,142,139,136,143,144,116,137,107,126,105,108,115,101,122,97,87,97,91,101,90,83,82,89,95,87,100,70,81,74,81,68,78,73,72,75,68,60,61,55,66,76,53,55,58,58,54,46,48,51,56,61,51,40,47,32,35,46,35,34,45,37,27,30,36,25,34,30,30,26,32,24,27,17,16,18,21,17,9,18,15,20,21,20,18,16,15,18,14,21,14,17,18,16,15,10,13,9,14,6,14,4,10,9,6,6,7,11,7,7,4,8,8,6,6,5,4,4,6,4,5,1,1,6,4,5,5,7,4,6,8,3,1,6,2,3,2,5,4,4,1,0,0,0,0,0,1]}], {"template":{"data":{"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"#E5ECF6","showlakes":true,"showland":true,"subunitcolor":"white"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2}}},"title":{"text":"Computes the input text length distribution"},"xaxis":{"title":{"text":""}},"yaxis":{"title":{"text":""}}}, {"responsive": true} ).then(function(){
|
741 |
+
|
742 |
+
var gd = document.getElementById('74d4b898-a8ff-4acd-baac-4ba913de0ec8');
|
743 |
+
var x = new MutationObserver(function (mutations, observer) {{
|
744 |
+
var display = window.getComputedStyle(gd).display;
|
745 |
+
if (!display || display === 'none') {{
|
746 |
+
console.log([gd, 'removed!']);
|
747 |
+
Plotly.purge(gd);
|
748 |
+
observer.disconnect();
|
749 |
+
}}
|
750 |
+
}});
|
751 |
+
|
752 |
+
// Listen for the removal of the full notebook cells
|
753 |
+
var notebookContainer = gd.closest('#notebook-container');
|
754 |
+
if (notebookContainer) {{
|
755 |
+
x.observe(notebookContainer, {childList: true});
|
756 |
+
}}
|
757 |
+
|
758 |
+
// Listen for the clearing of the current output cell
|
759 |
+
var outputEl = gd.closest('.output');
|
760 |
+
if (outputEl) {{
|
761 |
+
x.observe(outputEl, {childList: true});
|
762 |
+
}}
|
763 |
+
|
764 |
+
}) }; }); </script> </div>
|
765 |
+
|
766 |
+
|
767 |
+
|
768 |
+
```python
|
769 |
+
text_length("sst2").visualize()
|
770 |
+
```
|
771 |
+
|
772 |
+
|
773 |
+
<div> <div id="6c039f9e-bc30-4e48-92d6-99d7b24347f9" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("6c039f9e-bc30-4e48-92d6-99d7b24347f9")) { Plotly.newPlot( "6c039f9e-bc30-4e48-92d6-99d7b24347f9", [{"type":"bar","x":[2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0],"y":[3,10,80,256,416,595,731,928,1070,1074,1107,1123,1198,1187,1257,1212,1270,1290,1252,1316,1225,1203,1148,1066,1039,995,974,930,921,886,850,819,868,743,826,727,735,719,657,655,622,657,613,619,607,554,555,559,478,541,511,496,480,485,531,478,440,431,394,439,422,410,403,382,382,375,392,357,345,332,342,343,336,295,316,329,300,297,322,294,309,299,259,280,295,266,263,272,242,254,247,250,249,216,220,238,205,202,221,208,210,215,202,199,192,187,189,182,180,184,181,184,157,160,145,154,144,158,147,150,139,144,141,139,144,146,116,141,108,127,106,108,116,102,123,97,88,98,91,104,91,83,83,91,95,88,100,72,81,74,82,68,80,74,72,76,68,61,62,55,66,77,53,55,59,59,54,47,49,52,56,61,51,40,48,34,35,46,37,34,45,38,27,30,37,26,34,31,30,26,33,24,27,17,17,18,21,18,9,18,15,20,21,20,18,17,15,18,14,21,15,17,18,16,15,11,13,9,14,6,14,4,10,9,6,6,8,11,7,8,4,8,8,6,6,5,4,4,6,4,5,1,1,6,5,5,5,7,4,6,8,3,1,6,2,3,2,5,4,4,1,0,0,0,0,0,1]}], {"template":{"data":{"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"#E5ECF6","showlakes":true,"showland":true,"subunitcolor":"white"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2}}},"title":{"text":"Computes the input text length distribution"},"xaxis":{"title":{"text":""}},"yaxis":{"title":{"text":""}}}, {"responsive": true} ).then(function(){
|
774 |
+
|
775 |
+
var gd = document.getElementById('6c039f9e-bc30-4e48-92d6-99d7b24347f9');
|
776 |
+
var x = new MutationObserver(function (mutations, observer) {{
|
777 |
+
var display = window.getComputedStyle(gd).display;
|
778 |
+
if (!display || display === 'none') {{
|
779 |
+
console.log([gd, 'removed!']);
|
780 |
+
Plotly.purge(gd);
|
781 |
+
observer.disconnect();
|
782 |
+
}}
|
783 |
+
}});
|
784 |
+
|
785 |
+
// Listen for the removal of the full notebook cells
|
786 |
+
var notebookContainer = gd.closest('#notebook-container');
|
787 |
+
if (notebookContainer) {{
|
788 |
+
x.observe(notebookContainer, {childList: true});
|
789 |
+
}}
|
790 |
+
|
791 |
+
// Listen for the clearing of the current output cell
|
792 |
+
var outputEl = gd.closest('.output');
|
793 |
+
if (outputEl) {{
|
794 |
+
x.observe(outputEl, {childList: true});
|
795 |
+
}}
|
796 |
+
|
797 |
+
}) }; }); </script> </div>
|
798 |
+
|
799 |
+
|
800 |
+
|
801 |
+
```python
|
802 |
+
text_length("sst2", query="predicted_as:negative").visualize()
|
803 |
+
```
|
804 |
+
|
805 |
+
|
806 |
+
<div> <div id="d6bffdcd-d607-4241-9a03-2d1ff9b19461" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("d6bffdcd-d607-4241-9a03-2d1ff9b19461")) { Plotly.newPlot( "d6bffdcd-d607-4241-9a03-2d1ff9b19461", [{"type":"bar","x":[2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0],"y":[2,3,36,134,213,304,335,416,483,448,490,428,485,487,522,478,497,498,490,513,457,469,474,419,431,407,381,409,385,376,337,339,371,316,366,319,307,325,299,275,279,301,298,277,290,251,239,280,220,261,239,233,236,223,271,251,197,226,180,207,198,190,197,192,174,172,184,175,171,155,175,157,174,145,152,152,147,129,155,151,148,145,119,149,150,124,123,138,104,127,123,111,135,111,90,126,107,93,98,94,89,112,95,94,90,88,89,79,94,91,91,84,67,75,65,75,74,75,74,64,60,78,59,62,63,72,52,63,52,60,49,52,57,50,54,44,36,54,41,49,50,40,43,51,57,45,45,35,41,38,37,35,38,39,31,40,30,24,34,18,26,36,26,30,34,29,25,21,23,20,24,30,28,14,29,14,20,19,16,12,22,14,15,7,20,8,20,15,12,12,8,11,12,8,9,11,9,10,3,8,7,7,10,9,4,9,5,7,4,7,9,8,8,8,8,7,1,1,4,2,6,2,5,2,2,3,4,2,3,3,0,3,3,3,3,2,1,1,1,2,2,0,0,1,3,1,5,3,2,4,4,1,0,2,0,0,1,3,0,1]}], {"template":{"data":{"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"#E5ECF6","showlakes":true,"showland":true,"subunitcolor":"white"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2}}},"title":{"text":"Computes the input text length distribution"},"xaxis":{"title":{"text":""}},"yaxis":{"title":{"text":""}}}, {"responsive": true} ).then(function(){
|
807 |
+
|
808 |
+
var gd = document.getElementById('d6bffdcd-d607-4241-9a03-2d1ff9b19461');
|
809 |
+
var x = new MutationObserver(function (mutations, observer) {{
|
810 |
+
var display = window.getComputedStyle(gd).display;
|
811 |
+
if (!display || display === 'none') {{
|
812 |
+
console.log([gd, 'removed!']);
|
813 |
+
Plotly.purge(gd);
|
814 |
+
observer.disconnect();
|
815 |
+
}}
|
816 |
+
}});
|
817 |
+
|
818 |
+
// Listen for the removal of the full notebook cells
|
819 |
+
var notebookContainer = gd.closest('#notebook-container');
|
820 |
+
if (notebookContainer) {{
|
821 |
+
x.observe(notebookContainer, {childList: true});
|
822 |
+
}}
|
823 |
+
|
824 |
+
// Listen for the clearing of the current output cell
|
825 |
+
var outputEl = gd.closest('.output');
|
826 |
+
if (outputEl) {{
|
827 |
+
x.observe(outputEl, {childList: true});
|
828 |
+
}}
|
829 |
+
|
830 |
+
}) }; }); </script> </div>
|
831 |
+
|
832 |
+
|
833 |
+
|
834 |
+
```python
|
835 |
+
text_length("sst2", query="predicted_as:positive").visualize()
|
836 |
+
```
|
837 |
+
|
838 |
+
|
839 |
+
<div> <div id="7967280f-41e1-4c3c-9655-6595fc09867e" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("7967280f-41e1-4c3c-9655-6595fc09867e")) { Plotly.newPlot( "7967280f-41e1-4c3c-9655-6595fc09867e", [{"type":"bar","x":[2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0],"y":[1,7,44,122,203,291,396,512,587,626,617,695,713,700,735,734,773,792,762,803,768,734,674,647,608,588,593,521,536,510,513,480,497,427,460,408,428,394,358,380,343,356,315,342,317,303,316,279,258,280,272,263,244,262,260,227,243,205,214,232,224,220,206,190,208,203,208,182,174,177,167,186,162,150,164,177,153,168,167,143,161,154,140,131,145,142,140,134,138,127,124,139,114,105,130,112,98,109,123,114,121,103,107,105,102,99,100,103,86,93,90,100,90,85,80,79,70,83,73,86,79,66,82,77,81,74,64,78,56,67,57,56,59,52,69,53,52,44,50,55,41,43,40,40,38,43,55,37,40,36,45,33,42,35,41,36,38,37,28,37,40,41,27,25,25,30,29,26,26,32,32,31,23,26,19,20,15,27,21,22,23,24,12,23,17,18,14,16,18,14,25,13,15,9,8,7,12,8,6,10,8,13,11,11,14,8,10,11,10,14,6,9,10,8,7,4,12,8,10,4,8,2,5,7,4,3,4,9,4,5,4,5,5,3,3,3,3,3,5,2,3,1,1,5,2,4,0,4,2,2,4,2,1,4,2,3,1,2,4,3,1,0,0,0,0,0,1]}], {"template":{"data":{"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"#E5ECF6","showlakes":true,"showland":true,"subunitcolor":"white"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","gridwidth":2,"linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"bgcolor":"#E5ECF6","caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","zerolinewidth":2}}},"title":{"text":"Computes the input text length distribution"},"xaxis":{"title":{"text":""}},"yaxis":{"title":{"text":""}}}, {"responsive": true} ).then(function(){
|
840 |
+
|
841 |
+
var gd = document.getElementById('7967280f-41e1-4c3c-9655-6595fc09867e');
|
842 |
+
var x = new MutationObserver(function (mutations, observer) {{
|
843 |
+
var display = window.getComputedStyle(gd).display;
|
844 |
+
if (!display || display === 'none') {{
|
845 |
+
console.log([gd, 'removed!']);
|
846 |
+
Plotly.purge(gd);
|
847 |
+
observer.disconnect();
|
848 |
+
}}
|
849 |
+
}});
|
850 |
+
|
851 |
+
// Listen for the removal of the full notebook cells
|
852 |
+
var notebookContainer = gd.closest('#notebook-container');
|
853 |
+
if (notebookContainer) {{
|
854 |
+
x.observe(notebookContainer, {childList: true});
|
855 |
+
}}
|
856 |
+
|
857 |
+
// Listen for the clearing of the current output cell
|
858 |
+
var outputEl = gd.closest('.output');
|
859 |
+
if (outputEl) {{
|
860 |
+
x.observe(outputEl, {childList: true});
|
861 |
+
}}
|
862 |
+
|
863 |
+
}) }; }); </script> </div>
|
864 |
+
|