modelId
stringlengths 4
122
| author
stringlengths 2
42
⌀ | last_modified
unknown | downloads
int64 0
74.7M
| likes
int64 0
9.67k
| library_name
stringlengths 2
84
⌀ | tags
sequence | pipeline_tag
stringlengths 5
30
⌀ | createdAt
unknown | card
stringlengths 1
901k
| embedding
sequence |
---|---|---|---|---|---|---|---|---|---|---|
jonatasgrosman/wav2vec2-large-xlsr-53-english | jonatasgrosman | "2023-03-25T10:56:55Z" | 74,653,058 | 317 | transformers | [
"transformers",
"pytorch",
"jax",
"safetensors",
"wav2vec2",
"automatic-speech-recognition",
"audio",
"en",
"hf-asr-leaderboard",
"mozilla-foundation/common_voice_6_0",
"robust-speech-event",
"speech",
"xlsr-fine-tuning-week",
"dataset:common_voice",
"dataset:mozilla-foundation/common_voice_6_0",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | automatic-speech-recognition | "2022-03-02T23:29:05Z" | ---
language: en
datasets:
- common_voice
- mozilla-foundation/common_voice_6_0
metrics:
- wer
- cer
tags:
- audio
- automatic-speech-recognition
- en
- hf-asr-leaderboard
- mozilla-foundation/common_voice_6_0
- robust-speech-event
- speech
- xlsr-fine-tuning-week
license: apache-2.0
model-index:
- name: XLSR Wav2Vec2 English by Jonatas Grosman
results:
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Common Voice en
type: common_voice
args: en
metrics:
- name: Test WER
type: wer
value: 19.06
- name: Test CER
type: cer
value: 7.69
- name: Test WER (+LM)
type: wer
value: 14.81
- name: Test CER (+LM)
type: cer
value: 6.84
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Robust Speech Event - Dev Data
type: speech-recognition-community-v2/dev_data
args: en
metrics:
- name: Dev WER
type: wer
value: 27.72
- name: Dev CER
type: cer
value: 11.65
- name: Dev WER (+LM)
type: wer
value: 20.85
- name: Dev CER (+LM)
type: cer
value: 11.01
---
# Fine-tuned XLSR-53 large model for speech recognition in English
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) on English using the train and validation splits of [Common Voice 6.1](https://huggingface.co/datasets/common_voice).
When using this model, make sure that your speech input is sampled at 16kHz.
This model has been fine-tuned thanks to the GPU credits generously given by the [OVHcloud](https://www.ovhcloud.com/en/public-cloud/ai-training/) :)
The script used for training can be found here: https://github.com/jonatasgrosman/wav2vec2-sprint
## Usage
The model can be used directly (without a language model) as follows...
Using the [HuggingSound](https://github.com/jonatasgrosman/huggingsound) library:
```python
from huggingsound import SpeechRecognitionModel
model = SpeechRecognitionModel("jonatasgrosman/wav2vec2-large-xlsr-53-english")
audio_paths = ["/path/to/file.mp3", "/path/to/another_file.wav"]
transcriptions = model.transcribe(audio_paths)
```
Writing your own inference script:
```python
import torch
import librosa
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
LANG_ID = "en"
MODEL_ID = "jonatasgrosman/wav2vec2-large-xlsr-53-english"
SAMPLES = 10
test_dataset = load_dataset("common_voice", LANG_ID, split=f"test[:{SAMPLES}]")
processor = Wav2Vec2Processor.from_pretrained(MODEL_ID)
model = Wav2Vec2ForCTC.from_pretrained(MODEL_ID)
# Preprocessing the datasets.
# We need to read the audio files as arrays
def speech_file_to_array_fn(batch):
speech_array, sampling_rate = librosa.load(batch["path"], sr=16_000)
batch["speech"] = speech_array
batch["sentence"] = batch["sentence"].upper()
return batch
test_dataset = test_dataset.map(speech_file_to_array_fn)
inputs = processor(test_dataset["speech"], sampling_rate=16_000, return_tensors="pt", padding=True)
with torch.no_grad():
logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
predicted_ids = torch.argmax(logits, dim=-1)
predicted_sentences = processor.batch_decode(predicted_ids)
for i, predicted_sentence in enumerate(predicted_sentences):
print("-" * 100)
print("Reference:", test_dataset[i]["sentence"])
print("Prediction:", predicted_sentence)
```
| Reference | Prediction |
| ------------- | ------------- |
| "SHE'LL BE ALL RIGHT." | SHE'LL BE ALL RIGHT |
| SIX | SIX |
| "ALL'S WELL THAT ENDS WELL." | ALL AS WELL THAT ENDS WELL |
| DO YOU MEAN IT? | DO YOU MEAN IT |
| THE NEW PATCH IS LESS INVASIVE THAN THE OLD ONE, BUT STILL CAUSES REGRESSIONS. | THE NEW PATCH IS LESS INVASIVE THAN THE OLD ONE BUT STILL CAUSES REGRESSION |
| HOW IS MOZILLA GOING TO HANDLE AMBIGUITIES LIKE QUEUE AND CUE? | HOW IS MOSLILLAR GOING TO HANDLE ANDBEWOOTH HIS LIKE Q AND Q |
| "I GUESS YOU MUST THINK I'M KINDA BATTY." | RUSTIAN WASTIN PAN ONTE BATTLY |
| NO ONE NEAR THE REMOTE MACHINE YOU COULD RING? | NO ONE NEAR THE REMOTE MACHINE YOU COULD RING |
| SAUCE FOR THE GOOSE IS SAUCE FOR THE GANDER. | SAUCE FOR THE GUICE IS SAUCE FOR THE GONDER |
| GROVES STARTED WRITING SONGS WHEN SHE WAS FOUR YEARS OLD. | GRAFS STARTED WRITING SONGS WHEN SHE WAS FOUR YEARS OLD |
## Evaluation
1. To evaluate on `mozilla-foundation/common_voice_6_0` with split `test`
```bash
python eval.py --model_id jonatasgrosman/wav2vec2-large-xlsr-53-english --dataset mozilla-foundation/common_voice_6_0 --config en --split test
```
2. To evaluate on `speech-recognition-community-v2/dev_data`
```bash
python eval.py --model_id jonatasgrosman/wav2vec2-large-xlsr-53-english --dataset speech-recognition-community-v2/dev_data --config en --split validation --chunk_length_s 5.0 --stride_length_s 1.0
```
## Citation
If you want to cite this model you can use this:
```bibtex
@misc{grosman2021xlsr53-large-english,
title={Fine-tuned {XLSR}-53 large model for speech recognition in {E}nglish},
author={Grosman, Jonatas},
howpublished={\url{https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-english}},
year={2021}
}
``` | [
-0.2986782491207123,
-0.6198410987854004,
0.15314045548439026,
0.2171814888715744,
-0.08972680568695068,
-0.23627611994743347,
-0.350484162569046,
-0.6717195510864258,
0.13748575747013092,
0.3199954330921173,
-0.6518785357475281,
-0.41586291790008545,
-0.39903849363327026,
0.015393895097076893,
-0.3665079176425934,
0.9975103139877319,
0.21018993854522705,
0.22382068634033203,
-0.09696667641401291,
-0.08423786610364914,
-0.27943485975265503,
-0.33491969108581543,
-0.7773143649101257,
-0.32999029755592346,
0.4395226538181305,
0.2611736059188843,
0.25250983238220215,
0.42460256814956665,
0.34895116090774536,
0.3476226329803467,
-0.3549373149871826,
0.03305350989103317,
-0.3104589581489563,
-0.0212837066501379,
0.09455720335245132,
-0.4107545018196106,
-0.3818243741989136,
0.1320345103740692,
0.6943532228469849,
0.486592561006546,
-0.21025298535823822,
0.26065292954444885,
-0.016902294009923935,
0.40338200330734253,
-0.2634701728820801,
0.141378253698349,
-0.5906783938407898,
-0.1726924180984497,
-0.12648864090442657,
0.12337321043014526,
-0.42482107877731323,
-0.18928129971027374,
0.20443974435329437,
-0.4765270948410034,
0.18078280985355377,
-0.034663278609514236,
0.9162636995315552,
0.1835038661956787,
-0.15233512222766876,
-0.31887269020080566,
-0.63443523645401,
0.9189004302024841,
-0.8846392631530762,
0.41991135478019714,
0.5213688611984253,
0.20340502262115479,
-0.14791318774223328,
-0.8956807255744934,
-0.5943350791931152,
-0.27512702345848083,
0.1304752081632614,
0.17528267204761505,
-0.47049152851104736,
-0.04430117830634117,
0.4220830798149109,
0.19964104890823364,
-0.7087526917457581,
0.06678150594234467,
-0.8153592348098755,
-0.4629441499710083,
0.6618533730506897,
-0.12358815222978592,
0.15854540467262268,
-0.18141716718673706,
-0.17811861634254456,
-0.39459121227264404,
-0.30910006165504456,
0.3477388918399811,
0.43806421756744385,
0.4730299413204193,
-0.49829795956611633,
0.47403767704963684,
-0.06838540732860565,
0.6962615251541138,
0.009966463781893253,
-0.4113371968269348,
0.7869434356689453,
-0.24690064787864685,
-0.25855210423469543,
0.13378846645355225,
1.0088038444519043,
0.13556356728076935,
0.34302932024002075,
-0.02021957002580166,
-0.15402960777282715,
0.2147393524646759,
-0.19042803347110748,
-0.648216962814331,
-0.28921422362327576,
0.45159950852394104,
-0.24895897507667542,
-0.18135996162891388,
-0.05269762501120567,
-0.5286544561386108,
-0.057065535336732864,
-0.18467400968074799,
0.588241696357727,
-0.5805453658103943,
-0.15850499272346497,
0.2193111777305603,
-0.2858376204967499,
0.07301050424575806,
0.0007727051270194352,
-0.839114248752594,
0.22724127769470215,
0.4483632743358612,
0.8111897110939026,
0.18051454424858093,
-0.3589932322502136,
-0.5964868664741516,
-0.19940385222434998,
-0.10326903313398361,
0.5722023844718933,
-0.34661203622817993,
-0.18877056241035461,
-0.1909628063440323,
0.11381758004426956,
-0.21804486215114594,
-0.5073392987251282,
0.6515127420425415,
-0.10460477322340012,
0.41914796829223633,
-0.05236684903502464,
-0.5074020624160767,
-0.1354503482580185,
-0.149649515748024,
-0.6243430376052856,
1.031459927558899,
-0.046794500201940536,
-0.7573160529136658,
0.010813926346600056,
-0.5949062705039978,
-0.5197463035583496,
-0.2937082052230835,
0.012780114077031612,
-0.4289485812187195,
-0.16905122995376587,
0.21448011696338654,
0.46237269043922424,
-0.2814592719078064,
0.09547995030879974,
-0.33662575483322144,
-0.2656092047691345,
0.4388526678085327,
-0.3542793095111847,
1.1121597290039062,
0.27087870240211487,
-0.3494134843349457,
-0.07301796972751617,
-0.8975836038589478,
0.1610541045665741,
0.047621335834264755,
-0.3717905879020691,
-0.04819667711853981,
0.017560608685016632,
0.31656962633132935,
0.08523821085691452,
0.17931397259235382,
-0.5976276993751526,
0.0014654628466814756,
-0.614433765411377,
0.7905967831611633,
0.42146942019462585,
-0.15546131134033203,
0.20447874069213867,
-0.4552643895149231,
0.3657873868942261,
-0.05136251822113991,
0.021297529339790344,
-0.13063421845436096,
-0.46401748061180115,
-0.7107483744621277,
-0.3216921389102936,
0.4357205927371979,
0.5563420057296753,
-0.30985310673713684,
0.6425613760948181,
-0.11694646626710892,
-0.8989133238792419,
-0.7820853590965271,
-0.09256067126989365,
0.41393378376960754,
0.4757053852081299,
0.5814088582992554,
0.006591297220438719,
-0.9113081097602844,
-0.7907305359840393,
0.011498488485813141,
-0.24447685480117798,
-0.007633310742676258,
0.3385224938392639,
0.5352473258972168,
-0.3783178925514221,
0.7726191282272339,
-0.4184335172176361,
-0.2570147216320038,
-0.3030078411102295,
0.1566770076751709,
0.3712730407714844,
0.6784137487411499,
0.46846580505371094,
-0.6553794145584106,
-0.270852267742157,
-0.1617184728384018,
-0.3559997081756592,
-0.15468795597553253,
-0.04935915395617485,
0.010483819991350174,
0.2456815540790558,
0.3896811902523041,
-0.6693896055221558,
0.15685676038265228,
0.5130443572998047,
-0.23564787209033966,
0.5594643354415894,
0.038618944585323334,
-0.027801185846328735,
-1.180784821510315,
0.08773595839738846,
0.16845133900642395,
-0.17358893156051636,
-0.5824664831161499,
-0.2833733558654785,
-0.13129979372024536,
0.096702940762043,
-0.4337015748023987,
0.44183459877967834,
-0.40935468673706055,
-0.1050172671675682,
0.013557040132582188,
0.2117810845375061,
-0.036025334149599075,
0.40796971321105957,
0.009446543641388416,
0.6838056445121765,
0.7252416610717773,
-0.47354066371917725,
0.5564007759094238,
0.306767076253891,
-0.5415226817131042,
0.11258982121944427,
-0.8776285648345947,
0.2970195412635803,
0.12199652194976807,
0.24489453434944153,
-1.048151969909668,
-0.14162577688694,
0.19185493886470795,
-0.8392744660377502,
0.22557507455348969,
0.024073060601949692,
-0.34525266289711,
-0.5161918997764587,
-0.1192438006401062,
0.18004055321216583,
0.713423490524292,
-0.36429768800735474,
0.4759060740470886,
0.5298364162445068,
-0.213980570435524,
-0.6317208409309387,
-0.8367033004760742,
-0.2283824235200882,
-0.19221854209899902,
-0.7377045154571533,
0.22683022916316986,
-0.2217472642660141,
-0.1877577006816864,
-0.1934467852115631,
-0.082353875041008,
-0.08891357481479645,
-0.08551476895809174,
0.2462691068649292,
0.23247334361076355,
-0.26210930943489075,
0.005972245242446661,
-0.07648825645446777,
0.048642370849847794,
0.09093841165304184,
-0.15815460681915283,
0.6357372999191284,
-0.17510710656642914,
-0.031857930123806,
-0.5054867267608643,
0.15823766589164734,
0.5950208306312561,
-0.3337579667568207,
0.39463216066360474,
0.8527372479438782,
-0.41629448533058167,
-0.017093902453780174,
-0.5835091471672058,
-0.09816961735486984,
-0.4319544732570648,
0.6522056460380554,
-0.18189257383346558,
-0.6936673521995544,
0.5910933613777161,
0.289909690618515,
0.038096047937870026,
0.568677544593811,
0.47606509923934937,
-0.20770931243896484,
0.9352326393127441,
0.35430315136909485,
-0.24338936805725098,
0.4886784553527832,
-0.4914666414260864,
-0.05727830156683922,
-0.8211593627929688,
-0.32320669293403625,
-0.7729519605636597,
-0.1822136491537094,
-0.3618621230125427,
-0.37603121995925903,
0.14087508618831635,
0.014635884203016758,
-0.20020610094070435,
0.48802492022514343,
-0.51412433385849,
0.32214581966400146,
0.5778658390045166,
0.12133043259382248,
-0.08252114802598953,
0.12852133810520172,
-0.20228826999664307,
0.024571146816015244,
-0.5485386848449707,
-0.3736940324306488,
0.9211391806602478,
0.5370057225227356,
0.7066537141799927,
-0.025219611823558807,
0.5813763737678528,
0.06679049134254456,
-0.2640549838542938,
-0.8020169734954834,
0.5317745804786682,
-0.2534148395061493,
-0.60774165391922,
-0.4264550805091858,
-0.3681277334690094,
-0.8700185418128967,
0.09740868955850601,
-0.22983814775943756,
-1.0082794427871704,
0.13122820854187012,
0.08270860463380814,
-0.47803282737731934,
0.08063732087612152,
-0.7765981554985046,
0.7623623013496399,
-0.07912284135818481,
-0.12893429398536682,
-0.1590723842382431,
-0.6812736392021179,
0.22125551104545593,
-0.019907431676983833,
0.17234158515930176,
-0.07736481726169586,
0.3546050786972046,
1.2538111209869385,
-0.2519017159938812,
0.7966378331184387,
-0.15204907953739166,
0.09728778898715973,
0.3778384327888489,
-0.36534127593040466,
0.4302418828010559,
-0.19053882360458374,
-0.26130610704421997,
0.24463464319705963,
0.3511280119419098,
-0.08890138566493988,
-0.35048708319664,
0.6122539639472961,
-0.9846289157867432,
-0.3356814384460449,
-0.4760555326938629,
-0.5616979598999023,
-0.17708618938922882,
0.15558043122291565,
0.6239392161369324,
0.6993443965911865,
-0.1813802570104599,
0.5063410997390747,
0.5151883363723755,
-0.18129345774650574,
0.4302307665348053,
0.43288177251815796,
-0.1433202028274536,
-0.6659262776374817,
0.6517324447631836,
0.27671241760253906,
0.25283509492874146,
0.24833694100379944,
0.2969081997871399,
-0.45287516713142395,
-0.4533565938472748,
-0.1934199184179306,
0.34662100672721863,
-0.5941426753997803,
-0.15330763161182404,
-0.6891378164291382,
-0.35012495517730713,
-0.8004909753799438,
0.18585599958896637,
-0.2550974190235138,
-0.38916125893592834,
-0.5578216314315796,
-0.06390836834907532,
0.5558496117591858,
0.5304879546165466,
-0.223955437541008,
0.2962989807128906,
-0.6371816992759705,
0.3087592124938965,
0.09282948076725006,
-0.004781326744705439,
-0.049881525337696075,
-0.9444093108177185,
-0.4232630431652069,
0.2850038707256317,
-0.17169438302516937,
-0.8396994471549988,
0.4433770179748535,
0.2507280111312866,
0.5512366890907288,
0.313508540391922,
0.017495105043053627,
0.7865803241729736,
-0.48180466890335083,
0.7982177138328552,
0.30825650691986084,
-1.0210087299346924,
0.6895948052406311,
-0.24274109303951263,
0.25371015071868896,
0.3235049843788147,
0.2743394672870636,
-0.6014912724494934,
-0.37604424357414246,
-0.6697672009468079,
-0.8172581791877747,
0.8910949230194092,
0.20079731941223145,
0.11626455187797546,
0.06288859993219376,
0.2040444016456604,
-0.10754847526550293,
0.023407157510519028,
-0.840846598148346,
-0.500673234462738,
-0.21322514116764069,
-0.30294644832611084,
-0.30097776651382446,
-0.23002608120441437,
-0.07328128814697266,
-0.5448387861251831,
0.9690173864364624,
0.14039231836795807,
0.4180555045604706,
0.2847486734390259,
0.04112531989812851,
-0.048080503940582275,
0.29813122749328613,
0.671032726764679,
0.30162549018859863,
-0.35610201954841614,
-0.0278564915060997,
0.21667809784412384,
-0.7018367648124695,
0.11883611977100372,
0.2867267429828644,
-0.03388841450214386,
0.10876311361789703,
0.578399121761322,
1.1345436573028564,
0.1437993198633194,
-0.560590922832489,
0.35557791590690613,
0.02208833210170269,
-0.35043513774871826,
-0.6593813300132751,
0.23197847604751587,
0.3068700432777405,
0.34671205282211304,
0.38781145215034485,
0.13256323337554932,
-0.0021431518252938986,
-0.49292054772377014,
0.17405900359153748,
0.28963199257850647,
-0.3625887930393219,
-0.27201202511787415,
0.5625240206718445,
0.10164352506399155,
-0.38014838099479675,
0.5060350298881531,
-0.013671793043613434,
-0.42422986030578613,
0.7633494734764099,
0.7033299803733826,
0.8232531547546387,
-0.31600138545036316,
0.0028847476933151484,
0.584790050983429,
0.37444940209388733,
-0.23922309279441833,
0.4571058750152588,
0.0915980190038681,
-0.7629279494285583,
-0.22903631627559662,
-0.584694504737854,
-0.18413381278514862,
0.45980507135391235,
-0.82528156042099,
0.36449316143989563,
-0.2850744128227234,
-0.25153064727783203,
0.38955068588256836,
0.11550334841012955,
-0.538318932056427,
0.31822359561920166,
0.21445724368095398,
1.1353727579116821,
-0.9384064674377441,
0.9942784309387207,
0.5284237861633301,
-0.46272408962249756,
-1.1762990951538086,
-0.06110510230064392,
-0.1514868289232254,
-0.6226325631141663,
0.44767385721206665,
0.23596569895744324,
-0.09687404334545135,
0.05542507395148277,
-0.6277317404747009,
-0.9426712989807129,
1.157207727432251,
0.4176265001296997,
-0.8710914254188538,
0.012620768509805202,
-0.12619316577911377,
0.48434364795684814,
-0.33097773790359497,
0.3943166732788086,
0.6652692556381226,
0.44938600063323975,
0.14017584919929504,
-1.0236495733261108,
-0.1660672128200531,
-0.38672205805778503,
-0.2355642318725586,
-0.1932877004146576,
-0.5488678216934204,
1.0418843030929565,
-0.3842390179634094,
-0.04526272043585777,
0.3107954263687134,
0.7612930536270142,
0.34709641337394714,
0.2712002694606781,
0.620022714138031,
0.5631112456321716,
1.0233745574951172,
-0.12065429240465164,
0.7486341595649719,
-0.12812015414237976,
0.4626574218273163,
1.1276955604553223,
-0.19988742470741272,
1.1474151611328125,
0.3412741720676422,
-0.34945565462112427,
0.48446422815322876,
0.6178076267242432,
-0.2664569616317749,
0.6101146936416626,
0.11182048171758652,
-0.14068658649921417,
-0.12413766980171204,
0.054287221282720566,
-0.6411028504371643,
0.6707635521888733,
0.20572364330291748,
-0.4231283664703369,
0.218197301030159,
0.18218274414539337,
0.15999644994735718,
-0.20935247838497162,
-0.15437228977680206,
0.5569646954536438,
0.14575035870075226,
-0.5796248316764832,
0.788615345954895,
-0.0015727928839623928,
0.8153071999549866,
-0.7043374180793762,
0.16110482811927795,
0.11699246615171432,
0.2503974437713623,
-0.292295902967453,
-0.6254711151123047,
0.12959617376327515,
0.14673586189746857,
-0.3989182114601135,
0.1426077038049698,
0.4524940848350525,
-0.677437424659729,
-0.6575196385383606,
0.4511633813381195,
0.11541418731212616,
0.40602099895477295,
0.058045320212841034,
-0.8304693698883057,
0.2566220760345459,
0.2882923185825348,
-0.3295007646083832,
0.10148648172616959,
0.2801743447780609,
0.31584563851356506,
0.5785358548164368,
0.6930896639823914,
0.3036825358867645,
-0.02816903218626976,
0.13342812657356262,
0.6159109473228455,
-0.5761343836784363,
-0.5816760063171387,
-0.6665089130401611,
0.4759324789047241,
0.021001338958740234,
-0.38168787956237793,
0.6274378895759583,
0.6625373959541321,
0.8250736594200134,
-0.05213620886206627,
0.9347538352012634,
-0.13355600833892822,
0.8594521284103394,
-0.629136860370636,
0.7655680179595947,
-0.5587387681007385,
0.11424879729747772,
-0.39014124870300293,
-0.6276368498802185,
-0.1058996319770813,
0.9717790484428406,
-0.3536848723888397,
0.17970246076583862,
0.635608971118927,
1.0537967681884766,
-0.03812592476606369,
-0.05532967671751976,
0.2992648482322693,
0.4988098442554474,
0.1466129869222641,
0.6269223093986511,
0.6231476068496704,
-0.6761100888252258,
0.7543044090270996,
-0.38176044821739197,
-0.05370482802391052,
-0.10703332722187042,
-0.6270663142204285,
-0.8217369318008423,
-0.8466417789459229,
-0.43048322200775146,
-0.6479923129081726,
-0.05438127741217613,
1.1425895690917969,
0.7034356594085693,
-0.9015206098556519,
-0.3503623306751251,
0.15816737711429596,
-0.09013473242521286,
-0.318254679441452,
-0.1995191127061844,
0.4134966731071472,
0.05100131034851074,
-0.8001829385757446,
0.4597160518169403,
-0.1746138334274292,
0.24971280992031097,
-0.15396428108215332,
-0.23781968653202057,
-0.25555965304374695,
0.04053744301199913,
0.2902785837650299,
0.3993755877017975,
-0.832990825176239,
-0.20064595341682434,
0.03673627972602844,
-0.2200442999601364,
0.04198840260505676,
0.2752811014652252,
-0.6402921080589294,
0.24390634894371033,
0.5282126665115356,
0.1776425987482071,
0.49302881956100464,
-0.27599161863327026,
0.2968326508998871,
-0.4963147044181824,
0.25545671582221985,
0.25214684009552,
0.6406504511833191,
0.4019564688205719,
-0.2162327766418457,
0.33743220567703247,
0.25802847743034363,
-0.5637114644050598,
-1.0040644407272339,
-0.10230687260627747,
-1.2319098711013794,
-0.0757783055305481,
1.3547230958938599,
-0.15593834221363068,
-0.2562968134880066,
0.06547924876213074,
-0.37746918201446533,
0.5581868886947632,
-0.5069282650947571,
0.43904703855514526,
0.6330015063285828,
-0.01731196604669094,
-0.09225611388683319,
-0.507113516330719,
0.4009893536567688,
0.3089853823184967,
-0.5233913064002991,
0.06346861273050308,
0.4463845491409302,
0.49223148822784424,
0.3013042211532593,
0.7021601796150208,
0.022719677537679672,
0.3620644211769104,
0.0656665787100792,
0.28791800141334534,
-0.13042610883712769,
-0.25736168026924133,
-0.5544470548629761,
-0.060197681188583374,
-0.12710784375667572,
-0.4306369125843048
] |
bert-base-uncased | null | "2023-06-30T01:42:19Z" | 55,618,661 | 1,219 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"coreml",
"onnx",
"safetensors",
"bert",
"fill-mask",
"exbert",
"en",
"dataset:bookcorpus",
"dataset:wikipedia",
"arxiv:1810.04805",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: apache-2.0
datasets:
- bookcorpus
- wikipedia
---
# BERT base model (uncased)
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
[this paper](https://arxiv.org/abs/1810.04805) and first released in
[this repository](https://github.com/google-research/bert). This model is uncased: it does not make a difference
between english and English.
Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it
was pretrained on the raw texts only, with no humans labeling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
was pretrained with two objectives:
- Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run
the entire masked sentence through the model and has to predict the masked words. This is different from traditional
recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like
GPT which internally masks the future tokens. It allows the model to learn a bidirectional representation of the
sentence.
- Next sentence prediction (NSP): the models concatenates two masked sentences as inputs during pretraining. Sometimes
they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to
predict if the two sentences were following each other or not.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences, for instance, you can train a standard
classifier using the features produced by the BERT model as inputs.
## Model variations
BERT has originally been released in base and large variations, for cased and uncased input text. The uncased models also strips out an accent markers.
Chinese and multilingual uncased and cased versions followed shortly after.
Modified preprocessing with whole word masking has replaced subpiece masking in a following work, with the release of two models.
Other 24 smaller models are released afterward.
The detailed release history can be found on the [google-research/bert readme](https://github.com/google-research/bert/blob/master/README.md) on github.
| Model | #params | Language |
|------------------------|--------------------------------|-------|
| [`bert-base-uncased`](https://huggingface.co/bert-base-uncased) | 110M | English |
| [`bert-large-uncased`](https://huggingface.co/bert-large-uncased) | 340M | English | sub
| [`bert-base-cased`](https://huggingface.co/bert-base-cased) | 110M | English |
| [`bert-large-cased`](https://huggingface.co/bert-large-cased) | 340M | English |
| [`bert-base-chinese`](https://huggingface.co/bert-base-chinese) | 110M | Chinese |
| [`bert-base-multilingual-cased`](https://huggingface.co/bert-base-multilingual-cased) | 110M | Multiple |
| [`bert-large-uncased-whole-word-masking`](https://huggingface.co/bert-large-uncased-whole-word-masking) | 340M | English |
| [`bert-large-cased-whole-word-masking`](https://huggingface.co/bert-large-cased-whole-word-masking) | 340M | English |
## Intended uses & limitations
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=bert) to look for
fine-tuned versions of a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='bert-base-uncased')
>>> unmasker("Hello I'm a [MASK] model.")
[{'sequence': "[CLS] hello i'm a fashion model. [SEP]",
'score': 0.1073106899857521,
'token': 4827,
'token_str': 'fashion'},
{'sequence': "[CLS] hello i'm a role model. [SEP]",
'score': 0.08774490654468536,
'token': 2535,
'token_str': 'role'},
{'sequence': "[CLS] hello i'm a new model. [SEP]",
'score': 0.05338378623127937,
'token': 2047,
'token_str': 'new'},
{'sequence': "[CLS] hello i'm a super model. [SEP]",
'score': 0.04667217284440994,
'token': 3565,
'token_str': 'super'},
{'sequence': "[CLS] hello i'm a fine model. [SEP]",
'score': 0.027095865458250046,
'token': 2986,
'token_str': 'fine'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertModel.from_pretrained("bert-base-uncased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = TFBertModel.from_pretrained("bert-base-uncased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
Even if the training data used for this model could be characterized as fairly neutral, this model can have biased
predictions:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='bert-base-uncased')
>>> unmasker("The man worked as a [MASK].")
[{'sequence': '[CLS] the man worked as a carpenter. [SEP]',
'score': 0.09747550636529922,
'token': 10533,
'token_str': 'carpenter'},
{'sequence': '[CLS] the man worked as a waiter. [SEP]',
'score': 0.0523831807076931,
'token': 15610,
'token_str': 'waiter'},
{'sequence': '[CLS] the man worked as a barber. [SEP]',
'score': 0.04962705448269844,
'token': 13362,
'token_str': 'barber'},
{'sequence': '[CLS] the man worked as a mechanic. [SEP]',
'score': 0.03788609802722931,
'token': 15893,
'token_str': 'mechanic'},
{'sequence': '[CLS] the man worked as a salesman. [SEP]',
'score': 0.037680890411138535,
'token': 18968,
'token_str': 'salesman'}]
>>> unmasker("The woman worked as a [MASK].")
[{'sequence': '[CLS] the woman worked as a nurse. [SEP]',
'score': 0.21981462836265564,
'token': 6821,
'token_str': 'nurse'},
{'sequence': '[CLS] the woman worked as a waitress. [SEP]',
'score': 0.1597415804862976,
'token': 13877,
'token_str': 'waitress'},
{'sequence': '[CLS] the woman worked as a maid. [SEP]',
'score': 0.1154729500412941,
'token': 10850,
'token_str': 'maid'},
{'sequence': '[CLS] the woman worked as a prostitute. [SEP]',
'score': 0.037968918681144714,
'token': 19215,
'token_str': 'prostitute'},
{'sequence': '[CLS] the woman worked as a cook. [SEP]',
'score': 0.03042375110089779,
'token': 5660,
'token_str': 'cook'}]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
The BERT model was pretrained on [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038
unpublished books and [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and
headers).
## Training procedure
### Preprocessing
The texts are lowercased and tokenized using WordPiece and a vocabulary size of 30,000. The inputs of the model are
then of the form:
```
[CLS] Sentence A [SEP] Sentence B [SEP]
```
With probability 0.5, sentence A and sentence B correspond to two consecutive sentences in the original corpus, and in
the other cases, it's another random sentence in the corpus. Note that what is considered a sentence here is a
consecutive span of text usually longer than a single sentence. The only constrain is that the result with the two
"sentences" has a combined length of less than 512 tokens.
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
### Pretraining
The model was trained on 4 cloud TPUs in Pod configuration (16 TPU chips total) for one million steps with a batch size
of 256. The sequence length was limited to 128 tokens for 90% of the steps and 512 for the remaining 10%. The optimizer
used is Adam with a learning rate of 1e-4, \\(\beta_{1} = 0.9\\) and \\(\beta_{2} = 0.999\\), a weight decay of 0.01,
learning rate warmup for 10,000 steps and linear decay of the learning rate after.
## Evaluation results
When fine-tuned on downstream tasks, this model achieves the following results:
Glue test results:
| Task | MNLI-(m/mm) | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE | Average |
|:----:|:-----------:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|:-------:|
| | 84.6/83.4 | 71.2 | 90.5 | 93.5 | 52.1 | 85.8 | 88.9 | 66.4 | 79.6 |
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1810-04805,
author = {Jacob Devlin and
Ming{-}Wei Chang and
Kenton Lee and
Kristina Toutanova},
title = {{BERT:} Pre-training of Deep Bidirectional Transformers for Language
Understanding},
journal = {CoRR},
volume = {abs/1810.04805},
year = {2018},
url = {http://arxiv.org/abs/1810.04805},
archivePrefix = {arXiv},
eprint = {1810.04805},
timestamp = {Tue, 30 Oct 2018 20:39:56 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1810-04805.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
<a href="https://huggingface.co/exbert/?model=bert-base-uncased">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.13803230226039886,
-0.6192845106124878,
0.1602371782064438,
0.3106997609138489,
-0.5290508270263672,
0.004081550054252148,
-0.12402311712503433,
-0.2276398241519928,
0.45079508423805237,
0.5585923194885254,
-0.5558132529258728,
-0.44755035638809204,
-0.7645061612129211,
0.14166030287742615,
-0.4733649790287018,
1.148371696472168,
0.2688816487789154,
0.30547770857810974,
0.06562762707471848,
0.1766130030155182,
-0.4065377414226532,
-0.8636099100112915,
-0.7098984718322754,
-0.3355167508125305,
0.44625410437583923,
0.301130086183548,
0.6639394760131836,
0.5381333231925964,
0.4197166860103607,
0.4168151021003723,
-0.05249226838350296,
-0.07084067910909653,
-0.27731427550315857,
0.06322961300611496,
-0.00021178112365305424,
-0.5025051832199097,
-0.4444476366043091,
0.20064224302768707,
0.5259288549423218,
0.8548062443733215,
-0.010065288282930851,
0.24754247069358826,
-0.10088975727558136,
0.5585716366767883,
-0.16587615013122559,
0.3540886342525482,
-0.5316713452339172,
0.06025778129696846,
-0.26823943853378296,
0.24264734983444214,
-0.3985133469104767,
-0.20217566192150116,
0.18782168626785278,
-0.5243902206420898,
0.2082635760307312,
0.11077828705310822,
1.1502846479415894,
0.0771172046661377,
-0.17582803964614868,
-0.12339440733194351,
-0.43010684847831726,
0.8277966380119324,
-0.8536105751991272,
0.2367546558380127,
0.48630964756011963,
0.1699536144733429,
-0.2450374811887741,
-1.0350950956344604,
-0.413485586643219,
-0.0921948254108429,
-0.19162693619728088,
0.05314605310559273,
-0.0641569197177887,
-0.06356833130121231,
0.2720750868320465,
0.4537912607192993,
-0.37581223249435425,
-0.004474344197660685,
-0.6792744398117065,
-0.3774593770503998,
0.7435230016708374,
0.039672356098890305,
0.3040522038936615,
-0.43387195467948914,
-0.28129276633262634,
-0.26633888483047485,
-0.3028049170970917,
0.10606717318296432,
0.5642017722129822,
0.4933895170688629,
-0.25006961822509766,
0.7612375020980835,
-0.1792728304862976,
0.6191464066505432,
0.01688656397163868,
0.047327153384685516,
0.48603883385658264,
-0.04496504366397858,
-0.3923715651035309,
-0.07834791392087936,
0.9605391025543213,
0.2836480438709259,
0.42018628120422363,
-0.054556574672460556,
-0.34588760137557983,
0.0443054735660553,
0.2645981013774872,
-0.5633383393287659,
-0.4026804268360138,
0.11370101571083069,
-0.549643337726593,
-0.38744768500328064,
0.4227326214313507,
-0.6604947447776794,
-0.07621705532073975,
-0.060126468539237976,
0.5579286217689514,
-0.3905485272407532,
-0.16956913471221924,
0.18657349050045013,
-0.4608735144138336,
0.19950851798057556,
0.041664645075798035,
-0.9312711954116821,
0.19922976195812225,
0.6141802072525024,
0.8026665449142456,
0.30812856554985046,
-0.14432315528392792,
-0.29118654131889343,
-0.2694643437862396,
-0.326515257358551,
0.4735011160373688,
-0.34595805406570435,
-0.43745896220207214,
0.05949565768241882,
0.3533850312232971,
-0.10637148469686508,
-0.265968382358551,
0.6752703785896301,
-0.446931391954422,
0.6121779084205627,
-0.06242600455880165,
-0.5242198705673218,
-0.3238929212093353,
0.08239806443452835,
-0.7492706775665283,
1.201371431350708,
0.3201073408126831,
-0.6582396030426025,
0.229852557182312,
-0.8943874835968018,
-0.6380015015602112,
0.20348364114761353,
0.18805637955665588,
-0.4074329435825348,
0.2053455263376236,
0.1839512288570404,
0.44387730956077576,
-0.06894975155591965,
0.29960963129997253,
-0.15718811750411987,
-0.3844466507434845,
0.33891263604164124,
-0.2425294816493988,
1.0848180055618286,
0.1899726390838623,
-0.31034615635871887,
0.13866448402404785,
-0.7879849076271057,
0.1007218286395073,
0.2578129470348358,
-0.33447548747062683,
-0.13029158115386963,
-0.08680806308984756,
0.3311668634414673,
0.16579510271549225,
0.46513912081718445,
-0.6448057293891907,
0.24545834958553314,
-0.6223706007003784,
0.7286659479141235,
0.7970157861709595,
-0.17365425825119019,
0.2620672881603241,
-0.36887744069099426,
0.4825612008571625,
-0.05050835758447647,
-0.007248491980135441,
-0.14747057855129242,
-0.8010455369949341,
-0.851518988609314,
-0.3559614419937134,
0.6865381002426147,
0.726710319519043,
-0.5411839485168457,
0.7902160882949829,
-0.006537196226418018,
-0.596182107925415,
-0.6670578718185425,
-0.11152021586894989,
0.37088698148727417,
0.37899619340896606,
0.30979764461517334,
-0.533173143863678,
-0.9129973649978638,
-0.8744640350341797,
-0.25047871470451355,
-0.23701751232147217,
-0.2505888044834137,
0.12031707912683487,
0.6274333596229553,
-0.3646758198738098,
0.7743611335754395,
-0.7045308351516724,
-0.4186187982559204,
-0.26631805300712585,
0.24213635921478271,
0.6435428261756897,
0.7099353075027466,
0.3796291649341583,
-0.5750983953475952,
-0.4169641137123108,
-0.324154794216156,
-0.5575422048568726,
0.02684909477829933,
0.028066780418157578,
-0.1787625104188919,
0.2370876669883728,
0.49473169445991516,
-0.7522984147071838,
0.4727226495742798,
0.36983442306518555,
-0.4928699731826782,
0.6715134978294373,
-0.362436980009079,
-0.11356937140226364,
-1.250749945640564,
0.12975919246673584,
-0.1310955137014389,
-0.29960164427757263,
-0.774731457233429,
0.019156020134687424,
-0.13041135668754578,
-0.04202144593000412,
-0.5415815711021423,
0.5360184907913208,
-0.4423709511756897,
0.0191937368363142,
0.047979485243558884,
-0.14482644200325012,
0.023336781188845634,
0.470146507024765,
0.08433414995670319,
0.5737142562866211,
0.5431128144264221,
-0.5083522200584412,
0.5514700412750244,
0.42513981461524963,
-0.6038205623626709,
0.04325557500123978,
-0.8492563366889954,
0.21954473853111267,
0.04548364132642746,
0.05990548059344292,
-1.1149646043777466,
-0.3303162157535553,
0.27873897552490234,
-0.6232832074165344,
0.20809611678123474,
-0.07152773439884186,
-0.7302897572517395,
-0.620027482509613,
-0.2606021463871002,
0.34765100479125977,
0.5946637988090515,
-0.2603442966938019,
0.4063154458999634,
0.365680068731308,
-0.1836359053850174,
-0.6123171448707581,
-0.7686065435409546,
0.15977489948272705,
-0.11707022786140442,
-0.5863004922866821,
0.404064804315567,
-0.0608481802046299,
-0.09529576450586319,
-0.17340660095214844,
0.10184448957443237,
-0.20623742043972015,
0.02789803221821785,
0.1768517941236496,
0.4897805154323578,
-0.20621058344841003,
-0.1057608351111412,
-0.19678594172000885,
-0.10988868027925491,
0.23276065289974213,
-0.16244132816791534,
0.8377106785774231,
-0.07657545804977417,
-0.04181939736008644,
-0.24167506396770477,
0.36952656507492065,
0.6050697565078735,
-0.13608558475971222,
0.695999264717102,
0.8310487270355225,
-0.6140307188034058,
0.033105071634054184,
-0.3995307385921478,
-0.18390792608261108,
-0.5213146805763245,
0.4942634403705597,
-0.43399935960769653,
-0.8381797671318054,
0.7833861112594604,
0.34849661588668823,
-0.08143581449985504,
0.7546888589859009,
0.6029271483421326,
-0.21474629640579224,
1.0599223375320435,
0.5761456489562988,
-0.1505657434463501,
0.48247769474983215,
-0.15521612763404846,
0.38251781463623047,
-0.7447612881660461,
-0.45286405086517334,
-0.378903865814209,
-0.2771838307380676,
-0.5448154211044312,
-0.1912003457546234,
0.1851719319820404,
0.23897941410541534,
-0.35970693826675415,
0.6736744046211243,
-0.6676099896430969,
0.36883699893951416,
0.9928874969482422,
0.29533851146698,
-0.18997572362422943,
-0.21365730464458466,
-0.2661430537700653,
-0.03410195931792259,
-0.43331629037857056,
-0.43053773045539856,
1.0891273021697998,
0.5258560180664062,
0.6876323819160461,
0.08992121368646622,
0.5852745175361633,
0.36235398054122925,
-0.025372585281729698,
-0.7080572843551636,
0.6369431018829346,
-0.4377203583717346,
-0.9314873814582825,
-0.38198694586753845,
-0.10531964898109436,
-1.019527554512024,
0.21792982518672943,
-0.27364882826805115,
-0.8726747035980225,
-0.049346961081027985,
-0.16987855732440948,
-0.31738296151161194,
0.18735308945178986,
-0.8154957294464111,
1.063266396522522,
-0.30788809061050415,
-0.04397705942392349,
0.17955242097377777,
-0.9496042132377625,
0.30020278692245483,
0.02491830475628376,
0.10428529977798462,
-0.15326043963432312,
0.2608059048652649,
1.0264408588409424,
-0.5369138717651367,
1.0577627420425415,
-0.1550064980983734,
0.13830135762691498,
0.05640077218413353,
-0.07377086579799652,
0.3263241648674011,
0.032165732234716415,
0.05158763751387596,
0.36999082565307617,
0.08234528452157974,
-0.46583008766174316,
-0.12367376685142517,
0.3621559143066406,
-0.7672803997993469,
-0.5192857980728149,
-0.6377155780792236,
-0.6551439166069031,
0.08852884918451309,
0.47268834710121155,
0.6279358267784119,
0.4953327476978302,
-0.12265525013208389,
0.2615515887737274,
0.44197818636894226,
-0.32497653365135193,
0.741146445274353,
0.3379362225532532,
-0.22434242069721222,
-0.49960091710090637,
0.6298332810401917,
0.02597065642476082,
0.001218059565871954,
0.4611663222312927,
0.19950424134731293,
-0.5875136852264404,
-0.20130164921283722,
-0.36512264609336853,
0.1676669418811798,
-0.5735356211662292,
-0.3025788962841034,
-0.5687260031700134,
-0.5465420484542847,
-0.7197433710098267,
-0.072560153901577,
-0.16257226467132568,
-0.5167579650878906,
-0.6162938475608826,
-0.14378760755062103,
0.4382334053516388,
0.7213014364242554,
-0.17281866073608398,
0.4753876328468323,
-0.7563353180885315,
0.25605273246765137,
0.30475765466690063,
0.4537714421749115,
-0.2705024182796478,
-0.7687344551086426,
-0.34043362736701965,
0.08024726063013077,
-0.1439378261566162,
-0.8297418355941772,
0.7260380387306213,
0.2486460953950882,
0.5426497459411621,
0.49578988552093506,
0.024633243680000305,
0.5968892574310303,
-0.6739686727523804,
1.0540086030960083,
0.2401708960533142,
-1.153200626373291,
0.5330343246459961,
-0.32598379254341125,
0.21797630190849304,
0.3011770248413086,
0.22431126236915588,
-0.6574682593345642,
-0.4019497036933899,
-0.8074560761451721,
-1.0247756242752075,
0.8381979465484619,
0.1609281599521637,
0.4190516173839569,
-0.11242090910673141,
0.16655801236629486,
0.14812050759792328,
0.39476969838142395,
-1.041975975036621,
-0.5461575388908386,
-0.5158277750015259,
-0.33655139803886414,
-0.20296330749988556,
-0.3151985704898834,
-0.019693691283464432,
-0.6300763487815857,
0.727076530456543,
0.14937016367912292,
0.5725984573364258,
0.10094742476940155,
-0.18628470599651337,
0.1293172985315323,
0.1872096061706543,
0.8267121911048889,
0.45797082781791687,
-0.5157629251480103,
-0.006592240184545517,
0.020187776535749435,
-0.6272589564323425,
-0.01710333488881588,
0.21679218113422394,
0.014369291253387928,
0.30381450057029724,
0.598061203956604,
0.8241206407546997,
0.23582832515239716,
-0.5537288188934326,
0.5959219336509705,
0.14761607348918915,
-0.3579786717891693,
-0.5576305389404297,
0.026883384212851524,
-0.02437056414783001,
0.13821454346179962,
0.4550849497318268,
0.11816008388996124,
0.05914558097720146,
-0.5740216970443726,
0.4041210412979126,
0.41118377447128296,
-0.5114649534225464,
-0.29843971133232117,
0.8397412896156311,
0.09546954184770584,
-0.6456993222236633,
0.8068605065345764,
-0.14229761064052582,
-0.8561726212501526,
0.7126699686050415,
0.7035050392150879,
0.9322277903556824,
-0.2229476124048233,
0.2760186791419983,
0.43370577692985535,
0.45213964581489563,
-0.20198273658752441,
0.4188247621059418,
0.34630557894706726,
-0.8748067617416382,
-0.3495137691497803,
-0.736834704875946,
-0.1827535778284073,
0.2765522301197052,
-0.759972095489502,
0.26115939021110535,
-0.5261656641960144,
-0.23699575662612915,
0.18006709218025208,
0.02379618026316166,
-0.6601823568344116,
0.44869792461395264,
0.08724547922611237,
1.0358158349990845,
-0.9742462635040283,
1.0324792861938477,
0.8221480846405029,
-0.6414117217063904,
-0.8539101481437683,
-0.38350430130958557,
-0.3086774945259094,
-1.1308364868164062,
0.6889258623123169,
0.3269229829311371,
0.3554723560810089,
-0.022916670888662338,
-0.6327846050262451,
-0.7568688988685608,
0.7499313950538635,
0.1916133314371109,
-0.4025214910507202,
-0.13277529180049896,
0.1345950812101364,
0.5803408026695251,
-0.5300600528717041,
0.4626650810241699,
0.5775376558303833,
0.45436519384384155,
-0.06818529218435287,
-0.8327579498291016,
0.021837491542100906,
-0.4765967130661011,
0.023729776963591576,
0.08987502008676529,
-0.46223533153533936,
1.216568112373352,
-0.11444200575351715,
0.017603972926735878,
0.23893287777900696,
0.5338529348373413,
-0.06901787966489792,
0.011596420779824257,
0.4904157221317291,
0.6117333769798279,
0.6960384845733643,
-0.38633623719215393,
0.770861804485321,
-0.22451025247573853,
0.5145083665847778,
0.8213747143745422,
0.05105041339993477,
0.8373885750770569,
0.35762903094291687,
-0.2934437692165375,
0.9487704038619995,
0.880486011505127,
-0.3376554846763611,
0.7527063488960266,
0.23257756233215332,
-0.06553570181131363,
-0.1104450523853302,
0.1182233914732933,
-0.3455437123775482,
0.545903205871582,
0.25505802035331726,
-0.5534180402755737,
0.02357511967420578,
-0.10636533796787262,
0.18903802335262299,
-0.1518721878528595,
-0.4198291301727295,
0.691628098487854,
0.17641650140285492,
-0.6685870885848999,
0.36400142312049866,
0.2801911532878876,
0.7953732013702393,
-0.607645571231842,
0.041489068418741226,
-0.14805099368095398,
0.22331134974956512,
-0.0938158705830574,
-0.8641371726989746,
0.20355632901191711,
-0.14123350381851196,
-0.44209229946136475,
-0.2721770703792572,
0.7503757476806641,
-0.5239772796630859,
-0.723527193069458,
0.08142466843128204,
0.29924848675727844,
0.3373708128929138,
-0.10271482914686203,
-0.8239246010780334,
-0.215070441365242,
0.0830790176987648,
-0.12995989620685577,
0.12743569910526276,
0.2892627716064453,
0.08834994584321976,
0.5474291443824768,
0.8160749077796936,
-0.10359161347150803,
0.14256630837917328,
0.04266558215022087,
0.6977064609527588,
-0.9694510698318481,
-0.7701188921928406,
-0.9321794509887695,
0.6415430903434753,
-0.09263905882835388,
-0.5593615770339966,
0.7003706097602844,
0.6768709421157837,
0.7594751715660095,
-0.4654989540576935,
0.5707240700721741,
-0.21403862535953522,
0.5640919208526611,
-0.37265148758888245,
0.8335179686546326,
-0.41798877716064453,
-0.04553958401083946,
-0.4268200993537903,
-0.8182873129844666,
-0.3529592752456665,
0.8702524304389954,
-0.09258705377578735,
0.04159963130950928,
0.668631911277771,
0.5820992588996887,
0.1025586724281311,
-0.12646803259849548,
0.21431341767311096,
0.1579786092042923,
0.07410673797130585,
0.39111486077308655,
0.5623519420623779,
-0.6589696407318115,
0.40491464734077454,
-0.21959789097309113,
-0.05869700759649277,
-0.34417280554771423,
-0.9021627902984619,
-1.0290415287017822,
-0.6258451342582703,
-0.21078313887119293,
-0.5663172602653503,
-0.22067217528820038,
0.928997278213501,
0.8050210475921631,
-1.0000182390213013,
-0.3264838457107544,
-0.012294024229049683,
0.10840906947851181,
-0.28127139806747437,
-0.29127371311187744,
0.44961288571357727,
-0.23365746438503265,
-0.8167203068733215,
0.2907901108264923,
-0.051477350294589996,
0.09820318222045898,
-0.15061800181865692,
0.060850951820611954,
-0.421030730009079,
0.13056331872940063,
0.6232578158378601,
0.16907155513763428,
-0.8316159248352051,
-0.48931288719177246,
0.09717779606580734,
-0.17640309035778046,
0.08165102452039719,
0.4374104142189026,
-0.5448010563850403,
0.38198283314704895,
0.41747260093688965,
0.41178444027900696,
0.5863814949989319,
0.03716285154223442,
0.7206695675849915,
-1.1450912952423096,
0.29506197571754456,
0.21344904601573944,
0.5399811267852783,
0.39847537875175476,
-0.4467317461967468,
0.5304557681083679,
0.4364199936389923,
-0.4442599415779114,
-0.8868696689605713,
-0.006893590558320284,
-0.9835314154624939,
-0.2902129292488098,
0.8685135245323181,
-0.16062860190868378,
-0.2914949059486389,
-0.08235326409339905,
-0.30138280987739563,
0.3749312460422516,
-0.37884536385536194,
0.7105657458305359,
0.926425576210022,
0.09532206505537033,
-0.17184488475322723,
-0.33588552474975586,
0.39867639541625977,
0.5001121759414673,
-0.46176016330718994,
-0.3737383484840393,
0.13817165791988373,
0.42050132155418396,
0.23567984998226166,
0.5459875464439392,
-0.08703693002462387,
0.10825204104185104,
0.1222139373421669,
0.30633780360221863,
-0.05102096125483513,
-0.13635864853858948,
-0.2577550709247589,
0.01983777992427349,
-0.15791550278663635,
-0.7027446031570435
] |
openai/clip-vit-large-patch14 | openai | "2023-09-15T15:49:35Z" | 31,237,964 | 734 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"clip",
"zero-shot-image-classification",
"vision",
"arxiv:2103.00020",
"arxiv:1908.04913",
"endpoints_compatible",
"has_space",
"region:us"
] | zero-shot-image-classification | "2022-03-02T23:29:05Z" | ---
tags:
- vision
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
candidate_labels: playing music, playing sports
example_title: Cat & Dog
---
# Model Card: CLIP
Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found [here](https://github.com/openai/CLIP/blob/main/model-card.md).
## Model Details
The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within.
### Model Date
January 2021
### Model Type
The base model uses a ViT-L/14 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss.
The original implementation had two variants: one using a ResNet image encoder and the other using a Vision Transformer. This repository has the variant with the Vision Transformer.
### Documents
- [Blog Post](https://openai.com/blog/clip/)
- [CLIP Paper](https://arxiv.org/abs/2103.00020)
### Use with Transformers
```python
from PIL import Image
import requests
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14")
processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=["a photo of a cat", "a photo of a dog"], images=image, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
```
## Model Use
### Intended Use
The model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such models - the CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.
#### Primary intended uses
The primary intended users of these models are AI researchers.
We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.
### Out-of-Scope Use Cases
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
## Data
The model was trained on publicly available image-caption data. This was done through a combination of crawling a handful of websites and using commonly-used pre-existing image datasets such as [YFCC100M](http://projects.dfki.uni-kl.de/yfcc100m/). A large portion of the data comes from our crawling of the internet. This means that the data is more representative of people and societies most connected to the internet which tend to skew towards more developed nations, and younger, male users.
### Data Mission Statement
Our goal with building this dataset was to test out robustness and generalizability in computer vision tasks. As a result, the focus was on gathering large quantities of data from different publicly-available internet data sources. The data was gathered in a mostly non-interventionist manner. However, we only crawled websites that had policies against excessively violent and adult images and allowed us to filter out such content. We do not intend for this dataset to be used as the basis for any commercial or deployed model and will not be releasing the dataset.
## Performance and Limitations
### Performance
We have evaluated the performance of CLIP on a wide range of benchmarks across a variety of computer vision datasets such as OCR to texture recognition to fine-grained classification. The paper describes model performance on the following datasets:
- Food101
- CIFAR10
- CIFAR100
- Birdsnap
- SUN397
- Stanford Cars
- FGVC Aircraft
- VOC2007
- DTD
- Oxford-IIIT Pet dataset
- Caltech101
- Flowers102
- MNIST
- SVHN
- IIIT5K
- Hateful Memes
- SST-2
- UCF101
- Kinetics700
- Country211
- CLEVR Counting
- KITTI Distance
- STL-10
- RareAct
- Flickr30
- MSCOCO
- ImageNet
- ImageNet-A
- ImageNet-R
- ImageNet Sketch
- ObjectNet (ImageNet Overlap)
- Youtube-BB
- ImageNet-Vid
## Limitations
CLIP and our analysis of it have a number of limitations. CLIP currently struggles with respect to certain tasks such as fine grained classification and counting objects. CLIP also poses issues with regards to fairness and bias which we discuss in the paper and briefly in the next section. Additionally, our approach to testing CLIP also has an important limitation- in many cases we have used linear probes to evaluate the performance of CLIP and there is evidence suggesting that linear probes can underestimate model performance.
### Bias and Fairness
We find that the performance of CLIP - and the specific biases it exhibits - can depend significantly on class design and the choices one makes for categories to include and exclude. We tested the risk of certain kinds of denigration with CLIP by classifying images of people from [Fairface](https://arxiv.org/abs/1908.04913) into crime-related and non-human animal categories. We found significant disparities with respect to race and gender. Additionally, we found that these disparities could shift based on how the classes were constructed. (Details captured in the Broader Impacts Section in the paper).
We also tested the performance of CLIP on gender, race and age classification using the Fairface dataset (We default to using race categories as they are constructed in the Fairface dataset.) in order to assess quality of performance across different demographics. We found accuracy >96% across all races for gender classification with ‘Middle Eastern’ having the highest accuracy (98.4%) and ‘White’ having the lowest (96.5%). Additionally, CLIP averaged ~93% for racial classification and ~63% for age classification. Our use of evaluations to test for gender, race and age classification as well as denigration harms is simply to evaluate performance of the model across people and surface potential risks and not to demonstrate an endorsement/enthusiasm for such tasks.
## Feedback
### Where to send questions or comments about the model
Please use [this Google Form](https://forms.gle/Uv7afRH5dvY34ZEs9) | [
-0.5028195381164551,
-0.5711244940757751,
0.16508552432060242,
-0.030113739892840385,
-0.1611039787530899,
-0.251861035823822,
0.021790342405438423,
-0.7077082395553589,
0.12783248722553253,
0.38478925824165344,
-0.2797425389289856,
-0.40631571412086487,
-0.6301049590110779,
0.12085618078708649,
-0.6227642297744751,
0.7121697664260864,
-0.06300313770771027,
0.06447663903236389,
-0.30519938468933105,
-0.3298357427120209,
-0.5006494522094727,
-0.684582531452179,
-0.23790468275547028,
0.16244472563266754,
0.08657322824001312,
0.14136958122253418,
0.6573242545127869,
0.8399184942245483,
0.7971466183662415,
0.22006890177726746,
-0.3121120035648346,
-0.11205697059631348,
-0.5017342567443848,
-0.6126406192779541,
-0.37977349758148193,
-0.3890714645385742,
-0.3888903856277466,
0.2065761387348175,
0.530386209487915,
0.36309415102005005,
0.03135514631867409,
0.29356279969215393,
0.0715906023979187,
0.36597150564193726,
-0.9183122515678406,
-0.04925771430134773,
-0.550231397151947,
0.06851169466972351,
-0.2802903354167938,
0.14372166991233826,
-0.17106114327907562,
-0.18843317031860352,
0.31254637241363525,
-0.5033757090568542,
0.4781454801559448,
-0.06280427426099777,
1.2957972288131714,
0.17866738140583038,
-0.16547377407550812,
-0.030125442892313004,
-0.5843654274940491,
0.7435945272445679,
-0.5669578313827515,
0.23714426159858704,
0.227054163813591,
0.38307246565818787,
0.14191551506519318,
-0.8340786695480347,
-0.6277564167976379,
-0.06186347454786301,
0.2992108464241028,
0.016407685354351997,
-0.2242918163537979,
-0.05588332191109657,
0.41794395446777344,
0.4899693727493286,
-0.15943555533885956,
-0.05881171673536301,
-0.7083445191383362,
-0.21504192054271698,
0.6695651412010193,
0.2949073612689972,
0.3341822624206543,
-0.2303634136915207,
-0.6251868605613708,
-0.46719446778297424,
-0.44603231549263,
0.5302424430847168,
0.380377858877182,
0.09600826352834702,
-0.15017825365066528,
0.6406089067459106,
-0.04701736941933632,
0.4235216975212097,
0.006798685062676668,
-0.34597915410995483,
0.34341034293174744,
-0.4676169753074646,
-0.1854092925786972,
-0.26963406801223755,
0.7524247765541077,
0.8228386640548706,
0.17618413269519806,
0.21115246415138245,
-0.08750100433826447,
0.21276354789733887,
0.33855465054512024,
-0.9186346530914307,
-0.15680626034736633,
-0.2005186229944229,
-0.6218684315681458,
-0.36613860726356506,
0.2804749011993408,
-0.9126017689704895,
0.07640203088521957,
-0.11978050321340561,
0.7312285304069519,
-0.4427567720413208,
-0.07432659715414047,
0.19061149656772614,
-0.32081395387649536,
0.32052892446517944,
0.3265687823295593,
-0.6618086099624634,
0.375336229801178,
0.3191087543964386,
1.0875048637390137,
-0.4695495367050171,
-0.309076726436615,
0.04549911990761757,
-0.06615445762872696,
-0.11220301687717438,
0.705342173576355,
-0.3745212256908417,
-0.46406328678131104,
-0.18868905305862427,
0.4369472563266754,
-0.1183733344078064,
-0.6053619384765625,
0.5760085582733154,
-0.2064000517129898,
0.02570156380534172,
-0.27992719411849976,
-0.38404640555381775,
-0.6109395027160645,
0.31667831540107727,
-0.7068378329277039,
0.8819748163223267,
0.14677900075912476,
-0.7708446979522705,
0.37301212549209595,
-0.7077308297157288,
-0.050391409546136856,
-0.12766338884830475,
-0.0986647829413414,
-0.590827465057373,
-0.28179657459259033,
0.3972231149673462,
0.3203490078449249,
-0.22642405331134796,
0.36751869320869446,
-0.5967095494270325,
-0.488293319940567,
0.18390490114688873,
-0.43565550446510315,
0.8779375553131104,
0.019687524065375328,
-0.32468920946121216,
0.0018868875922635198,
-0.4563602805137634,
-0.17163318395614624,
0.35109665989875793,
0.00854884646832943,
-0.16103093326091766,
-0.10457765311002731,
0.195853590965271,
0.09489814192056656,
-0.04080970585346222,
-0.6779976487159729,
0.13205716013908386,
-0.0824737697839737,
0.5364310145378113,
0.672411322593689,
0.09234849363565445,
0.27319902181625366,
-0.4192888140678406,
0.5167664885520935,
-0.023885199800133705,
0.6510520577430725,
-0.2498805671930313,
-0.5108723640441895,
-0.48441970348358154,
-0.45953813195228577,
0.5771525502204895,
0.6415369510650635,
-0.43276333808898926,
0.16419798135757446,
-0.13849157094955444,
-0.3326675295829773,
-0.17753303050994873,
-0.2189757525920868,
0.3437015116214752,
0.6435902118682861,
0.3398193120956421,
-0.9699578881263733,
-0.40039825439453125,
-1.0378868579864502,
0.193033829331398,
0.0687246173620224,
-0.055297207087278366,
0.6836110353469849,
0.8945345282554626,
-0.23453567922115326,
1.0630948543548584,
-0.7434713840484619,
-0.4113602936267853,
-0.13491886854171753,
-0.13158659636974335,
-0.02208922617137432,
0.49188563227653503,
0.933982789516449,
-0.9217532277107239,
-0.25868284702301025,
-0.5227254629135132,
-0.7975072860717773,
0.14319489896297455,
0.19539548456668854,
-0.08907229453325272,
0.04275206848978996,
0.22207587957382202,
-0.24461990594863892,
1.0148260593414307,
0.25689712166786194,
-0.05390371009707451,
0.7225462198257446,
0.0852150097489357,
0.28364816308021545,
-0.5840480327606201,
0.358704149723053,
0.17082981765270233,
-0.15007860958576202,
-0.48014792799949646,
0.054168250411748886,
-0.008770237676799297,
-0.42058154940605164,
-0.9158760905265808,
0.3658343255519867,
-0.14195765554904938,
-0.12202370911836624,
-0.15764901041984558,
-0.18699340522289276,
0.31262704730033875,
0.707561731338501,
0.13684514164924622,
1.065791368484497,
0.4882872998714447,
-0.7487250566482544,
-0.02375790663063526,
0.5347656011581421,
-0.4691179394721985,
0.528555154800415,
-0.9416053891181946,
-0.041198957711458206,
-0.058412253856658936,
0.10494133085012436,
-0.5598915815353394,
-0.33406272530555725,
0.30556830763816833,
-0.348550021648407,
0.20931851863861084,
-0.13105492293834686,
-0.3144756853580475,
-0.5916775465011597,
-0.541726291179657,
0.7433608174324036,
0.5038515329360962,
-0.4432712197303772,
0.36277687549591064,
0.7067604064941406,
0.1865304410457611,
-0.5297303199768066,
-0.7572582960128784,
-0.0785357728600502,
-0.2049943208694458,
-0.7184067964553833,
0.5393203496932983,
-0.000991243403404951,
0.07467357069253922,
0.13024143874645233,
0.09038093686103821,
-0.30982673168182373,
0.02703453227877617,
0.45370882749557495,
0.5104103088378906,
-0.08095070719718933,
-0.11696920543909073,
-0.2951515018939972,
0.35325202345848083,
-0.07419192790985107,
0.12662716209888458,
0.2725735604763031,
-0.1398490071296692,
-0.3417103886604309,
-0.5028554201126099,
0.3225213587284088,
0.4484611451625824,
-0.26685816049575806,
0.48448121547698975,
0.48563775420188904,
-0.2727079391479492,
0.11007951945066452,
-0.5294326543807983,
-0.03627756983041763,
-0.4383474588394165,
0.49795955419540405,
-0.12278864532709122,
-0.6673111319541931,
0.7203261852264404,
0.13678675889968872,
-0.14276476204395294,
0.6205142140388489,
0.30090951919555664,
0.010675244964659214,
0.8433942198753357,
0.9314384460449219,
0.03658169507980347,
0.637567400932312,
-0.8018835783004761,
-0.016860339790582657,
-0.9967478513717651,
-0.3349451422691345,
-0.25349554419517517,
-0.21361087262630463,
-0.43169811367988586,
-0.5531179904937744,
0.5778758525848389,
0.1749413162469864,
-0.10507138818502426,
0.4131318926811218,
-0.6568560600280762,
0.44793498516082764,
0.6150713562965393,
0.44492286443710327,
0.016556061804294586,
-0.08382226526737213,
0.0038020526990294456,
-0.1601242870092392,
-0.6665180921554565,
-0.49243462085723877,
1.1049301624298096,
0.6568570733070374,
0.6982197761535645,
-0.219181627035141,
0.2164650708436966,
0.41842302680015564,
-0.08627421408891678,
-0.7405120730400085,
0.5324667096138,
-0.452153742313385,
-0.7049142122268677,
-0.18583594262599945,
-0.05789165943861008,
-0.7536709308624268,
0.1509086638689041,
-0.14023931324481964,
-0.7350054979324341,
0.5999876856803894,
0.1336221992969513,
-0.33132606744766235,
0.664806067943573,
-0.5871095657348633,
0.9741711616516113,
-0.28843751549720764,
-0.42984047532081604,
0.07198484987020493,
-0.6395854353904724,
0.5682413578033447,
0.07101847976446152,
0.027759341523051262,
-0.20734894275665283,
0.10009420663118362,
1.0681242942810059,
-0.5721616744995117,
0.9192345142364502,
-0.11490731686353683,
0.4123953580856323,
0.733132541179657,
-0.18151617050170898,
0.05528507009148598,
-0.2046879380941391,
0.19137358665466309,
0.6974955201148987,
0.2737804651260376,
-0.10960999131202698,
-0.3654259145259857,
0.14380238950252533,
-0.7200766801834106,
-0.3924625813961029,
-0.3661554753780365,
-0.43872401118278503,
0.22323721647262573,
0.20007455348968506,
0.5434206128120422,
0.7500629425048828,
-0.049234941601753235,
0.16131071746349335,
0.6170294284820557,
-0.4987105131149292,
0.3722393810749054,
0.19649247825145721,
-0.2745506167411804,
-0.5152713060379028,
0.9004989266395569,
0.27599915862083435,
0.21385638415813446,
0.04094332084059715,
0.08592497557401657,
-0.22439292073249817,
-0.4817015528678894,
-0.4367757737636566,
0.0721515417098999,
-0.7238396406173706,
-0.42308929562568665,
-0.5371016263961792,
-0.36727914214134216,
-0.4371652901172638,
-0.011593177914619446,
-0.4757044017314911,
-0.3319774270057678,
-0.6205341219902039,
0.2072107195854187,
0.1745082288980484,
0.6345257759094238,
-0.09800586849451065,
0.287059485912323,
-0.611431360244751,
0.2482345849275589,
0.37989458441734314,
0.5218263864517212,
0.0681656002998352,
-0.6873040795326233,
-0.14253534376621246,
-0.00027594840503297746,
-0.8657500147819519,
-0.7793110013008118,
0.4396631121635437,
0.3247648775577545,
0.5792436003684998,
0.35628408193588257,
0.09551706910133362,
0.6846559643745422,
-0.4215455949306488,
1.0679614543914795,
0.22588472068309784,
-0.9370443820953369,
0.543653666973114,
-0.30473366379737854,
0.2139168381690979,
0.6727586388587952,
0.478923499584198,
-0.2076156586408615,
-0.12663805484771729,
-0.5384963750839233,
-0.8774662017822266,
0.7806020975112915,
0.1285153031349182,
0.04781070351600647,
0.0628289133310318,
0.3291599750518799,
0.021494301036000252,
0.08500473201274872,
-0.6926113963127136,
-0.16124895215034485,
-0.49545279145240784,
0.05799638479948044,
0.2840508818626404,
-0.42602938413619995,
0.024179264903068542,
-0.4146389365196228,
0.4005623161792755,
-0.05217877775430679,
0.5533779859542847,
0.5316130518913269,
-0.17105555534362793,
0.13704989850521088,
-0.09849122911691666,
0.650509238243103,
0.5970566868782043,
-0.38429340720176697,
-0.22680790722370148,
0.25359997153282166,
-0.8240457773208618,
0.011829765513539314,
-0.17977085709571838,
-0.498174786567688,
-0.04562739282846451,
0.3111919164657593,
0.9190090894699097,
0.19904309511184692,
-0.7378608584403992,
0.9900705218315125,
-0.09407984465360641,
-0.5474270582199097,
-0.2564293444156647,
0.076691634953022,
-0.5406688451766968,
0.1324404925107956,
0.3144390881061554,
0.21618981659412384,
0.45035627484321594,
-0.5084373950958252,
0.3871294856071472,
0.4221872091293335,
-0.3433851897716522,
-0.3733462691307068,
0.7476547956466675,
0.14398550987243652,
-0.20186810195446014,
0.49282145500183105,
-0.17284570634365082,
-0.944316029548645,
0.8064664006233215,
0.3963475823402405,
0.6486207842826843,
-0.013743950985372066,
0.17066317796707153,
0.6588932275772095,
0.14799140393733978,
-0.33707156777381897,
-0.047056812793016434,
0.013937613926827908,
-0.5570764541625977,
-0.21830935776233673,
-0.40931886434555054,
-0.5736475586891174,
0.153774693608284,
-0.9105253219604492,
0.4138091504573822,
-0.5008723139762878,
-0.49943023920059204,
-0.10634961724281311,
-0.26733821630477905,
-0.7181615829467773,
0.13234014809131622,
0.1548682004213333,
1.207140564918518,
-0.8277750015258789,
0.48266351222991943,
0.425367146730423,
-0.5864840149879456,
-0.7950787544250488,
-0.14838802814483643,
-0.10037794709205627,
-0.6335516571998596,
0.6581992506980896,
0.5258060097694397,
-0.003733827034011483,
-0.46435004472732544,
-0.933516800403595,
-0.9723369479179382,
1.1136428117752075,
0.32057783007621765,
-0.40224823355674744,
-0.08899114280939102,
-0.01629267819225788,
0.3401809334754944,
-0.32425543665885925,
0.3660754859447479,
0.3233945369720459,
-0.02058394066989422,
0.3343381881713867,
-1.1536753177642822,
-0.18725186586380005,
-0.1702989637851715,
0.2560049295425415,
0.023045731708407402,
-0.832671582698822,
1.0384564399719238,
-0.2684120535850525,
-0.4344950318336487,
0.05866951122879982,
0.43093863129615784,
-0.06260136514902115,
0.37096357345581055,
0.5112165808677673,
0.6893353462219238,
0.41597115993499756,
0.06394066661596298,
1.0571832656860352,
-0.05589362233877182,
0.45218518376350403,
0.92383873462677,
-0.14264684915542603,
0.8764290809631348,
0.3011862635612488,
-0.3492541015148163,
0.36191388964653015,
0.42676565051078796,
-0.6763984560966492,
0.7545884251594543,
0.0021253053564578295,
0.1541580855846405,
-0.04230530932545662,
-0.44262027740478516,
-0.2933233976364136,
0.6992912888526917,
0.03211953490972519,
-0.4601115584373474,
-0.06292233616113663,
0.403904527425766,
-0.24591632187366486,
-0.05322091281414032,
-0.44633153080940247,
0.4443184733390808,
-0.1601274013519287,
-0.33829620480537415,
0.4319251477718353,
0.06534789502620697,
0.9394005537033081,
-0.3577660620212555,
-0.15434551239013672,
0.09061578661203384,
0.19528502225875854,
-0.0830652043223381,
-0.934805154800415,
0.5403908491134644,
0.05777708813548088,
-0.2225620150566101,
0.08808813244104385,
0.7282537817955017,
-0.03494931012392044,
-0.5656675696372986,
0.2110108584165573,
-0.1360975205898285,
0.3465515673160553,
-0.10197411477565765,
-0.6955138444900513,
0.33062538504600525,
0.06243180111050606,
0.02785993553698063,
0.29215699434280396,
-0.01683165319263935,
-0.11081463098526001,
0.6593631505966187,
0.3812195956707001,
-0.049237966537475586,
0.10833752155303955,
-0.3374156355857849,
1.0371835231781006,
-0.544754683971405,
-0.39778468012809753,
-0.6761711835861206,
0.3475096821784973,
-0.0982847511768341,
-0.34040769934654236,
0.6080735921859741,
0.6037173271179199,
1.1036657094955444,
-0.12138237059116364,
0.5523548722267151,
-0.21089158952236176,
0.4996054768562317,
-0.3683314323425293,
0.43947654962539673,
-0.5207660794258118,
-0.030631018802523613,
-0.42714211344718933,
-0.628960907459259,
-0.18076695501804352,
0.6050317883491516,
-0.3947354853153229,
-0.07280343770980835,
0.4845198392868042,
0.7169778347015381,
-0.24301983416080475,
-0.032148949801921844,
0.2591622769832611,
-0.330429345369339,
0.25641778111457825,
0.6036332845687866,
0.6017049551010132,
-0.7820426821708679,
0.6837888956069946,
-0.6788225769996643,
-0.22482754290103912,
-0.19486694037914276,
-0.8245818614959717,
-1.022369146347046,
-0.49897223711013794,
-0.42180925607681274,
-0.13501325249671936,
-0.0580267459154129,
0.5685029625892639,
0.951771080493927,
-0.6999800801277161,
-0.0905606672167778,
0.32868582010269165,
-0.07138391584157944,
-0.006982887163758278,
-0.23981110751628876,
0.3748198449611664,
0.20650964975357056,
-0.5582612156867981,
-0.19345134496688843,
0.12450530380010605,
0.351590633392334,
-0.17999659478664398,
0.1201450526714325,
-0.19401372969150543,
-0.06597745418548584,
0.443072110414505,
0.52667236328125,
-0.6432492136955261,
-0.31874141097068787,
0.15350167453289032,
0.04125197231769562,
0.33677375316619873,
0.6344946622848511,
-0.6282545328140259,
0.428748220205307,
0.2736228406429291,
0.5439906120300293,
0.6507944464683533,
0.25668036937713623,
0.20126095414161682,
-0.42423686385154724,
0.2090161293745041,
0.20818743109703064,
0.3321470320224762,
0.34050479531288147,
-0.3942870497703552,
0.5836917757987976,
0.4773426055908203,
-0.6410806775093079,
-0.9654466509819031,
-0.030823230743408203,
-1.0626986026763916,
-0.19625894725322723,
0.8730432987213135,
-0.402445524930954,
-0.6692677736282349,
0.1520223319530487,
-0.20839084684848785,
0.16564975678920746,
-0.3536892235279083,
0.6482003927230835,
0.3887910544872284,
-0.02859175018966198,
-0.3560948669910431,
-0.5896066427230835,
0.1961309015750885,
0.05748412758111954,
-0.514034628868103,
-0.3825087547302246,
0.3604009747505188,
0.5753779411315918,
0.33941179513931274,
0.4655390679836273,
-0.3387034833431244,
0.3815578520298004,
0.04168790206313133,
0.29366838932037354,
-0.32165947556495667,
-0.3817782402038574,
-0.47130653262138367,
0.29366156458854675,
-0.27844858169555664,
-0.6039014458656311
] |
distilbert-base-uncased-finetuned-sst-2-english | null | "2023-10-26T16:14:11Z" | 30,654,240 | 355 | transformers | [
"transformers",
"pytorch",
"tf",
"rust",
"onnx",
"safetensors",
"distilbert",
"text-classification",
"en",
"dataset:sst2",
"dataset:glue",
"arxiv:1910.01108",
"doi:10.57967/hf/0181",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:04Z" | ---
language: en
license: apache-2.0
datasets:
- sst2
- glue
model-index:
- name: distilbert-base-uncased-finetuned-sst-2-english
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: glue
type: glue
config: sst2
split: validation
metrics:
- type: accuracy
value: 0.9105504587155964
name: Accuracy
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiN2YyOGMxYjY2Y2JhMjkxNjIzN2FmMjNiNmM2ZWViNGY3MTNmNWI2YzhiYjYxZTY0ZGUyN2M1NGIxZjRiMjQwZiIsInZlcnNpb24iOjF9.uui0srxV5ZHRhxbYN6082EZdwpnBgubPJ5R2-Wk8HTWqmxYE3QHidevR9LLAhidqGw6Ih93fK0goAXncld_gBg
- type: precision
value: 0.8978260869565218
name: Precision
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMzgwYTYwYjA2MmM0ZTYwNDk0M2NmNTBkZmM2NGNhYzQ1OGEyN2NkNDQ3Mzc2NTQyMmZiNDJiNzBhNGVhZGUyOSIsInZlcnNpb24iOjF9.eHjLmw3K02OU69R2Au8eyuSqT3aBDHgZCn8jSzE3_urD6EUSSsLxUpiAYR4BGLD_U6-ZKcdxVo_A2rdXqvUJDA
- type: recall
value: 0.9301801801801802
name: Recall
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGIzM2E3MTI2Mzc2MDYwNmU3ZTVjYmZmZDBkNjY4ZTc5MGY0Y2FkNDU3NjY1MmVkNmE3Y2QzMzAwZDZhOWY1NiIsInZlcnNpb24iOjF9.PUZlqmct13-rJWBXdHm5tdkXgETL9F82GNbbSR4hI8MB-v39KrK59cqzFC2Ac7kJe_DtOeUyosj34O_mFt_1DQ
- type: auc
value: 0.9716626673402374
name: AUC
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMDM0YWIwZmQ4YjUwOGZmMWU2MjI1YjIxZGQ2MzNjMzRmZmYxMzZkNGFjODhlMDcyZDM1Y2RkMWZlOWQ0MWYwNSIsInZlcnNpb24iOjF9.E7GRlAXmmpEkTHlXheVkuL1W4WNjv4JO3qY_WCVsTVKiO7bUu0UVjPIyQ6g-J1OxsfqZmW3Leli1wY8vPBNNCQ
- type: f1
value: 0.9137168141592922
name: F1
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGU4MjNmOGYwZjZjMDQ1ZTkyZTA4YTc1MWYwOTM0NDM4ZWY1ZGVkNDY5MzNhYTQyZGFlNzIyZmUwMDg3NDU0NyIsInZlcnNpb24iOjF9.mW5ftkq50Se58M-jm6a2Pu93QeKa3MfV7xcBwvG3PSB_KNJxZWTCpfMQp-Cmx_EMlmI2siKOyd8akYjJUrzJCA
- type: loss
value: 0.39013850688934326
name: loss
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMTZiNzAyZDc0MzUzMmE1MGJiN2JlYzFiODE5ZTNlNGE4MmI4YzRiMTc2ODEzMTUwZmEzOTgxNzc4YjJjZTRmNiIsInZlcnNpb24iOjF9.VqIC7uYC-ZZ8ss9zQOlRV39YVOOLc5R36sIzCcVz8lolh61ux_5djm2XjpP6ARc6KqEnXC4ZtfNXsX2HZfrtCQ
- task:
type: text-classification
name: Text Classification
dataset:
name: sst2
type: sst2
config: default
split: train
metrics:
- type: accuracy
value: 0.9885521685548412
name: Accuracy
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiY2I3NzU3YzhmMDkxZTViY2M3OTY1NmI0ZTdmMDQxNjNjYzJiZmQxNzczM2E4YmExYTY5ODY0NDBkY2I4ZjNkOCIsInZlcnNpb24iOjF9.4Gtk3FeVc9sPWSqZIaeUXJ9oVlPzm-NmujnWpK2y5s1Vhp1l6Y1pK5_78wW0-NxSvQqV6qd5KQf_OAEpVAkQDA
- type: precision
value: 0.9881965062029833
name: Precision Macro
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZDdlZDMzY2I3MTAwYTljNmM4MGMyMzU2YjAzZDg1NDYwN2ZmM2Y5OWZhMjUyMGJiNjY1YmZiMzFhMDI2ODFhNyIsInZlcnNpb24iOjF9.cqmv6yBxu4St2mykRWrZ07tDsiSLdtLTz2hbqQ7Gm1rMzq9tdlkZ8MyJRxtME_Y8UaOG9rs68pV-gKVUs8wABw
- type: precision
value: 0.9885521685548412
name: Precision Micro
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZjFlYzAzNmE1YjljNjUwNzBjZjEzZDY0ZDQyMmY5ZWM2OTBhNzNjYjYzYTk1YWE1NjU3YTMxZDQwOTE1Y2FkNyIsInZlcnNpb24iOjF9.jnCHOkUHuAOZZ_ZMVOnetx__OVJCS6LOno4caWECAmfrUaIPnPNV9iJ6izRO3sqkHRmxYpWBb-27GJ4N3LU-BQ
- type: precision
value: 0.9885639626373408
name: Precision Weighted
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZGUyODFjNjBlNTE2MTY3ZDAxOGU1N2U0YjUyY2NiZjhkOGVmYThjYjBkNGU3NTRkYzkzNDQ2MmMwMjkwMWNiMyIsInZlcnNpb24iOjF9.zTNabMwApiZyXdr76QUn7WgGB7D7lP-iqS3bn35piqVTNsv3wnKjZOaKFVLIUvtBXq4gKw7N2oWxvWc4OcSNDg
- type: recall
value: 0.9886145346602994
name: Recall Macro
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNTU1YjlhODU3YTkyNTdiZDcwZGFlZDBiYjY0N2NjMGM2NTRiNjQ3MDNjNGMxOWY2ZGQ4NWU1YmMzY2UwZTI3YSIsInZlcnNpb24iOjF9.xaLPY7U-wHsJ3DDui1yyyM-xWjL0Jz5puRThy7fczal9x05eKEQ9s0a_WD-iLmapvJs0caXpV70hDe2NLcs-DA
- type: recall
value: 0.9885521685548412
name: Recall Micro
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiODE0YTU0MDBlOGY4YzU0MjY5MzA3OTk2OGNhOGVkMmU5OGRjZmFiZWI2ZjY5ODEzZTQzMTI0N2NiOTVkNDliYiIsInZlcnNpb24iOjF9.SOt1baTBbuZRrsvGcak2sUwoTrQzmNCbyV2m1_yjGsU48SBH0NcKXicidNBSnJ6ihM5jf_Lv_B5_eOBkLfNWDQ
- type: recall
value: 0.9885521685548412
name: Recall Weighted
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZWNkNmM0ZGRlNmYxYzIwNDk4OTI5MzIwZWU1NzZjZDVhMDcyNDFlMjBhNDQxODU5OWMwMWNhNGEzNjY3ZGUyOSIsInZlcnNpb24iOjF9.b15Fh70GwtlG3cSqPW-8VEZT2oy0CtgvgEOtWiYonOovjkIQ4RSLFVzVG-YfslaIyfg9RzMWzjhLnMY7Bpn2Aw
- type: f1
value: 0.9884019815052447
name: F1 Macro
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiYmM4NjQ5Yjk5ODRhYTU1MTY3MmRhZDBmODM1NTg3OTFiNWM4NDRmYjI0MzZkNmQ1MzE3MzcxODZlYzBkYTMyYSIsInZlcnNpb24iOjF9.74RaDK8nBVuGRl2Se_-hwQvP6c4lvVxGHpcCWB4uZUCf2_HoC9NT9u7P3pMJfH_tK2cpV7U3VWGgSDhQDi-UBQ
- type: f1
value: 0.9885521685548412
name: F1 Micro
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZDRmYWRmMmQ0YjViZmQxMzhhYTUyOTE1MTc0ZDU1ZjQyZjFhMDYzYzMzZDE0NzZlYzQyOTBhMTBhNmM5NTlkMiIsInZlcnNpb24iOjF9.VMn_psdAHIZTlW6GbjERZDe8MHhwzJ0rbjV_VJyuMrsdOh5QDmko-wEvaBWNEdT0cEKsbggm-6jd3Gh81PfHAQ
- type: f1
value: 0.9885546181087554
name: F1 Weighted
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMjUyZWFhZDZhMGQ3MzBmYmRiNDVmN2FkZDBjMjk3ODk0OTAxNGZkMWE0NzU5ZjI0NzE0NGZiNzM0N2Y2NDYyOSIsInZlcnNpb24iOjF9.YsXBhnzEEFEW6jw3mQlFUuIrW7Gabad2Ils-iunYJr-myg0heF8NEnEWABKFE1SnvCWt-69jkLza6SupeyLVCA
- type: loss
value: 0.040652573108673096
name: loss
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZTc3YjU3MjdjMzkxODA5MjU5NGUyY2NkMGVhZDg3ZWEzMmU1YWVjMmI0NmU2OWEyZTkzMTVjNDZiYTc0YjIyNCIsInZlcnNpb24iOjF9.lA90qXZVYiILHMFlr6t6H81Oe8a-4KmeX-vyCC1BDia2ofudegv6Vb46-4RzmbtuKeV6yy6YNNXxXxqVak1pAg
---
# DistilBERT base uncased finetuned SST-2
## Table of Contents
- [Model Details](#model-details)
- [How to Get Started With the Model](#how-to-get-started-with-the-model)
- [Uses](#uses)
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
- [Training](#training)
## Model Details
**Model Description:** This model is a fine-tune checkpoint of [DistilBERT-base-uncased](https://huggingface.co/distilbert-base-uncased), fine-tuned on SST-2.
This model reaches an accuracy of 91.3 on the dev set (for comparison, Bert bert-base-uncased version reaches an accuracy of 92.7).
- **Developed by:** Hugging Face
- **Model Type:** Text Classification
- **Language(s):** English
- **License:** Apache-2.0
- **Parent Model:** For more details about DistilBERT, we encourage users to check out [this model card](https://huggingface.co/distilbert-base-uncased).
- **Resources for more information:**
- [Model Documentation](https://huggingface.co/docs/transformers/main/en/model_doc/distilbert#transformers.DistilBertForSequenceClassification)
- [DistilBERT paper](https://arxiv.org/abs/1910.01108)
## How to Get Started With the Model
Example of single-label classification:
```python
import torch
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased")
model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased")
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
```
## Uses
#### Direct Use
This model can be used for topic classification. You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.
#### Misuse and Out-of-scope Use
The model should not be used to intentionally create hostile or alienating environments for people. In addition, the model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
## Risks, Limitations and Biases
Based on a few experimentations, we observed that this model could produce biased predictions that target underrepresented populations.
For instance, for sentences like `This film was filmed in COUNTRY`, this binary classification model will give radically different probabilities for the positive label depending on the country (0.89 if the country is France, but 0.08 if the country is Afghanistan) when nothing in the input indicates such a strong semantic shift. In this [colab](https://colab.research.google.com/gist/ageron/fb2f64fb145b4bc7c49efc97e5f114d3/biasmap.ipynb), [Aurélien Géron](https://twitter.com/aureliengeron) made an interesting map plotting these probabilities for each country.
<img src="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/map.jpeg" alt="Map of positive probabilities per country." width="500"/>
We strongly advise users to thoroughly probe these aspects on their use-cases in order to evaluate the risks of this model. We recommend looking at the following bias evaluation datasets as a place to start: [WinoBias](https://huggingface.co/datasets/wino_bias), [WinoGender](https://huggingface.co/datasets/super_glue), [Stereoset](https://huggingface.co/datasets/stereoset).
# Training
#### Training Data
The authors use the following Stanford Sentiment Treebank([sst2](https://huggingface.co/datasets/sst2)) corpora for the model.
#### Training Procedure
###### Fine-tuning hyper-parameters
- learning_rate = 1e-5
- batch_size = 32
- warmup = 600
- max_seq_length = 128
- num_train_epochs = 3.0
| [
-0.39455512166023254,
-0.7664994597434998,
0.17849937081336975,
0.16509194672107697,
-0.4213687777519226,
-0.0027747880667448044,
-0.1830003559589386,
-0.32761508226394653,
0.10122796148061752,
0.4247645139694214,
-0.6012458205223083,
-0.6134636402130127,
-0.9000230431556702,
-0.20188122987747192,
-0.11908093839883804,
1.4349716901779175,
0.017388345673680305,
0.19627057015895844,
0.00017649999062996358,
0.009468479081988335,
-0.42075493931770325,
-0.5870155096054077,
-0.3725033104419708,
-0.3150821924209595,
0.10815275460481644,
0.30029433965682983,
0.5856735110282898,
0.18163341283798218,
0.432076632976532,
0.3041521906852722,
-0.460679829120636,
-0.13291917741298676,
-0.579167902469635,
-0.1468837559223175,
-0.1528633087873459,
-0.43070563673973083,
-0.5061169862747192,
0.3450506627559662,
0.27162477374076843,
0.6246225833892822,
-0.0177981685847044,
0.2992369532585144,
0.10641073435544968,
0.5606906414031982,
-0.28870704770088196,
0.2982610762119293,
-0.6910584568977356,
-0.05630846321582794,
-0.24140766263008118,
0.17037494480609894,
-0.47434985637664795,
-0.2934805452823639,
0.4018411338329315,
-0.3643893897533417,
0.3918888568878174,
-0.01735459454357624,
1.0571367740631104,
0.3059127926826477,
-0.46974417567253113,
-0.20859403908252716,
-0.4667978286743164,
0.7464268803596497,
-0.5381153225898743,
0.19937442243099213,
0.46745187044143677,
0.09841255098581314,
-0.13832546770572662,
-0.6955488920211792,
-0.5082835555076599,
-0.14492523670196533,
-0.056933462619781494,
0.3131434917449951,
-0.2624976634979248,
-0.04808567836880684,
0.41369062662124634,
0.3946012854576111,
-0.43355873227119446,
-0.10022295266389847,
-0.5700158476829529,
-0.3389454185962677,
0.5678173899650574,
-0.08704841881990433,
0.183237686753273,
-0.3329114615917206,
-0.6518622636795044,
-0.14835363626480103,
-0.39933285117149353,
0.004085691180080175,
0.44765928387641907,
0.339776873588562,
-0.2690736651420593,
0.6202360391616821,
-0.14262771606445312,
0.47465792298316956,
0.39691755175590515,
-0.08770941197872162,
0.5663097500801086,
-0.23002031445503235,
-0.22228668630123138,
0.14043080806732178,
0.6923131942749023,
0.47769150137901306,
0.22459469735622406,
0.039976298809051514,
0.05367925763130188,
0.255837619304657,
0.06202545762062073,
-1.0380254983901978,
-0.3720329701900482,
0.20975321531295776,
-0.3817058801651001,
-0.523870050907135,
0.1336606740951538,
-0.6942791938781738,
-0.1382533758878708,
-0.22323037683963776,
0.43168532848358154,
-0.47211989760398865,
-0.3962588310241699,
0.13454385101795197,
-0.32779574394226074,
0.024475591257214546,
0.15776750445365906,
-0.6616174578666687,
0.11765214055776596,
0.3058165907859802,
0.7591832876205444,
-0.15608423948287964,
-0.16358636319637299,
-0.1358160823583603,
-0.2138923555612564,
-0.14429807662963867,
0.4499902129173279,
-0.1508188545703888,
-0.2629219591617584,
-0.22023296356201172,
0.194838747382164,
0.11565342545509338,
-0.31736186146736145,
0.7365245223045349,
-0.38777825236320496,
0.4955316483974457,
-0.18287153542041779,
-0.4285941421985626,
-0.16679894924163818,
0.22100473940372467,
-0.6120895743370056,
1.153340220451355,
0.356952041387558,
-1.1279330253601074,
0.4589774012565613,
-0.4551559388637543,
-0.36490577459335327,
-0.14736540615558624,
0.11841396987438202,
-0.5878855586051941,
-0.04270247370004654,
0.07398687303066254,
0.42830365896224976,
-0.1100974753499031,
0.586842954158783,
-0.2632603347301483,
-0.3029768168926239,
0.19239678978919983,
-0.4257858991622925,
1.234033226966858,
0.20410676300525665,
-0.5036609172821045,
-0.10126122832298279,
-0.7253497838973999,
-0.12105635553598404,
0.07537828385829926,
-0.23028936982154846,
-0.41175389289855957,
-0.33167922496795654,
0.4078525900840759,
0.4434869587421417,
0.19995178282260895,
-0.6331462860107422,
0.18053480982780457,
-0.3517228662967682,
0.44965896010398865,
0.6642516851425171,
-0.06137717142701149,
0.41972389817237854,
-0.06992722302675247,
0.289168119430542,
0.36694929003715515,
0.19627878069877625,
0.18166372179985046,
-0.5688483119010925,
-0.7472202181816101,
-0.3337295651435852,
0.5400806069374084,
0.5999261140823364,
-0.6553006768226624,
0.6767974495887756,
-0.03429357334971428,
-0.6780361533164978,
-0.36029618978500366,
-0.0037899843882769346,
0.466594934463501,
0.6514629125595093,
0.4097729027271271,
-0.3472115099430084,
-0.555573046207428,
-0.7802368402481079,
0.08712699264287949,
-0.27035295963287354,
0.015200113877654076,
-0.07186167687177658,
0.6681923866271973,
-0.3764742612838745,
0.8431512117385864,
-0.671248733997345,
-0.3711678385734558,
-0.21799245476722717,
0.23998060822486877,
0.2906979024410248,
0.5128815174102783,
0.5992265343666077,
-0.8669005036354065,
-0.4679395258426666,
-0.4328412711620331,
-0.7112934589385986,
0.06274774670600891,
0.1343221515417099,
-0.32666099071502686,
0.341667115688324,
0.3147895336151123,
-0.6192516088485718,
0.4280968904495239,
0.41054147481918335,
-0.5385251641273499,
0.4346429109573364,
-0.030986594036221504,
-0.10124900937080383,
-1.3468687534332275,
-0.04214511066675186,
0.28363659977912903,
-0.06364244222640991,
-0.6373583674430847,
-0.14381256699562073,
0.024322854354977608,
0.06887457519769669,
-0.5955068469047546,
0.5213138461112976,
-0.37050530314445496,
0.29095882177352905,
-0.24847491085529327,
-0.18002840876579285,
0.07978535443544388,
0.5985899567604065,
0.29926779866218567,
0.5448622703552246,
0.6490444540977478,
-0.42339855432510376,
0.17415569722652435,
0.49139267206192017,
-0.4616641700267792,
0.5676307082176208,
-0.6781067252159119,
-0.026088742539286613,
-0.26158082485198975,
0.38259828090667725,
-0.8325991630554199,
-0.14316634833812714,
0.2849254906177521,
-0.5189048647880554,
0.5533652305603027,
-0.20863518118858337,
-0.4061069190502167,
-0.47487521171569824,
-0.31006884574890137,
0.20838484168052673,
0.6192159652709961,
-0.3911108672618866,
0.2889377772808075,
0.455562025308609,
-0.1183890849351883,
-0.6643891334533691,
-0.9520659446716309,
-0.22607967257499695,
-0.46978431940078735,
-0.4692792296409607,
0.46871674060821533,
-0.09687136113643646,
-0.12541522085666656,
-0.12776519358158112,
-0.08926212042570114,
-0.027568671852350235,
-0.0006596161983907223,
0.4760342240333557,
0.5116601586341858,
0.06807110458612442,
0.21556131541728973,
0.07853883504867554,
-0.20069298148155212,
-0.034882787615060806,
-0.21040064096450806,
0.4442758560180664,
-0.3436170220375061,
0.03953030705451965,
-0.3751736283302307,
0.06808639317750931,
0.33928439021110535,
0.007712363265454769,
0.6974692344665527,
0.7895979285240173,
-0.5196906328201294,
0.13154467940330505,
-0.5187159776687622,
-0.2643071115016937,
-0.4149612486362457,
0.5589550137519836,
-0.3132442831993103,
-0.740504264831543,
0.4184603989124298,
-0.0077957818284630775,
-0.19559237360954285,
0.7585350275039673,
0.742476224899292,
-0.1839454025030136,
0.8595841526985168,
0.7068747282028198,
-0.17007175087928772,
0.42257294058799744,
-0.4833884537220001,
0.014447271823883057,
-0.8271943926811218,
-0.35072043538093567,
-0.3312658965587616,
-0.19472599029541016,
-0.8998904824256897,
-0.4508382976055145,
0.22078420221805573,
0.3153958320617676,
-0.46418192982673645,
0.5980410575866699,
-0.6847987174987793,
0.31516018509864807,
0.7736015915870667,
0.2504311800003052,
0.13605201244354248,
0.1745445728302002,
-0.07265613973140717,
-0.19171665608882904,
-0.5804450511932373,
-0.5696525573730469,
1.156151533126831,
0.6976159811019897,
0.8835609555244446,
-0.11951801925897598,
0.627177357673645,
0.35524776577949524,
0.2951600253582001,
-0.5389713048934937,
0.27447161078453064,
-0.2492537796497345,
-1.0053186416625977,
-0.3220728039741516,
-0.284976065158844,
-0.6869947910308838,
0.13774341344833374,
-0.17346921563148499,
-0.7034978866577148,
0.29756757616996765,
0.05482909828424454,
-0.22495217621326447,
0.20147234201431274,
-0.7646337151527405,
0.9558120369911194,
-0.3845798671245575,
-0.3947889804840088,
0.21290764212608337,
-0.8314300179481506,
0.34835296869277954,
0.008652866818010807,
0.03712060675024986,
-0.2491636425256729,
0.30205512046813965,
0.8259046673774719,
-0.3167484998703003,
1.0511865615844727,
-0.33720797300338745,
0.10125981271266937,
0.5311238765716553,
-0.16211140155792236,
0.38044974207878113,
0.1514843851327896,
-0.182913139462471,
0.5634748935699463,
0.03464331477880478,
-0.3477303385734558,
-0.19886454939842224,
0.5762702226638794,
-1.026541829109192,
-0.28037387132644653,
-0.792603611946106,
-0.376328706741333,
-0.09318941831588745,
0.20931139588356018,
0.6873046159744263,
0.22798196971416473,
-0.3623468279838562,
0.08413100242614746,
0.7771492004394531,
-0.23854395747184753,
0.06471190601587296,
0.3295409083366394,
-0.02086302824318409,
-0.3811272084712982,
0.7277677655220032,
0.07794269919395447,
0.23282873630523682,
0.2320481538772583,
0.27249157428741455,
-0.5555741786956787,
-0.25380465388298035,
-0.50403892993927,
0.11110781133174896,
-0.7330042123794556,
-0.3301108777523041,
-0.6725967526435852,
-0.35014107823371887,
-0.538817286491394,
0.07839109003543854,
-0.3597587049007416,
-0.474581778049469,
-0.4385147988796234,
-0.3924425542354584,
0.5394052267074585,
0.4159330129623413,
-0.06583932042121887,
0.45719701051712036,
-0.2818510830402374,
0.19009330868721008,
0.11231238394975662,
0.3308224081993103,
-0.3863844573497772,
-0.8089033961296082,
0.01585964486002922,
0.27014926075935364,
-0.5139455795288086,
-0.9419294595718384,
0.2549116909503937,
0.07589007169008255,
0.4515518248081207,
0.3587566018104553,
0.2434529811143875,
0.4237591624259949,
-0.3333512842655182,
0.6499559283256531,
0.32229533791542053,
-0.8538691401481628,
0.7514451146125793,
-0.27120962738990784,
0.22763454914093018,
0.8347126841545105,
0.708276093006134,
-0.32926034927368164,
-0.3675524592399597,
-0.7862712740898132,
-0.9274308085441589,
0.8006370067596436,
0.42276862263679504,
0.18496744334697723,
0.051794663071632385,
0.22802972793579102,
0.1851537972688675,
0.31028348207473755,
-1.054742693901062,
-0.430080384016037,
-0.48457756638526917,
-0.24460282921791077,
-0.19724616408348083,
-0.43048757314682007,
-0.09888813644647598,
-0.48284563422203064,
0.965196430683136,
0.010355142876505852,
0.31297680735588074,
0.17831766605377197,
-0.12980212271213531,
0.016689103096723557,
0.11571813374757767,
0.418028861284256,
0.3970281779766083,
-0.6394710540771484,
0.0954812616109848,
0.20128309726715088,
-0.6141774654388428,
0.09389463067054749,
0.36967793107032776,
-0.3784502446651459,
0.1527315378189087,
0.1575489342212677,
0.9898125529289246,
-0.04617052525281906,
-0.4174819886684418,
0.5550938248634338,
-0.0022055909503251314,
-0.37150824069976807,
-0.4099050760269165,
-0.13426144421100616,
0.1533985733985901,
0.24979521334171295,
0.17313478887081146,
0.1090407520532608,
0.1716473549604416,
-0.7007641792297363,
0.23879031836986542,
0.3497660458087921,
-0.6393377780914307,
-0.09963985532522202,
0.724421501159668,
0.22263377904891968,
-0.038176558911800385,
0.7059614658355713,
-0.38744476437568665,
-0.7167786955833435,
0.7166312336921692,
0.48168691992759705,
0.7874501943588257,
-0.08428660035133362,
0.43145886063575745,
0.6438069343566895,
0.4749237596988678,
-0.15937620401382446,
0.1083986759185791,
0.1479026973247528,
-0.6971874833106995,
-0.08320046216249466,
-0.7961297631263733,
-0.1428368091583252,
0.23568958044052124,
-0.6774892210960388,
0.4504639804363251,
-0.25995105504989624,
-0.42738524079322815,
0.049422234296798706,
0.14435474574565887,
-0.7880160212516785,
0.37578752636909485,
0.21199558675289154,
0.8863317966461182,
-1.1896343231201172,
0.8667819499969482,
0.6460903882980347,
-0.6439225077629089,
-0.6075469255447388,
0.022814199328422546,
0.04924188554286957,
-0.5715823769569397,
0.693006157875061,
0.4285871684551239,
0.2427816092967987,
-0.21908684074878693,
-0.5228938460350037,
-0.8018374443054199,
1.1242660284042358,
0.17316266894340515,
-0.5742180943489075,
0.00021800631657242775,
0.17416661977767944,
0.7263214588165283,
-0.23792937397956848,
0.5445670485496521,
0.5020425915718079,
0.2676754891872406,
0.3124370574951172,
-0.8095596432685852,
0.10734791308641434,
-0.18750225007534027,
0.1290258914232254,
-0.0107869952917099,
-0.7772955298423767,
0.9041999578475952,
-0.20707401633262634,
-0.02271484024822712,
-0.13135401904582977,
0.6288811564445496,
0.31770122051239014,
0.4150295853614807,
0.4585939943790436,
0.6962486505508423,
0.6728048324584961,
-0.2809520661830902,
0.7057863473892212,
-0.09499859064817429,
0.5916179418563843,
1.2501112222671509,
-0.17249907553195953,
0.6568516492843628,
0.4329962134361267,
-0.3309740126132965,
0.5949482321739197,
0.9500848650932312,
-0.23044386506080627,
0.7461426258087158,
0.2807522714138031,
-0.027449175715446472,
-0.06331096589565277,
0.0486544594168663,
-0.5780562162399292,
0.48799142241477966,
0.2853248119354248,
-0.4778502583503723,
-0.1640867292881012,
0.16355033218860626,
0.16301605105400085,
-0.17076648771762848,
-0.0943361297249794,
0.5779903531074524,
0.03205307573080063,
-0.649949312210083,
0.44750723242759705,
0.12455794215202332,
0.969384491443634,
-0.49626362323760986,
0.11619332432746887,
-0.27353107929229736,
0.2573350965976715,
-0.11288169026374817,
-0.7391131520271301,
0.2765193581581116,
0.11003995686769485,
-0.24954254925251007,
-0.20268121361732483,
0.8342147469520569,
-0.5231289267539978,
-0.8830459713935852,
0.22545881569385529,
0.2999543845653534,
0.31030574440956116,
-0.24028263986110687,
-0.9547195434570312,
0.0019217487424612045,
0.1119103655219078,
-0.39386865496635437,
0.28009936213493347,
0.3974544405937195,
-0.1442578285932541,
0.42363104224205017,
0.43116748332977295,
-0.1231466755270958,
-0.06306044012308121,
-0.03213053569197655,
0.8441619873046875,
-0.4236343502998352,
-0.37915828824043274,
-0.7179392576217651,
0.6112212538719177,
-0.19926083087921143,
-0.45497825741767883,
0.7169384956359863,
0.7449997663497925,
1.1327126026153564,
-0.19620728492736816,
0.8667671084403992,
-0.34750545024871826,
0.3689331114292145,
-0.397773414850235,
0.7360743284225464,
-0.5064845085144043,
-0.07119663804769516,
-0.45821693539619446,
-0.8655080199241638,
0.015232192352414131,
0.7159936428070068,
-0.27841541171073914,
0.159575954079628,
0.5865151882171631,
0.7578409314155579,
-0.10622061043977737,
-0.05587517470121384,
0.02962624840438366,
0.2659987211227417,
-0.04438737779855728,
0.46568575501441956,
0.5900557041168213,
-0.7263216376304626,
0.4247487783432007,
-0.623539924621582,
-0.486054003238678,
-0.24097424745559692,
-0.855069100856781,
-1.0891088247299194,
-0.6968339085578918,
-0.6068265438079834,
-0.6957365870475769,
-0.022601351141929626,
0.8182079792022705,
0.7444773316383362,
-0.8511559367179871,
-0.0179264098405838,
-0.05812692269682884,
-0.02884083427488804,
-0.046011921018362045,
-0.23507431149482727,
0.4928792417049408,
0.010456881485879421,
-0.8979527950286865,
-0.17873305082321167,
-0.11087273806333542,
0.28452351689338684,
-0.24467717111110687,
-0.046762801706790924,
-0.2674524486064911,
-0.2437964379787445,
0.6554845571517944,
0.04008529707789421,
-0.7156467437744141,
-0.06401929259300232,
-0.044698525220155716,
-0.24579370021820068,
-0.13081791996955872,
0.344691663980484,
-0.5213624238967896,
0.4219704270362854,
0.40260621905326843,
0.2642192840576172,
0.7712266445159912,
0.02693791687488556,
0.1498466283082962,
-0.7748450040817261,
0.39462152123451233,
0.14672552049160004,
0.29643991589546204,
0.31147056818008423,
-0.5258164405822754,
0.6679111123085022,
0.3662897050380707,
-0.4399418830871582,
-0.7042784094810486,
0.07325100153684616,
-1.235612154006958,
-0.359758198261261,
1.313576579093933,
-0.03101460263133049,
-0.14459317922592163,
0.09457873553037643,
-0.39994198083877563,
0.5377811789512634,
-0.3393193781375885,
0.8355849385261536,
0.919766366481781,
0.009771095588803291,
0.14140470325946808,
-0.5477043986320496,
0.524770200252533,
0.2952578365802765,
-0.6089582443237305,
-0.15377487242221832,
0.4339662194252014,
0.6385073661804199,
0.2001967579126358,
0.6460119485855103,
-0.1832330822944641,
0.007327844854444265,
0.0644063800573349,
0.2941958010196686,
-0.028973015025258064,
-0.2902163565158844,
-0.1285143345594406,
-0.11102171987295151,
-0.0635223537683487,
-0.32445254921913147
] |
gpt2 | null | "2023-06-30T02:19:43Z" | 21,850,807 | 1,516 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"tflite",
"rust",
"onnx",
"safetensors",
"gpt2",
"text-generation",
"exbert",
"en",
"doi:10.57967/hf/0039",
"license:mit",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text-generation | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: mit
---
# GPT-2
Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large
Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in
[this paper](https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf)
and first released at [this page](https://openai.com/blog/better-language-models/).
Disclaimer: The team releasing GPT-2 also wrote a
[model card](https://github.com/openai/gpt-2/blob/master/model_card.md) for their model. Content from this model card
has been written by the Hugging Face team to complete the information they provided and give specific examples of bias.
## Model description
GPT-2 is a transformers model pretrained on a very large corpus of English data in a self-supervised fashion. This
means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots
of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely,
it was trained to guess the next word in sentences.
More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence,
shifted one token (word or piece of word) to the right. The model uses internally a mask-mechanism to make sure the
predictions for the token `i` only uses the inputs from `1` to `i` but not the future tokens.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks. The model is best at what it was pretrained for however, which is generating texts from a
prompt.
This is the **smallest** version of GPT-2, with 124M parameters.
**Related Models:** [GPT-Large](https://huggingface.co/gpt2-large), [GPT-Medium](https://huggingface.co/gpt2-medium) and [GPT-XL](https://huggingface.co/gpt2-xl)
## Intended uses & limitations
You can use the raw model for text generation or fine-tune it to a downstream task. See the
[model hub](https://huggingface.co/models?filter=gpt2) to look for fine-tuned versions on a task that interests you.
### How to use
You can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, we
set a seed for reproducibility:
```python
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='gpt2')
>>> set_seed(42)
>>> generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
[{'generated_text': "Hello, I'm a language model, a language for thinking, a language for expressing thoughts."},
{'generated_text': "Hello, I'm a language model, a compiler, a compiler library, I just want to know how I build this kind of stuff. I don"},
{'generated_text': "Hello, I'm a language model, and also have more than a few of your own, but I understand that they're going to need some help"},
{'generated_text': "Hello, I'm a language model, a system model. I want to know my language so that it might be more interesting, more user-friendly"},
{'generated_text': 'Hello, I\'m a language model, not a language model"\n\nThe concept of "no-tricks" comes in handy later with new'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
model = GPT2Model.from_pretrained('gpt2')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import GPT2Tokenizer, TFGPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
model = TFGPT2Model.from_pretrained('gpt2')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
The training data used for this model has not been released as a dataset one can browse. We know it contains a lot of
unfiltered content from the internet, which is far from neutral. As the openAI team themselves point out in their
[model card](https://github.com/openai/gpt-2/blob/master/model_card.md#out-of-scope-use-cases):
> Because large-scale language models like GPT-2 do not distinguish fact from fiction, we don’t support use-cases
> that require the generated text to be true.
>
> Additionally, language models like GPT-2 reflect the biases inherent to the systems they were trained on, so we do
> not recommend that they be deployed into systems that interact with humans > unless the deployers first carry out a
> study of biases relevant to the intended use-case. We found no statistically significant difference in gender, race,
> and religious bias probes between 774M and 1.5B, implying all versions of GPT-2 should be approached with similar
> levels of caution around use cases that are sensitive to biases around human attributes.
Here's an example of how the model can have biased predictions:
```python
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='gpt2')
>>> set_seed(42)
>>> generator("The White man worked as a", max_length=10, num_return_sequences=5)
[{'generated_text': 'The White man worked as a mannequin for'},
{'generated_text': 'The White man worked as a maniser of the'},
{'generated_text': 'The White man worked as a bus conductor by day'},
{'generated_text': 'The White man worked as a plumber at the'},
{'generated_text': 'The White man worked as a journalist. He had'}]
>>> set_seed(42)
>>> generator("The Black man worked as a", max_length=10, num_return_sequences=5)
[{'generated_text': 'The Black man worked as a man at a restaurant'},
{'generated_text': 'The Black man worked as a car salesman in a'},
{'generated_text': 'The Black man worked as a police sergeant at the'},
{'generated_text': 'The Black man worked as a man-eating monster'},
{'generated_text': 'The Black man worked as a slave, and was'}]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
The OpenAI team wanted to train this model on a corpus as large as possible. To build it, they scraped all the web
pages from outbound links on Reddit which received at least 3 karma. Note that all Wikipedia pages were removed from
this dataset, so the model was not trained on any part of Wikipedia. The resulting dataset (called WebText) weights
40GB of texts but has not been publicly released. You can find a list of the top 1,000 domains present in WebText
[here](https://github.com/openai/gpt-2/blob/master/domains.txt).
## Training procedure
### Preprocessing
The texts are tokenized using a byte-level version of Byte Pair Encoding (BPE) (for unicode characters) and a
vocabulary size of 50,257. The inputs are sequences of 1024 consecutive tokens.
The larger model was trained on 256 cloud TPU v3 cores. The training duration was not disclosed, nor were the exact
details of training.
## Evaluation results
The model achieves the following results without any fine-tuning (zero-shot):
| Dataset | LAMBADA | LAMBADA | CBT-CN | CBT-NE | WikiText2 | PTB | enwiki8 | text8 | WikiText103 | 1BW |
|:--------:|:-------:|:-------:|:------:|:------:|:---------:|:------:|:-------:|:------:|:-----------:|:-----:|
| (metric) | (PPL) | (ACC) | (ACC) | (ACC) | (PPL) | (PPL) | (BPB) | (BPC) | (PPL) | (PPL) |
| | 35.13 | 45.99 | 87.65 | 83.4 | 29.41 | 65.85 | 1.16 | 1,17 | 37.50 | 75.20 |
### BibTeX entry and citation info
```bibtex
@article{radford2019language,
title={Language Models are Unsupervised Multitask Learners},
author={Radford, Alec and Wu, Jeff and Child, Rewon and Luan, David and Amodei, Dario and Sutskever, Ilya},
year={2019}
}
```
<a href="https://huggingface.co/exbert/?model=gpt2">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.26800060272216797,
-0.7213711738586426,
0.30211585760116577,
-0.029406607151031494,
-0.25600627064704895,
-0.30617034435272217,
-0.3942148983478546,
-0.5192710161209106,
-0.10086898505687714,
0.30821824073791504,
-0.47000324726104736,
-0.2688843607902527,
-0.7264645099639893,
-0.032964274287223816,
-0.2630700170993805,
1.3902673721313477,
-0.1165480837225914,
0.014302617870271206,
0.07921174168586731,
0.07556425780057907,
-0.34821563959121704,
-0.4475557506084442,
-0.626145601272583,
-0.44711577892303467,
0.3113221824169159,
0.11196576803922653,
0.5982396602630615,
0.6187265515327454,
0.19330264627933502,
0.18577978014945984,
-0.1108967736363411,
0.038254812359809875,
-0.4871658384799957,
-0.1758861094713211,
-0.19592522084712982,
-0.32758116722106934,
-0.31916528940200806,
0.21157662570476532,
0.49687138199806213,
0.38406431674957275,
0.14179302752017975,
0.3340820372104645,
0.29046663641929626,
0.28503215312957764,
-0.3820275366306305,
0.29248374700546265,
-0.5449777841567993,
-0.1045522689819336,
-0.37312787771224976,
0.09404546022415161,
-0.40795403718948364,
-0.12326181679964066,
0.10076796263456345,
-0.4875422716140747,
0.40994688868522644,
-0.09439310431480408,
1.1653259992599487,
0.24578028917312622,
-0.4644908607006073,
-0.19272516667842865,
-0.699135959148407,
0.7981328368186951,
-0.6962667107582092,
0.31467753648757935,
0.46429169178009033,
0.061448149383068085,
-0.024337971583008766,
-0.843987762928009,
-0.730614185333252,
-0.16626375913619995,
-0.29180431365966797,
0.2588072717189789,
-0.06669306755065918,
-0.05579200014472008,
0.36462417244911194,
0.3002094030380249,
-0.851883590221405,
-0.012264401651918888,
-0.4588051736354828,
-0.2986520528793335,
0.48013177514076233,
-0.10887100547552109,
0.35492467880249023,
-0.3975319266319275,
-0.3588367998600006,
-0.2832241952419281,
-0.5684046149253845,
-0.07404550164937973,
0.435140997171402,
0.25759562849998474,
-0.29499393701553345,
0.6803699731826782,
-0.0020231055095791817,
0.5221033692359924,
-0.06638520210981369,
-0.14566990733146667,
0.3320988118648529,
-0.48691725730895996,
-0.12801867723464966,
-0.23632092773914337,
1.1070319414138794,
0.26391366124153137,
0.4432751536369324,
-0.11973480135202408,
-0.2031804472208023,
0.12757743895053864,
0.05614260211586952,
-0.8937644362449646,
-0.3307704031467438,
0.19552700221538544,
-0.4306071996688843,
-0.3270542323589325,
0.06010166183114052,
-0.8052879571914673,
-0.045688048005104065,
-0.15496569871902466,
0.3911561071872711,
-0.4507558047771454,
-0.4880216419696808,
-0.23811085522174835,
-0.23508352041244507,
0.23662103712558746,
-0.06764927506446838,
-1.0571582317352295,
0.14638210833072662,
0.5997335910797119,
0.8951951265335083,
0.01524875033646822,
-0.4092927873134613,
-0.14700202643871307,
-0.0276336669921875,
-0.13536247611045837,
0.49413859844207764,
-0.26020628213882446,
-0.13727353513240814,
-0.09805407375097275,
0.01550777442753315,
-0.0613178052008152,
-0.2888031005859375,
0.4719673693180084,
-0.39514440298080444,
0.6220029592514038,
-0.22662149369716644,
-0.45036840438842773,
-0.0927693173289299,
0.04494751617312431,
-0.46900320053100586,
1.2078648805618286,
0.39375951886177063,
-1.0375611782073975,
0.38671526312828064,
-0.752838134765625,
-0.39512380957603455,
-0.12920862436294556,
-0.09098172932863235,
-0.5057074427604675,
-0.05609443038702011,
0.17857997119426727,
0.297180712223053,
-0.46523356437683105,
0.40792664885520935,
-0.11918146908283234,
-0.21414433419704437,
0.13202640414237976,
-0.38899436593055725,
1.0884586572647095,
0.2816142439842224,
-0.6598138213157654,
-0.06511913239955902,
-0.5095223784446716,
0.08556293696165085,
0.4092918038368225,
-0.347924143075943,
-0.13130274415016174,
-0.06556221097707748,
0.3314511179924011,
0.35934340953826904,
0.19003872573375702,
-0.5077027082443237,
0.22835850715637207,
-0.486895352602005,
0.6538479328155518,
0.6057867407798767,
-0.12694789469242096,
0.32181406021118164,
-0.18201051652431488,
0.2849946618080139,
-0.01680440455675125,
0.0934966653585434,
-0.05431259050965309,
-0.7667784094810486,
-0.7437343597412109,
-0.11866719275712967,
0.47263744473457336,
0.7276293039321899,
-0.773720920085907,
0.44414398074150085,
-0.2846788465976715,
-0.4806286692619324,
-0.4828583896160126,
0.10368817299604416,
0.6313635110855103,
0.5151225924491882,
0.43877390027046204,
-0.22405023872852325,
-0.5790882110595703,
-0.7968162894248962,
-0.28335240483283997,
-0.3306891620159149,
-0.1796269565820694,
0.1642143279314041,
0.7243932485580444,
-0.3068493604660034,
0.9339622259140015,
-0.5619862079620361,
-0.21537292003631592,
-0.38102278113365173,
0.19944939017295837,
0.14170153439044952,
0.5326336622238159,
0.5184351205825806,
-0.6424381136894226,
-0.4989464282989502,
-0.120135597884655,
-0.8040398955345154,
-0.08032265305519104,
0.0239741038531065,
-0.1285729855298996,
0.32160380482673645,
0.2774953246116638,
-0.8789204955101013,
0.27267464995384216,
0.48421773314476013,
-0.49706339836120605,
0.6610094904899597,
-0.12826049327850342,
-0.2625684440135956,
-1.3356661796569824,
0.3465004861354828,
0.1355881243944168,
-0.12252910435199738,
-0.7671564817428589,
0.13945402204990387,
0.04276818782091141,
-0.07160677760839462,
-0.2979741394519806,
0.7875285744667053,
-0.5081168413162231,
-0.00751293171197176,
-0.19843637943267822,
0.07589121162891388,
-0.12013852596282959,
0.64971524477005,
0.014435765333473682,
0.9322414994239807,
0.411895215511322,
-0.463489830493927,
0.13715112209320068,
0.29597511887550354,
-0.4007657766342163,
0.24701716005802155,
-0.7747828364372253,
0.2775854468345642,
-0.11215464025735855,
0.21461786329746246,
-0.9456405639648438,
-0.3721058666706085,
0.3128392696380615,
-0.6385411024093628,
0.4225650131702423,
-0.17437367141246796,
-0.6571202874183655,
-0.5477219820022583,
-0.14025536179542542,
0.4077211618423462,
0.7857695817947388,
-0.43490952253341675,
0.3347192406654358,
0.4391508996486664,
-0.13149046897888184,
-0.5604321956634521,
-0.8165533542633057,
-0.05467802658677101,
-0.11488664895296097,
-0.5928171277046204,
0.3433428406715393,
0.08607473224401474,
-0.07673565298318863,
-0.03740604966878891,
0.24864710867404938,
-0.06723125278949738,
-0.0037849280051887035,
0.19491885602474213,
0.3150444030761719,
-0.13385364413261414,
0.08810748904943466,
0.0042253644205629826,
-0.17629386484622955,
-0.00936805084347725,
-0.5585521459579468,
0.725403368473053,
0.05359577015042305,
-0.05226777121424675,
-0.40876853466033936,
0.14762000739574432,
0.3351588845252991,
-0.25821423530578613,
0.7117131352424622,
1.010573387145996,
-0.4582613706588745,
0.0018501841695979238,
-0.4366331100463867,
-0.2912878692150116,
-0.4026377499103546,
0.6927090287208557,
-0.3437272906303406,
-0.8904018998146057,
0.40723150968551636,
0.3026493191719055,
0.1341148465871811,
0.8081094622612,
0.7567421793937683,
0.16100551187992096,
1.0377908945083618,
0.5130167603492737,
-0.11988598108291626,
0.4114222824573517,
-0.4062674045562744,
0.17023585736751556,
-0.906610906124115,
-0.19863179326057434,
-0.4266345798969269,
-0.1311579942703247,
-0.7718591690063477,
-0.40216314792633057,
0.23521974682807922,
0.22589705884456635,
-0.4612140953540802,
0.4834059774875641,
-0.6199231743812561,
0.33947259187698364,
0.7517991662025452,
0.07817743718624115,
-0.022676769644021988,
0.11118581146001816,
-0.1992121934890747,
-0.00350290653295815,
-0.5338294506072998,
-0.5187957882881165,
1.2871243953704834,
0.43834319710731506,
0.4167836606502533,
0.028195952996611595,
0.42767831683158875,
0.03170802444219589,
0.3277318775653839,
-0.5097234845161438,
0.34809380769729614,
-0.277678519487381,
-0.8296948075294495,
-0.317909300327301,
-0.501082181930542,
-0.8991039991378784,
0.23071198165416718,
-0.02957106940448284,
-0.8976508378982544,
-0.0639822781085968,
0.18651573359966278,
-0.18512602150440216,
0.3927589952945709,
-0.8144452571868896,
1.0133906602859497,
-0.18981565535068512,
-0.35401830077171326,
0.044074300676584244,
-0.6978777050971985,
0.449972540140152,
-0.01484525017440319,
0.07528553158044815,
0.13486096262931824,
0.09085747599601746,
0.9053322076797485,
-0.6245647072792053,
0.916256844997406,
-0.29548200964927673,
-0.005859556142240763,
0.5056777596473694,
-0.08805472403764725,
0.534161388874054,
-0.044477030634880066,
0.034415747970342636,
0.3798922598361969,
-0.22214993834495544,
-0.4134658873081207,
-0.26896917819976807,
0.6071754693984985,
-1.184957504272461,
-0.36317434906959534,
-0.44240161776542664,
-0.4715040624141693,
0.04819166660308838,
0.3914695084095001,
0.7298160791397095,
0.3964495062828064,
-0.08616654574871063,
-0.09579665213823318,
0.4138718247413635,
-0.2435775250196457,
0.4494536221027374,
0.15433833003044128,
-0.12420237064361572,
-0.4439282715320587,
0.8603357672691345,
0.1618364453315735,
0.26865407824516296,
0.35537195205688477,
0.21158486604690552,
-0.49669885635375977,
-0.3594887852668762,
-0.6087033152580261,
0.4384844899177551,
-0.5510559678077698,
-0.10174434632062912,
-0.8119768500328064,
-0.3457333743572235,
-0.6339358687400818,
0.2323945164680481,
-0.2947476804256439,
-0.4493906795978546,
-0.39651229977607727,
-0.15983577072620392,
0.2917042672634125,
0.8486515283584595,
0.0418647825717926,
0.39577656984329224,
-0.4636988341808319,
0.22048842906951904,
0.4037657082080841,
0.37119394540786743,
0.009919606149196625,
-0.7324863076210022,
-0.1855265349149704,
0.24214671552181244,
-0.4823529124259949,
-0.8280507326126099,
0.34308579564094543,
0.08988941460847855,
0.3521391749382019,
0.28812000155448914,
-0.19161829352378845,
0.4323657751083374,
-0.4473225772380829,
1.0535187721252441,
0.18685311079025269,
-0.8218963146209717,
0.50159752368927,
-0.3928958475589752,
0.2882399559020996,
0.33473658561706543,
0.2575318515300751,
-0.5158659815788269,
-0.28199172019958496,
-0.6583702564239502,
-0.8613508939743042,
0.9132770895957947,
0.4461021423339844,
0.17654310166835785,
-0.06547531485557556,
0.4186922311782837,
0.062362831085920334,
0.11308256536722183,
-1.0410906076431274,
-0.3902961313724518,
-0.5319854617118835,
-0.31022611260414124,
-0.20339155197143555,
-0.44128620624542236,
0.0660208985209465,
-0.20821432769298553,
0.7967042326927185,
-0.043552473187446594,
0.6466165781021118,
0.12722748517990112,
-0.2520384192466736,
0.04633825272321701,
0.1593116819858551,
0.6545462012290955,
0.5236353278160095,
-0.08097896724939346,
0.11724525690078735,
0.09723123908042908,
-0.7058572173118591,
0.006657379679381847,
0.2274378389120102,
-0.46653106808662415,
0.014052494429051876,
0.3627628982067108,
1.1284927129745483,
-0.17111964523792267,
-0.3689991235733032,
0.6230653524398804,
0.11818922311067581,
-0.28338831663131714,
-0.377174973487854,
-0.008642543107271194,
0.07189302891492844,
0.13362576067447662,
0.23323166370391846,
-0.04890561103820801,
-0.08191262930631638,
-0.5237978100776672,
0.15718889236450195,
0.3241625130176544,
-0.38809147477149963,
-0.510742723941803,
0.9770525097846985,
0.0853576734662056,
-0.2860836684703827,
0.8123061060905457,
-0.4817317724227905,
-0.6476997137069702,
0.5594940185546875,
0.7122218608856201,
0.9522725343704224,
-0.12782280147075653,
0.28609007596969604,
0.644853949546814,
0.4218883812427521,
-0.22604435682296753,
0.19301442801952362,
0.20214596390724182,
-0.7106346487998962,
-0.5089858770370483,
-0.6269577741622925,
0.04147981479763985,
0.46577417850494385,
-0.37330713868141174,
0.29646095633506775,
-0.3641170859336853,
-0.3079545199871063,
-0.07672257721424103,
0.06536015123128891,
-0.7903711199760437,
0.24284283816814423,
0.08035686612129211,
0.7506875395774841,
-0.9109331369400024,
0.9211437702178955,
0.6786550283432007,
-0.6857967376708984,
-0.9349444508552551,
0.1256517916917801,
-0.023530030623078346,
-0.8510869145393372,
0.638496994972229,
0.3101532459259033,
0.4045220613479614,
0.05338480696082115,
-0.515187680721283,
-0.8637335300445557,
1.1447993516921997,
0.2939298450946808,
-0.3679497241973877,
-0.26547688245773315,
0.34589192271232605,
0.6052057147026062,
-0.1192711666226387,
0.7019214630126953,
0.5606275200843811,
0.48654189705848694,
-0.17398542165756226,
-1.0288004875183105,
0.2828434109687805,
-0.330595999956131,
0.18590962886810303,
0.22017857432365417,
-0.7651781439781189,
1.168226957321167,
-0.2407006323337555,
-0.15598566830158234,
0.08569645136594772,
0.554932177066803,
0.10836654901504517,
0.037449803203344345,
0.40727147459983826,
0.6568664312362671,
0.6801350116729736,
-0.30083832144737244,
1.2677667140960693,
-0.3242199122905731,
0.6897895932197571,
1.0587784051895142,
0.07107196003198624,
0.6327437162399292,
0.3020801842212677,
-0.2821864187717438,
0.47166940569877625,
0.6130788326263428,
-0.14451247453689575,
0.549699068069458,
0.06542303413152695,
0.03683043643832207,
0.02561301179230213,
-0.021907448768615723,
-0.4058336019515991,
0.38616159558296204,
0.09967286139726639,
-0.5244377255439758,
-0.1164919063448906,
-0.03231293708086014,
0.42983561754226685,
-0.28713634610176086,
-0.053241197019815445,
0.7209063768386841,
0.09167949855327606,
-0.8592329621315002,
0.665591299533844,
0.308433473110199,
0.7687047719955444,
-0.5763344168663025,
0.16395990550518036,
-0.13765716552734375,
0.2581499218940735,
-0.1440669745206833,
-0.7767511010169983,
0.17480646073818207,
0.11221832036972046,
-0.32738468050956726,
-0.1583128124475479,
0.7199274897575378,
-0.5567746758460999,
-0.4291622042655945,
0.26953238248825073,
0.43337658047676086,
0.3087013363838196,
-0.22416310012340546,
-0.736251711845398,
-0.18669874966144562,
0.18247993290424347,
-0.454316109418869,
0.3840043246746063,
0.27320051193237305,
-0.07310883700847626,
0.37324824929237366,
0.647759199142456,
0.08566077053546906,
0.025547156110405922,
0.10052385926246643,
0.7372643947601318,
-0.5779276490211487,
-0.4512730836868286,
-0.9202864766120911,
0.5858457684516907,
-0.09076029062271118,
-0.5608783960342407,
0.657627284526825,
0.6443025469779968,
1.0220173597335815,
-0.14791184663772583,
1.013791561126709,
-0.3654012084007263,
0.44123849272727966,
-0.409017950296402,
0.7577755451202393,
-0.5141586065292358,
-0.07105136662721634,
-0.24143409729003906,
-1.0052385330200195,
-0.05019117519259453,
0.6307552456855774,
-0.3299505114555359,
0.35164305567741394,
0.739716649055481,
0.867887556552887,
-0.11490798741579056,
-0.09091459959745407,
0.01570977456867695,
0.37901660799980164,
0.32746621966362,
0.6663816571235657,
0.4530796408653259,
-0.6471797823905945,
0.6932317018508911,
-0.3478170335292816,
-0.3195335865020752,
-0.06411959230899811,
-0.5901902914047241,
-1.0248439311981201,
-0.6521384119987488,
-0.1938524693250656,
-0.5778084397315979,
0.02656811662018299,
0.8428603410720825,
0.6702060103416443,
-0.8657920360565186,
-0.22634442150592804,
-0.23799413442611694,
-0.09036734700202942,
-0.15369386970996857,
-0.28477418422698975,
0.48875635862350464,
-0.23629847168922424,
-0.7635785937309265,
-0.015300487168133259,
-0.1274365931749344,
0.19849665462970734,
-0.25950995087623596,
-0.17400768399238586,
-0.21592330932617188,
-0.18638065457344055,
0.535668134689331,
0.20458093285560608,
-0.6781095266342163,
-0.3611910343170166,
-0.037340108305215836,
-0.20583447813987732,
-0.059516869485378265,
0.6663970351219177,
-0.5570838451385498,
0.2479744404554367,
0.5099780559539795,
0.4193369448184967,
0.5908821225166321,
-0.11142013221979141,
0.4345402121543884,
-0.727213442325592,
0.21286959946155548,
-0.00995674729347229,
0.3287694752216339,
0.3667744994163513,
-0.40244582295417786,
0.6035663485527039,
0.48052337765693665,
-0.6191853880882263,
-0.6935640573501587,
0.17578984797000885,
-0.746711015701294,
-0.27755314111709595,
1.4319003820419312,
-0.11748728156089783,
-0.166074737906456,
-0.029791751876473427,
-0.18566353619098663,
0.6330386400222778,
-0.3753071129322052,
0.6690351366996765,
0.6748413443565369,
0.16290877759456635,
-0.08876632153987885,
-0.6962429881095886,
0.5650122761726379,
0.30741024017333984,
-0.6768838763237,
0.049271680414676666,
0.21262142062187195,
0.5891735553741455,
0.22511906921863556,
0.7403094172477722,
-0.1352323591709137,
0.04189683496952057,
0.043528202921152115,
0.2142183482646942,
-0.10028295964002609,
-0.16453728079795837,
-0.15367716550827026,
0.048850346356630325,
-0.07545870542526245,
-0.13926011323928833
] |
timm/mobilenetv3_large_100.ra_in1k | timm | "2023-04-27T22:49:21Z" | 15,846,252 | 17 | timm | [
"timm",
"pytorch",
"safetensors",
"image-classification",
"dataset:imagenet-1k",
"arxiv:2110.00476",
"arxiv:1905.02244",
"license:apache-2.0",
"has_space",
"region:us"
] | image-classification | "2022-12-16T05:38:07Z" | ---
tags:
- image-classification
- timm
library_name: timm
license: apache-2.0
datasets:
- imagenet-1k
---
# Model card for mobilenetv3_large_100.ra_in1k
A MobileNet-v3 image classification model. Trained on ImageNet-1k in `timm` using recipe template described below.
Recipe details:
* RandAugment `RA` recipe. Inspired by and evolved from EfficientNet RandAugment recipes. Published as `B` recipe in [ResNet Strikes Back](https://arxiv.org/abs/2110.00476).
* RMSProp (TF 1.0 behaviour) optimizer, EMA weight averaging
* Step (exponential decay w/ staircase) LR schedule with warmup
## Model Details
- **Model Type:** Image classification / feature backbone
- **Model Stats:**
- Params (M): 5.5
- GMACs: 0.2
- Activations (M): 4.4
- Image size: 224 x 224
- **Papers:**
- Searching for MobileNetV3: https://arxiv.org/abs/1905.02244
- ResNet strikes back: An improved training procedure in timm: https://arxiv.org/abs/2110.00476
- **Dataset:** ImageNet-1k
- **Original:** https://github.com/huggingface/pytorch-image-models
## Model Usage
### Image Classification
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model('mobilenetv3_large_100.ra_in1k', pretrained=True)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
```
### Feature Map Extraction
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'mobilenetv3_large_100.ra_in1k',
pretrained=True,
features_only=True,
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
for o in output:
# print shape of each feature map in output
# e.g.:
# torch.Size([1, 16, 112, 112])
# torch.Size([1, 24, 56, 56])
# torch.Size([1, 40, 28, 28])
# torch.Size([1, 112, 14, 14])
# torch.Size([1, 960, 7, 7])
print(o.shape)
```
### Image Embeddings
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'mobilenetv3_large_100.ra_in1k',
pretrained=True,
num_classes=0, # remove classifier nn.Linear
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
# or equivalently (without needing to set num_classes=0)
output = model.forward_features(transforms(img).unsqueeze(0))
# output is unpooled, a (1, 960, 7, 7) shaped tensor
output = model.forward_head(output, pre_logits=True)
# output is a (1, num_features) shaped tensor
```
## Model Comparison
Explore the dataset and runtime metrics of this model in timm [model results](https://github.com/huggingface/pytorch-image-models/tree/main/results).
## Citation
```bibtex
@inproceedings{howard2019searching,
title={Searching for mobilenetv3},
author={Howard, Andrew and Sandler, Mark and Chu, Grace and Chen, Liang-Chieh and Chen, Bo and Tan, Mingxing and Wang, Weijun and Zhu, Yukun and Pang, Ruoming and Vasudevan, Vijay and others},
booktitle={Proceedings of the IEEE/CVF international conference on computer vision},
pages={1314--1324},
year={2019}
}
```
```bibtex
@misc{rw2019timm,
author = {Ross Wightman},
title = {PyTorch Image Models},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
doi = {10.5281/zenodo.4414861},
howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
}
```
```bibtex
@inproceedings{wightman2021resnet,
title={ResNet strikes back: An improved training procedure in timm},
author={Wightman, Ross and Touvron, Hugo and Jegou, Herve},
booktitle={NeurIPS 2021 Workshop on ImageNet: Past, Present, and Future}
}
```
| [
-0.42348533868789673,
-0.28704380989074707,
-0.060248397290706635,
0.08704610168933868,
-0.3158630132675171,
-0.41070929169654846,
-0.07284087687730789,
-0.35634562373161316,
0.38355836272239685,
0.4785507321357727,
-0.37447744607925415,
-0.741416871547699,
-0.5964348316192627,
-0.09770839661359787,
-0.1315591037273407,
0.8204724788665771,
-0.11619140952825546,
-0.07914324104785919,
-0.11129607260227203,
-0.6696323156356812,
-0.23828454315662384,
-0.3398592472076416,
-0.9126936793327332,
-0.482953280210495,
0.4982103705406189,
0.3534066677093506,
0.5794948935508728,
0.686033308506012,
0.6429165601730347,
0.43396225571632385,
-0.037324871867895126,
0.1376400589942932,
-0.09297335147857666,
-0.19031496345996857,
0.41923603415489197,
-0.7002341151237488,
-0.44241973757743835,
0.3282971680164337,
0.6296827793121338,
0.23484256863594055,
0.007683929055929184,
0.4462060332298279,
0.044905394315719604,
0.735454261302948,
-0.36965706944465637,
-0.023695332929491997,
-0.48746877908706665,
0.20347414910793304,
-0.15914268791675568,
-0.037138164043426514,
-0.2747045159339905,
-0.457736074924469,
0.11535139381885529,
-0.4381166994571686,
0.39791151881217957,
0.010497053153812885,
1.3639661073684692,
0.16708098351955414,
-0.1713085174560547,
0.024953775107860565,
-0.26268458366394043,
0.7973536849021912,
-0.7441643476486206,
0.21717171370983124,
0.41337257623672485,
0.24148185551166534,
-0.08083496987819672,
-1.0586925745010376,
-0.6307123303413391,
-0.18606649339199066,
0.0002544317103456706,
-0.021648496389389038,
-0.2164537012577057,
-0.10148067027330399,
0.2597903609275818,
0.25181880593299866,
-0.44010865688323975,
0.10682906955480576,
-0.5297539830207825,
-0.21305087208747864,
0.6085715293884277,
0.05116874352097511,
0.40953323245048523,
-0.32476845383644104,
-0.4280506372451782,
-0.38584446907043457,
-0.48898711800575256,
0.3252717852592468,
0.24587737023830414,
0.2129523903131485,
-0.6616863012313843,
0.5074856281280518,
0.05605536326766014,
0.6982414722442627,
-0.02660249173641205,
-0.43251219391822815,
0.7313666939735413,
-0.06633323431015015,
-0.4136558473110199,
-0.08313822746276855,
1.175633430480957,
0.5658135414123535,
0.1634339839220047,
0.19523297250270844,
-0.0962085947394371,
-0.4745062589645386,
-0.020654525607824326,
-1.1938143968582153,
-0.2604677677154541,
0.3521154522895813,
-0.879441499710083,
-0.48203209042549133,
0.21844063699245453,
-0.5124501585960388,
-0.2268432229757309,
0.05903937667608261,
0.4552991986274719,
-0.42989566922187805,
-0.42538610100746155,
0.05430371314287186,
-0.13325314223766327,
0.37115004658699036,
0.14203405380249023,
-0.5906597971916199,
0.1351097971200943,
0.22229062020778656,
1.3122295141220093,
0.1401495337486267,
-0.47035470604896545,
-0.26221540570259094,
-0.38237306475639343,
-0.22011491656303406,
0.4125920236110687,
-0.10161234438419342,
-0.16200295090675354,
-0.3378206193447113,
0.3388643264770508,
-0.2706914246082306,
-0.8196733593940735,
0.3650502860546112,
-0.3122868835926056,
0.19094251096248627,
-0.004904091823846102,
-0.029084281995892525,
-0.6309621930122375,
0.3008995056152344,
-0.5346730947494507,
1.402312159538269,
0.27842092514038086,
-0.9229663610458374,
0.2863938510417938,
-0.578763484954834,
-0.19145788252353668,
-0.3849440813064575,
0.005219656508415937,
-1.0957401990890503,
-0.16754208505153656,
0.2589605450630188,
0.8700389862060547,
-0.3934794068336487,
-0.07281536608934402,
-0.6129143238067627,
-0.3251670002937317,
0.31497129797935486,
0.13740669190883636,
1.0734502077102661,
0.25100648403167725,
-0.5429611206054688,
0.21784843504428864,
-0.6422085762023926,
0.19757963716983795,
0.4923722445964813,
-0.24261505901813507,
-0.1239829808473587,
-0.459246963262558,
0.10754761844873428,
0.38549572229385376,
0.0005027271108701825,
-0.564276933670044,
0.21448586881160736,
-0.1703403890132904,
0.5713128447532654,
0.43105417490005493,
-0.13112425804138184,
0.39608290791511536,
-0.46400678157806396,
0.2913931608200073,
0.2858252227306366,
0.2854510247707367,
-0.11374001204967499,
-0.5876470804214478,
-0.8015453219413757,
-0.45345422625541687,
0.39280977845191956,
0.47878149151802063,
-0.5906392335891724,
0.34106630086898804,
-0.20854663848876953,
-0.8528625965118408,
-0.4573950469493866,
0.08097974210977554,
0.4567543864250183,
0.5435879826545715,
0.30953821539878845,
-0.5093849301338196,
-0.6313554644584656,
-0.9302613735198975,
-0.05380910262465477,
0.045439112931489944,
0.011821726337075233,
0.463560551404953,
0.7264660000801086,
-0.1754179298877716,
0.6988248229026794,
-0.29281044006347656,
-0.29222217202186584,
-0.25267601013183594,
0.08841254562139511,
0.4093695282936096,
0.832099437713623,
0.8242072463035583,
-0.8466474413871765,
-0.4737040400505066,
-0.023675940930843353,
-0.9794518351554871,
0.19910240173339844,
-0.11242476850748062,
-0.07590793818235397,
0.2725590467453003,
0.27029144763946533,
-0.6408718228340149,
0.6537405252456665,
0.2488146871328354,
-0.16347216069698334,
0.3784598410129547,
-0.0691852793097496,
0.2896188795566559,
-1.2992026805877686,
0.13201113045215607,
0.48081740736961365,
-0.14780211448669434,
-0.38070738315582275,
0.07961510866880417,
0.09835832566022873,
-0.1468922197818756,
-0.602266252040863,
0.6969393491744995,
-0.5478137135505676,
-0.242793008685112,
-0.20578700304031372,
-0.12740178406238556,
-0.017239371314644814,
0.6025288105010986,
-0.15862436592578888,
0.47201821208000183,
0.7386423945426941,
-0.5644050240516663,
0.5459485650062561,
0.2805376648902893,
-0.18191249668598175,
0.3116166591644287,
-0.72276371717453,
0.1866394430398941,
0.03355417028069496,
0.38326185941696167,
-0.8627443313598633,
-0.29552558064460754,
0.4104108214378357,
-0.6978734731674194,
0.43533894419670105,
-0.658306896686554,
-0.4408513009548187,
-0.652315616607666,
-0.5554404258728027,
0.4280366897583008,
0.589364767074585,
-0.7847724556922913,
0.6407856345176697,
0.29438483715057373,
0.3754956126213074,
-0.6312875747680664,
-0.8393887877464294,
-0.19125379621982574,
-0.49849921464920044,
-0.7980324029922485,
0.456439346075058,
0.3226906955242157,
0.08638279885053635,
0.03431084752082825,
-0.1635177582502365,
-0.17195627093315125,
-0.11082285642623901,
0.7221019864082336,
0.342162162065506,
-0.27190929651260376,
-0.21018242835998535,
-0.4845534563064575,
-0.03554254025220871,
-0.015787435695528984,
-0.4046647250652313,
0.6128990054130554,
-0.34907224774360657,
-0.05122484639286995,
-0.946409285068512,
-0.21927528083324432,
0.5775348544120789,
-0.15181437134742737,
0.8220127820968628,
1.186039686203003,
-0.520042359828949,
0.1437680423259735,
-0.5133559107780457,
-0.187224879860878,
-0.5027512311935425,
0.3794330060482025,
-0.4527505338191986,
-0.4843794107437134,
0.9595658779144287,
0.033577002584934235,
-0.0014107167953625321,
0.6493582725524902,
0.3387535810470581,
-0.07680614292621613,
0.8017215132713318,
0.5736362338066101,
0.1662721186876297,
0.7273172736167908,
-0.9061659574508667,
-0.22195936739444733,
-0.952970027923584,
-0.6513695120811462,
-0.4635567367076874,
-0.5293684005737305,
-0.7712084650993347,
-0.4209119975566864,
0.40926337242126465,
0.1751173436641693,
-0.45303651690483093,
0.5451992750167847,
-0.7724483609199524,
0.10077983886003494,
0.7326833605766296,
0.6784394979476929,
-0.41388118267059326,
0.3678516745567322,
-0.35816165804862976,
-0.0011080054100602865,
-0.8235939145088196,
-0.26887571811676025,
1.1865462064743042,
0.4701661467552185,
0.5517743825912476,
-0.08954568952322006,
0.8287662267684937,
-0.31057116389274597,
0.34672003984451294,
-0.6627294421195984,
0.6230694651603699,
-0.0766533613204956,
-0.45444387197494507,
-0.03587116673588753,
-0.5132749080657959,
-1.1091132164001465,
0.1544867604970932,
-0.30484429001808167,
-0.8158209323883057,
0.18959400057792664,
0.1986398845911026,
-0.2837434411048889,
0.7722648978233337,
-0.8674749135971069,
0.916687548160553,
-0.05335213243961334,
-0.5436697602272034,
0.1319233924150467,
-0.7414104342460632,
0.39805829524993896,
0.20876777172088623,
-0.1775331199169159,
-0.11060954630374908,
0.13390310108661652,
1.0940808057785034,
-0.6632060408592224,
0.819428563117981,
-0.49431827664375305,
0.41609805822372437,
0.5961350798606873,
-0.1273093968629837,
0.40298959612846375,
-0.05176255851984024,
-0.24658703804016113,
0.27626219391822815,
-0.0171051025390625,
-0.4780831038951874,
-0.5578088760375977,
0.6930992603302002,
-0.9334447979927063,
-0.26092827320098877,
-0.3649969696998596,
-0.3462616205215454,
0.205439493060112,
0.2003602534532547,
0.5632120966911316,
0.7205398082733154,
0.3669765591621399,
0.3323966860771179,
0.5685994625091553,
-0.5302707552909851,
0.5088195204734802,
-0.09600286185741425,
-0.2660495638847351,
-0.5624807476997375,
0.9515230655670166,
0.12932747602462769,
0.02000402845442295,
0.13930918276309967,
0.17294904589653015,
-0.3384872376918793,
-0.6400954723358154,
-0.316924512386322,
0.27723509073257446,
-0.6187702417373657,
-0.5126295685768127,
-0.6424781084060669,
-0.41436922550201416,
-0.31728702783584595,
-0.04697370529174805,
-0.5686346888542175,
-0.33187776803970337,
-0.42672842741012573,
0.3242977261543274,
0.7336624264717102,
0.495635449886322,
-0.16023774445056915,
0.6234549880027771,
-0.675430417060852,
0.19333548843860626,
0.07215636968612671,
0.4662696123123169,
-0.0707777664065361,
-0.8228791356086731,
-0.27240538597106934,
-0.017414478585124016,
-0.45394137501716614,
-0.6513543128967285,
0.5143735408782959,
0.0783066675066948,
0.39860618114471436,
0.24455475807189941,
-0.2718374729156494,
0.7549176216125488,
-0.015025493688881397,
0.6250133514404297,
0.5717119574546814,
-0.5451094508171082,
0.6303005814552307,
-0.1981404423713684,
0.25684574246406555,
0.14384111762046814,
0.40357568860054016,
-0.24515387415885925,
0.13147424161434174,
-0.9019796848297119,
-0.8111575245857239,
0.8364982008934021,
0.13343656063079834,
-0.01672898605465889,
0.34152787923812866,
0.7742083072662354,
-0.13387146592140198,
-0.07237204164266586,
-0.859839677810669,
-0.45691484212875366,
-0.4137187898159027,
-0.2503059208393097,
0.1909787356853485,
-0.11073070764541626,
-0.031447045505046844,
-0.7211777567863464,
0.6884593963623047,
0.003837296972051263,
0.7919813394546509,
0.3950577676296234,
0.052759792655706406,
0.05595900118350983,
-0.47693273425102234,
0.5995327234268188,
0.26095205545425415,
-0.39490386843681335,
0.07907191663980484,
0.14345687627792358,
-0.732158899307251,
0.16230709850788116,
0.11864076554775238,
0.03070748969912529,
0.03198980912566185,
0.3613387644290924,
0.895924985408783,
-0.05238579958677292,
0.09379538893699646,
0.45496776700019836,
-0.13138389587402344,
-0.5558854341506958,
-0.3073793351650238,
0.14006726443767548,
-0.039888545870780945,
0.4232349097728729,
0.4395013749599457,
0.4674142003059387,
-0.1227404996752739,
-0.23640455305576324,
0.2831578850746155,
0.4135206937789917,
-0.2954753339290619,
-0.25651001930236816,
0.7236454486846924,
-0.09993383288383484,
-0.2277735322713852,
0.7834814786911011,
-0.13311268389225006,
-0.4863165318965912,
1.0759793519973755,
0.4622451066970825,
0.9269233345985413,
-0.08244089782238007,
0.06493154168128967,
0.8917442560195923,
0.31376805901527405,
-0.10660708695650101,
0.2619699239730835,
0.2143675684928894,
-0.7820839881896973,
0.01692471094429493,
-0.4519488215446472,
0.10996030271053314,
0.4556168019771576,
-0.5754011869430542,
0.3593224585056305,
-0.6879422664642334,
-0.5173597931861877,
0.2475656121969223,
0.2960878610610962,
-0.8942639827728271,
0.2995672821998596,
-0.15976344048976898,
0.9494009017944336,
-0.5839245319366455,
0.8114690780639648,
0.9143181443214417,
-0.5009404420852661,
-1.1185073852539062,
0.013654801063239574,
0.09442786127328873,
-0.9374832510948181,
0.7423568964004517,
0.5140979290008545,
0.011262595653533936,
0.10740146040916443,
-0.8437169790267944,
-0.7055767774581909,
1.4188138246536255,
0.42389801144599915,
-0.08796501904726028,
0.3425700068473816,
-0.16670162975788116,
0.0653371810913086,
-0.4828898310661316,
0.5531744360923767,
0.1472480446100235,
0.28993067145347595,
0.31202030181884766,
-0.7744052410125732,
0.2530193328857422,
-0.39293015003204346,
0.18893401324748993,
0.21682193875312805,
-0.8722915053367615,
0.7795101404190063,
-0.5831138491630554,
-0.1359471082687378,
0.012401042506098747,
0.6125088334083557,
0.25680088996887207,
0.3005574345588684,
0.4628185033798218,
0.7548122406005859,
0.5080176591873169,
-0.24219128489494324,
0.9473742246627808,
0.016934433951973915,
0.4970037639141083,
0.6450777053833008,
0.24751773476600647,
0.6296773552894592,
0.36367669701576233,
-0.1845729947090149,
0.41382548213005066,
1.2270251512527466,
-0.2813389301300049,
0.30661535263061523,
0.1955552101135254,
-0.07356643676757812,
-0.005383160896599293,
0.09786003082990646,
-0.47442013025283813,
0.6504635810852051,
0.1167997494339943,
-0.6259492635726929,
-0.14229576289653778,
0.09837325662374496,
0.05372624471783638,
-0.3483488857746124,
-0.2681216895580292,
0.36482152342796326,
0.0637262761592865,
-0.36496496200561523,
1.0872145891189575,
0.26650404930114746,
0.8891480565071106,
-0.2689782381057739,
0.06064436212182045,
-0.31325051188468933,
0.103676937520504,
-0.4843413531780243,
-0.7068573236465454,
0.28762343525886536,
-0.2964957356452942,
-0.034857332706451416,
0.1028909906744957,
0.741881787776947,
-0.11524251848459244,
-0.3132686913013458,
0.08478605002164841,
0.20882079005241394,
0.5144577622413635,
0.038547907024621964,
-1.236317753791809,
0.29479530453681946,
0.14158570766448975,
-0.5930477380752563,
0.32462242245674133,
0.3153114914894104,
0.08030076324939728,
0.9015547037124634,
0.6318965554237366,
-0.2159574329853058,
0.13691046833992004,
-0.24228200316429138,
0.84771728515625,
-0.6403581500053406,
-0.21756501495838165,
-0.8629745244979858,
0.6076021790504456,
-0.2022780478000641,
-0.616715133190155,
0.58740234375,
0.695358395576477,
0.8193150162696838,
0.04244224354624748,
0.5328148007392883,
-0.3225293457508087,
-0.030999181792140007,
-0.5170333385467529,
0.6721293926239014,
-0.8111162185668945,
0.09081375598907471,
-0.08174844831228256,
-0.676059901714325,
-0.44690439105033875,
0.840299129486084,
-0.2758261561393738,
0.4403124153614044,
0.544383704662323,
1.0911879539489746,
-0.450914204120636,
-0.2624810039997101,
0.06788709759712219,
-0.0032723688054829836,
-0.038936909288167953,
0.34037256240844727,
0.43732962012290955,
-0.9268322587013245,
0.4039561152458191,
-0.5546688437461853,
-0.18340513110160828,
-0.2649306058883667,
-0.7723538875579834,
-1.015716552734375,
-0.9115860462188721,
-0.553787350654602,
-0.8974683880805969,
-0.17468874156475067,
0.9823368787765503,
1.1638892889022827,
-0.5544816851615906,
-0.15976957976818085,
-0.0025378225836902857,
0.23647920787334442,
-0.18541373312473297,
-0.22402295470237732,
0.5842830538749695,
-0.03952034190297127,
-0.6286787986755371,
-0.21890637278556824,
-0.007982644252479076,
0.42943283915519714,
0.18137148022651672,
-0.238022118806839,
-0.17250889539718628,
-0.3679819703102112,
0.30880206823349,
0.4988957345485687,
-0.6253921389579773,
-0.08677980303764343,
-0.21018248796463013,
-0.22719134390354156,
0.4020480811595917,
0.563814103603363,
-0.5050827264785767,
0.2662062644958496,
0.2401396632194519,
0.36281049251556396,
0.9180933237075806,
-0.34163936972618103,
0.11988992244005203,
-0.8492425680160522,
0.6467593908309937,
-0.15102282166481018,
0.39679187536239624,
0.41327059268951416,
-0.2859653830528259,
0.6552876830101013,
0.4252198040485382,
-0.4167431890964508,
-0.9459969401359558,
-0.0806816890835762,
-1.0966153144836426,
-0.050301868468523026,
1.0355197191238403,
-0.28048214316368103,
-0.528342604637146,
0.3525335490703583,
-0.012822181917726994,
0.6232350468635559,
-0.11751161515712738,
0.4551444351673126,
0.17568954825401306,
-0.16459998488426208,
-0.7555505633354187,
-0.7522554397583008,
0.479911208152771,
0.1338600218296051,
-0.6148243546485901,
-0.5369886159896851,
-0.046340666711330414,
0.6901860237121582,
0.21824821829795837,
0.6391547322273254,
-0.2230127602815628,
0.16810233891010284,
0.07777722924947739,
0.5638473629951477,
-0.4413525462150574,
-0.03758186101913452,
-0.2584663927555084,
-0.023583868518471718,
-0.12658534944057465,
-0.7305856943130493
] |
distilgpt2 | null | "2023-04-29T12:24:21Z" | 14,735,848 | 275 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"tflite",
"rust",
"coreml",
"safetensors",
"gpt2",
"text-generation",
"exbert",
"en",
"dataset:openwebtext",
"arxiv:1910.01108",
"arxiv:2201.08542",
"arxiv:2203.12574",
"arxiv:1910.09700",
"arxiv:1503.02531",
"license:apache-2.0",
"model-index",
"co2_eq_emissions",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text-generation | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: apache-2.0
datasets:
- openwebtext
model-index:
- name: distilgpt2
results:
- task:
type: text-generation
name: Text Generation
dataset:
type: wikitext
name: WikiText-103
metrics:
- type: perplexity
name: Perplexity
value: 21.1
co2_eq_emissions: 149200
---
# DistilGPT2
DistilGPT2 (short for Distilled-GPT2) is an English-language model pre-trained with the supervision of the smallest version of Generative Pre-trained Transformer 2 (GPT-2). Like GPT-2, DistilGPT2 can be used to generate text. Users of this model card should also consider information about the design, training, and limitations of [GPT-2](https://huggingface.co/gpt2).
## Model Details
- **Developed by:** Hugging Face
- **Model type:** Transformer-based Language Model
- **Language:** English
- **License:** Apache 2.0
- **Model Description:** DistilGPT2 is an English-language model pre-trained with the supervision of the 124 million parameter version of GPT-2. DistilGPT2, which has 82 million parameters, was developed using [knowledge distillation](#knowledge-distillation) and was designed to be a faster, lighter version of GPT-2.
- **Resources for more information:** See [this repository](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) for more about Distil\* (a class of compressed models including Distilled-GPT2), [Sanh et al. (2019)](https://arxiv.org/abs/1910.01108) for more information about knowledge distillation and the training procedure, and this page for more about [GPT-2](https://openai.com/blog/better-language-models/).
## Uses, Limitations and Risks
#### Limitations and Risks
<details>
<summary>Click to expand</summary>
**CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.**
As the developers of GPT-2 (OpenAI) note in their [model card](https://github.com/openai/gpt-2/blob/master/model_card.md), “language models like GPT-2 reflect the biases inherent to the systems they were trained on.” Significant research has explored bias and fairness issues with models for language generation including GPT-2 (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
DistilGPT2 also suffers from persistent bias issues, as highlighted in the demonstrative examples below. Note that these examples are not a comprehensive stress-testing of the model. Readers considering using the model should consider more rigorous evaluations of the model depending on their use case and context.
The impact of model compression techniques – such as knowledge distillation – on bias and fairness issues associated with language models is an active area of research. For example:
- [Silva, Tambwekar and Gombolay (2021)](https://aclanthology.org/2021.naacl-main.189.pdf) find that distilled versions of BERT and RoBERTa consistently exhibit statistically significant bias (with regard to gender and race) with effect sizes larger than the teacher models.
- [Xu and Hu (2022)](https://arxiv.org/pdf/2201.08542.pdf) find that distilled versions of GPT-2 showed consistent reductions in toxicity and bias compared to the teacher model (see the paper for more detail on metrics used to define/measure toxicity and bias).
- [Gupta et al. (2022)](https://arxiv.org/pdf/2203.12574.pdf) find that DistilGPT2 exhibits greater gender disparities than GPT-2 and propose a technique for mitigating gender bias in distilled language models like DistilGPT2.
```python
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='distilgpt2')
>>> set_seed(48)
>>> generator("The White man worked as a", max_length=20, num_return_sequences=3)
[{'generated_text': "The White man worked as a salesman at a McDonald's restaurant called Kia at the time of the"},
{'generated_text': 'The White man worked as a contractor in the Army in the late 1990s. He became a "'},
{'generated_text': 'The White man worked as a police spokesman to the US Navy in the 1930s.'}]
>>> set_seed(48)
>>> generator("The Black man worked as a", max_length=20, num_return_sequences=3)
[{'generated_text': 'The Black man worked as a shop assistant for an hour at Wal-Mart at Wal-Mart in'},
{'generated_text': 'The Black man worked as a waiter in the hotel when he was assaulted when he got out of a'},
{'generated_text': 'The Black man worked as a police spokesman four months ago...'}]
```
</details>
#### Potential Uses
Since DistilGPT2 is a distilled version of GPT-2, it is intended to be used for similar use cases with the increased functionality of being smaller and easier to run than the base model.
The developers of GPT-2 state in their [model card](https://github.com/openai/gpt-2/blob/master/model_card.md) that they envisioned GPT-2 would be used by researchers to better understand large-scale generative language models, with possible secondary use cases including:
> - *Writing assistance: Grammar assistance, autocompletion (for normal prose or code)*
> - *Creative writing and art: exploring the generation of creative, fictional texts; aiding creation of poetry and other literary art.*
> - *Entertainment: Creation of games, chat bots, and amusing generations.*
Using DistilGPT2, the Hugging Face team built the [Write With Transformers](https://transformer.huggingface.co/doc/distil-gpt2) web app, which allows users to play with the model to generate text directly from their browser.
#### Out-of-scope Uses
OpenAI states in the GPT-2 [model card](https://github.com/openai/gpt-2/blob/master/model_card.md):
> Because large-scale language models like GPT-2 do not distinguish fact from fiction, we don’t support use-cases that require the generated text to be true.
>
> Additionally, language models like GPT-2 reflect the biases inherent to the systems they were trained on, so we do not recommend that they be deployed into systems that interact with humans unless the deployers first carry out a study of biases relevant to the intended use-case.
### How to Get Started with the Model
<details>
<summary>Click to expand</summary>
*Be sure to read the sections on in-scope and out-of-scope uses and limitations of the model for further information on how to use the model.*
Using DistilGPT2 is similar to using GPT-2. DistilGPT2 can be used directly with a pipeline for text generation. Since the generation relies on some randomness, we set a seed for reproducibility:
```python
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='distilgpt2')
>>> set_seed(42)
>>> generator("Hello, I’m a language model", max_length=20, num_return_sequences=5)
Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.
[{'generated_text': "Hello, I'm a language model, I'm a language model. In my previous post I've"},
{'generated_text': "Hello, I'm a language model, and I'd love to hear what you think about it."},
{'generated_text': "Hello, I'm a language model, but I don't get much of a connection anymore, so"},
{'generated_text': "Hello, I'm a language model, a functional language... It's not an example, and that"},
{'generated_text': "Hello, I'm a language model, not an object model.\n\nIn a nutshell, I"}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
model = GPT2Model.from_pretrained('distilgpt2')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
And in TensorFlow:
```python
from transformers import GPT2Tokenizer, TFGPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
model = TFGPT2Model.from_pretrained('distilgpt2')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
</details>
## Training Data
DistilGPT2 was trained using [OpenWebTextCorpus](https://skylion007.github.io/OpenWebTextCorpus/), an open-source reproduction of OpenAI’s WebText dataset, which was used to train GPT-2. See the [OpenWebTextCorpus Dataset Card](https://huggingface.co/datasets/openwebtext) for additional information about OpenWebTextCorpus and [Radford et al. (2019)](https://d4mucfpksywv.cloudfront.net/better-language-models/language-models.pdf) for additional information about WebText.
## Training Procedure
The texts were tokenized using the same tokenizer as GPT-2, a byte-level version of Byte Pair Encoding (BPE). DistilGPT2 was trained using knowledge distillation, following a procedure similar to the training procedure for DistilBERT, described in more detail in [Sanh et al. (2019)](https://arxiv.org/abs/1910.01108).
## Evaluation Results
The creators of DistilGPT2 [report](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) that, on the [WikiText-103](https://blog.einstein.ai/the-wikitext-long-term-dependency-language-modeling-dataset/) benchmark, GPT-2 reaches a perplexity on the test set of 16.3 compared to 21.1 for DistilGPT2 (after fine-tuning on the train set).
## Environmental Impact
*Carbon emissions were estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.*
- **Hardware Type:** 8 16GB V100
- **Hours used:** 168 (1 week)
- **Cloud Provider:** Azure
- **Compute Region:** unavailable, assumed East US for calculations
- **Carbon Emitted** *(Power consumption x Time x Carbon produced based on location of power grid)*: 149.2 kg eq. CO2
## Citation
```bibtex
@inproceedings{sanh2019distilbert,
title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
author={Sanh, Victor and Debut, Lysandre and Chaumond, Julien and Wolf, Thomas},
booktitle={NeurIPS EMC^2 Workshop},
year={2019}
}
```
## Glossary
- <a name="knowledge-distillation">**Knowledge Distillation**</a>: As described in [Sanh et al. (2019)](https://arxiv.org/pdf/1910.01108.pdf), “knowledge distillation is a compression technique in which a compact model – the student – is trained to reproduce the behavior of a larger model – the teacher – or an ensemble of models.” Also see [Bucila et al. (2006)](https://www.cs.cornell.edu/~caruana/compression.kdd06.pdf) and [Hinton et al. (2015)](https://arxiv.org/abs/1503.02531).
<a href="https://huggingface.co/exbert/?model=distilgpt2">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.14997319877147675,
-0.7801599502563477,
0.3517022430896759,
0.20232826471328735,
-0.27720993757247925,
-0.2595542073249817,
-0.2875414192676544,
-0.4347073435783386,
-0.4004024565219879,
0.15011632442474365,
-0.325300931930542,
-0.021060721948742867,
-0.9394680857658386,
-0.013787766918540001,
-0.27776509523391724,
1.4022268056869507,
-0.1333015114068985,
0.05073832347989082,
0.17392899096012115,
0.2597130239009857,
-0.475102961063385,
-0.4987308084964752,
-0.6867436766624451,
-0.552096426486969,
0.20563437044620514,
-0.021347956731915474,
0.643539309501648,
0.41404926776885986,
0.25518548488616943,
0.25403714179992676,
-0.31431832909584045,
-0.07985579967498779,
-0.5399245023727417,
-0.021993810310959816,
-0.23764774203300476,
-0.3982561230659485,
-0.32265016436576843,
0.3191944360733032,
0.25785666704177856,
0.33511555194854736,
-0.08362041413784027,
0.24792176485061646,
0.45538488030433655,
0.5381214618682861,
-0.25141751766204834,
0.4756637215614319,
-0.5434263348579407,
-0.03335218504071236,
-0.2530502378940582,
0.2767728567123413,
-0.3942122161388397,
-0.28519466519355774,
0.2017160803079605,
-0.3945971429347992,
0.29676058888435364,
-0.1444423943758011,
0.9476772546768188,
0.32963135838508606,
-0.40798017382621765,
-0.3951435387134552,
-0.8853196501731873,
0.6894330978393555,
-0.7517397999763489,
0.08439178764820099,
0.3927401602268219,
0.2974124550819397,
-0.13229992985725403,
-1.0694612264633179,
-0.7972820997238159,
-0.13287539780139923,
-0.3512874245643616,
0.3011355698108673,
-0.2901066839694977,
-0.028507357463240623,
0.4688999652862549,
0.40967389941215515,
-0.7293018102645874,
-0.037739697843790054,
-0.530029833316803,
-0.06795495003461838,
0.3645039200782776,
-0.1986830085515976,
0.3634093999862671,
-0.16896085441112518,
-0.2901749014854431,
-0.16181528568267822,
-0.5422317385673523,
-0.21755942702293396,
0.568647563457489,
0.14989787340164185,
-0.1727900207042694,
0.5640863180160522,
0.08634120225906372,
0.3794780373573303,
-0.058830972760915756,
-0.1322142779827118,
0.21398453414440155,
-0.3432896137237549,
-0.1479506492614746,
-0.13528454303741455,
0.9538782835006714,
0.4245372712612152,
0.5075126886367798,
0.03858368098735809,
-0.21545429527759552,
0.07630909234285355,
-0.03507634252309799,
-0.9909726977348328,
-0.4909948408603668,
0.11676020175218582,
-0.43236345052719116,
-0.42257288098335266,
0.01769413612782955,
-0.8996926546096802,
-0.1593405306339264,
-0.1407867670059204,
0.2863869071006775,
-0.28539103269577026,
-0.7029407024383545,
-0.1970815807580948,
-0.5244009494781494,
0.07548017054796219,
0.0325440838932991,
-1.2639846801757812,
0.22609449923038483,
0.6543174386024475,
0.9431106448173523,
0.12918485701084137,
-0.1652517318725586,
-0.023661669343709946,
-0.08683646470308304,
-0.003590498585253954,
0.30162546038627625,
-0.1883842647075653,
-0.2577866017818451,
-0.07528146356344223,
-0.05992722138762474,
0.26135051250457764,
-0.4859956204891205,
0.4393008351325989,
-0.27610909938812256,
0.7135880589485168,
-0.28242355585098267,
-0.2662886083126068,
-0.04277747869491577,
-0.08055379241704941,
-0.5231156945228577,
1.3165557384490967,
0.47653961181640625,
-0.9761852025985718,
0.32213684916496277,
-0.7264615297317505,
-0.36023402214050293,
-0.13585127890110016,
-0.0563209243118763,
-0.4791082739830017,
0.0836762934923172,
0.033422816544771194,
0.039189159870147705,
-0.5506054162979126,
0.5194968581199646,
0.01144873071461916,
-0.25368615984916687,
0.12020478397607803,
-0.6429350972175598,
1.0244529247283936,
0.5094640851020813,
-0.7190407514572144,
-0.44916144013404846,
-0.3039834797382355,
-0.03883642703294754,
0.4651508331298828,
-0.3853660225868225,
-0.23045013844966888,
0.08843358606100082,
0.3947925269603729,
0.3873755633831024,
0.10645545274019241,
-0.3724016845226288,
0.20908674597740173,
-0.4030109643936157,
0.8357400894165039,
0.6633899211883545,
-0.3086619973182678,
0.3236278295516968,
-0.1162552759051323,
0.20233945548534393,
0.07934381812810898,
0.15241171419620514,
0.08676250278949738,
-0.7779807448387146,
-0.6793509125709534,
-0.055693112313747406,
0.37477269768714905,
0.770793080329895,
-0.8547250032424927,
0.39063599705696106,
-0.1414669305086136,
-0.44930046796798706,
-0.3667612671852112,
-0.03935248777270317,
0.6401139497756958,
0.5285472869873047,
0.3768947124481201,
-0.11183740943670273,
-0.6038926243782043,
-0.7961452007293701,
-0.278326153755188,
-0.5522162914276123,
-0.19137614965438843,
0.12226834893226624,
0.6410109996795654,
-0.16449834406375885,
1.0624302625656128,
-0.6934837102890015,
-0.2185184210538864,
-0.4302908778190613,
0.24254776537418365,
0.13325516879558563,
0.4740506410598755,
0.7157189846038818,
-0.8007349967956543,
-0.618667483329773,
-0.19172757863998413,
-0.7420084476470947,
-0.3052895665168762,
0.2382364422082901,
0.03225459158420563,
0.2526286840438843,
0.18679718673229218,
-0.6189733147621155,
0.21191060543060303,
0.5433599352836609,
-0.39850836992263794,
0.45170995593070984,
-0.2182074636220932,
-0.13060560822486877,
-1.3507941961288452,
0.19470727443695068,
0.08445140719413757,
-0.12147211283445358,
-0.9063640236854553,
-0.02200930565595627,
-0.14148397743701935,
-0.1352730542421341,
-0.44272851943969727,
0.6442310214042664,
-0.46741339564323425,
0.10310035198926926,
-0.346534788608551,
-0.023199766874313354,
-0.030462799593806267,
0.4290684163570404,
0.047529350966215134,
0.9650529026985168,
0.3986675441265106,
-0.33440640568733215,
0.2722375690937042,
0.28766360878944397,
-0.23926441371440887,
0.21911917626857758,
-0.8310061693191528,
0.37629395723342896,
-0.20203983783721924,
0.22959718108177185,
-0.8878973126411438,
-0.1616460680961609,
0.37783923745155334,
-0.5609449744224548,
0.4874541759490967,
-0.39350172877311707,
-0.6913551688194275,
-0.5773557424545288,
-0.13033851981163025,
0.37267884612083435,
1.0941001176834106,
-0.4613761901855469,
0.1880086064338684,
0.38796988129615784,
-0.3033198118209839,
-0.45711255073547363,
-1.0710840225219727,
0.001869382569566369,
-0.25190818309783936,
-0.43954071402549744,
0.2403729110956192,
0.19964554905891418,
-0.31304726004600525,
-0.03346151113510132,
0.1192031279206276,
-0.2220275104045868,
0.03264202922582626,
0.14292114973068237,
0.22378063201904297,
0.021408317610621452,
0.005548074375838041,
0.21296516060829163,
-0.271453857421875,
-0.039769671857357025,
-0.5181360840797424,
0.6497704386711121,
-0.027825644239783287,
-0.014063544571399689,
-0.35664302110671997,
0.2892766296863556,
0.28569495677948,
-0.10890933126211166,
0.5339377522468567,
0.8362244367599487,
-0.40237292647361755,
0.019858330488204956,
-0.40191900730133057,
-0.36457791924476624,
-0.4670296013355255,
0.7691959738731384,
-0.21259072422981262,
-0.9279966950416565,
0.24590148031711578,
-0.0030825326684862375,
-0.008993327617645264,
0.6719167828559875,
0.8663622140884399,
0.0211371798068285,
0.9264235496520996,
0.548044741153717,
-0.15005071461200714,
0.47111794352531433,
-0.2136121243238449,
0.38078969717025757,
-0.8045397996902466,
-0.20954887568950653,
-0.49495047330856323,
-0.22315257787704468,
-0.7720122337341309,
-0.41156330704689026,
0.22847922146320343,
0.39094680547714233,
-0.2729418873786926,
0.381623774766922,
-0.7667489051818848,
0.4491100311279297,
0.624347448348999,
-0.11586464196443558,
0.06729573011398315,
0.2163492739200592,
0.053797632455825806,
-0.1333385854959488,
-0.5026620030403137,
-0.7481796741485596,
1.1477546691894531,
0.5820018649101257,
0.5458890795707703,
0.2444564700126648,
0.4058910012245178,
0.1901218444108963,
0.26125261187553406,
-0.38663744926452637,
0.23428098857402802,
-0.40247493982315063,
-0.8927587866783142,
-0.2952089011669159,
-0.3860483169555664,
-0.6733523011207581,
0.1791820377111435,
0.2202165126800537,
-0.8062000274658203,
-0.019230734556913376,
0.28468358516693115,
-0.021234650164842606,
0.3667987585067749,
-0.9518305659294128,
0.8171706795692444,
-0.1928875595331192,
-0.25743013620376587,
0.12474622577428818,
-0.650271475315094,
0.46610963344573975,
0.02165895886719227,
0.049234434962272644,
0.007000301964581013,
0.21846294403076172,
0.6792141795158386,
-0.6675053238868713,
0.7955493330955505,
-0.4700928330421448,
-0.14919954538345337,
0.5609260201454163,
-0.0774434506893158,
0.5561556816101074,
0.10082148760557175,
-0.028308700770139694,
0.40885210037231445,
-0.1444021463394165,
-0.19300217926502228,
-0.4023778438568115,
0.5342956781387329,
-0.9189901947975159,
-0.4604566991329193,
-0.6151334643363953,
-0.37888115644454956,
0.28390151262283325,
0.1694415658712387,
0.5684319734573364,
0.258111834526062,
-0.0699101909995079,
-0.21969276666641235,
0.4766472280025482,
-0.32620754837989807,
0.5061010122299194,
0.25449666380882263,
-0.1417965441942215,
-0.29505258798599243,
0.7346757054328918,
0.11290766298770905,
0.42422541975975037,
0.1725950837135315,
0.20087723433971405,
-0.6464307308197021,
-0.3853971064090729,
-0.6379641890525818,
0.13106639683246613,
-0.5468816757202148,
-0.010849983431398869,
-0.6594603061676025,
-0.3330208957195282,
-0.5847020745277405,
0.3776516318321228,
-0.3150324821472168,
-0.501894474029541,
-0.3634456992149353,
-0.19034069776535034,
0.4611719250679016,
0.789322555065155,
-0.07828389108181,
0.34973040223121643,
-0.359024316072464,
0.2644980549812317,
0.44826358556747437,
0.37089216709136963,
-0.14211595058441162,
-0.7238242626190186,
0.11014486104249954,
0.337197482585907,
-0.5102708339691162,
-0.8676735758781433,
0.2029038369655609,
0.1414453238248825,
0.28909826278686523,
0.1719139963388443,
-0.13069525361061096,
0.3763827681541443,
-0.6116216778755188,
1.0269215106964111,
0.21332493424415588,
-0.8407469987869263,
0.5998806953430176,
-0.2154000997543335,
0.06256280094385147,
0.45755577087402344,
0.2481001764535904,
-0.6014494299888611,
-0.42143604159355164,
-0.3933826684951782,
-0.8880963921546936,
0.9779914021492004,
0.6977978348731995,
0.35553449392318726,
-0.10211772471666336,
0.43386006355285645,
0.07722976058721542,
0.13435113430023193,
-1.031292200088501,
-0.5494038462638855,
-0.5161272287368774,
-0.24672019481658936,
-0.025167908519506454,
-0.6669707894325256,
0.056286901235580444,
-0.23068518936634064,
0.6955719590187073,
0.1282198429107666,
0.5561532974243164,
0.17389380931854248,
-0.15844205021858215,
0.2117733657360077,
0.31488239765167236,
0.6522135138511658,
0.38301321864128113,
-0.08996926248073578,
0.2678183317184448,
0.10207415372133255,
-0.8013430833816528,
0.2872013449668884,
0.3473336100578308,
-0.4839618504047394,
0.13266418874263763,
0.18052205443382263,
1.0641231536865234,
-0.4316845238208771,
-0.28973010182380676,
0.5224101543426514,
0.0006533796549774706,
-0.3431776463985443,
-0.3544093668460846,
-0.004990886896848679,
0.12682844698429108,
0.24337927997112274,
0.27840596437454224,
-0.10856853425502777,
0.17004536092281342,
-0.7174732089042664,
0.10450664907693863,
0.138703852891922,
-0.4600818157196045,
-0.3717900216579437,
1.0260999202728271,
0.2628348171710968,
-0.2892743945121765,
0.80785071849823,
-0.5525161027908325,
-0.658165454864502,
0.5259265899658203,
0.7344656586647034,
0.9176239967346191,
-0.1547577679157257,
0.25435954332351685,
0.5052648782730103,
0.4772353172302246,
-0.43624138832092285,
0.1938323676586151,
0.2597699463367462,
-0.4882529079914093,
-0.27511832118034363,
-0.5890159010887146,
0.12815973162651062,
0.3435707986354828,
-0.3629325330257416,
0.27451568841934204,
-0.2989485263824463,
-0.39915141463279724,
-0.19923794269561768,
-0.11194407194852829,
-0.5237016677856445,
0.03836808726191521,
0.14243638515472412,
0.6396914720535278,
-1.0864371061325073,
0.9635149240493774,
0.520175576210022,
-0.6943855285644531,
-0.8406863808631897,
0.10404954850673676,
0.14530730247497559,
-0.5124715566635132,
0.7215794920921326,
0.17738355696201324,
0.3947673439979553,
0.04437534511089325,
-0.25011327862739563,
-0.5770787000656128,
1.242838978767395,
0.4082915484905243,
-0.6541252732276917,
-0.14843451976776123,
0.5912708044052124,
0.7015088200569153,
0.056120678782463074,
0.7250467538833618,
0.7755418419837952,
0.5597825646400452,
-0.052530769258737564,
-1.1433799266815186,
0.25824469327926636,
-0.3229130804538727,
0.4018814265727997,
0.12984447181224823,
-0.6774179339408875,
1.1452372074127197,
-0.12412158399820328,
-0.20628733932971954,
0.04827529191970825,
0.43177223205566406,
0.09465222805738449,
0.09444079548120499,
0.3435218036174774,
0.6422134041786194,
0.6340004205703735,
-0.586469829082489,
1.104017972946167,
-0.05960334837436676,
0.7416789531707764,
1.1188803911209106,
-0.188157856464386,
0.3989291191101074,
0.41967540979385376,
-0.5277469754219055,
0.31866347789764404,
0.5355705618858337,
-0.20408272743225098,
0.7661280035972595,
0.22113865613937378,
-0.13725298643112183,
0.3634769022464752,
0.043836560100317,
-0.6445651650428772,
0.2425004094839096,
-0.01855052448809147,
-0.5454530119895935,
-0.25298741459846497,
-0.12532827258110046,
0.4204944670200348,
-0.13984693586826324,
0.21826598048210144,
0.8081325888633728,
0.2217780351638794,
-0.6799306273460388,
0.524803876876831,
0.3625078797340393,
0.736051619052887,
-0.5104166269302368,
-0.07904054969549179,
-0.2734394669532776,
0.25944334268569946,
-0.07597152888774872,
-0.8402581214904785,
0.3393779397010803,
0.2911926805973053,
-0.35589149594306946,
-0.26534122228622437,
0.641334593296051,
-0.6999664306640625,
-0.48108428716659546,
0.2496575117111206,
0.3454931974411011,
0.30572474002838135,
-0.21682794392108917,
-0.7200984954833984,
-0.1303914487361908,
0.14773529767990112,
-0.3552591800689697,
0.3563537299633026,
0.39629894495010376,
-0.040259964764118195,
0.29617488384246826,
0.5899072289466858,
0.031227296218276024,
-0.04556633159518242,
0.17594049870967865,
0.8116534948348999,
-0.24042898416519165,
-0.25841832160949707,
-1.1533931493759155,
0.6338663101196289,
-0.15533366799354553,
-0.3729175329208374,
0.5352694392204285,
0.7678796052932739,
0.8613851070404053,
-0.20806367695331573,
1.1310893297195435,
-0.552790105342865,
0.2613351345062256,
-0.3940175771713257,
0.9326520562171936,
-0.3682365417480469,
0.07238960266113281,
-0.300742506980896,
-1.0913441181182861,
0.01842465251684189,
0.5549391508102417,
-0.22529268264770508,
0.362774521112442,
0.6757560968399048,
0.8145245909690857,
-0.10390648990869522,
-0.2072211056947708,
-0.04385819286108017,
0.3124942481517792,
0.5542547702789307,
0.6194531917572021,
0.6299304366111755,
-0.6800296902656555,
0.6543409824371338,
-0.305654913187027,
-0.3386359214782715,
-0.03646516799926758,
-0.7043834924697876,
-0.9335730075836182,
-0.6070002913475037,
-0.20270554721355438,
-0.5213870406150818,
0.13534249365329742,
0.6799128651618958,
0.5115624666213989,
-0.7329234480857849,
-0.07831007987260818,
-0.29116180539131165,
-0.0858360007405281,
-0.08045299351215363,
-0.2457301914691925,
0.3255467116832733,
-0.17272844910621643,
-0.996368944644928,
-0.10018344223499298,
0.02897721901535988,
0.33839526772499084,
-0.21560822427272797,
-0.22437065839767456,
-0.015680518001317978,
-0.2774626612663269,
0.635657787322998,
0.00861370749771595,
-0.7015872001647949,
-0.2592902183532715,
-0.30930623412132263,
-0.18209940195083618,
-0.0856676995754242,
0.6891862154006958,
-0.3766905665397644,
0.3161379396915436,
0.5141279697418213,
0.16241559386253357,
0.5605081915855408,
-0.09704137593507767,
0.5288156270980835,
-0.6861833333969116,
0.51784348487854,
0.11570543050765991,
0.2883676588535309,
0.26737964153289795,
-0.35448580980300903,
0.6825019717216492,
0.3844261169433594,
-0.5054682493209839,
-0.774878978729248,
0.2479102611541748,
-0.6761664748191833,
-0.30184221267700195,
1.4982080459594727,
-0.19237686693668365,
0.08299793303012848,
-0.09049441665410995,
-0.431971937417984,
0.6297547221183777,
-0.34565842151641846,
0.7438265681266785,
0.7185499668121338,
0.29133298993110657,
-0.012696397490799427,
-0.8473063111305237,
0.6948195695877075,
0.22396241128444672,
-0.6755278706550598,
0.1607436239719391,
0.263872891664505,
0.595809280872345,
-0.010340111330151558,
0.6688128113746643,
-0.3380209505558014,
-0.01875380054116249,
0.08541440218687057,
0.15490509569644928,
-0.2792567312717438,
-0.08467599749565125,
-0.23751752078533173,
-0.12379713356494904,
0.07837580144405365,
-0.033446092158555984
] |
roberta-base | null | "2023-03-06T15:14:53Z" | 14,521,862 | 247 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"roberta",
"fill-mask",
"exbert",
"en",
"dataset:bookcorpus",
"dataset:wikipedia",
"arxiv:1907.11692",
"arxiv:1806.02847",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: mit
datasets:
- bookcorpus
- wikipedia
---
# RoBERTa base model
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
[this paper](https://arxiv.org/abs/1907.11692) and first released in
[this repository](https://github.com/pytorch/fairseq/tree/master/examples/roberta). This model is case-sensitive: it
makes a difference between english and English.
Disclaimer: The team releasing RoBERTa did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
RoBERTa is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means
it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model
randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict
the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one
after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to
learn a bidirectional representation of the sentence.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
classifier using the features produced by the BERT model as inputs.
## Intended uses & limitations
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task.
See the [model hub](https://huggingface.co/models?filter=roberta) to look for fine-tuned versions on a task that
interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at a model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='roberta-base')
>>> unmasker("Hello I'm a <mask> model.")
[{'sequence': "<s>Hello I'm a male model.</s>",
'score': 0.3306540250778198,
'token': 2943,
'token_str': 'Ġmale'},
{'sequence': "<s>Hello I'm a female model.</s>",
'score': 0.04655390977859497,
'token': 2182,
'token_str': 'Ġfemale'},
{'sequence': "<s>Hello I'm a professional model.</s>",
'score': 0.04232972860336304,
'token': 2038,
'token_str': 'Ġprofessional'},
{'sequence': "<s>Hello I'm a fashion model.</s>",
'score': 0.037216778844594955,
'token': 2734,
'token_str': 'Ġfashion'},
{'sequence': "<s>Hello I'm a Russian model.</s>",
'score': 0.03253649175167084,
'token': 1083,
'token_str': 'ĠRussian'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import RobertaTokenizer, RobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
model = RobertaModel.from_pretrained('roberta-base')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import RobertaTokenizer, TFRobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
model = TFRobertaModel.from_pretrained('roberta-base')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
The training data used for this model contains a lot of unfiltered content from the internet, which is far from
neutral. Therefore, the model can have biased predictions:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='roberta-base')
>>> unmasker("The man worked as a <mask>.")
[{'sequence': '<s>The man worked as a mechanic.</s>',
'score': 0.08702439814805984,
'token': 25682,
'token_str': 'Ġmechanic'},
{'sequence': '<s>The man worked as a waiter.</s>',
'score': 0.0819653645157814,
'token': 38233,
'token_str': 'Ġwaiter'},
{'sequence': '<s>The man worked as a butcher.</s>',
'score': 0.073323555290699,
'token': 32364,
'token_str': 'Ġbutcher'},
{'sequence': '<s>The man worked as a miner.</s>',
'score': 0.046322137117385864,
'token': 18678,
'token_str': 'Ġminer'},
{'sequence': '<s>The man worked as a guard.</s>',
'score': 0.040150221437215805,
'token': 2510,
'token_str': 'Ġguard'}]
>>> unmasker("The Black woman worked as a <mask>.")
[{'sequence': '<s>The Black woman worked as a waitress.</s>',
'score': 0.22177888453006744,
'token': 35698,
'token_str': 'Ġwaitress'},
{'sequence': '<s>The Black woman worked as a prostitute.</s>',
'score': 0.19288744032382965,
'token': 36289,
'token_str': 'Ġprostitute'},
{'sequence': '<s>The Black woman worked as a maid.</s>',
'score': 0.06498628109693527,
'token': 29754,
'token_str': 'Ġmaid'},
{'sequence': '<s>The Black woman worked as a secretary.</s>',
'score': 0.05375480651855469,
'token': 2971,
'token_str': 'Ġsecretary'},
{'sequence': '<s>The Black woman worked as a nurse.</s>',
'score': 0.05245552211999893,
'token': 9008,
'token_str': 'Ġnurse'}]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
The RoBERTa model was pretrained on the reunion of five datasets:
- [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038 unpublished books;
- [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and headers) ;
- [CC-News](https://commoncrawl.org/2016/10/news-dataset-available/), a dataset containing 63 millions English news
articles crawled between September 2016 and February 2019.
- [OpenWebText](https://github.com/jcpeterson/openwebtext), an opensource recreation of the WebText dataset used to
train GPT-2,
- [Stories](https://arxiv.org/abs/1806.02847) a dataset containing a subset of CommonCrawl data filtered to match the
story-like style of Winograd schemas.
Together these datasets weigh 160GB of text.
## Training procedure
### Preprocessing
The texts are tokenized using a byte version of Byte-Pair Encoding (BPE) and a vocabulary size of 50,000. The inputs of
the model take pieces of 512 contiguous tokens that may span over documents. The beginning of a new document is marked
with `<s>` and the end of one by `</s>`
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `<mask>`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
Contrary to BERT, the masking is done dynamically during pretraining (e.g., it changes at each epoch and is not fixed).
### Pretraining
The model was trained on 1024 V100 GPUs for 500K steps with a batch size of 8K and a sequence length of 512. The
optimizer used is Adam with a learning rate of 6e-4, \\(\beta_{1} = 0.9\\), \\(\beta_{2} = 0.98\\) and
\\(\epsilon = 1e-6\\), a weight decay of 0.01, learning rate warmup for 24,000 steps and linear decay of the learning
rate after.
## Evaluation results
When fine-tuned on downstream tasks, this model achieves the following results:
Glue test results:
| Task | MNLI | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE |
|:----:|:----:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|
| | 87.6 | 91.9 | 92.8 | 94.8 | 63.6 | 91.2 | 90.2 | 78.7 |
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1907-11692,
author = {Yinhan Liu and
Myle Ott and
Naman Goyal and
Jingfei Du and
Mandar Joshi and
Danqi Chen and
Omer Levy and
Mike Lewis and
Luke Zettlemoyer and
Veselin Stoyanov},
title = {RoBERTa: {A} Robustly Optimized {BERT} Pretraining Approach},
journal = {CoRR},
volume = {abs/1907.11692},
year = {2019},
url = {http://arxiv.org/abs/1907.11692},
archivePrefix = {arXiv},
eprint = {1907.11692},
timestamp = {Thu, 01 Aug 2019 08:59:33 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1907-11692.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
<a href="https://huggingface.co/exbert/?model=roberta-base">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.15874525904655457,
-0.7864440083503723,
0.2143075317144394,
-0.01406010426580906,
-0.36069953441619873,
-0.06675083190202713,
-0.35677042603492737,
-0.37536904215812683,
0.27712708711624146,
0.408024400472641,
-0.5700899958610535,
-0.5863821506500244,
-0.9068484306335449,
0.016096128150820732,
-0.35417822003364563,
1.3477998971939087,
0.15623240172863007,
0.20087386667728424,
0.06800553947687149,
0.1846427321434021,
-0.30424419045448303,
-0.5910210013389587,
-0.5965970754623413,
-0.3084702789783478,
0.24352221190929413,
-0.07217985391616821,
0.5531235933303833,
0.5253962874412537,
0.3077291250228882,
0.3472326993942261,
-0.2576225697994232,
0.07259778678417206,
-0.41709104180336,
0.012396411970257759,
-0.0662979856133461,
-0.4749290943145752,
-0.3101073205471039,
0.27496975660324097,
0.31947046518325806,
0.564972460269928,
-0.06504391878843307,
0.40428921580314636,
0.17490199208259583,
0.417063444852829,
-0.25276538729667664,
0.20770277082920074,
-0.6348682045936584,
-0.0244924183934927,
-0.3315502107143402,
0.1614479124546051,
-0.37584176659584045,
-0.15675367414951324,
0.15380899608135223,
-0.39519381523132324,
0.42506900429725647,
-0.03388790413737297,
1.3685752153396606,
0.16098587214946747,
-0.26381415128707886,
-0.2746463119983673,
-0.5668419599533081,
0.9625809788703918,
-0.8623589277267456,
0.19568663835525513,
0.43717142939567566,
0.10399901866912842,
-0.12592695653438568,
-0.9214186668395996,
-0.5824969410896301,
-0.10253732651472092,
-0.24958012998104095,
0.16203950345516205,
-0.3511531352996826,
-0.1853683739900589,
0.29387804865837097,
0.42353302240371704,
-0.6683114171028137,
-0.1447506546974182,
-0.6433879733085632,
-0.29888954758644104,
0.5493419170379639,
0.0022938260808587074,
0.2629498839378357,
-0.41872933506965637,
-0.36308181285858154,
-0.2078268975019455,
-0.25006410479545593,
0.14492365717887878,
0.5394351482391357,
0.3533642590045929,
-0.24127784371376038,
0.5155608057975769,
-0.07189054787158966,
0.7403894662857056,
0.06429418176412582,
-0.28648388385772705,
0.5365337133407593,
-0.2107376605272293,
-0.2978352904319763,
-0.23597051203250885,
0.9668583273887634,
0.2658221423625946,
0.3551822006702423,
-0.06192290410399437,
-0.17604489624500275,
0.22386962175369263,
0.20983895659446716,
-0.7085675597190857,
-0.2934303283691406,
0.25163733959198,
-0.515845537185669,
-0.4759533703327179,
0.17110902070999146,
-0.7976714372634888,
0.015365427359938622,
-0.1213303804397583,
0.5736854672431946,
-0.390480637550354,
-0.19224311411380768,
0.17187798023223877,
-0.37315043807029724,
0.203351229429245,
0.06352704763412476,
-0.8573644161224365,
0.12747101485729218,
0.4722135663032532,
0.9025866389274597,
0.06312549114227295,
-0.1869470626115799,
-0.24649789929389954,
-0.10792459547519684,
0.006349640898406506,
0.44739198684692383,
-0.31369996070861816,
-0.06275366991758347,
-0.1049436405301094,
0.2847490906715393,
-0.23188038170337677,
-0.24185092747211456,
0.48084235191345215,
-0.3002033829689026,
0.6689082980155945,
0.20337238907814026,
-0.38987183570861816,
-0.3200414180755615,
0.1744949072599411,
-0.5676715970039368,
1.191321611404419,
0.2533036768436432,
-0.9026476144790649,
0.2792940139770508,
-0.6562745571136475,
-0.41829341650009155,
-0.1852799654006958,
0.1464909017086029,
-0.6917725801467896,
-0.05100441351532936,
0.31247055530548096,
0.4727456867694855,
-0.32430198788642883,
0.3682880699634552,
-0.048681046813726425,
-0.3440217673778534,
0.2940575182437897,
-0.38268956542015076,
1.3796330690383911,
0.19620521366596222,
-0.6193810105323792,
0.0009235059842467308,
-0.7901957631111145,
-0.0329165980219841,
0.4549154043197632,
-0.3787447214126587,
-0.1016029343008995,
-0.20794735848903656,
0.18133018910884857,
0.28898367285728455,
0.19154375791549683,
-0.543763279914856,
0.14926353096961975,
-0.48575180768966675,
0.696351945400238,
0.7396957874298096,
-0.12020424008369446,
0.2451099008321762,
-0.43273207545280457,
0.5591078996658325,
-0.042191699147224426,
0.1916104555130005,
-0.20709367096424103,
-0.692968487739563,
-0.7333182692527771,
-0.47308990359306335,
0.673233151435852,
0.6932870149612427,
-0.4818387031555176,
0.5464655756950378,
-0.09212487190961838,
-0.5784304738044739,
-0.8699588775634766,
-0.06346599012613297,
0.468717485666275,
0.5795320272445679,
0.45458292961120605,
-0.44897469878196716,
-0.6535660028457642,
-0.7540098428726196,
-0.2846292555332184,
0.0941663384437561,
-0.28063860535621643,
0.2805483639240265,
0.6210357546806335,
-0.2814563512802124,
0.692162811756134,
-0.605465292930603,
-0.5212743282318115,
-0.33916762471199036,
0.08663266152143478,
0.5576511025428772,
0.6780513525009155,
0.47286251187324524,
-0.6304001212120056,
-0.49981629848480225,
-0.24478134512901306,
-0.724946916103363,
0.1350666582584381,
-0.005817367695271969,
-0.14433303475379944,
0.386711984872818,
0.3547315299510956,
-0.7952368855476379,
0.5737815499305725,
0.558641791343689,
-0.34968024492263794,
0.6156887412071228,
-0.22577813267707825,
-0.06924597918987274,
-1.35037362575531,
0.21780243515968323,
0.00909310020506382,
-0.27304980158805847,
-0.795632004737854,
0.054522205144166946,
-0.19967018067836761,
-0.18967117369174957,
-0.4613361358642578,
0.5351645350456238,
-0.5793722867965698,
-0.015290437266230583,
0.032307397574186325,
0.15328708291053772,
0.1420244425535202,
0.8049898147583008,
0.010588851757347584,
0.6667850613594055,
0.5857158303260803,
-0.3313373625278473,
0.16765666007995605,
0.35758641362190247,
-0.4750540256500244,
0.18550936877727509,
-0.7488389015197754,
0.2911365330219269,
-0.11483044177293777,
0.09503638744354248,
-0.9966416358947754,
-0.1064378023147583,
0.32457005977630615,
-0.761180579662323,
0.40123510360717773,
-0.43407630920410156,
-0.4880724549293518,
-0.5555427074432373,
-0.17979194223880768,
0.1633041501045227,
0.7077209949493408,
-0.3327886760234833,
0.6630650758743286,
0.40096402168273926,
-0.07689984142780304,
-0.765596330165863,
-0.7810398936271667,
-0.02729788050055504,
-0.23340629041194916,
-0.7212831974029541,
0.46187230944633484,
0.052504945546388626,
-0.07932552695274353,
-0.10234315693378448,
0.04130878672003746,
-0.12966518104076385,
0.1263253092765808,
0.26954224705696106,
0.45463046431541443,
-0.0460829883813858,
-0.13280418515205383,
-0.20046348869800568,
-0.1418582797050476,
0.03413921594619751,
-0.4595811367034912,
0.9375596046447754,
-0.043696217238903046,
-0.047264255583286285,
-0.42396974563598633,
0.21585485339164734,
0.3764243423938751,
-0.3626015782356262,
0.8774513006210327,
1.0447720289230347,
-0.3760637044906616,
0.01888333633542061,
-0.4213905334472656,
-0.24551811814308167,
-0.44686731696128845,
0.4352600574493408,
-0.31728583574295044,
-0.846406102180481,
0.6663037538528442,
0.31882068514823914,
-0.1396031230688095,
0.7338795065879822,
0.5770137310028076,
-0.13191290199756622,
1.0038763284683228,
0.4565885663032532,
-0.12405499070882797,
0.491949200630188,
-0.6054865717887878,
0.174162819981575,
-0.8270164728164673,
-0.3345523476600647,
-0.5013993382453918,
-0.2609914243221283,
-0.6837285757064819,
-0.4196016788482666,
0.29264816641807556,
0.12485715746879578,
-0.22343024611473083,
0.4993566870689392,
-0.7471539974212646,
0.26198792457580566,
0.8502834439277649,
0.3953166902065277,
-0.024728933349251747,
0.08437538146972656,
-0.23530712723731995,
-0.03716736659407616,
-0.6153460741043091,
-0.41782307624816895,
1.3027119636535645,
0.46665215492248535,
0.5281667113304138,
0.028761180117726326,
0.6532049775123596,
0.2778868079185486,
0.02615508623421192,
-0.4331320822238922,
0.40141725540161133,
-0.2828231751918793,
-0.8693122863769531,
-0.28115007281303406,
-0.2952538728713989,
-1.0575296878814697,
0.2689662575721741,
-0.338844895362854,
-0.8679628968238831,
0.05496549606323242,
-0.05691435560584068,
-0.16372866928577423,
0.39717942476272583,
-0.6944206357002258,
1.0001769065856934,
-0.1539529263973236,
-0.3292887508869171,
-0.029785197228193283,
-0.8237899541854858,
0.3098992109298706,
0.1359819620847702,
0.09194840490818024,
0.02975970320403576,
0.37377268075942993,
0.9714796543121338,
-0.48967215418815613,
1.0000507831573486,
-0.24576525390148163,
0.10030152648687363,
0.23550526797771454,
-0.04332708939909935,
0.5753719210624695,
-0.14761529862880707,
0.0044474215246737,
0.605459451675415,
-0.18572939932346344,
-0.5006523132324219,
-0.2974969148635864,
0.3875495195388794,
-0.8795266151428223,
-0.6385089755058289,
-0.6676780581474304,
-0.5847854018211365,
0.25884389877319336,
0.37107157707214355,
0.5768234729766846,
0.5314850211143494,
0.09614178538322449,
0.06980429589748383,
0.4649685323238373,
-0.22470423579216003,
0.4613286256790161,
0.2797612249851227,
-0.06145381182432175,
-0.454635351896286,
0.7003443837165833,
0.07910331338644028,
0.21185775101184845,
0.26903676986694336,
0.0745246484875679,
-0.34686940908432007,
-0.5685166716575623,
-0.3704988956451416,
0.33820682764053345,
-0.5496801733970642,
-0.29554229974746704,
-0.8183059692382812,
-0.440183162689209,
-0.5593914985656738,
-0.06435438245534897,
-0.14200368523597717,
-0.49034106731414795,
-0.5542197823524475,
-0.05732211098074913,
0.3875390589237213,
0.6796218752861023,
-0.040241267532110214,
0.3014363646507263,
-0.5203587412834167,
0.19515083730220795,
0.2948373854160309,
0.1450352817773819,
-0.10470137745141983,
-0.9729100465774536,
-0.3298586905002594,
0.1702101081609726,
-0.3350694477558136,
-0.8366946578025818,
0.7689328789710999,
0.00594387948513031,
0.49002590775489807,
0.3298220932483673,
-0.13840146362781525,
0.6469072699546814,
-0.3710881173610687,
0.9317964911460876,
0.13920117914676666,
-0.9457662105560303,
0.5736358165740967,
-0.4230419397354126,
0.16392818093299866,
0.3044664263725281,
0.3726058304309845,
-0.4249064028263092,
-0.5381258726119995,
-0.9309485554695129,
-0.981903612613678,
0.9278938174247742,
0.35402220487594604,
0.11472927778959274,
0.03938138484954834,
0.22856704890727997,
-0.029348697513341904,
0.30466124415397644,
-1.146537184715271,
-0.49251192808151245,
-0.41791167855262756,
-0.3255308270454407,
-0.16654478013515472,
-0.22181275486946106,
-0.09192916005849838,
-0.3614145517349243,
0.7908885478973389,
0.1084839403629303,
0.633197546005249,
0.22747941315174103,
-0.3867611587047577,
0.14938421547412872,
0.14829470217227936,
0.7183430194854736,
0.5518866777420044,
-0.46549081802368164,
0.07535514235496521,
0.16915036737918854,
-0.6328173279762268,
0.005947629455476999,
0.3189224898815155,
-0.3328309953212738,
0.1345108598470688,
0.43988561630249023,
0.9476363062858582,
0.011346559040248394,
-0.48096078634262085,
0.6411776542663574,
0.08759516477584839,
-0.2814946472644806,
-0.4576503038406372,
0.06521818786859512,
0.07000108808279037,
0.28050941228866577,
0.44412150979042053,
0.172618567943573,
-0.07865510880947113,
-0.5660063028335571,
0.22554099559783936,
0.4895671010017395,
-0.39983418583869934,
-0.26427963376045227,
0.9084092974662781,
-0.11484784632921219,
-0.4915420413017273,
0.6705104112625122,
-0.3078485131263733,
-0.7794354557991028,
0.6678457856178284,
0.6963236927986145,
0.8743532299995422,
-0.1978437304496765,
0.27961334586143494,
0.5637646317481995,
0.46059417724609375,
0.005947444122284651,
0.10087434202432632,
0.19372497498989105,
-0.6590011119842529,
-0.4132607579231262,
-0.7898231148719788,
0.13303960859775543,
0.3438184857368469,
-0.6270903944969177,
0.1980026513338089,
-0.4513307511806488,
-0.3099076747894287,
0.08584270626306534,
0.16356690227985382,
-0.7870287895202637,
0.2470167726278305,
-0.03973418474197388,
0.8052603602409363,
-1.0546915531158447,
0.8655318021774292,
0.5652614831924438,
-0.721137285232544,
-0.8039286732673645,
-0.04599034786224365,
-0.1147804781794548,
-0.9969087839126587,
0.7433468103408813,
0.2768443524837494,
0.3235014081001282,
0.009037323296070099,
-0.4893268644809723,
-0.8888920545578003,
1.2504644393920898,
0.27462950348854065,
-0.4208681285381317,
-0.18754486739635468,
0.10608995705842972,
0.5851078033447266,
-0.4966464340686798,
0.6609218716621399,
0.4796190857887268,
0.37828329205513,
-0.20370982587337494,
-0.9054732918739319,
0.1447964459657669,
-0.33916375041007996,
0.08237535506486893,
0.11153211444616318,
-0.6822039484977722,
1.2371412515640259,
-0.1379633992910385,
-0.09053177386522293,
0.009017017669975758,
0.43260854482650757,
0.06843018531799316,
0.12844988703727722,
0.4641844630241394,
0.7644282579421997,
0.7687880396842957,
-0.2932785153388977,
1.0601847171783447,
-0.31756606698036194,
0.6009185314178467,
0.8459786772727966,
0.17720560729503632,
0.6928814053535461,
0.24137058854103088,
-0.37902024388313293,
0.8292019367218018,
0.5822975635528564,
-0.3282373249530792,
0.509320855140686,
0.14819082617759705,
-0.06864229589700699,
-0.016817037016153336,
0.06504698097705841,
-0.2656635046005249,
0.5239992141723633,
0.06267944723367691,
-0.554378867149353,
-0.01175817009061575,
0.025282127782702446,
0.37201955914497375,
-0.05182402580976486,
-0.14570128917694092,
0.7090296149253845,
-0.042715251445770264,
-0.6052680611610413,
0.6915640234947205,
0.17544831335544586,
0.8097725510597229,
-0.6095824241638184,
0.059352096170186996,
-0.21666352450847626,
0.11977498233318329,
-0.107952781021595,
-0.6603121161460876,
0.14095796644687653,
0.023338785395026207,
-0.43911564350128174,
-0.17752636969089508,
0.6946230530738831,
-0.6244308948516846,
-0.5932964086532593,
0.25729790329933167,
0.2687356770038605,
0.33402755856513977,
-0.09415112435817719,
-0.8929693698883057,
-0.07281862199306488,
0.3521280586719513,
-0.22024360299110413,
0.36971914768218994,
0.2148509919643402,
0.1270727515220642,
0.6100230813026428,
0.9095953702926636,
0.1571706384420395,
0.08061084151268005,
-0.05270812287926674,
0.842827320098877,
-0.7605599164962769,
-0.5603251457214355,
-0.8305301070213318,
0.7619190216064453,
-0.11439915746450424,
-0.3324766159057617,
0.8075904846191406,
0.6189011335372925,
0.9155260324478149,
-0.25310760736465454,
0.7030481100082397,
-0.17163243889808655,
0.5633641481399536,
-0.6039797067642212,
0.7707543969154358,
-0.48783960938453674,
0.07764893770217896,
-0.36278417706489563,
-0.8621655702590942,
-0.14731135964393616,
0.8447845578193665,
-0.20467308163642883,
0.20346131920814514,
0.60457843542099,
0.9195375442504883,
-0.11580643802881241,
-0.31797951459884644,
0.08869095891714096,
0.3603518605232239,
0.15432998538017273,
0.6193614602088928,
0.4622267484664917,
-0.816265344619751,
0.6671577095985413,
-0.26756617426872253,
-0.15573222935199738,
-0.2700421214103699,
-0.7988465428352356,
-1.104252815246582,
-0.6543927788734436,
-0.2902541756629944,
-0.6897505521774292,
0.09135778993368149,
0.843639075756073,
0.778422474861145,
-0.8294525146484375,
-0.2202731817960739,
-0.032177943736314774,
0.1124875545501709,
-0.35449570417404175,
-0.3165677785873413,
0.5369951725006104,
-0.25017639994621277,
-0.8619773387908936,
0.1571594923734665,
-0.045047786086797714,
0.20005491375923157,
-0.16442714631557465,
-0.07355214655399323,
-0.4583749771118164,
-0.012191126123070717,
0.427484393119812,
0.08645837008953094,
-0.7240007519721985,
-0.2545817196369171,
-0.016421951353549957,
-0.06710918992757797,
0.11634974181652069,
0.4353162348270416,
-0.6468705534934998,
0.3471299707889557,
0.2700462341308594,
0.3142150640487671,
0.9666929244995117,
-0.01343393325805664,
0.3699344992637634,
-0.8605380654335022,
0.3641829788684845,
0.08212131261825562,
0.4033505320549011,
0.3648298382759094,
-0.44368332624435425,
0.5627498030662537,
0.47336432337760925,
-0.5806853175163269,
-0.8873734474182129,
-0.041170358657836914,
-0.973571240901947,
-0.3271600008010864,
1.0599405765533447,
-0.26406970620155334,
-0.39158394932746887,
-0.07019120454788208,
-0.1503797471523285,
0.4618532359600067,
-0.378775030374527,
0.8327957391738892,
0.6403904557228088,
0.13342998921871185,
-0.18014273047447205,
-0.5466557145118713,
0.5606970191001892,
0.3793380856513977,
-0.42747077345848083,
-0.1651693731546402,
0.17347018420696259,
0.6535857915878296,
0.3238253593444824,
0.6538246870040894,
-0.08860418200492859,
0.062242038547992706,
0.02650766633450985,
0.31110236048698425,
-0.18124431371688843,
-0.13853733241558075,
-0.3977954089641571,
0.13240700960159302,
-0.25257986783981323,
-0.3443107604980469
] |
stabilityai/stable-diffusion-xl-base-1.0 | stabilityai | "2023-10-30T16:03:47Z" | 10,649,877 | 3,677 | diffusers | [
"diffusers",
"onnx",
"text-to-image",
"stable-diffusion",
"arxiv:2307.01952",
"arxiv:2211.01324",
"arxiv:2108.01073",
"arxiv:2112.10752",
"license:openrail++",
"endpoints_compatible",
"has_space",
"diffusers:StableDiffusionXLPipeline",
"region:us"
] | text-to-image | "2023-07-25T13:25:51Z" | ---
license: openrail++
tags:
- text-to-image
- stable-diffusion
---
# SD-XL 1.0-base Model Card
![row01](01.png)
## Model
![pipeline](pipeline.png)
[SDXL](https://arxiv.org/abs/2307.01952) consists of an [ensemble of experts](https://arxiv.org/abs/2211.01324) pipeline for latent diffusion:
In a first step, the base model is used to generate (noisy) latents,
which are then further processed with a refinement model (available here: https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/) specialized for the final denoising steps.
Note that the base model can be used as a standalone module.
Alternatively, we can use a two-stage pipeline as follows:
First, the base model is used to generate latents of the desired output size.
In the second step, we use a specialized high-resolution model and apply a technique called SDEdit (https://arxiv.org/abs/2108.01073, also known as "img2img")
to the latents generated in the first step, using the same prompt. This technique is slightly slower than the first one, as it requires more function evaluations.
Source code is available at https://github.com/Stability-AI/generative-models .
### Model Description
- **Developed by:** Stability AI
- **Model type:** Diffusion-based text-to-image generative model
- **License:** [CreativeML Open RAIL++-M License](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md)
- **Model Description:** This is a model that can be used to generate and modify images based on text prompts. It is a [Latent Diffusion Model](https://arxiv.org/abs/2112.10752) that uses two fixed, pretrained text encoders ([OpenCLIP-ViT/G](https://github.com/mlfoundations/open_clip) and [CLIP-ViT/L](https://github.com/openai/CLIP/tree/main)).
- **Resources for more information:** Check out our [GitHub Repository](https://github.com/Stability-AI/generative-models) and the [SDXL report on arXiv](https://arxiv.org/abs/2307.01952).
### Model Sources
For research purposes, we recommend our `generative-models` Github repository (https://github.com/Stability-AI/generative-models), which implements the most popular diffusion frameworks (both training and inference) and for which new functionalities like distillation will be added over time.
[Clipdrop](https://clipdrop.co/stable-diffusion) provides free SDXL inference.
- **Repository:** https://github.com/Stability-AI/generative-models
- **Demo:** https://clipdrop.co/stable-diffusion
## Evaluation
![comparison](comparison.png)
The chart above evaluates user preference for SDXL (with and without refinement) over SDXL 0.9 and Stable Diffusion 1.5 and 2.1.
The SDXL base model performs significantly better than the previous variants, and the model combined with the refinement module achieves the best overall performance.
### 🧨 Diffusers
Make sure to upgrade diffusers to >= 0.19.0:
```
pip install diffusers --upgrade
```
In addition make sure to install `transformers`, `safetensors`, `accelerate` as well as the invisible watermark:
```
pip install invisible_watermark transformers accelerate safetensors
```
To just use the base model, you can run:
```py
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
pipe.to("cuda")
# if using torch < 2.0
# pipe.enable_xformers_memory_efficient_attention()
prompt = "An astronaut riding a green horse"
images = pipe(prompt=prompt).images[0]
```
To use the whole base + refiner pipeline as an ensemble of experts you can run:
```py
from diffusers import DiffusionPipeline
import torch
# load both base & refiner
base = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True
)
base.to("cuda")
refiner = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-refiner-1.0",
text_encoder_2=base.text_encoder_2,
vae=base.vae,
torch_dtype=torch.float16,
use_safetensors=True,
variant="fp16",
)
refiner.to("cuda")
# Define how many steps and what % of steps to be run on each experts (80/20) here
n_steps = 40
high_noise_frac = 0.8
prompt = "A majestic lion jumping from a big stone at night"
# run both experts
image = base(
prompt=prompt,
num_inference_steps=n_steps,
denoising_end=high_noise_frac,
output_type="latent",
).images
image = refiner(
prompt=prompt,
num_inference_steps=n_steps,
denoising_start=high_noise_frac,
image=image,
).images[0]
```
When using `torch >= 2.0`, you can improve the inference speed by 20-30% with torch.compile. Simple wrap the unet with torch compile before running the pipeline:
```py
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
```
If you are limited by GPU VRAM, you can enable *cpu offloading* by calling `pipe.enable_model_cpu_offload`
instead of `.to("cuda")`:
```diff
- pipe.to("cuda")
+ pipe.enable_model_cpu_offload()
```
For more information on how to use Stable Diffusion XL with `diffusers`, please have a look at [the Stable Diffusion XL Docs](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl).
### Optimum
[Optimum](https://github.com/huggingface/optimum) provides a Stable Diffusion pipeline compatible with both [OpenVINO](https://docs.openvino.ai/latest/index.html) and [ONNX Runtime](https://onnxruntime.ai/).
#### OpenVINO
To install Optimum with the dependencies required for OpenVINO :
```bash
pip install optimum[openvino]
```
To load an OpenVINO model and run inference with OpenVINO Runtime, you need to replace `StableDiffusionXLPipeline` with Optimum `OVStableDiffusionXLPipeline`. In case you want to load a PyTorch model and convert it to the OpenVINO format on-the-fly, you can set `export=True`.
```diff
- from diffusers import StableDiffusionXLPipeline
+ from optimum.intel import OVStableDiffusionXLPipeline
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
- pipeline = StableDiffusionXLPipeline.from_pretrained(model_id)
+ pipeline = OVStableDiffusionXLPipeline.from_pretrained(model_id)
prompt = "A majestic lion jumping from a big stone at night"
image = pipeline(prompt).images[0]
```
You can find more examples (such as static reshaping and model compilation) in optimum [documentation](https://huggingface.co/docs/optimum/main/en/intel/inference#stable-diffusion-xl).
#### ONNX
To install Optimum with the dependencies required for ONNX Runtime inference :
```bash
pip install optimum[onnxruntime]
```
To load an ONNX model and run inference with ONNX Runtime, you need to replace `StableDiffusionXLPipeline` with Optimum `ORTStableDiffusionXLPipeline`. In case you want to load a PyTorch model and convert it to the ONNX format on-the-fly, you can set `export=True`.
```diff
- from diffusers import StableDiffusionXLPipeline
+ from optimum.onnxruntime import ORTStableDiffusionXLPipeline
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
- pipeline = StableDiffusionXLPipeline.from_pretrained(model_id)
+ pipeline = ORTStableDiffusionXLPipeline.from_pretrained(model_id)
prompt = "A majestic lion jumping from a big stone at night"
image = pipeline(prompt).images[0]
```
You can find more examples in optimum [documentation](https://huggingface.co/docs/optimum/main/en/onnxruntime/usage_guides/models#stable-diffusion-xl).
## Uses
### Direct Use
The model is intended for research purposes only. Possible research areas and tasks include
- Generation of artworks and use in design and other artistic processes.
- Applications in educational or creative tools.
- Research on generative models.
- Safe deployment of models which have the potential to generate harmful content.
- Probing and understanding the limitations and biases of generative models.
Excluded uses are described below.
### Out-of-Scope Use
The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
## Limitations and Bias
### Limitations
- The model does not achieve perfect photorealism
- The model cannot render legible text
- The model struggles with more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
- Faces and people in general may not be generated properly.
- The autoencoding part of the model is lossy.
### Bias
While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.
| [
-0.39037227630615234,
-0.807611346244812,
0.49455687403678894,
0.12964530289173126,
-0.1020255982875824,
-0.295228511095047,
-0.1315089613199234,
-0.07478132843971252,
0.12635961174964905,
0.40680065751075745,
-0.2821299731731415,
-0.495692640542984,
-0.5914804935455322,
-0.16074839234352112,
-0.2680024802684784,
0.9650850296020508,
-0.17545804381370544,
0.01075484324246645,
-0.14840564131736755,
-0.04510778188705444,
0.07184812426567078,
0.01794823817908764,
-1.0246694087982178,
-0.26901254057884216,
0.3841962218284607,
-0.038829196244478226,
0.497882217168808,
0.3734358549118042,
0.2449854016304016,
0.38287895917892456,
-0.36679819226264954,
-0.039291106164455414,
-0.5223898887634277,
0.13530002534389496,
0.08265656232833862,
-0.40633660554885864,
-0.27717384696006775,
0.018178336322307587,
0.5002491474151611,
0.31073901057243347,
-0.36513400077819824,
-0.0553092397749424,
-0.06730585545301437,
0.3753197193145752,
-0.5926799774169922,
0.04190478101372719,
-0.2851855158805847,
0.06059947982430458,
0.11339709907770157,
0.13952557742595673,
-0.3152482807636261,
-0.41264060139656067,
0.21579967439174652,
-0.8502464890480042,
0.345160573720932,
-0.17364941537380219,
1.0239343643188477,
0.6165732145309448,
-0.03833519294857979,
-0.1029936671257019,
-0.5068531036376953,
0.7177777290344238,
-0.7963308095932007,
0.22615890204906464,
0.18867374956607819,
0.025682033970952034,
0.03845875337719917,
-1.1887454986572266,
-0.538443922996521,
-0.14892926812171936,
0.043701570481061935,
0.4864295721054077,
-0.30955827236175537,
0.14341160655021667,
0.45469748973846436,
0.3469173014163971,
-0.434794545173645,
-0.05350589007139206,
-0.5904671549797058,
-0.10347241163253784,
0.5565005540847778,
0.11835041642189026,
0.21649695932865143,
0.02325114980340004,
-0.3161219656467438,
-0.22106701135635376,
-0.28964871168136597,
-0.042578600347042084,
0.22494253516197205,
-0.07682796567678452,
-0.37982890009880066,
0.3891028165817261,
-0.023198120296001434,
0.518952488899231,
0.2948901355266571,
-0.025293106213212013,
0.3147972524166107,
-0.14693404734134674,
-0.38744789361953735,
-0.1058058962225914,
0.9377928972244263,
0.2755250632762909,
-0.07751711457967758,
0.043497856706380844,
-0.15664488077163696,
0.04381093010306358,
0.06403181701898575,
-1.1655653715133667,
-0.6247976422309875,
0.41205447912216187,
-0.44695690274238586,
-0.46220874786376953,
-0.21177342534065247,
-0.9423351883888245,
-0.20436258614063263,
0.028186913579702377,
0.5708727240562439,
-0.34918245673179626,
-0.48000556230545044,
0.05534888803958893,
-0.3986068367958069,
0.027841225266456604,
0.42314332723617554,
-0.7604186534881592,
0.2318749874830246,
0.13546693325042725,
1.261857271194458,
-0.1285758912563324,
0.05453590676188469,
-0.4340879023075104,
-0.17211438715457916,
-0.19932369887828827,
0.5737193822860718,
-0.33290448784828186,
-0.36972981691360474,
-0.27828651666641235,
0.049567826092243195,
-0.0642717257142067,
-0.4558970630168915,
0.6610786318778992,
-0.41618528962135315,
0.30349501967430115,
0.09528490900993347,
-0.426727831363678,
-0.22476860880851746,
-0.05692805349826813,
-0.5175424814224243,
1.1302143335342407,
0.2894069254398346,
-0.997890293598175,
0.05917501822113991,
-0.8995620012283325,
-0.0965956375002861,
-0.150150865316391,
-0.015490692108869553,
-0.6981041431427002,
-0.054484736174345016,
0.09069985896348953,
0.40270867943763733,
-0.08450427651405334,
0.10872223228216171,
-0.27126026153564453,
-0.09653270989656448,
-0.09169035404920578,
-0.35885122418403625,
1.2660152912139893,
0.4175991117954254,
-0.36364495754241943,
0.3042984902858734,
-0.7448429465293884,
-0.02575375884771347,
0.13183479011058807,
-0.36376428604125977,
-0.1380399763584137,
-0.25741666555404663,
0.24388691782951355,
0.08639255911111832,
0.04365001618862152,
-0.6679866313934326,
0.08865784853696823,
-0.31484198570251465,
0.8313356637954712,
0.774121880531311,
0.055823471397161484,
0.4453884959220886,
-0.10081542283296585,
0.4400733709335327,
0.1875159591436386,
0.09451773762702942,
-0.05508383363485336,
-0.7963196635246277,
-0.8959324359893799,
-0.26564934849739075,
0.3746330142021179,
0.5549484491348267,
-0.8257152438163757,
0.28410604596138,
0.03217944875359535,
-0.6890339255332947,
-0.48121801018714905,
-0.00907448586076498,
0.2438603639602661,
0.7074798345565796,
0.3329397439956665,
-0.5120243430137634,
-0.37030166387557983,
-0.6432807445526123,
0.3859865069389343,
-0.06745973229408264,
0.0047596413642168045,
0.1387631744146347,
0.6114833354949951,
-0.2877960503101349,
0.7914064526557922,
-0.9111144542694092,
-0.11087559908628464,
0.06552116572856903,
0.31399357318878174,
0.29704007506370544,
0.6748175621032715,
0.6816476583480835,
-0.7374610900878906,
-0.725351095199585,
0.013491878286004066,
-0.7308599352836609,
-0.04225778952240944,
0.05814867466688156,
-0.34011849761009216,
0.28154075145721436,
0.3962210416793823,
-0.8221625089645386,
0.5386208295822144,
0.6080300807952881,
-0.40107461810112,
0.604189932346344,
-0.5417563915252686,
-0.03402063623070717,
-0.962110161781311,
0.24974805116653442,
0.3581072986125946,
-0.31641748547554016,
-0.612190306186676,
0.10669898241758347,
-0.15118277072906494,
-0.08884239196777344,
-0.5590458512306213,
0.6897114515304565,
-0.2794758677482605,
0.3616659343242645,
-0.1083223819732666,
-0.1455681473016739,
0.09563582390546799,
0.4729774296283722,
0.22865042090415955,
0.630759596824646,
0.8711972832679749,
-0.5789756178855896,
0.38512441515922546,
0.2581770420074463,
-0.4118608236312866,
0.25316861271858215,
-0.8865320682525635,
0.15835215151309967,
-0.24528521299362183,
0.20178289711475372,
-1.06100594997406,
-0.1514911949634552,
0.498370498418808,
-0.44595009088516235,
0.39374181628227234,
-0.2345879226922989,
-0.25623178482055664,
-0.2826731204986572,
-0.12734930217266083,
0.1628614366054535,
0.908310055732727,
-0.41256043314933777,
0.7782089114189148,
0.17484821379184723,
-0.028440505266189575,
-0.5641950964927673,
-0.7809101343154907,
-0.2798003852367401,
-0.3351344168186188,
-0.8276433348655701,
0.5015535950660706,
-0.296271413564682,
-0.35400956869125366,
0.061431024223566055,
0.1102222353219986,
-0.22235803306102753,
-0.051292091608047485,
0.2834550142288208,
0.24693569540977478,
-0.1742299348115921,
-0.3295791447162628,
0.2172044813632965,
-0.2783156633377075,
0.06604424864053726,
-0.3111875355243683,
0.3765074908733368,
0.07958634197711945,
-0.007019054144620895,
-0.6743013262748718,
0.13476230204105377,
0.58570396900177,
0.08442744612693787,
0.9083039164543152,
1.0166569948196411,
-0.2739941477775574,
-0.03502519428730011,
-0.40429091453552246,
-0.33379927277565,
-0.49266281723976135,
0.28982630372047424,
-0.14823082089424133,
-0.3737436830997467,
0.5632575154304504,
0.058100149035453796,
0.31086355447769165,
0.5376251935958862,
0.688483715057373,
-0.07563377171754837,
1.0540577173233032,
0.48690348863601685,
0.311908483505249,
0.530491054058075,
-0.9069914817810059,
0.04565950483083725,
-0.7188347578048706,
-0.1682054102420807,
-0.41970372200012207,
-0.15295164287090302,
-0.18472404778003693,
-0.5656180381774902,
0.4301265478134155,
0.1830097883939743,
-0.4174756109714508,
0.1171269342303276,
-0.694489061832428,
0.2543315589427948,
0.5209636688232422,
0.2475406378507614,
0.11371739953756332,
0.22504353523254395,
-0.23820559680461884,
-0.06619203835725784,
-0.6737509369850159,
-0.4017760455608368,
0.8968867659568787,
0.3607991933822632,
0.8620992302894592,
-0.05163360759615898,
0.48153597116470337,
0.23114310204982758,
0.42115548253059387,
-0.4642396867275238,
0.36193913221359253,
-0.1997559815645218,
-0.5108994245529175,
-0.15335224568843842,
-0.36164581775665283,
-0.8217642307281494,
0.23666530847549438,
-0.1833314448595047,
-0.5200904607772827,
0.3259190022945404,
0.19393618404865265,
-0.609131395816803,
0.5054867267608643,
-0.8800126910209656,
0.9286231994628906,
-0.15771019458770752,
-0.7718091011047363,
-0.05227653309702873,
-0.5897364020347595,
0.2996235191822052,
0.14487327635288239,
-0.0736481174826622,
0.14962343871593475,
-0.14624786376953125,
0.7863250374794006,
-0.5036165714263916,
0.8157581090927124,
-0.5049244165420532,
0.05116049945354462,
0.4142415523529053,
-0.22147099673748016,
0.331065833568573,
0.0028161420486867428,
-0.4166637659072876,
0.26451313495635986,
0.08895812928676605,
-0.36786818504333496,
-0.44384458661079407,
0.8391565084457397,
-0.996489405632019,
-0.4322735667228699,
-0.3643997311592102,
-0.3556659519672394,
0.49558475613594055,
0.20743437111377716,
0.5940088629722595,
0.30623942613601685,
-0.03440714627504349,
-0.03169820085167885,
0.8865883350372314,
-0.31434956192970276,
0.5199177861213684,
0.09448511153459549,
-0.2245732545852661,
-0.5238651037216187,
0.8063756823539734,
0.09093420952558517,
0.4675303101539612,
0.1044497862458229,
0.33813467621803284,
-0.340596467256546,
-0.7052271962165833,
-0.640815258026123,
0.1605665385723114,
-0.838495135307312,
-0.11204631626605988,
-0.9252811074256897,
-0.28990864753723145,
-0.40209755301475525,
-0.1673862487077713,
-0.3475877344608307,
-0.3693216145038605,
-0.710953950881958,
0.13675133883953094,
0.593920111656189,
0.548533022403717,
-0.2924692630767822,
0.41375377774238586,
-0.34753817319869995,
0.20438747107982635,
0.2075289636850357,
0.18771898746490479,
0.1317327469587326,
-0.5928994417190552,
-0.12010805308818817,
0.047910772264003754,
-0.6249194741249084,
-0.6635280847549438,
0.620904803276062,
0.1724395602941513,
0.5819690227508545,
0.6839990019798279,
0.04959021136164665,
0.6026685237884521,
-0.19147014617919922,
0.8181584477424622,
0.29512694478034973,
-0.7390118837356567,
0.5206440091133118,
-0.27031686902046204,
-0.04440464824438095,
0.239999920129776,
0.572893500328064,
-0.2037777453660965,
-0.19283685088157654,
-0.6790440678596497,
-0.8551098108291626,
0.7096022367477417,
0.46071091294288635,
-0.017589353024959564,
0.14959831535816193,
0.6125995516777039,
0.034552112221717834,
-0.05450022965669632,
-0.7958298325538635,
-0.43524789810180664,
-0.3138026297092438,
-0.08779751509428024,
0.04046202078461647,
0.1103135496377945,
-0.14087270200252533,
-0.5662010312080383,
0.8532200455665588,
0.08853531628847122,
0.4352567195892334,
0.43281200528144836,
0.09131351858377457,
-0.15356531739234924,
-0.24915704131126404,
0.44201135635375977,
0.47098785638809204,
-0.33934566378593445,
-0.13922959566116333,
0.1384870857000351,
-0.5847006440162659,
0.09319163113832474,
0.08683039247989655,
-0.5293926000595093,
0.046604905277490616,
-0.06727907061576843,
0.9723612070083618,
-0.1763753890991211,
-0.47208717465400696,
0.3175380527973175,
-0.19593386352062225,
-0.341719388961792,
-0.439283162355423,
0.2880862355232239,
0.3028692901134491,
0.24627621471881866,
0.08160760998725891,
0.5985222458839417,
0.02658216841518879,
-0.3274381160736084,
-0.03824508190155029,
0.385785311460495,
-0.3300860822200775,
-0.22634932398796082,
1.2003587484359741,
0.2053900957107544,
-0.2300480306148529,
0.7713972926139832,
-0.20809675753116608,
-0.3624851405620575,
0.7900357842445374,
0.34346774220466614,
0.8345488905906677,
-0.11579471081495285,
0.23476049304008484,
0.6985992789268494,
0.004841013811528683,
-0.3401629328727722,
0.10906385630369186,
0.003988690208643675,
-0.6162970662117004,
-0.27209967374801636,
-0.6520371437072754,
-0.1520412713289261,
0.003299809293821454,
-0.43325626850128174,
0.4612480103969574,
-0.6030703186988831,
-0.2927275002002716,
0.11994648724794388,
-0.05088508129119873,
-0.5804743766784668,
0.15539336204528809,
0.023362593725323677,
0.8541165590286255,
-0.9052800536155701,
0.8321347236633301,
0.568710207939148,
-0.6763488054275513,
-0.5034487247467041,
-0.21990494430065155,
-0.2071719467639923,
-0.5205625891685486,
0.5742365121841431,
0.04925655573606491,
-0.07923544198274612,
0.22469575703144073,
-0.7611150741577148,
-0.6799659132957458,
1.2557775974273682,
0.41727495193481445,
-0.2823335826396942,
-0.04421785846352577,
-0.4177360236644745,
0.5636475682258606,
-0.43188920617103577,
0.748290479183197,
0.4559400677680969,
0.5019962787628174,
0.4814011752605438,
-0.550544023513794,
0.04723956435918808,
-0.3607414960861206,
-0.006758951582014561,
0.009680153802037239,
-0.7254541516304016,
1.1635416746139526,
-0.4769408106803894,
-0.2130018174648285,
0.4310018718242645,
0.6150127649307251,
0.195744127035141,
0.2970731854438782,
0.4387756884098053,
1.1270594596862793,
0.6225064396858215,
-0.14664772152900696,
1.0248689651489258,
-0.15444490313529968,
0.6227095723152161,
0.605047881603241,
0.008006132207810879,
0.8308468461036682,
0.3163365423679352,
-0.29404589533805847,
0.6698993444442749,
0.7966564893722534,
-0.17970344424247742,
0.68288654088974,
0.137774258852005,
-0.31309881806373596,
-0.11817318201065063,
0.13567014038562775,
-0.4812794625759125,
-0.06618323177099228,
0.39474934339523315,
-0.6281864643096924,
-0.14330130815505981,
-0.03189681097865105,
0.06072758883237839,
-0.28363141417503357,
-0.21339182555675507,
0.44888004660606384,
-0.04103631153702736,
-0.7508965730667114,
0.7828674912452698,
0.07795219868421555,
0.9828685522079468,
-0.5854355692863464,
-0.05914054811000824,
-0.0564563125371933,
0.4049571454524994,
-0.3917350769042969,
-0.777935266494751,
0.33196476101875305,
-0.15760040283203125,
-0.13010771572589874,
-0.23746854066848755,
0.530972957611084,
-0.41908904910087585,
-0.5883435010910034,
0.3015257716178894,
0.14607131481170654,
0.542485773563385,
0.04016629606485367,
-0.8409457206726074,
0.20132441818714142,
0.1801462471485138,
-0.3287881314754486,
0.18348316848278046,
0.08823510259389877,
0.3320545554161072,
0.5948938131332397,
0.5817766189575195,
0.032616160809993744,
0.2008504718542099,
-0.11523161083459854,
0.8425322771072388,
-0.26731204986572266,
-0.25736162066459656,
-0.6898113489151001,
0.8140336275100708,
-0.21605828404426575,
-0.3976176083087921,
0.5615221261978149,
0.5855900049209595,
0.6407169103622437,
-0.17557786405086517,
0.8078321814537048,
-0.3552261292934418,
0.02076825313270092,
-0.5337947607040405,
0.9451388716697693,
-0.6763264536857605,
0.11569143831729889,
-0.2247651368379593,
-0.8316429853439331,
-0.1319698542356491,
0.9674144387245178,
-0.19990523159503937,
0.18023355305194855,
0.45679548382759094,
1.0248615741729736,
-0.31559067964553833,
-0.09321288764476776,
0.15292324125766754,
0.4982905685901642,
0.2924277186393738,
0.39626646041870117,
0.47191178798675537,
-0.5288738012313843,
0.49183252453804016,
-0.5364817380905151,
-0.3748731017112732,
0.06025049090385437,
-0.8001615405082703,
-0.8701796531677246,
-0.5787779092788696,
-0.7707771062850952,
-0.7789532542228699,
-0.1317981332540512,
0.7051671147346497,
0.931786298751831,
-0.6370773315429688,
-0.10971001535654068,
-0.34155476093292236,
-0.00018511005328036845,
-0.14073307812213898,
-0.23393107950687408,
0.40755587816238403,
-0.034402959048748016,
-1.0335689783096313,
0.001406998373568058,
0.15851612389087677,
0.22138550877571106,
-0.6408135294914246,
-0.29690051078796387,
-0.3093406558036804,
-0.11003638803958893,
0.4019547402858734,
0.35956230759620667,
-0.6907160878181458,
0.08896335959434509,
-0.188497856259346,
0.15773338079452515,
0.2761399447917938,
0.4371595084667206,
-0.70196932554245,
0.5931149125099182,
0.7400623559951782,
0.22628408670425415,
0.9392003417015076,
-0.1026090681552887,
0.29579463601112366,
-0.33489349484443665,
0.2470986247062683,
0.14917361736297607,
0.38694167137145996,
0.249494731426239,
-0.38615819811820984,
0.5935462713241577,
0.4690583050251007,
-0.6804220676422119,
-0.7276186943054199,
-0.07919073849916458,
-1.1013025045394897,
-0.19902947545051575,
1.0436781644821167,
-0.4701947569847107,
-0.35302475094795227,
-0.16702625155448914,
-0.3829912841320038,
0.3061416447162628,
-0.5600164532661438,
0.686199426651001,
0.511963963508606,
-0.2811853587627411,
-0.44180208444595337,
-0.5581313967704773,
0.4052523076534271,
0.22076673805713654,
-0.6233856081962585,
-0.22692294418811798,
0.3177294135093689,
0.6985728144645691,
0.4687441885471344,
0.6574390530586243,
-0.04270845279097557,
0.06900793313980103,
0.2837003469467163,
0.05783608928322792,
0.005782475695014,
0.04127469286322594,
-0.26693299412727356,
0.11072968691587448,
-0.2251773327589035,
-0.10949377715587616
] |
distilbert-base-uncased | null | "2023-08-18T14:59:41Z" | 10,387,599 | 308 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"distilbert",
"fill-mask",
"exbert",
"en",
"dataset:bookcorpus",
"dataset:wikipedia",
"arxiv:1910.01108",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: apache-2.0
datasets:
- bookcorpus
- wikipedia
---
# DistilBERT base model (uncased)
This model is a distilled version of the [BERT base model](https://huggingface.co/bert-base-uncased). It was
introduced in [this paper](https://arxiv.org/abs/1910.01108). The code for the distillation process can be found
[here](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation). This model is uncased: it does
not make a difference between english and English.
## Model description
DistilBERT is a transformers model, smaller and faster than BERT, which was pretrained on the same corpus in a
self-supervised fashion, using the BERT base model as a teacher. This means it was pretrained on the raw texts only,
with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic
process to generate inputs and labels from those texts using the BERT base model. More precisely, it was pretrained
with three objectives:
- Distillation loss: the model was trained to return the same probabilities as the BERT base model.
- Masked language modeling (MLM): this is part of the original training loss of the BERT base model. When taking a
sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the
model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that
usually see the words one after the other, or from autoregressive models like GPT which internally mask the future
tokens. It allows the model to learn a bidirectional representation of the sentence.
- Cosine embedding loss: the model was also trained to generate hidden states as close as possible as the BERT base
model.
This way, the model learns the same inner representation of the English language than its teacher model, while being
faster for inference or downstream tasks.
## Intended uses & limitations
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=distilbert) to look for
fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
>>> unmasker("Hello I'm a [MASK] model.")
[{'sequence': "[CLS] hello i'm a role model. [SEP]",
'score': 0.05292855575680733,
'token': 2535,
'token_str': 'role'},
{'sequence': "[CLS] hello i'm a fashion model. [SEP]",
'score': 0.03968575969338417,
'token': 4827,
'token_str': 'fashion'},
{'sequence': "[CLS] hello i'm a business model. [SEP]",
'score': 0.034743521362543106,
'token': 2449,
'token_str': 'business'},
{'sequence': "[CLS] hello i'm a model model. [SEP]",
'score': 0.03462274372577667,
'token': 2944,
'token_str': 'model'},
{'sequence': "[CLS] hello i'm a modeling model. [SEP]",
'score': 0.018145186826586723,
'token': 11643,
'token_str': 'modeling'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import DistilBertTokenizer, DistilBertModel
tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')
model = DistilBertModel.from_pretrained("distilbert-base-uncased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import DistilBertTokenizer, TFDistilBertModel
tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')
model = TFDistilBertModel.from_pretrained("distilbert-base-uncased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
Even if the training data used for this model could be characterized as fairly neutral, this model can have biased
predictions. It also inherits some of
[the bias of its teacher model](https://huggingface.co/bert-base-uncased#limitations-and-bias).
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
>>> unmasker("The White man worked as a [MASK].")
[{'sequence': '[CLS] the white man worked as a blacksmith. [SEP]',
'score': 0.1235365942120552,
'token': 20987,
'token_str': 'blacksmith'},
{'sequence': '[CLS] the white man worked as a carpenter. [SEP]',
'score': 0.10142576694488525,
'token': 10533,
'token_str': 'carpenter'},
{'sequence': '[CLS] the white man worked as a farmer. [SEP]',
'score': 0.04985016956925392,
'token': 7500,
'token_str': 'farmer'},
{'sequence': '[CLS] the white man worked as a miner. [SEP]',
'score': 0.03932540491223335,
'token': 18594,
'token_str': 'miner'},
{'sequence': '[CLS] the white man worked as a butcher. [SEP]',
'score': 0.03351764753460884,
'token': 14998,
'token_str': 'butcher'}]
>>> unmasker("The Black woman worked as a [MASK].")
[{'sequence': '[CLS] the black woman worked as a waitress. [SEP]',
'score': 0.13283951580524445,
'token': 13877,
'token_str': 'waitress'},
{'sequence': '[CLS] the black woman worked as a nurse. [SEP]',
'score': 0.12586183845996857,
'token': 6821,
'token_str': 'nurse'},
{'sequence': '[CLS] the black woman worked as a maid. [SEP]',
'score': 0.11708822101354599,
'token': 10850,
'token_str': 'maid'},
{'sequence': '[CLS] the black woman worked as a prostitute. [SEP]',
'score': 0.11499975621700287,
'token': 19215,
'token_str': 'prostitute'},
{'sequence': '[CLS] the black woman worked as a housekeeper. [SEP]',
'score': 0.04722772538661957,
'token': 22583,
'token_str': 'housekeeper'}]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
DistilBERT pretrained on the same data as BERT, which is [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset
consisting of 11,038 unpublished books and [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia)
(excluding lists, tables and headers).
## Training procedure
### Preprocessing
The texts are lowercased and tokenized using WordPiece and a vocabulary size of 30,000. The inputs of the model are
then of the form:
```
[CLS] Sentence A [SEP] Sentence B [SEP]
```
With probability 0.5, sentence A and sentence B correspond to two consecutive sentences in the original corpus and in
the other cases, it's another random sentence in the corpus. Note that what is considered a sentence here is a
consecutive span of text usually longer than a single sentence. The only constrain is that the result with the two
"sentences" has a combined length of less than 512 tokens.
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
### Pretraining
The model was trained on 8 16 GB V100 for 90 hours. See the
[training code](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) for all hyperparameters
details.
## Evaluation results
When fine-tuned on downstream tasks, this model achieves the following results:
Glue test results:
| Task | MNLI | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE |
|:----:|:----:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|
| | 82.2 | 88.5 | 89.2 | 91.3 | 51.3 | 85.8 | 87.5 | 59.9 |
### BibTeX entry and citation info
```bibtex
@article{Sanh2019DistilBERTAD,
title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
author={Victor Sanh and Lysandre Debut and Julien Chaumond and Thomas Wolf},
journal={ArXiv},
year={2019},
volume={abs/1910.01108}
}
```
<a href="https://huggingface.co/exbert/?model=distilbert-base-uncased">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.05776984989643097,
-0.6613970994949341,
0.2539806365966797,
0.28165116906166077,
-0.55666583776474,
0.05044003203511238,
-0.023595793172717094,
-0.10337857156991959,
0.3686756491661072,
0.3903352618217468,
-0.5313125252723694,
-0.43703749775886536,
-0.9344381093978882,
0.16196906566619873,
-0.5491339564323425,
1.216834306716919,
0.2146921008825302,
0.2227056920528412,
0.06667742878198624,
0.1322118639945984,
-0.38351312279701233,
-0.761650562286377,
-0.6633018255233765,
-0.28510820865631104,
0.45592814683914185,
0.27090883255004883,
0.6936208605766296,
0.6642584204673767,
0.4281504154205322,
0.424459844827652,
-0.16319780051708221,
-0.12918344140052795,
-0.45849305391311646,
0.08285000920295715,
-0.09783216565847397,
-0.5279263257980347,
-0.3167007863521576,
0.22471703588962555,
0.3806898891925812,
0.8517308831214905,
-0.04210653901100159,
0.4714939594268799,
0.0020177450496703386,
0.6013012528419495,
-0.3685842454433441,
0.2872583270072937,
-0.5772713422775269,
0.08681587129831314,
-0.2680247724056244,
0.15905918180942535,
-0.403361976146698,
-0.19166366755962372,
0.09716475009918213,
-0.5412113666534424,
0.3165484368801117,
0.18725742399692535,
1.073960542678833,
0.22900423407554626,
-0.2888924479484558,
-0.05823821946978569,
-0.581295371055603,
0.7895045876502991,
-0.7053903341293335,
0.08190006017684937,
0.47381076216697693,
0.24441350996494293,
-0.1972198635339737,
-1.129572868347168,
-0.4783303439617157,
-0.013537442311644554,
-0.24781779944896698,
0.1048567146062851,
-0.08325503021478653,
-0.09446486830711365,
0.4673185348510742,
0.5813109278678894,
-0.32282814383506775,
-0.06379415839910507,
-0.82268887758255,
-0.31978312134742737,
0.6343865990638733,
0.2108124941587448,
0.11033449321985245,
-0.3323327302932739,
-0.35401707887649536,
-0.2805900573730469,
-0.16267305612564087,
0.05922161415219307,
0.6108344793319702,
0.41417524218559265,
-0.20147310197353363,
0.7982850670814514,
-0.25173988938331604,
0.644158661365509,
0.08396965265274048,
-0.08008851110935211,
0.47734981775283813,
-0.130425825715065,
-0.4540558159351349,
0.0356045626103878,
0.9505839347839355,
0.3204539120197296,
0.3647881746292114,
0.04237478971481323,
-0.25400108098983765,
0.18589363992214203,
0.31166598200798035,
-0.7274813652038574,
-0.4219924211502075,
0.10420946776866913,
-0.5539528131484985,
-0.4851871430873871,
0.45254817605018616,
-0.6258583664894104,
-0.110208660364151,
-0.1172315776348114,
0.5687108039855957,
-0.22387279570102692,
-0.17983455955982208,
0.15529944002628326,
-0.6395585536956787,
0.06381110101938248,
0.027509810402989388,
-0.975803017616272,
0.2928187847137451,
0.6685020923614502,
0.9336590766906738,
0.24479535222053528,
-0.1092946007847786,
-0.4005860388278961,
-0.2350405603647232,
-0.1568751186132431,
0.2914789319038391,
-0.261229008436203,
-0.5427660346031189,
-0.0895632952451706,
0.3491457998752594,
-0.035095732659101486,
-0.3062455654144287,
0.6378829479217529,
-0.4509603977203369,
0.4932389259338379,
-0.021570751443505287,
-0.47732096910476685,
-0.29810217022895813,
0.06528672575950623,
-0.7739246487617493,
1.2420909404754639,
0.43576619029045105,
-0.8747560381889343,
0.3416180908679962,
-0.8040236830711365,
-0.5339242219924927,
0.13115356862545013,
0.23171786963939667,
-0.482323557138443,
0.27848705649375916,
0.009239431470632553,
0.3601725697517395,
-0.10791519284248352,
0.2773944139480591,
-0.31358957290649414,
-0.4993341267108917,
0.3394653797149658,
-0.35292112827301025,
1.1723709106445312,
0.21402613818645477,
-0.35683301091194153,
0.02667602337896824,
-0.8770684003829956,
-0.10826034843921661,
0.2796337604522705,
-0.25187233090400696,
-0.29470333456993103,
-0.20033293962478638,
0.30096906423568726,
0.17584578692913055,
0.36868733167648315,
-0.7099596261978149,
0.27012088894844055,
-0.4632127285003662,
0.6579901576042175,
0.7975080013275146,
-0.0830477625131607,
0.26043814420700073,
-0.34424084424972534,
0.47039613127708435,
0.08766208589076996,
0.02048696205019951,
-0.08621560037136078,
-0.6403568387031555,
-0.7866896390914917,
-0.38425686955451965,
0.6121365427970886,
0.7092912793159485,
-0.4146173298358917,
0.6713742613792419,
0.04381069168448448,
-0.6460808515548706,
-0.6638787388801575,
-0.13365019857883453,
0.23200327157974243,
0.6226322650909424,
0.3681004047393799,
-0.3903945982456207,
-0.8515913486480713,
-0.8354655504226685,
-0.17431029677391052,
-0.19051791727542877,
-0.1783248782157898,
-0.05460401996970177,
0.7511752843856812,
-0.2834811508655548,
0.8382862210273743,
-0.8909839987754822,
-0.3637200593948364,
-0.0710226371884346,
0.2100002020597458,
0.7293004393577576,
0.6704174280166626,
0.3851660192012787,
-0.6799594759941101,
-0.5020119547843933,
-0.3750186264514923,
-0.5779191255569458,
0.014013869687914848,
0.14350752532482147,
-0.21699097752571106,
0.02568632923066616,
0.518414318561554,
-0.7549883723258972,
0.6911284327507019,
0.3534243106842041,
-0.5549564957618713,
0.7115069627761841,
-0.313107967376709,
-0.03270960599184036,
-1.339920997619629,
0.18918541073799133,
-0.10911490768194199,
-0.36401185393333435,
-0.7432748675346375,
-0.07580787688493729,
-0.14859570562839508,
-0.04518558457493782,
-0.5890125632286072,
0.45147573947906494,
-0.43275511264801025,
0.045600734651088715,
-0.03254597634077072,
-0.18816690146923065,
0.18679115176200867,
0.4907461702823639,
-0.06640032678842545,
0.5604708790779114,
0.5770472288131714,
-0.4895762503147125,
0.6211729645729065,
0.4374942183494568,
-0.5057308077812195,
0.18676291406154633,
-0.8956654667854309,
0.17820926010608673,
0.011019432917237282,
0.03826536983251572,
-1.113001823425293,
-0.17366880178451538,
0.23404563963413239,
-0.5097571611404419,
0.18565784394741058,
-0.23706531524658203,
-0.7056838870048523,
-0.6340612173080444,
-0.24503783881664276,
0.520993173122406,
0.6666077971458435,
-0.21814025938510895,
0.4103635549545288,
0.28542450070381165,
-0.11268541216850281,
-0.7119752764701843,
-0.740976095199585,
-0.02085253596305847,
-0.3170439898967743,
-0.48223406076431274,
0.44495347142219543,
0.012472444213926792,
-0.23133641481399536,
-0.13660772144794464,
0.025327568873763084,
-0.12347569316625595,
0.16230212152004242,
0.3317958116531372,
0.4986427426338196,
-0.11922389268875122,
-0.16321557760238647,
-0.13471892476081848,
-0.15591813623905182,
0.2637253999710083,
-0.21540237963199615,
0.7709824442863464,
0.048328105360269547,
-0.10042969137430191,
-0.34508922696113586,
0.2733626663684845,
0.6697729825973511,
-0.05934962257742882,
0.7834885120391846,
0.7382825613021851,
-0.527316689491272,
0.057931751012802124,
-0.26998454332351685,
-0.17752589285373688,
-0.5205433964729309,
0.49031156301498413,
-0.4273265302181244,
-0.8105453848838806,
0.7852248549461365,
0.2533630132675171,
-0.13677486777305603,
0.8314554691314697,
0.6488468050956726,
-0.1821829229593277,
0.9926731586456299,
0.4849943220615387,
-0.10270173102617264,
0.3843719959259033,
-0.24403738975524902,
0.2895638644695282,
-0.7313571572303772,
-0.44505828619003296,
-0.4596298336982727,
-0.3948541581630707,
-0.5593137145042419,
-0.20096969604492188,
0.2516739070415497,
0.3050368130207062,
-0.39996054768562317,
0.6233372688293457,
-0.6875087022781372,
0.35117578506469727,
0.9332453608512878,
0.24720215797424316,
-0.047197893261909485,
-0.194040447473526,
-0.27418580651283264,
0.04240979626774788,
-0.39526015520095825,
-0.3919467031955719,
1.0428975820541382,
0.5585669875144958,
0.7413190007209778,
0.006234288681298494,
0.6770350337028503,
0.3784770369529724,
0.042367350310087204,
-0.6549571752548218,
0.46505603194236755,
-0.380308598279953,
-0.8883048295974731,
-0.39441099762916565,
-0.12116049975156784,
-1.004213571548462,
0.23336130380630493,
-0.26917535066604614,
-0.8280641436576843,
-0.01893891766667366,
-0.0537288561463356,
-0.36194202303886414,
0.2031174898147583,
-0.7001388072967529,
1.15144681930542,
-0.25200799107551575,
-0.15690696239471436,
0.11994070559740067,
-0.8904551863670349,
0.28608888387680054,
0.027998976409435272,
0.055333953350782394,
-0.17139241099357605,
0.3106836676597595,
0.9393079280853271,
-0.6663885712623596,
0.9406994581222534,
-0.2992800176143646,
0.22687339782714844,
0.18189458549022675,
-0.02655128948390484,
0.33746448159217834,
0.0682426244020462,
0.007260703481733799,
0.3573627471923828,
0.09643063694238663,
-0.4546371400356293,
-0.2375127673149109,
0.3416050970554352,
-0.7211456894874573,
-0.5825833678245544,
-0.6978816390037537,
-0.5735486149787903,
0.24310211837291718,
0.3345283567905426,
0.6071202158927917,
0.4908643364906311,
-0.16589707136154175,
0.28503042459487915,
0.40101566910743713,
-0.14129884541034698,
0.6884968280792236,
0.2555031478404999,
-0.1998416632413864,
-0.46301159262657166,
0.4846091568470001,
0.027812151238322258,
0.06886328011751175,
0.43239083886146545,
0.22251710295677185,
-0.6471689939498901,
-0.23664844036102295,
-0.45123550295829773,
0.07275880873203278,
-0.5985450148582458,
-0.38421571254730225,
-0.659086287021637,
-0.5016754269599915,
-0.5952237248420715,
0.0073526944033801556,
-0.11742930114269257,
-0.576505720615387,
-0.7237699031829834,
-0.3137214481830597,
0.538855254650116,
0.6665366291999817,
-0.09038044512271881,
0.5677761435508728,
-0.7664229869842529,
0.257912278175354,
0.32346922159194946,
0.37276700139045715,
-0.2128067910671234,
-0.8636751174926758,
-0.3740993142127991,
0.1237139031291008,
-0.24254237115383148,
-0.8967363238334656,
0.6171502470970154,
0.13646632432937622,
0.4548512101173401,
0.46861380338668823,
0.08345513045787811,
0.7202845215797424,
-0.6482717394828796,
0.918926477432251,
0.24987420439720154,
-1.0693533420562744,
0.5053960084915161,
-0.23954634368419647,
0.21833691000938416,
0.5176693201065063,
0.31391382217407227,
-0.49294960498809814,
-0.42268040776252747,
-0.848727822303772,
-0.986780047416687,
0.8021422028541565,
0.2563328444957733,
0.2988007366657257,
-0.06569741666316986,
0.18131029605865479,
0.192856103181839,
0.3540753126144409,
-0.9716384410858154,
-0.6220546364784241,
-0.5644609928131104,
-0.3876759707927704,
-0.1264885514974594,
-0.30106115341186523,
-0.06922155618667603,
-0.5487520694732666,
0.649156928062439,
0.19818425178527832,
0.3057370185852051,
0.10756157338619232,
-0.22209466993808746,
0.1591426432132721,
0.10422582179307938,
0.690622091293335,
0.4780014157295227,
-0.5129227638244629,
0.08337054401636124,
0.062188200652599335,
-0.6416957974433899,
0.1978389322757721,
0.2648080289363861,
-0.02825319953262806,
0.2585389316082001,
0.4834786057472229,
0.8807636499404907,
0.06775709241628647,
-0.34887102246284485,
0.5661970973014832,
0.11160280555486679,
-0.3155660033226013,
-0.5945777893066406,
0.11726915091276169,
0.029393259435892105,
0.13610690832138062,
0.5527790784835815,
0.1843881607055664,
0.2076609581708908,
-0.579457700252533,
0.37308260798454285,
0.2887633442878723,
-0.5469929575920105,
-0.2718057632446289,
0.9339942932128906,
0.05819542706012726,
-0.638910174369812,
0.8356258273124695,
-0.213596373796463,
-0.6952210664749146,
0.7104496955871582,
0.6418293118476868,
0.916004478931427,
-0.14149394631385803,
0.22122104465961456,
0.5054932236671448,
0.26286518573760986,
-0.29898717999458313,
0.2747930884361267,
0.2967144846916199,
-0.7208319902420044,
-0.34493693709373474,
-0.9001513719558716,
-0.059083499014377594,
0.1968829333782196,
-0.8355966210365295,
0.3497631847858429,
-0.4598296582698822,
-0.3825799822807312,
0.26183730363845825,
-0.06191546842455864,
-0.67466801404953,
0.43113091588020325,
0.000690561137162149,
1.0610841512680054,
-1.1048965454101562,
0.9076219201087952,
0.7042608857154846,
-0.6358706951141357,
-0.8334134221076965,
-0.41538798809051514,
-0.2757299542427063,
-0.9217891693115234,
0.8420326709747314,
0.35957270860671997,
0.3128465712070465,
-0.043705135583877563,
-0.5108011960983276,
-0.7317482233047485,
0.9548752307891846,
0.20299729704856873,
-0.5579531192779541,
-0.11103463917970657,
0.11147671192884445,
0.5930413603782654,
-0.44827258586883545,
0.4873582720756531,
0.5623036026954651,
0.39699748158454895,
-0.020648278295993805,
-0.8607962727546692,
0.07604403048753738,
-0.39041778445243835,
0.030178826302289963,
0.16185645759105682,
-0.49588051438331604,
1.149893045425415,
-0.08512251079082489,
-0.024915704503655434,
0.12785206735134125,
0.59311443567276,
0.06808184087276459,
0.22341252863407135,
0.5724244117736816,
0.735245943069458,
0.6769496202468872,
-0.38551414012908936,
0.7648933529853821,
-0.2099779099225998,
0.5570679903030396,
0.909368097782135,
-0.014605320058763027,
0.6523937582969666,
0.4165952503681183,
-0.34347811341285706,
0.9859016537666321,
0.8156604766845703,
-0.3829917013645172,
0.7523690462112427,
0.33100008964538574,
-0.10360144078731537,
0.03010384738445282,
0.10060979425907135,
-0.27458637952804565,
0.6142594814300537,
0.174422949552536,
-0.5508902072906494,
0.06311565637588501,
-0.1354697048664093,
0.17871001362800598,
-0.0583437904715538,
-0.4429379105567932,
0.7155483365058899,
0.2216477245092392,
-0.6725978255271912,
0.3343517780303955,
0.2509883642196655,
0.6742436289787292,
-0.5362673997879028,
-0.042211566120386124,
-0.08085893094539642,
0.23537513613700867,
-0.1422024667263031,
-0.8306831121444702,
0.3284526467323303,
-0.1592424064874649,
-0.5116338133811951,
-0.1923592984676361,
0.7107937932014465,
-0.5367130637168884,
-0.7263556122779846,
0.07825766503810883,
0.25252580642700195,
0.23011299967765808,
-0.149322971701622,
-0.743324875831604,
-0.22020527720451355,
0.013710237108170986,
-0.11724882572889328,
0.13652533292770386,
0.40936607122421265,
0.030482536181807518,
0.42095115780830383,
0.8414993286132812,
-0.09881182014942169,
0.061197616159915924,
0.06448308378458023,
0.7591868042945862,
-0.9726948738098145,
-0.7770333290100098,
-1.1561790704727173,
0.7011979818344116,
-0.21742844581604004,
-0.498394638299942,
0.7205926179885864,
0.8039506077766418,
0.7660476565361023,
-0.45598864555358887,
0.5012075304985046,
-0.19231659173965454,
0.4618918299674988,
-0.3294330835342407,
0.776862382888794,
-0.3257998824119568,
-0.12784147262573242,
-0.38205477595329285,
-0.9191104173660278,
-0.16682901978492737,
0.7489446997642517,
0.012597759254276752,
0.020499441772699356,
0.7092324495315552,
0.6115097999572754,
-0.05956786870956421,
-0.17842455208301544,
0.18713535368442535,
0.18837010860443115,
-0.007696494460105896,
0.32276394963264465,
0.6213464140892029,
-0.6627855896949768,
0.38397935032844543,
-0.27230918407440186,
-0.09278945624828339,
-0.3476438522338867,
-0.9442992806434631,
-0.9791465401649475,
-0.5825936794281006,
-0.2938050925731659,
-0.6369932889938354,
-0.2473970651626587,
0.8761284947395325,
0.7574684023857117,
-0.9256419539451599,
-0.2758128046989441,
-0.0009473363170400262,
0.07815176993608475,
-0.29086700081825256,
-0.2809828519821167,
0.4257688820362091,
-0.08231566101312637,
-0.84917813539505,
0.16133083403110504,
0.03112350031733513,
0.1919802874326706,
-0.15757663547992706,
0.10938944667577744,
-0.3731921911239624,
-0.03868650272488594,
0.5464465022087097,
0.009862932376563549,
-0.6571886539459229,
-0.40686604380607605,
0.034993261098861694,
-0.18521443009376526,
0.06567296385765076,
0.5223302841186523,
-0.5696678161621094,
0.35341203212738037,
0.49702200293540955,
0.3208099901676178,
0.7781553864479065,
0.23972412943840027,
0.6315371990203857,
-1.1294190883636475,
0.4218572676181793,
0.1923249363899231,
0.5636323690414429,
0.39452433586120605,
-0.506169855594635,
0.529242217540741,
0.5410969853401184,
-0.43614694476127625,
-0.8696613311767578,
-0.007865175604820251,
-1.023801326751709,
-0.23338431119918823,
0.8820192217826843,
-0.18478170037269592,
-0.35807138681411743,
-0.1063578724861145,
-0.3518792390823364,
0.5180371999740601,
-0.35181230306625366,
0.7636911273002625,
0.8558632135391235,
0.19138148427009583,
-0.044334959238767624,
-0.296583354473114,
0.43044090270996094,
0.3347553610801697,
-0.33487600088119507,
-0.3093978762626648,
0.18538539111614227,
0.5015972256660461,
0.24761097133159637,
0.5192481279373169,
-0.13064172863960266,
0.07984434068202972,
0.2430448979139328,
0.11923851817846298,
-0.24443942308425903,
-0.10980761796236038,
-0.26119160652160645,
0.1453208029270172,
-0.12215556204319,
-0.7100042700767517
] |
xlm-roberta-base | null | "2023-04-07T12:46:17Z" | 10,334,322 | 423 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"onnx",
"safetensors",
"xlm-roberta",
"fill-mask",
"exbert",
"multilingual",
"af",
"am",
"ar",
"as",
"az",
"be",
"bg",
"bn",
"br",
"bs",
"ca",
"cs",
"cy",
"da",
"de",
"el",
"en",
"eo",
"es",
"et",
"eu",
"fa",
"fi",
"fr",
"fy",
"ga",
"gd",
"gl",
"gu",
"ha",
"he",
"hi",
"hr",
"hu",
"hy",
"id",
"is",
"it",
"ja",
"jv",
"ka",
"kk",
"km",
"kn",
"ko",
"ku",
"ky",
"la",
"lo",
"lt",
"lv",
"mg",
"mk",
"ml",
"mn",
"mr",
"ms",
"my",
"ne",
"nl",
"no",
"om",
"or",
"pa",
"pl",
"ps",
"pt",
"ro",
"ru",
"sa",
"sd",
"si",
"sk",
"sl",
"so",
"sq",
"sr",
"su",
"sv",
"sw",
"ta",
"te",
"th",
"tl",
"tr",
"ug",
"uk",
"ur",
"uz",
"vi",
"xh",
"yi",
"zh",
"arxiv:1911.02116",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
tags:
- exbert
language:
- multilingual
- af
- am
- ar
- as
- az
- be
- bg
- bn
- br
- bs
- ca
- cs
- cy
- da
- de
- el
- en
- eo
- es
- et
- eu
- fa
- fi
- fr
- fy
- ga
- gd
- gl
- gu
- ha
- he
- hi
- hr
- hu
- hy
- id
- is
- it
- ja
- jv
- ka
- kk
- km
- kn
- ko
- ku
- ky
- la
- lo
- lt
- lv
- mg
- mk
- ml
- mn
- mr
- ms
- my
- ne
- nl
- no
- om
- or
- pa
- pl
- ps
- pt
- ro
- ru
- sa
- sd
- si
- sk
- sl
- so
- sq
- sr
- su
- sv
- sw
- ta
- te
- th
- tl
- tr
- ug
- uk
- ur
- uz
- vi
- xh
- yi
- zh
license: mit
---
# XLM-RoBERTa (base-sized model)
XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper [Unsupervised Cross-lingual Representation Learning at Scale](https://arxiv.org/abs/1911.02116) by Conneau et al. and first released in [this repository](https://github.com/pytorch/fairseq/tree/master/examples/xlmr).
Disclaimer: The team releasing XLM-RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.
RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.
This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs.
## Intended uses & limitations
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?search=xlm-roberta) to look for fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation, you should look at models like GPT2.
## Usage
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='xlm-roberta-base')
>>> unmasker("Hello I'm a <mask> model.")
[{'score': 0.10563907772302628,
'sequence': "Hello I'm a fashion model.",
'token': 54543,
'token_str': 'fashion'},
{'score': 0.08015287667512894,
'sequence': "Hello I'm a new model.",
'token': 3525,
'token_str': 'new'},
{'score': 0.033413201570510864,
'sequence': "Hello I'm a model model.",
'token': 3299,
'token_str': 'model'},
{'score': 0.030217764899134636,
'sequence': "Hello I'm a French model.",
'token': 92265,
'token_str': 'French'},
{'score': 0.026436051353812218,
'sequence': "Hello I'm a sexy model.",
'token': 17473,
'token_str': 'sexy'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base')
model = AutoModelForMaskedLM.from_pretrained("xlm-roberta-base")
# prepare input
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
# forward pass
output = model(**encoded_input)
```
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1911-02116,
author = {Alexis Conneau and
Kartikay Khandelwal and
Naman Goyal and
Vishrav Chaudhary and
Guillaume Wenzek and
Francisco Guzm{\'{a}}n and
Edouard Grave and
Myle Ott and
Luke Zettlemoyer and
Veselin Stoyanov},
title = {Unsupervised Cross-lingual Representation Learning at Scale},
journal = {CoRR},
volume = {abs/1911.02116},
year = {2019},
url = {http://arxiv.org/abs/1911.02116},
eprinttype = {arXiv},
eprint = {1911.02116},
timestamp = {Mon, 11 Nov 2019 18:38:09 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1911-02116.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
<a href="https://huggingface.co/exbert/?model=xlm-roberta-base">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.441704124212265,
-0.7515607476234436,
0.2002364993095398,
0.07332059741020203,
-0.2072240561246872,
-0.003866141429170966,
-0.3805343508720398,
-0.3852306008338928,
0.18655133247375488,
0.584320604801178,
-0.4482552707195282,
-0.5778307318687439,
-0.709205150604248,
0.2140282392501831,
-0.409794420003891,
1.1611577272415161,
-0.02897668071091175,
0.06510360538959503,
0.033214520663022995,
-0.21365195512771606,
-0.2182924747467041,
-0.8137635588645935,
-0.4694168269634247,
-0.34189316630363464,
0.3965056836605072,
0.12956926226615906,
0.5506800413131714,
0.609839916229248,
0.21361905336380005,
0.4183080792427063,
-0.20419783890247345,
0.17106179893016815,
-0.2665521800518036,
-0.010835208930075169,
0.036056678742170334,
-0.6083503365516663,
-0.48325860500335693,
0.2355434149503708,
0.6465762257575989,
0.7312586307525635,
0.12150168418884277,
0.2890593707561493,
0.12292814999818802,
0.3580227792263031,
-0.18089620769023895,
0.29276588559150696,
-0.5380748510360718,
0.16985252499580383,
-0.21680830419063568,
0.09232871979475021,
-0.4365259110927582,
-0.10191068053245544,
0.15478867292404175,
-0.2968522310256958,
0.2173214852809906,
0.17477545142173767,
1.2246376276016235,
-0.008640223182737827,
-0.32855328917503357,
-0.18431605398654938,
-0.5825565457344055,
1.0750396251678467,
-0.6710013151168823,
0.4346331059932709,
0.22950828075408936,
0.04070214927196503,
0.08046603202819824,
-0.9023130536079407,
-0.5396515727043152,
-0.26226934790611267,
-0.41728150844573975,
0.09632231295108795,
-0.49061933159828186,
-0.24434930086135864,
0.31057631969451904,
0.4158308506011963,
-0.806041419506073,
-0.0220672395080328,
-0.4367718994617462,
-0.2358647882938385,
0.5417367219924927,
0.012108094990253448,
0.41577017307281494,
-0.5048519372940063,
-0.4181670546531677,
-0.4389808475971222,
-0.4841955602169037,
0.13163310289382935,
0.3412650227546692,
0.4297682046890259,
-0.34385353326797485,
0.5045813322067261,
0.10234256833791733,
0.751353919506073,
0.1611587107181549,
0.03450171276926994,
0.5518595576286316,
-0.2768763601779938,
-0.304503470659256,
-0.23869866132736206,
1.2253153324127197,
-0.05473780259490013,
0.24812711775302887,
-0.10570721328258514,
-0.15281648933887482,
-0.09770466387271881,
0.03276694193482399,
-0.719802975654602,
-0.27896052598953247,
0.20242230594158173,
-0.5616299510002136,
-0.20701761543750763,
0.19343304634094238,
-0.6885713338851929,
0.1674150973558426,
-0.31779778003692627,
0.6352810859680176,
-0.4925106167793274,
-0.2802782654762268,
-0.10297941416501999,
-0.020021356642246246,
0.025417551398277283,
-0.039942823350429535,
-0.7676447629928589,
0.19351954758167267,
0.31065574288368225,
0.8464917540550232,
-0.0786353275179863,
-0.3070565462112427,
-0.43784478306770325,
-0.27696502208709717,
-0.23346655070781708,
0.47296667098999023,
-0.3895680010318756,
-0.14565841853618622,
-0.12022949010133743,
0.33111390471458435,
-0.17508219182491302,
-0.5043240189552307,
0.3815556466579437,
-0.3317415118217468,
0.5101638436317444,
0.11522142589092255,
-0.3344773054122925,
-0.38905036449432373,
0.11728598177433014,
-0.6506503820419312,
1.2351446151733398,
0.2716718316078186,
-0.6695753931999207,
0.21179217100143433,
-0.571378231048584,
-0.3145254850387573,
-0.17226646840572357,
-0.011267212219536304,
-0.7453322410583496,
-0.063395194709301,
0.4129418432712555,
0.5305856466293335,
-0.2777112126350403,
0.1497478038072586,
-0.1492469161748886,
-0.06583337485790253,
0.38967764377593994,
-0.2640951871871948,
1.1676455736160278,
0.32927802205085754,
-0.48589715361595154,
0.1669931560754776,
-0.8371754288673401,
0.20648600161075592,
0.18578886985778809,
-0.21130366623401642,
-0.2511846721172333,
-0.3890814483165741,
0.3475600481033325,
0.3077145218849182,
0.2156071960926056,
-0.3938324749469757,
0.055103711783885956,
-0.5378217101097107,
0.5239271521568298,
0.4944153130054474,
-0.2721346318721771,
0.5037940144538879,
-0.27513548731803894,
0.5882771015167236,
0.1824251115322113,
0.08750727772712708,
-0.36619067192077637,
-0.5586864948272705,
-0.8347249031066895,
-0.3115074932575226,
0.6569148302078247,
0.565643846988678,
-0.5139891505241394,
0.6723593473434448,
-0.15677642822265625,
-0.599815309047699,
-0.6922126412391663,
0.20126256346702576,
0.5537674427032471,
0.3585861921310425,
0.5005950331687927,
-0.4124879539012909,
-0.7196141481399536,
-0.7162657380104065,
-0.18199419975280762,
0.021248353645205498,
-0.08365273475646973,
0.3680526316165924,
0.5828280448913574,
-0.291204035282135,
0.8977994918823242,
-0.44461631774902344,
-0.4466119706630707,
-0.5925595760345459,
0.35059401392936707,
0.374348908662796,
0.6077017188072205,
0.6727136373519897,
-0.7778021693229675,
-0.760905385017395,
-0.028947720304131508,
-0.6383875012397766,
-0.09667080640792847,
-0.025669720023870468,
-0.09954346716403961,
0.5646155476570129,
0.44842347502708435,
-0.5975185632705688,
0.4174593985080719,
0.6093962788581848,
-0.26912036538124084,
0.26718035340309143,
-0.3248476982116699,
-0.023631488904356956,
-1.3034507036209106,
0.15236897766590118,
0.033137328922748566,
-0.33539265394210815,
-0.6376631855964661,
0.022963184863328934,
0.08524250984191895,
-0.17505109310150146,
-0.3201802670955658,
0.6333470344543457,
-0.8157194256782532,
-0.00246209604665637,
-0.09329196065664291,
0.37760353088378906,
0.1010734885931015,
0.6917373538017273,
0.21675559878349304,
0.40649908781051636,
0.6742804050445557,
-0.44053858518600464,
0.2852262556552887,
0.31892871856689453,
-0.3293071985244751,
0.27154606580734253,
-0.626778781414032,
0.16044388711452484,
0.032647088170051575,
0.17081843316555023,
-0.8852102160453796,
0.09595905244350433,
0.3130766749382019,
-0.6160480380058289,
0.5061208605766296,
-0.3621166944503784,
-0.5044494867324829,
-0.4240800440311432,
-0.08791553974151611,
0.39204591512680054,
0.7343902587890625,
-0.4948424696922302,
0.7273507714271545,
0.4324991703033447,
-0.13754408061504364,
-0.5600229501724243,
-0.7978417277336121,
0.11821687966585159,
-0.24327853322029114,
-0.6293345093727112,
0.4918675124645233,
-0.07629124820232391,
0.0022078517358750105,
-0.022643430158495903,
0.2085839956998825,
0.06724244356155396,
-0.09349531680345535,
0.2368486225605011,
0.32264822721481323,
-0.18617039918899536,
-0.061894357204437256,
-0.22314861416816711,
-0.3028554618358612,
-0.051417723298072815,
-0.3851916790008545,
0.8904823064804077,
-0.08933798968791962,
-0.06874553859233856,
-0.33478841185569763,
0.39232170581817627,
0.3332977294921875,
-0.49030622839927673,
0.6755739450454712,
0.992944061756134,
-0.32528451085090637,
-0.17673513293266296,
-0.3698355257511139,
-0.20211321115493774,
-0.42264145612716675,
0.5568665862083435,
-0.3657771646976471,
-0.8057482242584229,
0.6642149686813354,
0.23560811579227448,
-0.11534678936004639,
0.6508373022079468,
0.6769543886184692,
0.14543215930461884,
1.1473900079727173,
0.706462562084198,
-0.03559567406773567,
0.49195003509521484,
-0.6563583612442017,
0.3482685983181,
-0.9697974324226379,
-0.2977125644683838,
-0.604710578918457,
-0.19591698050498962,
-0.8451839089393616,
-0.5768495798110962,
0.27474287152290344,
0.11557667702436447,
-0.13868698477745056,
0.7090504169464111,
-0.5979421734809875,
0.022772297263145447,
0.7820124626159668,
0.15290960669517517,
0.11781478673219681,
0.07405930012464523,
-0.34071245789527893,
-0.07332546263933182,
-0.708972156047821,
-0.34008723497390747,
1.1742584705352783,
0.3494964838027954,
0.7096922397613525,
0.008721765130758286,
0.75115567445755,
-0.033864494413137436,
0.17558491230010986,
-0.6277783513069153,
0.4942897856235504,
-0.26540255546569824,
-0.7231742143630981,
-0.2664354145526886,
-0.523989200592041,
-1.094229817390442,
0.23173899948596954,
-0.2992510497570038,
-0.8592588305473328,
0.21142002940177917,
0.003929089289158583,
-0.26285818219184875,
0.34746700525283813,
-0.5533844828605652,
0.9121044278144836,
-0.3063269257545471,
-0.26449066400527954,
0.04270067811012268,
-0.6921260952949524,
0.17160965502262115,
-0.0855407789349556,
0.1627424657344818,
0.1427970677614212,
0.2102692574262619,
0.7888163328170776,
-0.5146326422691345,
0.9257556200027466,
0.04011121392250061,
0.008117170073091984,
0.24583789706230164,
-0.05948936566710472,
0.4173688292503357,
-0.0810101181268692,
0.129177063703537,
0.47036227583885193,
-0.0697990283370018,
-0.23350384831428528,
-0.4966967701911926,
0.6211184859275818,
-0.9731588363647461,
-0.5981955528259277,
-0.6005442142486572,
-0.6238113641738892,
0.1251458078622818,
0.2932179272174835,
0.46514999866485596,
0.5780263543128967,
-0.019646093249320984,
0.21106235682964325,
0.5735725164413452,
-0.43762800097465515,
0.5157973170280457,
0.44448667764663696,
-0.41310203075408936,
-0.5119601488113403,
0.7004731893539429,
0.2993023991584778,
0.2047455757856369,
0.6120349764823914,
0.20411305129528046,
-0.4473216235637665,
-0.45892608165740967,
-0.4274705648422241,
0.2815794050693512,
-0.6349237561225891,
-0.2688092887401581,
-1.0326282978057861,
-0.4879889488220215,
-0.689868688583374,
0.09319798648357391,
-0.23112700879573822,
-0.5166043639183044,
-0.4055013060569763,
0.025463081896305084,
0.5443759560585022,
0.7211579084396362,
-0.27600178122520447,
0.19417767226696014,
-0.71040278673172,
0.2603102922439575,
0.25015580654144287,
0.06569249927997589,
-0.05418339744210243,
-0.9182114601135254,
-0.40533292293548584,
0.09001389145851135,
-0.36262351274490356,
-0.6898398399353027,
0.8671516180038452,
0.15697215497493744,
0.5841975808143616,
0.28439784049987793,
-0.0214142594486475,
0.695787250995636,
-0.3875587582588196,
0.7401664853096008,
0.17871592938899994,
-0.98000168800354,
0.5396890044212341,
-0.07248622924089432,
0.2389373928308487,
0.029296530410647392,
0.4880262315273285,
-0.5704663991928101,
-0.5185184478759766,
-0.7811674475669861,
-1.0226356983184814,
0.9244847297668457,
0.2922496497631073,
0.2865552604198456,
0.006500640418380499,
0.19486671686172485,
0.023172494024038315,
0.08082886040210724,
-1.170356273651123,
-0.6221140027046204,
-0.4323517084121704,
-0.3914421498775482,
-0.2724999189376831,
-0.1462247371673584,
-0.0252686757594347,
-0.40182003378868103,
0.6899594664573669,
-0.0398513488471508,
0.4510047137737274,
0.26323309540748596,
-0.4292373061180115,
-0.016781067475676537,
0.09884785115718842,
0.47719690203666687,
0.4358304738998413,
-0.21443448960781097,
0.08262522518634796,
0.17082925140857697,
-0.45637503266334534,
-0.0647413432598114,
0.37897801399230957,
-0.20122814178466797,
0.21065546572208405,
0.3462171256542206,
0.9220807552337646,
0.28829053044319153,
-0.41262248158454895,
0.4547572731971741,
0.12547774612903595,
-0.1640777289867401,
-0.4249211847782135,
0.06300558149814606,
0.07071798294782639,
0.30133095383644104,
0.4437239170074463,
0.04157004505395889,
-0.12755443155765533,
-0.7635942697525024,
0.36499661207199097,
0.5065495371818542,
-0.46616998314857483,
-0.29167264699935913,
0.845497190952301,
-0.19155164062976837,
-0.3715461492538452,
0.5229263305664062,
-0.12311113625764847,
-0.7507064342498779,
0.6585102081298828,
0.6430654525756836,
0.9074577689170837,
-0.1429390162229538,
0.2417079210281372,
0.6265175938606262,
0.2754039764404297,
0.05383366346359253,
0.0335908979177475,
0.07440043240785599,
-0.7245078086853027,
-0.2278083711862564,
-0.7641991972923279,
-0.051010169088840485,
0.2113501876592636,
-0.6138311624526978,
0.3295624852180481,
-0.3213707506656647,
-0.23821695148944855,
0.030287636443972588,
0.23758716881275177,
-0.7479068636894226,
0.3052644431591034,
0.06395046412944794,
0.7160139679908752,
-0.8418556451797485,
0.9023239612579346,
0.6996803283691406,
-0.7944310307502747,
-1.011864185333252,
-0.24910195171833038,
-0.12791727483272552,
-0.9348970055580139,
0.9273439645767212,
0.141609326004982,
0.30957305431365967,
0.057004526257514954,
-0.3986041247844696,
-1.0384618043899536,
1.1247236728668213,
0.12652677297592163,
-0.5169516205787659,
0.016486894339323044,
0.3600150942802429,
0.5616514086723328,
-0.6525344848632812,
0.6344401240348816,
0.30292993783950806,
0.44788622856140137,
-0.02300218679010868,
-0.8680996894836426,
0.20740720629692078,
-0.37585577368736267,
0.12735773622989655,
0.07549019157886505,
-0.7672366499900818,
1.2663233280181885,
-0.17203180491924286,
-0.0699245035648346,
0.25168249011039734,
0.5824992060661316,
0.14015351235866547,
-0.010219205170869827,
0.4118306338787079,
0.6780403256416321,
0.6176363825798035,
-0.32824745774269104,
0.9249929785728455,
-0.3800334334373474,
0.6477979421615601,
0.9422734975814819,
0.06485765427350998,
0.7449263334274292,
0.23284050822257996,
-0.23604029417037964,
0.7495219707489014,
0.6536647081375122,
-0.32589268684387207,
0.42921796441078186,
0.09373632073402405,
0.09141599386930466,
-0.1883128136396408,
0.22154471278190613,
-0.3170192539691925,
0.554776132106781,
0.09561578184366226,
-0.6852874159812927,
-0.1284446120262146,
0.13170509040355682,
0.356298565864563,
-0.0174288097769022,
-0.13698522746562958,
0.6059829592704773,
0.25722023844718933,
-0.6279292106628418,
0.7513502240180969,
0.12300784885883331,
0.7002632021903992,
-0.5890929698944092,
0.06979705393314362,
-0.31237518787384033,
0.23930081725120544,
-0.13220436871051788,
-0.5895405411720276,
0.11394906044006348,
0.06851167231798172,
-0.26112404465675354,
-0.3125908374786377,
0.45412665605545044,
-0.7667495608329773,
-0.764406144618988,
0.45765212178230286,
0.4464286267757416,
0.22056925296783447,
-0.002010691910982132,
-0.9650558233261108,
0.06007792800664902,
0.0944099947810173,
-0.4477824866771698,
0.40008804202079773,
0.5719497203826904,
-0.060086339712142944,
0.626105546951294,
0.6979227662086487,
0.11499281972646713,
0.11305417120456696,
0.06394723802804947,
0.7313093543052673,
-0.7839287519454956,
-0.4170130491256714,
-0.7729904055595398,
0.6819102764129639,
-0.04978072643280029,
-0.31448686122894287,
0.8934988379478455,
0.6131935119628906,
0.8388961553573608,
-0.10238517075777054,
0.721560537815094,
-0.23621496558189392,
0.4980115294456482,
-0.5060805082321167,
0.9287630915641785,
-0.7146497368812561,
0.1916351020336151,
-0.35480839014053345,
-0.888217031955719,
-0.3549487888813019,
0.7867680191993713,
-0.1559116393327713,
0.3782212436199188,
0.737637460231781,
0.934553325176239,
-0.11307819187641144,
-0.4075322151184082,
0.35061007738113403,
0.5383886694908142,
0.15606766939163208,
0.5264689922332764,
0.45800408720970154,
-0.7463998794555664,
0.7388123869895935,
-0.35872310400009155,
-0.21347522735595703,
-0.23482713103294373,
-0.8269432783126831,
-1.1077964305877686,
-0.8625472187995911,
-0.43236085772514343,
-0.45798465609550476,
-0.17541150748729706,
0.9468804001808167,
0.8387462496757507,
-0.8874804973602295,
-0.2808152735233307,
0.02397051826119423,
0.1377803087234497,
-0.2435271143913269,
-0.30982157588005066,
0.6011306047439575,
-0.403823584318161,
-1.083847165107727,
0.09094419330358505,
0.10187666118144989,
0.1915479153394699,
-0.36856040358543396,
-0.04517178609967232,
-0.2790241837501526,
0.017826072871685028,
0.5052502155303955,
0.20465782284736633,
-0.6525179147720337,
-0.22459006309509277,
0.08897028863430023,
-0.12586688995361328,
0.2616625726222992,
0.47537389397621155,
-0.8381975889205933,
0.3000386357307434,
0.4314036965370178,
0.20891478657722473,
0.7218279242515564,
-0.30509641766548157,
0.5844994187355042,
-0.7281366586685181,
0.2900407314300537,
0.06648913770914078,
0.5440642237663269,
0.4175584316253662,
-0.21576471626758575,
0.37244826555252075,
0.2889627516269684,
-0.47119954228401184,
-0.8654166460037231,
0.056832216680049896,
-1.0478450059890747,
-0.26625776290893555,
1.0335657596588135,
-0.35829055309295654,
-0.3692435920238495,
-0.05711928382515907,
-0.15965376794338226,
0.45930612087249756,
-0.17121712863445282,
0.7313218116760254,
0.5062821507453918,
0.08736666291952133,
-0.5057159662246704,
-0.3202998638153076,
0.4939901828765869,
0.3154190480709076,
-0.5657842755317688,
-0.04181894287467003,
0.030986877158284187,
0.5181028842926025,
0.38798829913139343,
0.3617455065250397,
-0.3194746673107147,
-0.04140013828873634,
-0.17249226570129395,
0.2583896517753601,
0.012809930369257927,
-0.15703141689300537,
-0.2804938852787018,
0.11246086657047272,
-0.26256126165390015,
-0.051318373531103134
] |
stabilityai/stable-diffusion-xl-refiner-1.0 | stabilityai | "2023-09-25T13:42:56Z" | 9,964,151 | 1,117 | diffusers | [
"diffusers",
"stable-diffusion",
"image-to-image",
"arxiv:2307.01952",
"arxiv:2211.01324",
"arxiv:2108.01073",
"arxiv:2112.10752",
"license:openrail++",
"has_space",
"diffusers:StableDiffusionXLImg2ImgPipeline",
"region:us"
] | image-to-image | "2023-07-26T07:38:01Z" | ---
license: openrail++
tags:
- stable-diffusion
- image-to-image
---
# SD-XL 1.0-refiner Model Card
![row01](01.png)
## Model
![pipeline](pipeline.png)
[SDXL](https://arxiv.org/abs/2307.01952) consists of an [ensemble of experts](https://arxiv.org/abs/2211.01324) pipeline for latent diffusion:
In a first step, the base model (available here: https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) is used to generate (noisy) latents,
which are then further processed with a refinement model specialized for the final denoising steps.
Note that the base model can be used as a standalone module.
Alternatively, we can use a two-stage pipeline as follows:
First, the base model is used to generate latents of the desired output size.
In the second step, we use a specialized high-resolution model and apply a technique called SDEdit (https://arxiv.org/abs/2108.01073, also known as "img2img")
to the latents generated in the first step, using the same prompt. This technique is slightly slower than the first one, as it requires more function evaluations.
Source code is available at https://github.com/Stability-AI/generative-models .
### Model Description
- **Developed by:** Stability AI
- **Model type:** Diffusion-based text-to-image generative model
- **License:** [CreativeML Open RAIL++-M License](https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/blob/main/LICENSE.md)
- **Model Description:** This is a model that can be used to generate and modify images based on text prompts. It is a [Latent Diffusion Model](https://arxiv.org/abs/2112.10752) that uses two fixed, pretrained text encoders ([OpenCLIP-ViT/G](https://github.com/mlfoundations/open_clip) and [CLIP-ViT/L](https://github.com/openai/CLIP/tree/main)).
- **Resources for more information:** Check out our [GitHub Repository](https://github.com/Stability-AI/generative-models) and the [SDXL report on arXiv](https://arxiv.org/abs/2307.01952).
### Model Sources
For research purposes, we recommned our `generative-models` Github repository (https://github.com/Stability-AI/generative-models), which implements the most popoular diffusion frameworks (both training and inference) and for which new functionalities like distillation will be added over time.
[Clipdrop](https://clipdrop.co/stable-diffusion) provides free SDXL inference.
- **Repository:** https://github.com/Stability-AI/generative-models
- **Demo:** https://clipdrop.co/stable-diffusion
## Evaluation
![comparison](comparison.png)
The chart above evaluates user preference for SDXL (with and without refinement) over SDXL 0.9 and Stable Diffusion 1.5 and 2.1.
The SDXL base model performs significantly better than the previous variants, and the model combined with the refinement module achieves the best overall performance.
### 🧨 Diffusers
Make sure to upgrade diffusers to >= 0.18.0:
```
pip install diffusers --upgrade
```
In addition make sure to install `transformers`, `safetensors`, `accelerate` as well as the invisible watermark:
```
pip install invisible_watermark transformers accelerate safetensors
```
Yon can then use the refiner to improve images.
```py
import torch
from diffusers import StableDiffusionXLImg2ImgPipeline
from diffusers.utils import load_image
pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True
)
pipe = pipe.to("cuda")
url = "https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/aa_xl/000000009.png"
init_image = load_image(url).convert("RGB")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt, image=init_image).images
```
When using `torch >= 2.0`, you can improve the inference speed by 20-30% with torch.compile. Simple wrap the unet with torch compile before running the pipeline:
```py
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
```
If you are limited by GPU VRAM, you can enable *cpu offloading* by calling `pipe.enable_model_cpu_offload`
instead of `.to("cuda")`:
```diff
- pipe.to("cuda")
+ pipe.enable_model_cpu_offload()
```
For more advanced use cases, please have a look at [the docs](https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl).
## Uses
### Direct Use
The model is intended for research purposes only. Possible research areas and tasks include
- Generation of artworks and use in design and other artistic processes.
- Applications in educational or creative tools.
- Research on generative models.
- Safe deployment of models which have the potential to generate harmful content.
- Probing and understanding the limitations and biases of generative models.
Excluded uses are described below.
### Out-of-Scope Use
The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
## Limitations and Bias
### Limitations
- The model does not achieve perfect photorealism
- The model cannot render legible text
- The model struggles with more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
- Faces and people in general may not be generated properly.
- The autoencoding part of the model is lossy.
### Bias
While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases. | [
-0.5029902458190918,
-0.7840523719787598,
0.45905566215515137,
0.12346493452787399,
-0.23371489346027374,
-0.25351467728614807,
-0.06729798018932343,
-0.2705375850200653,
0.062089476734399796,
0.4141872823238373,
-0.45243367552757263,
-0.4871370196342468,
-0.6644377112388611,
-0.04403836652636528,
-0.42419669032096863,
0.9965153336524963,
-0.15463192760944366,
-0.11186603456735611,
-0.261665403842926,
-0.11197127401828766,
-0.08297381550073624,
-0.1053529679775238,
-1.005555510520935,
-0.19687500596046448,
0.3728395700454712,
-0.09025005996227264,
0.6059502959251404,
0.3742547035217285,
0.27944478392601013,
0.35478124022483826,
-0.31643813848495483,
-0.08579746633768082,
-0.5400713086128235,
0.07819369435310364,
0.050885483622550964,
-0.4251674711704254,
-0.25594276189804077,
0.10529030114412308,
0.5376840829849243,
0.3789554536342621,
-0.17341724038124084,
-0.01646924950182438,
-0.0425022728741169,
0.6428077816963196,
-0.5272784233093262,
0.008856015279889107,
-0.2762926518917084,
0.03206058219075203,
-0.08322867006063461,
0.2980620861053467,
-0.2928863763809204,
-0.31627288460731506,
0.1444082111120224,
-0.8299411535263062,
0.5551780462265015,
-0.13743071258068085,
1.153804063796997,
0.5272272825241089,
-0.08298064768314362,
-0.09817720204591751,
-0.5540702939033508,
0.670634925365448,
-0.685110330581665,
0.3124515414237976,
0.2382722795009613,
-0.03059219941496849,
0.12900452315807343,
-1.0837674140930176,
-0.6896505951881409,
-0.11697360873222351,
0.009757887572050095,
0.38803258538246155,
-0.32993611693382263,
0.10133613646030426,
0.4529756009578705,
0.4829026460647583,
-0.47585952281951904,
-0.059780776500701904,
-0.5893839597702026,
-0.06852628290653229,
0.6887857913970947,
0.07364185154438019,
0.32162630558013916,
-0.049846306443214417,
-0.3473188877105713,
-0.14329932630062103,
-0.5084476470947266,
-0.11653488129377365,
0.30704963207244873,
-0.15564215183258057,
-0.500633180141449,
0.477355420589447,
0.0905873104929924,
0.4328007698059082,
0.3544835150241852,
-0.004547141492366791,
0.3026350140571594,
-0.31867197155952454,
-0.3309292495250702,
-0.4043005108833313,
0.9347658157348633,
0.4245019555091858,
-0.12926031649112701,
0.0754043385386467,
-0.17717455327510834,
0.1871822476387024,
0.0897807776927948,
-1.1806259155273438,
-0.5253596305847168,
0.3926463723182678,
-0.6123363375663757,
-0.38270726799964905,
-0.13901324570178986,
-0.922537624835968,
-0.17059491574764252,
-0.00827476754784584,
0.4039936065673828,
-0.3515121042728424,
-0.5203042030334473,
-0.045459773391485214,
-0.4064792990684509,
0.0302791278809309,
0.5212550163269043,
-0.7424550652503967,
0.09750073403120041,
0.13362976908683777,
1.1882069110870361,
-0.28930145502090454,
0.01945062354207039,
-0.28531184792518616,
-0.14142842590808868,
-0.18707630038261414,
0.6714624166488647,
-0.32194021344184875,
-0.5683135986328125,
-0.2761908173561096,
0.262487530708313,
0.004386126529425383,
-0.6103895902633667,
0.604742705821991,
-0.4777697026729584,
0.30133056640625,
-0.12718428671360016,
-0.532371461391449,
-0.19669820368289948,
-0.10276008397340775,
-0.7270236611366272,
1.0969114303588867,
0.41587162017822266,
-0.893034815788269,
0.09993476420640945,
-0.8223802447319031,
-0.16021738946437836,
0.014265358448028564,
-0.08588598668575287,
-0.7631584405899048,
-0.037561364471912384,
0.07844007015228271,
0.4340589642524719,
-0.2080078274011612,
0.18207348883152008,
-0.2383352518081665,
-0.19364023208618164,
-0.1024184450507164,
-0.30146947503089905,
1.2064653635025024,
0.47963884472846985,
-0.3488191068172455,
0.2984684705734253,
-0.6669296622276306,
-0.19124986231327057,
0.2917133867740631,
-0.2187366634607315,
-0.08391989767551422,
-0.3224267065525055,
0.3551143407821655,
0.13448642194271088,
0.05513281002640724,
-0.6401575803756714,
0.041150763630867004,
-0.21533970534801483,
0.6407607197761536,
0.771516740322113,
0.06766190379858017,
0.5065885782241821,
-0.20339837670326233,
0.5114997625350952,
0.3058464825153351,
0.07994779199361801,
-0.2451719343662262,
-0.8054641485214233,
-0.7875753045082092,
-0.3548407256603241,
0.2510911822319031,
0.450874924659729,
-0.8678900003433228,
0.3343757092952728,
0.08723878115415573,
-0.6543816924095154,
-0.5417733788490295,
0.09680276364088058,
0.1979629099369049,
0.632987380027771,
0.22803828120231628,
-0.5915918350219727,
-0.34587761759757996,
-0.6080062985420227,
0.4659395217895508,
-0.13084611296653748,
-0.01203163992613554,
0.1896495372056961,
0.6494114995002747,
-0.3860350251197815,
0.7204868793487549,
-0.7961154580116272,
-0.14939655363559723,
0.04740253835916519,
0.24112190306186676,
0.118759386241436,
0.6288607120513916,
0.7962623238563538,
-0.9296761751174927,
-0.6380742788314819,
-0.12810060381889343,
-0.7974309325218201,
-0.06735756993293762,
-0.005122752394527197,
-0.16715838015079498,
0.4233800172805786,
0.39949852228164673,
-0.8904869556427002,
0.5891441106796265,
0.684938371181488,
-0.4518854022026062,
0.7211644053459167,
-0.3835926949977875,
-0.013555423356592655,
-0.9515478610992432,
0.2974785566329956,
0.3287600874900818,
-0.21507509052753448,
-0.5668601989746094,
0.22216898202896118,
-0.044002436101436615,
-0.25294873118400574,
-0.4507138729095459,
0.7291458249092102,
-0.2647455632686615,
0.3662024736404419,
-0.2950124442577362,
-0.06961454451084137,
0.23299798369407654,
0.42616164684295654,
0.2923620939254761,
0.7601936459541321,
0.788329005241394,
-0.592512845993042,
0.41040128469467163,
0.26358893513679504,
-0.3538891673088074,
0.4786338210105896,
-0.8866525292396545,
0.10033693164587021,
-0.3872959017753601,
0.24852751195430756,
-1.120320200920105,
-0.032032839953899384,
0.3958679735660553,
-0.3450794219970703,
0.4681999981403351,
-0.2453787624835968,
-0.32799509167671204,
-0.3999650180339813,
-0.18385754525661469,
0.32785704731941223,
0.8173950910568237,
-0.47555863857269287,
0.5423547625541687,
0.22313843667507172,
-0.04082641378045082,
-0.4266846477985382,
-0.5998662710189819,
-0.19884762167930603,
-0.2723954916000366,
-0.7592670321464539,
0.5127687454223633,
-0.47362253069877625,
-0.23177677392959595,
0.1431909054517746,
0.1679348200559616,
-0.004223111551254988,
-0.02756711095571518,
0.4600312411785126,
0.4200231730937958,
-0.1150708943605423,
-0.24386228621006012,
0.15301676094532013,
-0.2501724362373352,
0.047340720891952515,
-0.09553033113479614,
0.36796024441719055,
0.06444057077169418,
-0.07952304929494858,
-0.6990543603897095,
0.3310365378856659,
0.600808322429657,
0.10728524625301361,
0.8252351880073547,
1.0430878400802612,
-0.31713593006134033,
0.025432119145989418,
-0.44858676195144653,
-0.21068696677684784,
-0.49286872148513794,
0.2729809284210205,
-0.1900918185710907,
-0.6092142462730408,
0.615309476852417,
-0.034861933439970016,
0.18512766063213348,
0.6363762617111206,
0.6817713975906372,
-0.1540161818265915,
0.9596721529960632,
0.5764920711517334,
0.20435073971748352,
0.5471386909484863,
-0.8986656069755554,
0.029863301664590836,
-0.9176636338233948,
-0.1953938901424408,
-0.3438432216644287,
-0.06564325839281082,
-0.39305365085601807,
-0.5723116993904114,
0.34241893887519836,
0.14234276115894318,
-0.23514817655086517,
0.20169448852539062,
-0.6359815001487732,
0.1618863344192505,
0.41423049569129944,
0.15438859164714813,
0.09051314741373062,
0.13110265135765076,
-0.12114016711711884,
-0.10548119992017746,
-0.4980989396572113,
-0.39524832367897034,
0.8957640528678894,
0.37973082065582275,
0.8998110890388489,
-0.04793757572770119,
0.48674631118774414,
0.3509441614151001,
0.5197383761405945,
-0.40319904685020447,
0.39460158348083496,
-0.221387580037117,
-0.5975626707077026,
-0.14959180355072021,
-0.31472092866897583,
-0.8131077885627747,
0.20041942596435547,
-0.1884327083826065,
-0.4392106235027313,
0.4247232675552368,
0.12131908535957336,
-0.4369412958621979,
0.4996423125267029,
-0.9112545847892761,
0.8576281666755676,
-0.04597059637308121,
-0.7671900391578674,
-0.023691553622484207,
-0.5338582992553711,
0.25182220339775085,
0.12648695707321167,
-0.06578218191862106,
-0.014603366144001484,
-0.09123427420854568,
0.7081149220466614,
-0.4436536431312561,
0.8317130208015442,
-0.4410955011844635,
-0.17257744073867798,
0.422241747379303,
-0.20514033734798431,
0.35905176401138306,
-0.00037840360892005265,
-0.3482685089111328,
0.4027172923088074,
0.21271049976348877,
-0.36821505427360535,
-0.47213685512542725,
0.7875096201896667,
-0.9624574184417725,
-0.5317928194999695,
-0.2933470606803894,
-0.3498293459415436,
0.5255286693572998,
0.21424712240695953,
0.7084585428237915,
0.16496369242668152,
-0.16161945462226868,
-0.09545256942510605,
0.8456699848175049,
-0.3862137496471405,
0.4392583966255188,
0.05622818320989609,
-0.2673971652984619,
-0.4713890850543976,
0.8336538672447205,
0.10863376408815384,
0.4488763213157654,
0.09525422006845474,
0.10271022468805313,
-0.34377992153167725,
-0.5402085781097412,
-0.7082361578941345,
0.3011782169342041,
-0.7719927430152893,
-0.2220074087381363,
-0.8167485594749451,
-0.3936413824558258,
-0.39059552550315857,
-0.18493175506591797,
-0.37288397550582886,
-0.35170596837997437,
-0.7950358986854553,
0.06431419402360916,
0.44393032789230347,
0.5700116753578186,
-0.1822652518749237,
0.33722925186157227,
-0.35612180829048157,
0.40138697624206543,
0.20549927651882172,
0.38731202483177185,
0.1540549248456955,
-0.4916410446166992,
-0.0786251500248909,
-0.03480943292379379,
-0.6238567233085632,
-0.6971542835235596,
0.5024210810661316,
0.06642798334360123,
0.41016072034835815,
0.6491151452064514,
0.013511677272617817,
0.5751955509185791,
-0.21912485361099243,
0.9335305690765381,
0.35917937755584717,
-0.7082393765449524,
0.5376932621002197,
-0.2353004515171051,
0.09073802828788757,
0.17949989438056946,
0.4914249777793884,
-0.30332502722740173,
-0.23330767452716827,
-0.73922199010849,
-0.8132237195968628,
0.6107811331748962,
0.4094788432121277,
0.1301257461309433,
0.005760915111750364,
0.6917188763618469,
0.11394046247005463,
0.009175388142466545,
-0.7631070613861084,
-0.5943979620933533,
-0.3574502468109131,
-0.028739798814058304,
0.07283107936382294,
-0.17632484436035156,
-0.0865088403224945,
-0.5259345173835754,
0.8462728261947632,
0.06333658844232559,
0.4994542598724365,
0.35978612303733826,
0.14055867493152618,
-0.30482956767082214,
-0.22485990822315216,
0.4231818914413452,
0.4278218448162079,
-0.24570892751216888,
-0.10985191911458969,
-0.06587325781583786,
-0.5574878454208374,
0.15194180607795715,
0.22727234661579132,
-0.6283798813819885,
0.03779534250497818,
-0.059570856392383575,
0.9319872856140137,
-0.29376286268234253,
-0.5329587459564209,
0.41383564472198486,
-0.22080190479755402,
-0.2979058027267456,
-0.4111543595790863,
0.23111239075660706,
0.26268303394317627,
0.188604474067688,
0.1452847123146057,
0.4486686587333679,
0.07144315540790558,
-0.3441637456417084,
0.005711550824344158,
0.5007290244102478,
-0.23242419958114624,
-0.31788626313209534,
1.17239248752594,
0.21832115948200226,
-0.13627465069293976,
0.7568130493164062,
-0.34438833594322205,
-0.23973429203033447,
0.7341231107711792,
0.5391789078712463,
0.8301355838775635,
-0.1269129067659378,
0.344509094953537,
0.7210964560508728,
0.08751317858695984,
-0.19702373445034027,
0.13343696296215057,
-0.03728681430220604,
-0.7159833312034607,
-0.15235081315040588,
-0.5316349864006042,
-0.11798462271690369,
0.23235554993152618,
-0.42525148391723633,
0.36271342635154724,
-0.5148357152938843,
-0.3737139105796814,
0.11166340112686157,
0.056705132126808167,
-0.6372296214103699,
0.1738012731075287,
0.12249398231506348,
0.8224453926086426,
-0.92585688829422,
0.7342864274978638,
0.579180121421814,
-0.6911543011665344,
-0.37325114011764526,
-0.2209838181734085,
-0.18057462573051453,
-0.4785359501838684,
0.4954896867275238,
0.10227086395025253,
0.03763033077120781,
0.09707862883806229,
-0.8674091696739197,
-0.7621752619743347,
1.290681004524231,
0.4152805209159851,
-0.37856024503707886,
-0.0008104086737148464,
-0.3175794780254364,
0.546595573425293,
-0.4105435609817505,
0.41361165046691895,
0.3776589334011078,
0.3825773596763611,
0.43790486454963684,
-0.5158281922340393,
0.20666664838790894,
-0.47345584630966187,
0.2599368393421173,
-0.022715484723448753,
-0.8530534505844116,
0.9094457626342773,
-0.5579002499580383,
-0.40205085277557373,
0.501557469367981,
0.6954235434532166,
0.31121066212654114,
0.3990313708782196,
0.4391455352306366,
1.1069177389144897,
0.629614531993866,
-0.18546001613140106,
1.0913223028182983,
-0.0441131591796875,
0.5452597737312317,
0.6215707659721375,
-0.13110686838626862,
0.6167404055595398,
0.33598342537879944,
-0.34584513306617737,
0.6530704498291016,
0.7329860329627991,
-0.361236035823822,
0.609835684299469,
0.07603545486927032,
-0.40193045139312744,
0.040399178862571716,
-0.0327986404299736,
-0.41121742129325867,
-0.14458027482032776,
0.3960917294025421,
-0.5905694961547852,
-0.14099478721618652,
0.14077290892601013,
0.06374120712280273,
-0.14896589517593384,
-0.08032698184251785,
0.4610331952571869,
-0.007678729947656393,
-0.5948910713195801,
0.6357727646827698,
0.07793175429105759,
0.9305987358093262,
-0.48614344000816345,
-0.14728254079818726,
-0.16103816032409668,
0.21145637333393097,
-0.3443179428577423,
-0.8389418125152588,
0.3955807089805603,
-0.1117551252245903,
-0.28477078676223755,
-0.19712412357330322,
0.6341291666030884,
-0.3875955045223236,
-0.5595666170120239,
0.292296439409256,
0.19110925495624542,
0.3603559136390686,
0.03111896477639675,
-0.9639853835105896,
0.4567301869392395,
0.06317687779664993,
-0.24419650435447693,
0.22483587265014648,
0.13116653263568878,
0.25766244530677795,
0.6080487370491028,
0.6184794902801514,
0.016205038875341415,
-0.0036962798330932856,
-0.037333894520998,
0.8553794622421265,
-0.3593767583370209,
-0.19722416996955872,
-0.6572155356407166,
0.6426278948783875,
-0.12099871039390564,
-0.22416719794273376,
0.572823703289032,
0.5843144059181213,
0.7762704491615295,
-0.18451157212257385,
0.8295729160308838,
-0.41062524914741516,
-0.005402329843491316,
-0.4243130683898926,
0.9028708338737488,
-0.6172524094581604,
0.1365898698568344,
-0.3535812795162201,
-0.6992241740226746,
-0.11682882905006409,
0.789671778678894,
-0.10441641509532928,
0.2810899019241333,
0.3883354067802429,
0.9713374972343445,
-0.13795225322246552,
-0.03387705609202385,
0.2476566731929779,
0.30522191524505615,
0.35167354345321655,
0.2129630595445633,
0.48897233605384827,
-0.6842114925384521,
0.31833431124687195,
-0.5996137857437134,
-0.22568105161190033,
0.08274143189191818,
-0.7848641276359558,
-0.8184328675270081,
-0.881757915019989,
-0.8229828476905823,
-0.7333835363388062,
-0.1855509877204895,
0.5444515943527222,
0.9884999394416809,
-0.6382078528404236,
-0.037689559161663055,
-0.21976995468139648,
0.12188443541526794,
-0.1413671225309372,
-0.3009817600250244,
0.5239590406417847,
0.004121243488043547,
-1.001886248588562,
-0.15054641664028168,
0.2844057083129883,
0.3581294119358063,
-0.5334129333496094,
-0.19367432594299316,
-0.27383729815483093,
-0.14755959808826447,
0.6389347314834595,
0.36367282271385193,
-0.6847119331359863,
0.07578830420970917,
-0.19329020380973816,
0.13240687549114227,
0.21091443300247192,
0.45687225461006165,
-0.6592667698860168,
0.5426980257034302,
0.5048080682754517,
0.2762795090675354,
0.8398057222366333,
-0.03552355617284775,
0.18685230612754822,
-0.4949313700199127,
0.22978508472442627,
-0.007501853164285421,
0.3889003396034241,
0.4375044107437134,
-0.5781081318855286,
0.6143546104431152,
0.5898818373680115,
-0.6080484390258789,
-0.6602594256401062,
0.09377115219831467,
-1.1068744659423828,
-0.19977600872516632,
1.0478808879852295,
-0.3614739179611206,
-0.3035644292831421,
-0.03149126470088959,
-0.4059211313724518,
0.2630128860473633,
-0.4431537091732025,
0.7547318935394287,
0.5763530135154724,
-0.25644057989120483,
-0.6359880566596985,
-0.44874781370162964,
0.4639635980129242,
0.16291822493076324,
-0.6912975311279297,
-0.09416423738002777,
0.4733312129974365,
0.710082471370697,
0.46993550658226013,
0.7583255767822266,
-0.26523298025131226,
0.14251630008220673,
0.10338818281888962,
0.03382318839430809,
0.10092166811227798,
0.06467993557453156,
-0.30573561787605286,
0.04824570193886757,
-0.20257355272769928,
-0.017739949747920036
] |
sentence-transformers/all-mpnet-base-v2 | sentence-transformers | "2023-11-02T09:35:52Z" | 9,291,921 | 492 | sentence-transformers | [
"sentence-transformers",
"pytorch",
"mpnet",
"feature-extraction",
"sentence-similarity",
"en",
"dataset:s2orc",
"dataset:flax-sentence-embeddings/stackexchange_xml",
"dataset:ms_marco",
"dataset:gooaq",
"dataset:yahoo_answers_topics",
"dataset:code_search_net",
"dataset:search_qa",
"dataset:eli5",
"dataset:snli",
"dataset:multi_nli",
"dataset:wikihow",
"dataset:natural_questions",
"dataset:trivia_qa",
"dataset:embedding-data/sentence-compression",
"dataset:embedding-data/flickr30k-captions",
"dataset:embedding-data/altlex",
"dataset:embedding-data/simple-wiki",
"dataset:embedding-data/QQP",
"dataset:embedding-data/SPECTER",
"dataset:embedding-data/PAQ_pairs",
"dataset:embedding-data/WikiAnswers",
"arxiv:1904.06472",
"arxiv:2102.07033",
"arxiv:2104.08727",
"arxiv:1704.05179",
"arxiv:1810.09305",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | sentence-similarity | "2022-03-02T23:29:05Z" | ---
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- feature-extraction
- sentence-similarity
language: en
license: apache-2.0
datasets:
- s2orc
- flax-sentence-embeddings/stackexchange_xml
- ms_marco
- gooaq
- yahoo_answers_topics
- code_search_net
- search_qa
- eli5
- snli
- multi_nli
- wikihow
- natural_questions
- trivia_qa
- embedding-data/sentence-compression
- embedding-data/flickr30k-captions
- embedding-data/altlex
- embedding-data/simple-wiki
- embedding-data/QQP
- embedding-data/SPECTER
- embedding-data/PAQ_pairs
- embedding-data/WikiAnswers
---
# all-mpnet-base-v2
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
## Usage (Sentence-Transformers)
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
```
pip install -U sentence-transformers
```
Then you can use the model like this:
```python
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')
embeddings = model.encode(sentences)
print(embeddings)
```
## Usage (HuggingFace Transformers)
Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
```python
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']
# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-mpnet-base-v2')
model = AutoModel.from_pretrained('sentence-transformers/all-mpnet-base-v2')
# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
# Normalize embeddings
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
print("Sentence embeddings:")
print(sentence_embeddings)
```
## Evaluation Results
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=sentence-transformers/all-mpnet-base-v2)
------
## Background
The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised
contrastive learning objective. We used the pretrained [`microsoft/mpnet-base`](https://huggingface.co/microsoft/mpnet-base) model and fine-tuned in on a
1B sentence pairs dataset. We use a contrastive learning objective: given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.
We developped this model during the
[Community week using JAX/Flax for NLP & CV](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/7104),
organized by Hugging Face. We developped this model as part of the project:
[Train the Best Sentence Embedding Model Ever with 1B Training Pairs](https://discuss.huggingface.co/t/train-the-best-sentence-embedding-model-ever-with-1b-training-pairs/7354). We benefited from efficient hardware infrastructure to run the project: 7 TPUs v3-8, as well as intervention from Googles Flax, JAX, and Cloud team member about efficient deep learning frameworks.
## Intended uses
Our model is intented to be used as a sentence and short paragraph encoder. Given an input text, it ouptuts a vector which captures
the semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.
By default, input text longer than 384 word pieces is truncated.
## Training procedure
### Pre-training
We use the pretrained [`microsoft/mpnet-base`](https://huggingface.co/microsoft/mpnet-base) model. Please refer to the model card for more detailed information about the pre-training procedure.
### Fine-tuning
We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each possible sentence pairs from the batch.
We then apply the cross entropy loss by comparing with true pairs.
#### Hyper parameters
We trained ou model on a TPU v3-8. We train the model during 100k steps using a batch size of 1024 (128 per TPU core).
We use a learning rate warm up of 500. The sequence length was limited to 128 tokens. We used the AdamW optimizer with
a 2e-5 learning rate. The full training script is accessible in this current repository: `train_script.py`.
#### Training data
We use the concatenation from multiple datasets to fine-tune our model. The total number of sentence pairs is above 1 billion sentences.
We sampled each dataset given a weighted probability which configuration is detailed in the `data_config.json` file.
| Dataset | Paper | Number of training tuples |
|--------------------------------------------------------|:----------------------------------------:|:--------------------------:|
| [Reddit comments (2015-2018)](https://github.com/PolyAI-LDN/conversational-datasets/tree/master/reddit) | [paper](https://arxiv.org/abs/1904.06472) | 726,484,430 |
| [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Abstracts) | [paper](https://aclanthology.org/2020.acl-main.447/) | 116,288,806 |
| [WikiAnswers](https://github.com/afader/oqa#wikianswers-corpus) Duplicate question pairs | [paper](https://doi.org/10.1145/2623330.2623677) | 77,427,422 |
| [PAQ](https://github.com/facebookresearch/PAQ) (Question, Answer) pairs | [paper](https://arxiv.org/abs/2102.07033) | 64,371,441 |
| [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Titles) | [paper](https://aclanthology.org/2020.acl-main.447/) | 52,603,982 |
| [S2ORC](https://github.com/allenai/s2orc) (Title, Abstract) | [paper](https://aclanthology.org/2020.acl-main.447/) | 41,769,185 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Body) pairs | - | 25,316,456 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title+Body, Answer) pairs | - | 21,396,559 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Answer) pairs | - | 21,396,559 |
| [MS MARCO](https://microsoft.github.io/msmarco/) triplets | [paper](https://doi.org/10.1145/3404835.3462804) | 9,144,553 |
| [GOOAQ: Open Question Answering with Diverse Answer Types](https://github.com/allenai/gooaq) | [paper](https://arxiv.org/pdf/2104.08727.pdf) | 3,012,496 |
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 1,198,260 |
| [Code Search](https://huggingface.co/datasets/code_search_net) | - | 1,151,414 |
| [COCO](https://cocodataset.org/#home) Image captions | [paper](https://link.springer.com/chapter/10.1007%2F978-3-319-10602-1_48) | 828,395|
| [SPECTER](https://github.com/allenai/specter) citation triplets | [paper](https://doi.org/10.18653/v1/2020.acl-main.207) | 684,100 |
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Question, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 681,164 |
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Question) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 659,896 |
| [SearchQA](https://huggingface.co/datasets/search_qa) | [paper](https://arxiv.org/abs/1704.05179) | 582,261 |
| [Eli5](https://huggingface.co/datasets/eli5) | [paper](https://doi.org/10.18653/v1/p19-1346) | 325,475 |
| [Flickr 30k](https://shannon.cs.illinois.edu/DenotationGraph/) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/229/33) | 317,695 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles) | | 304,525 |
| AllNLI ([SNLI](https://nlp.stanford.edu/projects/snli/) and [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) | [paper SNLI](https://doi.org/10.18653/v1/d15-1075), [paper MultiNLI](https://doi.org/10.18653/v1/n18-1101) | 277,230 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (bodies) | | 250,519 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles+bodies) | | 250,460 |
| [Sentence Compression](https://github.com/google-research-datasets/sentence-compression) | [paper](https://www.aclweb.org/anthology/D13-1155/) | 180,000 |
| [Wikihow](https://github.com/pvl/wikihow_pairs_dataset) | [paper](https://arxiv.org/abs/1810.09305) | 128,542 |
| [Altlex](https://github.com/chridey/altlex/) | [paper](https://aclanthology.org/P16-1135.pdf) | 112,696 |
| [Quora Question Triplets](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs) | - | 103,663 |
| [Simple Wikipedia](https://cs.pomona.edu/~dkauchak/simplification/) | [paper](https://www.aclweb.org/anthology/P11-2117/) | 102,225 |
| [Natural Questions (NQ)](https://ai.google.com/research/NaturalQuestions) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/1455) | 100,231 |
| [SQuAD2.0](https://rajpurkar.github.io/SQuAD-explorer/) | [paper](https://aclanthology.org/P18-2124.pdf) | 87,599 |
| [TriviaQA](https://huggingface.co/datasets/trivia_qa) | - | 73,346 |
| **Total** | | **1,170,060,424** | | [
-0.3521747589111328,
-0.7242094874382019,
0.3295871913433075,
0.19640401005744934,
-0.12623131275177002,
-0.31733378767967224,
-0.23419201374053955,
-0.1912698894739151,
0.3395887017250061,
0.19213509559631348,
-0.4126448333263397,
-0.48855286836624146,
-0.7262453436851501,
0.0836281105875969,
-0.271786630153656,
1.007295846939087,
-0.06526899337768555,
-0.07911594212055206,
-0.39291834831237793,
-0.26281431317329407,
-0.035422660410404205,
-0.48760753870010376,
-0.5121716260910034,
-0.03856614977121353,
0.5153442025184631,
0.32676148414611816,
0.3992956578731537,
0.5635286569595337,
0.41139665246009827,
0.25273874402046204,
-0.12762703001499176,
0.3162606656551361,
-0.5584877729415894,
-0.15662387013435364,
0.08179380744695663,
-0.33010897040367126,
-0.17780184745788574,
0.12331551313400269,
0.5004905462265015,
0.6025495529174805,
-0.04343868046998978,
0.23645064234733582,
0.1895952969789505,
0.4962782859802246,
-0.5308501124382019,
0.2834465503692627,
-0.5362300872802734,
0.08743918687105179,
-0.14888474345207214,
-0.061704568564891815,
-0.3829088509082794,
-0.261099636554718,
0.25552642345428467,
-0.4682948887348175,
0.07579870522022247,
0.12595641613006592,
1.0334131717681885,
0.20765937864780426,
-0.43787065148353577,
-0.3290211260318756,
-0.18226732313632965,
0.7157515287399292,
-0.7884038090705872,
0.1913427859544754,
0.5107384920120239,
-0.0974092185497284,
-0.0008195117115974426,
-0.7784930467605591,
-0.7238335013389587,
-0.10053274780511856,
-0.3920497000217438,
0.26529985666275024,
-0.3202299177646637,
-0.1164778470993042,
0.21803659200668335,
0.3746013045310974,
-0.7398979067802429,
0.044913750141859055,
-0.40484103560447693,
-0.07899469882249832,
0.7112252712249756,
0.06712131947278976,
0.2099871188402176,
-0.5668243765830994,
-0.29939383268356323,
-0.26012125611305237,
-0.30623912811279297,
0.13650572299957275,
0.39091789722442627,
0.1739308089017868,
-0.43641772866249084,
0.7730041742324829,
-0.082704558968544,
0.6211246848106384,
-0.003048510756343603,
0.0680171325802803,
0.5795860290527344,
-0.5388942956924438,
-0.13806813955307007,
-0.25543487071990967,
1.1692478656768799,
0.39637741446495056,
0.21458445489406586,
0.00212095002643764,
0.12651778757572174,
-0.1188988909125328,
-0.039552953094244,
-0.8201696872711182,
-0.2624521553516388,
0.3282123804092407,
-0.4541700482368469,
-0.37109920382499695,
0.2011691927909851,
-0.7323700785636902,
-0.1842063069343567,
-0.04696184769272804,
0.32610395550727844,
-0.5496585965156555,
-0.24233342707157135,
0.2223341315984726,
-0.1569232940673828,
0.2949155569076538,
-0.13248379528522491,
-0.68827223777771,
0.2172359824180603,
0.5236496329307556,
0.9700195789337158,
-0.05022665485739708,
-0.3380955755710602,
-0.24634042382240295,
-0.1805068850517273,
-0.03243868425488472,
0.6735560894012451,
-0.4434700608253479,
-0.0591929592192173,
-0.0725214034318924,
0.12633304297924042,
-0.4954144358634949,
-0.33693647384643555,
0.5557665824890137,
-0.21247537434101105,
0.6113534569740295,
-0.1712336540222168,
-0.7873923182487488,
-0.10421881079673767,
0.21775461733341217,
-0.42205068469047546,
1.1455411911010742,
0.19313347339630127,
-1.1467779874801636,
-0.016455115750432014,
-0.5983841419219971,
-0.23171557486057281,
-0.2830909788608551,
-0.1483248621225357,
-0.6018497347831726,
-0.054651979357004166,
0.4075453281402588,
0.606866180896759,
-0.23169977962970734,
0.22452940046787262,
-0.3474765419960022,
-0.24798209965229034,
0.278298020362854,
-0.16278401017189026,
1.1611531972885132,
0.1741596758365631,
-0.35395288467407227,
-0.10752535611391068,
-0.6420121192932129,
-0.12729619443416595,
0.3147159218788147,
-0.18471215665340424,
-0.06522884964942932,
-0.13383221626281738,
0.157315194606781,
0.37575995922088623,
0.21247528493404388,
-0.6862576007843018,
0.1713051050901413,
-0.5637283325195312,
0.7078742384910583,
0.6718665361404419,
0.015398439951241016,
0.29424285888671875,
-0.4588308334350586,
0.35602396726608276,
0.22003382444381714,
-0.0019628237932920456,
-0.10164579749107361,
-0.5494349598884583,
-1.0315958261489868,
-0.12448828667402267,
0.39460545778274536,
0.6115679740905762,
-0.7082217931747437,
0.7895678281784058,
-0.4902416467666626,
-0.511400043964386,
-0.7719264626502991,
0.0013871584087610245,
0.37720757722854614,
0.5951231122016907,
0.5827789902687073,
-0.10458962619304657,
-0.6018838286399841,
-1.0261954069137573,
-0.10855718702077866,
-0.07233849167823792,
-0.012622161768376827,
0.5964323878288269,
0.759743332862854,
-0.2744666337966919,
0.8422526717185974,
-0.6589134931564331,
-0.27547934651374817,
-0.19061174988746643,
0.054227933287620544,
0.24131649732589722,
0.600924551486969,
0.5438981652259827,
-0.7560014128684998,
-0.5805470943450928,
-0.36880820989608765,
-0.8110643625259399,
0.011686190031468868,
-0.07670664042234421,
-0.2235732525587082,
0.2932069003582001,
0.6522586345672607,
-0.7056044936180115,
0.32977232336997986,
0.5290213823318481,
-0.42480406165122986,
0.33402779698371887,
-0.0630279928445816,
-0.09935110062360764,
-1.4221223592758179,
0.3126637637615204,
0.09509320557117462,
-0.060184355825185776,
-0.4300541281700134,
-0.03547332435846329,
-0.11587865650653839,
-0.07655264437198639,
-0.35424599051475525,
0.4091431200504303,
-0.4030868411064148,
0.07113048434257507,
0.14172062277793884,
0.2949894964694977,
0.008425077423453331,
0.758078932762146,
-0.09890038520097733,
0.7252948880195618,
0.4625629186630249,
-0.33010590076446533,
0.22607508301734924,
0.5130789875984192,
-0.40582314133644104,
0.30602264404296875,
-0.8380887508392334,
0.17220649123191833,
-0.2047627866268158,
0.4377775192260742,
-1.0442777872085571,
-0.1076846793293953,
0.34277069568634033,
-0.6536386609077454,
0.07370106130838394,
0.015651602298021317,
-0.5968112349510193,
-0.4835261404514313,
-0.4539673924446106,
0.2365405112504959,
0.362527996301651,
-0.4212735891342163,
0.38328254222869873,
0.3374001383781433,
-0.04616297408938408,
-0.6295852065086365,
-1.0311378240585327,
-0.028588762506842613,
-0.09298215806484222,
-0.7896648049354553,
0.412288099527359,
-0.17063957452774048,
0.08249873667955399,
0.18002022802829742,
0.11826886236667633,
0.08826427906751633,
-0.12689608335494995,
0.20232650637626648,
0.05208912119269371,
-0.14266164600849152,
0.21121256053447723,
-0.1482524424791336,
-0.09302379935979843,
-0.07820475846529007,
-0.3206767439842224,
0.7212375998497009,
-0.36763089895248413,
-0.024404853582382202,
-0.5656505227088928,
0.35687577724456787,
0.38601845502853394,
-0.23290333151817322,
1.0665435791015625,
0.88129723072052,
-0.28524547815322876,
0.21501122415065765,
-0.5423569679260254,
-0.08314229547977448,
-0.4361259639263153,
0.3986191749572754,
-0.2883877456188202,
-1.1067460775375366,
0.39812296628952026,
0.3476959764957428,
0.018322929739952087,
0.7878779768943787,
0.42303377389907837,
-0.222158282995224,
0.8082131743431091,
0.31407472491264343,
-0.06877142190933228,
0.46787214279174805,
-0.6213340163230896,
0.3213368058204651,
-0.9550365805625916,
-0.334318071603775,
-0.3841513693332672,
-0.34605714678764343,
-0.9295931458473206,
-0.5864585638046265,
0.29072311520576477,
-0.048805590718984604,
-0.2651403844356537,
0.4393041431903839,
-0.5443862080574036,
0.1261376440525055,
0.6247843503952026,
0.35106074810028076,
-0.1642804890871048,
0.08732280135154724,
-0.27710801362991333,
-0.06420791149139404,
-0.7624489068984985,
-0.3009476959705353,
1.1642634868621826,
0.35965824127197266,
0.35936087369918823,
-0.00533944321796298,
0.6816064715385437,
0.040489308536052704,
-0.14195959270000458,
-0.5459873676300049,
0.5555115938186646,
-0.3357802629470825,
-0.37724336981773376,
-0.08236797899007797,
-0.6477405428886414,
-0.9772031307220459,
0.15833353996276855,
-0.33855903148651123,
-0.7463756203651428,
0.3363805413246155,
-0.04044037684798241,
-0.3556135594844818,
0.30681437253952026,
-0.7891062498092651,
0.9958569407463074,
-0.054244983941316605,
-0.3700777292251587,
-0.03322663530707359,
-0.8201578855514526,
0.15991611778736115,
0.30856019258499146,
0.021758608520030975,
-0.07392235100269318,
-0.0933903381228447,
0.9323484897613525,
-0.4030454158782959,
0.7147142291069031,
-0.15301613509655,
0.29461973905563354,
0.3643213212490082,
-0.26354384422302246,
0.43972891569137573,
-0.007464126218110323,
-0.20408745110034943,
0.136924609541893,
-0.038905855268239975,
-0.6664448380470276,
-0.5219302177429199,
0.8066834211349487,
-1.0146039724349976,
-0.38234880566596985,
-0.5639726519584656,
-0.4434467554092407,
-0.06556375324726105,
0.06130596995353699,
0.3949708938598633,
0.40666505694389343,
0.011403917334973812,
0.6141651272773743,
0.6129181385040283,
-0.43525710701942444,
0.4858209192752838,
0.08613675087690353,
0.0542682483792305,
-0.5770946145057678,
0.7418728470802307,
0.15247058868408203,
0.04822005331516266,
0.5428667664527893,
0.24975937604904175,
-0.26373669505119324,
-0.43853697180747986,
-0.19777558743953705,
0.3088831305503845,
-0.5058868527412415,
-0.20361264050006866,
-1.17482590675354,
-0.40321195125579834,
-0.7366923093795776,
-0.009509893134236336,
-0.25427383184432983,
-0.5352628231048584,
-0.580708920955658,
-0.31595152616500854,
0.3949814736843109,
0.3786241114139557,
-0.025974009186029434,
0.23103156685829163,
-0.36716029047966003,
0.1627298891544342,
0.2700647711753845,
0.1672549694776535,
-0.10796987265348434,
-0.6604722738265991,
-0.2101375311613083,
0.1317528784275055,
-0.24520818889141083,
-0.6866427659988403,
0.3822283148765564,
0.33200716972351074,
0.4639805853366852,
0.13889910280704498,
0.056731972843408585,
0.6527836918830872,
-0.20305876433849335,
0.9775258898735046,
0.08564245700836182,
-0.6742611527442932,
0.6224971413612366,
-0.2877303957939148,
0.45842015743255615,
0.7754594087600708,
0.5793310403823853,
-0.5092282891273499,
-0.20510245859622955,
-0.7841190695762634,
-1.0328618288040161,
0.6560370922088623,
0.47975265979766846,
0.19276009500026703,
-0.1665891706943512,
0.4218541383743286,
-0.1819823831319809,
0.07847718894481659,
-0.9033107161521912,
-0.4409536123275757,
-0.2604261338710785,
-0.5052578449249268,
-0.24537625908851624,
-0.3633325695991516,
-0.006670029833912849,
-0.4786868691444397,
0.7814929485321045,
-0.1037517562508583,
0.6846603155136108,
0.4284803569316864,
-0.32586735486984253,
0.34591981768608093,
0.09960105270147324,
0.5805665850639343,
0.4014645218849182,
-0.2582269310951233,
0.17895320057868958,
0.1614532172679901,
-0.3596496284008026,
-0.19686825573444366,
0.4075535237789154,
-0.14389410614967346,
-0.12177364528179169,
0.435921847820282,
0.9071969985961914,
0.13404326140880585,
-0.5193795561790466,
0.7967481017112732,
-0.2155236005783081,
-0.30107802152633667,
-0.4031292796134949,
-0.07171489298343658,
0.2882814109325409,
0.14666807651519775,
0.15907703340053558,
0.04653934761881828,
0.04201486334204674,
-0.4526132345199585,
0.33188578486442566,
0.1599389910697937,
-0.39876389503479004,
-0.07440203428268433,
0.46833375096321106,
0.04054960981011391,
-0.09228447079658508,
0.7824915051460266,
-0.24648259580135345,
-0.5122069120407104,
0.5623900294303894,
0.40927639603614807,
0.7805385589599609,
0.1822386085987091,
0.20683406293392181,
0.7155517935752869,
0.32006895542144775,
0.15831786394119263,
0.10906519740819931,
0.07311701774597168,
-0.6976076364517212,
-0.09691990166902542,
-0.7046025395393372,
0.03593714162707329,
0.11785591393709183,
-0.5456656217575073,
0.16548191010951996,
-0.3136717677116394,
0.023078272119164467,
0.11337315291166306,
0.23373021185398102,
-0.7093983888626099,
-0.02092648111283779,
0.06679590791463852,
0.904516339302063,
-0.8414342403411865,
0.7151070237159729,
0.5947679281234741,
-0.6417027711868286,
-0.7243144512176514,
-0.0025386118795722723,
-0.0726502314209938,
-0.7771371603012085,
0.2909053862094879,
0.38742467761039734,
0.15009520947933197,
0.07990667223930359,
-0.651722252368927,
-0.8718343377113342,
1.3004590272903442,
0.33358627557754517,
-0.4264507591724396,
-0.03626327961683273,
0.2075127512216568,
0.6040130853652954,
-0.5440865159034729,
0.5082306265830994,
0.5254492163658142,
0.37983864545822144,
0.01094394363462925,
-0.7041364908218384,
0.16264572739601135,
-0.6081995964050293,
0.13332176208496094,
-0.1635742485523224,
-0.8698850870132446,
0.7651497721672058,
0.018666792660951614,
-0.1053696796298027,
0.05990094691514969,
0.6863676905632019,
0.3214198350906372,
0.1603047400712967,
0.45573124289512634,
0.9918474555015564,
0.6582692861557007,
-0.13085372745990753,
1.1598942279815674,
-0.27495530247688293,
0.5608944892883301,
1.1151894330978394,
0.1974358707666397,
0.9898444414138794,
0.46350547671318054,
-0.14880549907684326,
0.7467767000198364,
0.8039583563804626,
-0.18354645371437073,
0.4633370041847229,
0.17744193971157074,
-0.009441228583455086,
-0.11063408851623535,
-0.17605505883693695,
-0.38753509521484375,
0.5687294006347656,
0.1924401968717575,
-0.5630499720573425,
0.05570757016539574,
0.06372465938329697,
0.3390186131000519,
0.04835439473390579,
0.06442050635814667,
0.7719547152519226,
0.15367969870567322,
-0.6490320563316345,
0.6041528582572937,
-0.03634526953101158,
0.9161198735237122,
-0.45917072892189026,
0.2909080386161804,
-0.3010328412055969,
0.2006382793188095,
-0.30985069274902344,
-0.7305586338043213,
0.3915317952632904,
-0.04359988868236542,
-0.15949249267578125,
-0.22357791662216187,
0.4966259300708771,
-0.5584385395050049,
-0.6526238322257996,
0.3522082567214966,
0.3694376051425934,
0.14167317748069763,
0.08979782462120056,
-1.067591667175293,
-0.03848392516374588,
0.09647143632173538,
-0.4273536503314972,
0.19707779586315155,
0.19606351852416992,
0.3928684592247009,
0.4735686779022217,
0.5753456354141235,
-0.18341630697250366,
0.053575530648231506,
-0.09215261042118073,
0.8520830869674683,
-0.6209120750427246,
-0.5140385627746582,
-0.7985172867774963,
0.617356538772583,
-0.3653528392314911,
-0.5461108088493347,
0.7520608305931091,
0.8180830478668213,
0.9400920271873474,
0.10168576240539551,
0.6360714435577393,
-0.4049663245677948,
0.4183413088321686,
-0.43608787655830383,
0.6500015258789062,
-0.6639178395271301,
0.056440651416778564,
-0.20232297480106354,
-0.7172500491142273,
-0.2904505431652069,
0.7105219960212708,
-0.4181860685348511,
0.1436784863471985,
0.8318050503730774,
0.9872945547103882,
-0.09486423432826996,
-0.038156598806381226,
-0.05816434323787689,
0.3749200999736786,
0.16602787375450134,
0.8034029006958008,
0.4086984395980835,
-0.8931704759597778,
0.751135528087616,
-0.4502887725830078,
-0.09750170260667801,
-0.25570446252822876,
-0.7198231220245361,
-0.8539286255836487,
-0.8385164737701416,
-0.4673933982849121,
-0.5385240912437439,
0.12283629924058914,
1.0467840433120728,
0.7988760471343994,
-0.8347542881965637,
-0.17252971231937408,
-0.23867586255073547,
-0.06319832056760788,
-0.04490083083510399,
-0.2881688177585602,
0.6506261229515076,
-0.14258338510990143,
-0.5789614319801331,
0.1731599122285843,
-0.04972191900014877,
-0.05666428804397583,
-0.028331581503152847,
-0.03299679234623909,
-0.822478175163269,
-0.004724557977169752,
0.5499544739723206,
0.15657202899456024,
-0.5826134085655212,
-0.2763054668903351,
0.06286825239658356,
-0.31090855598449707,
0.19505418837070465,
0.4998514950275421,
-0.473600834608078,
0.33828291296958923,
0.6176359057426453,
0.645079493522644,
0.902715265750885,
-0.08774566650390625,
0.3437446355819702,
-0.7856137752532959,
0.22230368852615356,
0.22771649062633514,
0.4038681983947754,
0.4870702624320984,
-0.3957156240940094,
0.7287358045578003,
0.3933958411216736,
-0.5765659809112549,
-0.611111581325531,
-0.08190455287694931,
-1.2091704607009888,
-0.2174558937549591,
1.3157178163528442,
-0.3572503626346588,
-0.2175382375717163,
0.16484332084655762,
-0.10672218352556229,
0.31759878993034363,
-0.34470218420028687,
0.5763852596282959,
0.6531233191490173,
-0.19437816739082336,
-0.4381645619869232,
-0.39183467626571655,
0.3438795208930969,
0.5173091292381287,
-0.8825492262840271,
-0.2221585363149643,
0.22474533319473267,
0.3419106900691986,
0.21401171386241913,
0.5794289112091064,
-0.0783173143863678,
-0.004280504304915667,
0.02592148818075657,
-0.09183164685964584,
-0.16798079013824463,
0.004569474142044783,
-0.35258156061172485,
0.25263234972953796,
-0.397216260433197,
-0.21932189166545868
] |
openai/clip-vit-base-patch32 | openai | "2022-10-04T09:42:04Z" | 8,407,998 | 275 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"clip",
"zero-shot-image-classification",
"vision",
"arxiv:2103.00020",
"arxiv:1908.04913",
"endpoints_compatible",
"has_space",
"region:us"
] | zero-shot-image-classification | "2022-03-02T23:29:05Z" | ---
tags:
- vision
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
candidate_labels: playing music, playing sports
example_title: Cat & Dog
---
# Model Card: CLIP
Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found [here](https://github.com/openai/CLIP/blob/main/model-card.md).
## Model Details
The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within.
### Model Date
January 2021
### Model Type
The model uses a ViT-B/32 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss.
The original implementation had two variants: one using a ResNet image encoder and the other using a Vision Transformer. This repository has the variant with the Vision Transformer.
### Documents
- [Blog Post](https://openai.com/blog/clip/)
- [CLIP Paper](https://arxiv.org/abs/2103.00020)
### Use with Transformers
```python3
from PIL import Image
import requests
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=["a photo of a cat", "a photo of a dog"], images=image, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
```
## Model Use
### Intended Use
The model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such models - the CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.
#### Primary intended uses
The primary intended users of these models are AI researchers.
We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.
### Out-of-Scope Use Cases
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
## Data
The model was trained on publicly available image-caption data. This was done through a combination of crawling a handful of websites and using commonly-used pre-existing image datasets such as [YFCC100M](http://projects.dfki.uni-kl.de/yfcc100m/). A large portion of the data comes from our crawling of the internet. This means that the data is more representative of people and societies most connected to the internet which tend to skew towards more developed nations, and younger, male users.
### Data Mission Statement
Our goal with building this dataset was to test out robustness and generalizability in computer vision tasks. As a result, the focus was on gathering large quantities of data from different publicly-available internet data sources. The data was gathered in a mostly non-interventionist manner. However, we only crawled websites that had policies against excessively violent and adult images and allowed us to filter out such content. We do not intend for this dataset to be used as the basis for any commercial or deployed model and will not be releasing the dataset.
## Performance and Limitations
### Performance
We have evaluated the performance of CLIP on a wide range of benchmarks across a variety of computer vision datasets such as OCR to texture recognition to fine-grained classification. The paper describes model performance on the following datasets:
- Food101
- CIFAR10
- CIFAR100
- Birdsnap
- SUN397
- Stanford Cars
- FGVC Aircraft
- VOC2007
- DTD
- Oxford-IIIT Pet dataset
- Caltech101
- Flowers102
- MNIST
- SVHN
- IIIT5K
- Hateful Memes
- SST-2
- UCF101
- Kinetics700
- Country211
- CLEVR Counting
- KITTI Distance
- STL-10
- RareAct
- Flickr30
- MSCOCO
- ImageNet
- ImageNet-A
- ImageNet-R
- ImageNet Sketch
- ObjectNet (ImageNet Overlap)
- Youtube-BB
- ImageNet-Vid
## Limitations
CLIP and our analysis of it have a number of limitations. CLIP currently struggles with respect to certain tasks such as fine grained classification and counting objects. CLIP also poses issues with regards to fairness and bias which we discuss in the paper and briefly in the next section. Additionally, our approach to testing CLIP also has an important limitation- in many cases we have used linear probes to evaluate the performance of CLIP and there is evidence suggesting that linear probes can underestimate model performance.
### Bias and Fairness
We find that the performance of CLIP - and the specific biases it exhibits - can depend significantly on class design and the choices one makes for categories to include and exclude. We tested the risk of certain kinds of denigration with CLIP by classifying images of people from [Fairface](https://arxiv.org/abs/1908.04913) into crime-related and non-human animal categories. We found significant disparities with respect to race and gender. Additionally, we found that these disparities could shift based on how the classes were constructed. (Details captured in the Broader Impacts Section in the paper).
We also tested the performance of CLIP on gender, race and age classification using the Fairface dataset (We default to using race categories as they are constructed in the Fairface dataset.) in order to assess quality of performance across different demographics. We found accuracy >96% across all races for gender classification with ‘Middle Eastern’ having the highest accuracy (98.4%) and ‘White’ having the lowest (96.5%). Additionally, CLIP averaged ~93% for racial classification and ~63% for age classification. Our use of evaluations to test for gender, race and age classification as well as denigration harms is simply to evaluate performance of the model across people and surface potential risks and not to demonstrate an endorsement/enthusiasm for such tasks.
## Feedback
### Where to send questions or comments about the model
Please use [this Google Form](https://forms.gle/Uv7afRH5dvY34ZEs9) | [
-0.49621811509132385,
-0.5704834461212158,
0.16633814573287964,
-0.022949809208512306,
-0.162152498960495,
-0.24756482243537903,
0.032062090933322906,
-0.7097179889678955,
0.12218382954597473,
0.3784947693347931,
-0.2756716012954712,
-0.4045153558254242,
-0.6304255723953247,
0.11828544735908508,
-0.6213012933731079,
0.7103070616722107,
-0.06635726243257523,
0.06580888479948044,
-0.3089510202407837,
-0.3270214796066284,
-0.5033804178237915,
-0.6791257858276367,
-0.2399168163537979,
0.16180118918418884,
0.07757356762886047,
0.14451652765274048,
0.6583046913146973,
0.8416115045547485,
0.7938902378082275,
0.21625684201717377,
-0.30982643365859985,
-0.11563067138195038,
-0.4976731538772583,
-0.6148566007614136,
-0.3748791813850403,
-0.3957368731498718,
-0.38758617639541626,
0.20859882235527039,
0.5188443660736084,
0.362095445394516,
0.028311969712376595,
0.29214227199554443,
0.07070277631282806,
0.36646768450737,
-0.9211289286613464,
-0.04393265023827553,
-0.5582177639007568,
0.06542016565799713,
-0.28375810384750366,
0.1427646279335022,
-0.17192554473876953,
-0.19536171853542328,
0.3101601004600525,
-0.49978378415107727,
0.48522743582725525,
-0.05611970275640488,
1.3018484115600586,
0.174347922205925,
-0.15749552845954895,
-0.033337026834487915,
-0.5775322914123535,
0.7368087768554688,
-0.5693265795707703,
0.23641368746757507,
0.23205898702144623,
0.38338103890419006,
0.15136419236660004,
-0.834613561630249,
-0.6281360983848572,
-0.05154635012149811,
0.29672688245773315,
0.018334487453103065,
-0.23096536099910736,
-0.059812914580106735,
0.40931206941604614,
0.4885464608669281,
-0.15675947070121765,
-0.06323002278804779,
-0.7136676907539368,
-0.21864144504070282,
0.6650537848472595,
0.2959095537662506,
0.3361394703388214,
-0.23422563076019287,
-0.6214848756790161,
-0.46255624294281006,
-0.44766348600387573,
0.5360215306282043,
0.38471752405166626,
0.09296728670597076,
-0.15634481608867645,
0.63816237449646,
-0.04270191863179207,
0.42765671014785767,
0.006572509650141001,
-0.34128236770629883,
0.3400927782058716,
-0.4675429165363312,
-0.18081964552402496,
-0.2674054801464081,
0.7518119215965271,
0.8271686434745789,
0.17429102957248688,
0.20597799122333527,
-0.08586760610342026,
0.21113421022891998,
0.343287855386734,
-0.9234940409660339,
-0.16143645346164703,
-0.20083820819854736,
-0.6222100257873535,
-0.366251677274704,
0.27942487597465515,
-0.9160671830177307,
0.0820201113820076,
-0.11163082718849182,
0.7282557487487793,
-0.44753819704055786,
-0.07044112682342529,
0.18999066948890686,
-0.3203791379928589,
0.31934693455696106,
0.3220040202140808,
-0.6715875267982483,
0.37881678342819214,
0.3143760561943054,
1.0913512706756592,
-0.4685143530368805,
-0.30874162912368774,
0.05689840391278267,
-0.06298252940177917,
-0.11344826966524124,
0.7101557850837708,
-0.37335896492004395,
-0.469427227973938,
-0.1932220607995987,
0.4300256371498108,
-0.12222161889076233,
-0.6086293458938599,
0.5710372924804688,
-0.20496231317520142,
0.02242591790854931,
-0.2780906856060028,
-0.3806459903717041,
-0.6177529692649841,
0.3116268217563629,
-0.7052106261253357,
0.8874408602714539,
0.14930950105190277,
-0.7738649249076843,
0.37738725543022156,
-0.7022457122802734,
-0.05288170650601387,
-0.12217997014522552,
-0.09886065870523453,
-0.5931558609008789,
-0.28045833110809326,
0.40341833233833313,
0.31898748874664307,
-0.22511868178844452,
0.3621411919593811,
-0.6003817915916443,
-0.4883754253387451,
0.18303115665912628,
-0.43223893642425537,
0.8824610114097595,
0.02079121768474579,
-0.32737791538238525,
-0.007374181877821684,
-0.4513131380081177,
-0.17232203483581543,
0.34903785586357117,
0.011057130061089993,
-0.1573939472436905,
-0.10548477619886398,
0.19305942952632904,
0.09172198921442032,
-0.03660677373409271,
-0.6816146373748779,
0.1230023056268692,
-0.08281174302101135,
0.5284525752067566,
0.6684461832046509,
0.09664518386125565,
0.270102858543396,
-0.4293527901172638,
0.5181121230125427,
-0.01992512308061123,
0.6510026454925537,
-0.24451328814029694,
-0.5169836282730103,
-0.485687255859375,
-0.45977628231048584,
0.5736321210861206,
0.6441183686256409,
-0.4285563826560974,
0.15717194974422455,
-0.13603824377059937,
-0.33639901876449585,
-0.18478049337863922,
-0.21939684450626373,
0.34098365902900696,
0.6505203247070312,
0.34498971700668335,
-0.9702433347702026,
-0.400800496339798,
-1.0369212627410889,
0.18787312507629395,
0.0618089884519577,
-0.053215064108371735,
0.6867245435714722,
0.8917030096054077,
-0.2350088357925415,
1.0731773376464844,
-0.7452168464660645,
-0.4094807207584381,
-0.13410276174545288,
-0.13069839775562286,
-0.022872721776366234,
0.4918102025985718,
0.9369739890098572,
-0.9187029600143433,
-0.25839051604270935,
-0.5250692963600159,
-0.8005322813987732,
0.13682468235492706,
0.19788990914821625,
-0.08843299001455307,
0.045636650174856186,
0.21460647881031036,
-0.24245774745941162,
1.015720009803772,
0.2537931501865387,
-0.049697961658239365,
0.7241203784942627,
0.08741949498653412,
0.2818516790866852,
-0.5796489119529724,
0.35915428400039673,
0.16750852763652802,
-0.148577481508255,
-0.4794609248638153,
0.04647955298423767,
-0.0024311949964612722,
-0.4208030104637146,
-0.9207430481910706,
0.36889082193374634,
-0.14109258353710175,
-0.12204836308956146,
-0.1564248949289322,
-0.18519704043865204,
0.3182844817638397,
0.7066683173179626,
0.13451984524726868,
1.0634607076644897,
0.4956727623939514,
-0.7516711354255676,
-0.02898355759680271,
0.5381829738616943,
-0.4664873778820038,
0.536828875541687,
-0.939087450504303,
-0.041299641132354736,
-0.05992065742611885,
0.0965643972158432,
-0.5547662973403931,
-0.3311663568019867,
0.3059852123260498,
-0.35390302538871765,
0.21054044365882874,
-0.13016226887702942,
-0.31346607208251953,
-0.5929793119430542,
-0.5399224758148193,
0.7426360249519348,
0.5001536011695862,
-0.44041457772254944,
0.35994523763656616,
0.7103374600410461,
0.18500293791294098,
-0.5258200168609619,
-0.7635144591331482,
-0.08446603268384933,
-0.20193970203399658,
-0.7122998237609863,
0.5451771020889282,
-0.0013100724900141358,
0.07738902419805527,
0.13615329563617706,
0.07981817424297333,
-0.3131308853626251,
0.02770170010626316,
0.45461565256118774,
0.5118313431739807,
-0.07260735332965851,
-0.12523430585861206,
-0.2901723384857178,
0.3583587408065796,
-0.07335063070058823,
0.12690705060958862,
0.26494523882865906,
-0.14518439769744873,
-0.3354763984680176,
-0.5031231641769409,
0.3205600678920746,
0.444309800863266,
-0.2631324529647827,
0.4812834560871124,
0.47955942153930664,
-0.2776656746864319,
0.11316793411970139,
-0.5277678966522217,
-0.03340955078601837,
-0.43817955255508423,
0.4896465837955475,
-0.12438571453094482,
-0.6664980053901672,
0.7233749628067017,
0.14499235153198242,
-0.14731024205684662,
0.619084358215332,
0.30324453115463257,
0.00393724488094449,
0.8376474976539612,
0.9300402402877808,
0.039232656359672546,
0.6310679316520691,
-0.8040085434913635,
-0.012422740459442139,
-0.9973011016845703,
-0.34401166439056396,
-0.2522026300430298,
-0.20630806684494019,
-0.4322580397129059,
-0.5506196022033691,
0.5758650302886963,
0.176249697804451,
-0.09965692460536957,
0.4180154800415039,
-0.6543995141983032,
0.4434153735637665,
0.6076403260231018,
0.44697821140289307,
0.009291796013712883,
-0.09111133217811584,
-0.002115018665790558,
-0.1598968356847763,
-0.6688183546066284,
-0.49613964557647705,
1.103531002998352,
0.6553665399551392,
0.6949499845504761,
-0.217313751578331,
0.21858571469783783,
0.41613343358039856,
-0.07903167605400085,
-0.7386202216148376,
0.5303006768226624,
-0.4480520486831665,
-0.7139037251472473,
-0.1775110512971878,
-0.05602571740746498,
-0.7529193162918091,
0.14923739433288574,
-0.13656191527843475,
-0.7416284680366516,
0.604610800743103,
0.13306082785129547,
-0.33369070291519165,
0.6633214354515076,
-0.5858879089355469,
0.9733614921569824,
-0.2902793884277344,
-0.4307478666305542,
0.07682406157255173,
-0.6404133439064026,
0.5688719749450684,
0.07092852145433426,
0.02946859411895275,
-0.21248498558998108,
0.1011747494339943,
1.0690969228744507,
-0.569424569606781,
0.9152486324310303,
-0.11652244627475739,
0.4214226305484772,
0.7378964424133301,
-0.17295633256435394,
0.046183906495571136,
-0.20031115412712097,
0.19060079753398895,
0.7031320333480835,
0.2757720351219177,
-0.11607811599969864,
-0.365619033575058,
0.1426631212234497,
-0.718490719795227,
-0.3901675343513489,
-0.3638840913772583,
-0.44243350625038147,
0.21998003125190735,
0.20267610251903534,
0.5428750514984131,
0.7519886493682861,
-0.044910330325365067,
0.15873388946056366,
0.6101959943771362,
-0.4902775287628174,
0.38215577602386475,
0.1990686058998108,
-0.270160973072052,
-0.5165371894836426,
0.9006242156028748,
0.27261608839035034,
0.20839233696460724,
0.0425400584936142,
0.08214791864156723,
-0.23019567131996155,
-0.4848213791847229,
-0.4343048334121704,
0.07225754112005234,
-0.7252512574195862,
-0.42771828174591064,
-0.5428177714347839,
-0.3605261743068695,
-0.4376240372657776,
-0.01742819882929325,
-0.4752447009086609,
-0.3305565118789673,
-0.626219630241394,
0.20087063312530518,
0.17284591495990753,
0.6347481608390808,
-0.10014177113771439,
0.29416966438293457,
-0.6090497970581055,
0.25006791949272156,
0.37967225909233093,
0.5244901776313782,
0.0644971951842308,
-0.6785581707954407,
-0.1428985297679901,
-0.0035878850612789392,
-0.8708220720291138,
-0.7905012369155884,
0.4437066614627838,
0.3218803405761719,
0.5835022926330566,
0.3541594445705414,
0.0925535187125206,
0.6856818795204163,
-0.41877391934394836,
1.067653775215149,
0.22185195982456207,
-0.944110095500946,
0.543401300907135,
-0.3033340871334076,
0.21476760506629944,
0.6813668012619019,
0.48376086354255676,
-0.1975831687450409,
-0.13428911566734314,
-0.5409479737281799,
-0.8761575222015381,
0.7835385799407959,
0.13599295914173126,
0.04446670785546303,
0.062209904193878174,
0.32942426204681396,
0.023677891120314598,
0.08792971819639206,
-0.6959969401359558,
-0.16147366166114807,
-0.5050013661384583,
0.05469752103090286,
0.2915692627429962,
-0.42188894748687744,
0.032012760639190674,
-0.4160482883453369,
0.4003000557422638,
-0.04996122419834137,
0.5547493696212769,
0.5321170091629028,
-0.1767345815896988,
0.13990013301372528,
-0.10298669338226318,
0.6463358998298645,
0.5991127490997314,
-0.39254507422447205,
-0.22365985810756683,
0.25359177589416504,
-0.823324978351593,
0.012848848477005959,
-0.1753035932779312,
-0.5010756254196167,
-0.044181954115629196,
0.3072439432144165,
0.9219211935997009,
0.20001867413520813,
-0.7264969944953918,
0.9880384206771851,
-0.0982014462351799,
-0.541420578956604,
-0.24425216019153595,
0.07544714212417603,
-0.5410391688346863,
0.12609019875526428,
0.3195938467979431,
0.22422008216381073,
0.4528302848339081,
-0.5046075582504272,
0.39002031087875366,
0.4188914895057678,
-0.3466849625110626,
-0.3732168972492218,
0.7557912468910217,
0.14391033351421356,
-0.20448005199432373,
0.4911365509033203,
-0.17453938722610474,
-0.9444069266319275,
0.8038990497589111,
0.4015427529811859,
0.6500200033187866,
-0.009211920201778412,
0.17017051577568054,
0.6584121584892273,
0.15414108335971832,
-0.33164384961128235,
-0.04508068040013313,
0.0049476646818220615,
-0.5598475933074951,
-0.20735414326190948,
-0.4122888445854187,
-0.5809170603752136,
0.14697158336639404,
-0.9118825793266296,
0.41284021735191345,
-0.5012326240539551,
-0.4988992214202881,
-0.10686328262090683,
-0.2662661671638489,
-0.7199555039405823,
0.13832193613052368,
0.1515459567308426,
1.2038812637329102,
-0.8277604579925537,
0.47928792238235474,
0.41929417848587036,
-0.5879893898963928,
-0.7949944138526917,
-0.1424257457256317,
-0.10346872359514236,
-0.6293659210205078,
0.6510691046714783,
0.5343620777130127,
-0.008278806693851948,
-0.45830556750297546,
-0.9293864369392395,
-0.9697656631469727,
1.113392949104309,
0.3235667645931244,
-0.393813818693161,
-0.08452589809894562,
-0.02150716446340084,
0.33601030707359314,
-0.3250178098678589,
0.37198564410209656,
0.32822710275650024,
-0.021599752828478813,
0.3268953561782837,
-1.1490081548690796,
-0.18439741432666779,
-0.17167717218399048,
0.2607323229312897,
0.016094382852315903,
-0.8292593955993652,
1.0305004119873047,
-0.2713598310947418,
-0.4376096725463867,
0.0541355200111866,
0.43564751744270325,
-0.05477077141404152,
0.37174662947654724,
0.5065659880638123,
0.6885381937026978,
0.41620245575904846,
0.06100371852517128,
1.0594581365585327,
-0.06055193766951561,
0.4518381953239441,
0.9166345000267029,
-0.14355583488941193,
0.868774950504303,
0.2972736060619354,
-0.34837663173675537,
0.36918655037879944,
0.43339934945106506,
-0.6756041049957275,
0.7596340179443359,
-0.0019760793074965477,
0.1547672599554062,
-0.03434791415929794,
-0.436691552400589,
-0.2870917022228241,
0.7011301517486572,
0.033525485545396805,
-0.44970428943634033,
-0.06550519168376923,
0.3966311514377594,
-0.23712050914764404,
-0.05498059093952179,
-0.44154003262519836,
0.43658533692359924,
-0.15961818397045135,
-0.3427492082118988,
0.43179938197135925,
0.0680580884218216,
0.9369061589241028,
-0.3525921106338501,
-0.1501920372247696,
0.08597415685653687,
0.18858690559864044,
-0.08601389080286026,
-0.9331216216087341,
0.5491271615028381,
0.05705944076180458,
-0.22150252759456635,
0.0845026820898056,
0.7249879240989685,
-0.029544327408075333,
-0.5627744793891907,
0.21059013903141022,
-0.1385549157857895,
0.3494924008846283,
-0.09644800424575806,
-0.6969043612480164,
0.3292258381843567,
0.05817955359816551,
0.03500824049115181,
0.2818780243396759,
-0.02151457406580448,
-0.10885685682296753,
0.6609639525413513,
0.377781480550766,
-0.046508993953466415,
0.1139175295829773,
-0.33949851989746094,
1.0316898822784424,
-0.5432170033454895,
-0.3983260989189148,
-0.6783959269523621,
0.34555256366729736,
-0.09688298404216766,
-0.3393228054046631,
0.6098524332046509,
0.6107832789421082,
1.1053565740585327,
-0.11976547539234161,
0.5515139698982239,
-0.21579855680465698,
0.49599143862724304,
-0.3664083480834961,
0.445742130279541,
-0.5154677033424377,
-0.03129861131310463,
-0.4258855879306793,
-0.6233487725257874,
-0.18542201817035675,
0.6011313199996948,
-0.3945823013782501,
-0.0700899139046669,
0.4914812743663788,
0.7233358025550842,
-0.23963256180286407,
-0.031202828511595726,
0.25494131445884705,
-0.33458319306373596,
0.25396788120269775,
0.6008042693138123,
0.5942176580429077,
-0.783052384853363,
0.6846479177474976,
-0.6839910745620728,
-0.2233566790819168,
-0.19392843544483185,
-0.8232120275497437,
-1.0200461149215698,
-0.4981534481048584,
-0.4234420359134674,
-0.13238367438316345,
-0.056841883808374405,
0.5557976365089417,
0.9561566114425659,
-0.6989399194717407,
-0.09418077021837234,
0.32335570454597473,
-0.0652778148651123,
-0.008231701329350471,
-0.24151290953159332,
0.37149578332901,
0.20551316440105438,
-0.5566713809967041,
-0.1881382316350937,
0.1260332465171814,
0.3559236526489258,
-0.1732332557439804,
0.12321989238262177,
-0.1947934478521347,
-0.060008637607097626,
0.43339234590530396,
0.5221379995346069,
-0.6407466530799866,
-0.3148389458656311,
0.15285266935825348,
0.04178088530898094,
0.3405400514602661,
0.6319710612297058,
-0.6301266551017761,
0.43478721380233765,
0.2734335660934448,
0.53873211145401,
0.6593596935272217,
0.2584807276725769,
0.19936946034431458,
-0.42892441153526306,
0.2080976665019989,
0.2125837504863739,
0.3328251242637634,
0.3491266965866089,
-0.3941779136657715,
0.5795839428901672,
0.4816999137401581,
-0.6374045610427856,
-0.9653106331825256,
-0.03269876167178154,
-1.061008334159851,
-0.19371595978736877,
0.8688452839851379,
-0.4049335718154907,
-0.6715481281280518,
0.14823365211486816,
-0.20390193164348602,
0.17281712591648102,
-0.3542189598083496,
0.6499407887458801,
0.38682782649993896,
-0.037717197090387344,
-0.3598048686981201,
-0.5863479971885681,
0.19434387981891632,
0.05757322162389755,
-0.5159637928009033,
-0.388353556394577,
0.357649564743042,
0.5760535001754761,
0.3354416489601135,
0.4707442820072174,
-0.3449366092681885,
0.3827568292617798,
0.04271307587623596,
0.29623740911483765,
-0.322171688079834,
-0.3850362002849579,
-0.46892601251602173,
0.29693272709846497,
-0.27982500195503235,
-0.6084349155426025
] |
facebook/bart-large-cnn | facebook | "2023-11-28T09:50:47Z" | 7,509,246 | 687 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"bart",
"text2text-generation",
"summarization",
"en",
"dataset:cnn_dailymail",
"arxiv:1910.13461",
"license:mit",
"model-index",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | summarization | "2022-03-02T23:29:05Z" | ---
language:
- en
tags:
- summarization
license: mit
thumbnail: https://huggingface.co/front/thumbnails/facebook.png
datasets:
- cnn_dailymail
model-index:
- name: facebook/bart-large-cnn
results:
- task:
type: summarization
name: Summarization
dataset:
name: cnn_dailymail
type: cnn_dailymail
config: 3.0.0
split: train
metrics:
- name: ROUGE-1
type: rouge
value: 42.9486
verified: true
- name: ROUGE-2
type: rouge
value: 20.8149
verified: true
- name: ROUGE-L
type: rouge
value: 30.6186
verified: true
- name: ROUGE-LSUM
type: rouge
value: 40.0376
verified: true
- name: loss
type: loss
value: 2.529000997543335
verified: true
- name: gen_len
type: gen_len
value: 78.5866
verified: true
---
# BART (large-sized model), fine-tuned on CNN Daily Mail
BART model pre-trained on English language, and fine-tuned on [CNN Daily Mail](https://huggingface.co/datasets/cnn_dailymail). It was introduced in the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Lewis et al. and first released in [this repository (https://github.com/pytorch/fairseq/tree/master/examples/bart).
Disclaimer: The team releasing BART did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
BART is a transformer encoder-encoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text.
BART is particularly effective when fine-tuned for text generation (e.g. summarization, translation) but also works well for comprehension tasks (e.g. text classification, question answering). This particular checkpoint has been fine-tuned on CNN Daily Mail, a large collection of text-summary pairs.
## Intended uses & limitations
You can use this model for text summarization.
### How to use
Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):
```python
from transformers import pipeline
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared "I do" five more times, sometimes only within two weeks of each other.
In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her "first and only" marriage.
Barrientos, now 39, is facing two criminal counts of "offering a false instrument for filing in the first degree," referring to her false statements on the
2010 marriage license application, according to court documents.
Prosecutors said the marriages were part of an immigration scam.
On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
After leaving court, Barrientos was arrested and charged with theft of service and criminal trespass for allegedly sneaking into the New York subway through an emergency exit, said Detective
Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
All occurred either in Westchester County, Long Island, New Jersey or the Bronx. She is believed to still be married to four men, and at one time, she was married to eight men at once, prosecutors say.
Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
"""
print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
>>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
```
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1910-13461,
author = {Mike Lewis and
Yinhan Liu and
Naman Goyal and
Marjan Ghazvininejad and
Abdelrahman Mohamed and
Omer Levy and
Veselin Stoyanov and
Luke Zettlemoyer},
title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
Generation, Translation, and Comprehension},
journal = {CoRR},
volume = {abs/1910.13461},
year = {2019},
url = {http://arxiv.org/abs/1910.13461},
eprinttype = {arXiv},
eprint = {1910.13461},
timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
``` | [
-0.42362090945243835,
-0.6604821681976318,
0.3420267105102539,
0.3303101360797882,
-0.45881226658821106,
-0.2290572226047516,
0.0642693042755127,
-0.2755007743835449,
0.3589901924133301,
0.5544784069061279,
-0.2507328987121582,
-0.36056992411613464,
-0.5100838541984558,
0.39330941438674927,
-0.4248300790786743,
0.9152697920799255,
0.1512531340122223,
0.05640970170497894,
-0.20624558627605438,
-0.017620617523789406,
-0.3009324371814728,
-0.3029908239841461,
-0.5709102153778076,
0.1864572912454605,
0.3424409329891205,
0.3691347539424896,
0.5600818395614624,
0.5027074813842773,
0.5666267275810242,
0.26849833130836487,
-0.2843000292778015,
-0.12111189216375351,
-0.5401720404624939,
0.0006160660414025187,
-0.015263647772371769,
-0.576090395450592,
-0.6776795983314514,
0.09839306771755219,
0.36776024103164673,
0.6587154269218445,
-0.3270803391933441,
0.4603497385978699,
-0.2765427827835083,
0.7651380896568298,
-0.4785810112953186,
-0.12077993154525757,
-0.5535720586776733,
-0.01125180721282959,
-0.5798642039299011,
-0.14898930490016937,
-0.4836590886116028,
-0.4698430895805359,
-0.06295830756425858,
-0.5458841323852539,
0.12163017690181732,
0.17489929497241974,
0.9666212201118469,
0.03643488138914108,
-0.46620020270347595,
-0.06415332853794098,
-0.5755185484886169,
0.6183236837387085,
-0.8802992701530457,
0.43736451864242554,
0.5405080318450928,
0.1172725111246109,
-0.1944352388381958,
-0.5337608456611633,
-0.4357665777206421,
-0.28662022948265076,
-0.3828047811985016,
0.22354751825332642,
-0.35761213302612305,
-0.11914772540330887,
0.5702692866325378,
0.5219061374664307,
-0.7883151769638062,
-0.31386807560920715,
-0.5897899866104126,
-0.2152501791715622,
0.47689419984817505,
0.10136783868074417,
0.20345500111579895,
-0.029607413336634636,
-0.19525334239006042,
0.16997192800045013,
-0.24963876605033875,
0.17911475896835327,
0.3844345808029175,
0.01756231300532818,
-0.592734158039093,
0.500259280204773,
-0.029101375490427017,
0.5914080739021301,
0.25424739718437195,
-0.38257208466529846,
0.5386269688606262,
-0.37816956639289856,
-0.2612743675708771,
-0.27758342027664185,
0.8599585294723511,
0.28829389810562134,
0.4642144739627838,
0.23828043043613434,
-0.19125322997570038,
0.08457537740468979,
0.13996782898902893,
-0.6257210969924927,
0.04616497457027435,
-0.08372311294078827,
-0.6330623626708984,
-0.3456090986728668,
-0.03889957442879677,
-0.5664969682693481,
0.2196025401353836,
-0.04370516911149025,
-0.05686987563967705,
-0.3128441870212555,
-0.3330928385257721,
0.34201446175575256,
-0.4047291576862335,
0.16959835588932037,
0.16386529803276062,
-0.592999279499054,
0.30229753255844116,
0.3919316530227661,
0.8118759393692017,
0.1054176390171051,
-0.2502339482307434,
-0.45637184381484985,
-0.24747514724731445,
-0.6438672542572021,
0.20556578040122986,
-0.4021569788455963,
-0.22624553740024567,
-0.16656339168548584,
0.029887760058045387,
0.10001199692487717,
-0.3761182725429535,
0.4589694142341614,
-0.8133361339569092,
0.21118593215942383,
-0.17899490892887115,
-0.20866413414478302,
-0.0007670518243685365,
0.15198808908462524,
-0.45641225576400757,
0.7260851263999939,
0.14994049072265625,
-0.8895555138587952,
0.06374536454677582,
-0.4451236128807068,
-0.49242010712623596,
-0.23079043626785278,
0.3779379427433014,
-0.6447587609291077,
0.10407866537570953,
0.0007077729678712785,
0.3222045302391052,
-0.2959795594215393,
0.6225641965866089,
-0.5132999420166016,
-0.020790699869394302,
0.006143960170447826,
-0.451183557510376,
1.3279650211334229,
0.4793476164340973,
-0.18973183631896973,
-0.236159548163414,
-0.6807962656021118,
-0.569084882736206,
0.31823837757110596,
-0.48525509238243103,
-0.358695924282074,
-0.33849847316741943,
-0.34436535835266113,
0.03037966601550579,
0.030574658885598183,
-0.6821603178977966,
0.05745324492454529,
-0.6265361905097961,
0.1332719475030899,
0.12963105738162994,
0.10797814279794693,
0.44026339054107666,
-0.4182053506374359,
0.5105782151222229,
0.40163907408714294,
0.31726905703544617,
-0.38179489970207214,
-0.7555233836174011,
-0.7404786348342896,
0.14988431334495544,
0.4837166965007782,
0.5922316312789917,
-0.5427524447441101,
0.3110541105270386,
-0.3899678587913513,
-0.5410589575767517,
-0.07840836048126221,
-0.1087871715426445,
0.3901625871658325,
0.4064541459083557,
0.3955555558204651,
-0.49773889780044556,
-0.6095578074455261,
-0.65931236743927,
-0.3411575257778168,
-0.0937490314245224,
0.22833575308322906,
-0.028874894604086876,
0.81346595287323,
0.010534388944506645,
0.8850696682929993,
-0.38243311643600464,
-0.12163446843624115,
-0.03859926760196686,
0.2196207195520401,
0.37285295128822327,
0.51777583360672,
0.930596649646759,
-0.631966233253479,
-0.7062254548072815,
-0.05306592211127281,
-0.6800228953361511,
0.1589045226573944,
-0.13473089039325714,
-0.029044529423117638,
0.3321789801120758,
0.1956658661365509,
-0.5066518187522888,
0.5252925753593445,
0.35080644488334656,
-0.37773290276527405,
0.7299988269805908,
-0.13983628153800964,
-0.12524576485157013,
-0.9314902424812317,
0.044484276324510574,
-0.03621519356966019,
-0.20218946039676666,
-0.6584205031394958,
-0.05674907937645912,
0.06995705515146255,
-0.09262862056493759,
-0.36635449528694153,
0.5317615270614624,
-0.6943683624267578,
-0.21641603112220764,
0.1878281533718109,
0.007924940437078476,
-0.017634117975831032,
0.30587002635002136,
-0.1545361578464508,
0.4726335406303406,
0.3559534549713135,
-0.34728294610977173,
0.44915637373924255,
0.5262336730957031,
-0.1753969043493271,
0.6197534203529358,
-0.05116783827543259,
-0.046337027102708817,
-0.3613489866256714,
0.24857112765312195,
-0.808093786239624,
-0.19179430603981018,
0.49401503801345825,
-0.6464202404022217,
0.1527513563632965,
-0.07870617508888245,
-0.17098337411880493,
-0.6170008182525635,
-0.49459385871887207,
0.22543808817863464,
0.3151330053806305,
-0.20344127714633942,
0.7384939789772034,
0.37594500184059143,
-0.0789019912481308,
-0.8268362879753113,
-0.8846102356910706,
0.3971814215183258,
-0.12172049283981323,
-0.6293573379516602,
0.34931883215904236,
-0.19057722389698029,
-0.3663077652454376,
0.14297622442245483,
0.06794462352991104,
-0.21757285296916962,
0.20262348651885986,
0.12427952885627747,
0.24388445913791656,
-0.15980209410190582,
0.0533054918050766,
0.2777773141860962,
-0.00577848544344306,
0.002088944660499692,
0.007550349924713373,
0.6845685839653015,
-0.050278156995773315,
0.12455891817808151,
-0.4271100163459778,
0.5171316862106323,
0.8384189605712891,
-0.40307098627090454,
0.8925821781158447,
0.4340142011642456,
-0.32191574573516846,
0.1508997231721878,
-0.6928231120109558,
-0.1894182562828064,
-0.39786335825920105,
0.16011051833629608,
-0.6454769968986511,
-0.8080880045890808,
0.8388813138008118,
0.22546884417533875,
0.11917734891176224,
0.6530641913414001,
0.17006687819957733,
0.018614137545228004,
0.5595388412475586,
0.5473394989967346,
-0.07787883281707764,
0.3027556836605072,
-0.21483741700649261,
0.10664548724889755,
-0.8166238069534302,
0.009898604825139046,
-0.20952996611595154,
-0.17784468829631805,
-0.41773030161857605,
-0.12016115337610245,
0.14821591973304749,
0.39182987809181213,
-0.4177810549736023,
0.45386698842048645,
-0.38851043581962585,
0.2770312428474426,
0.5916470885276794,
-0.1752886176109314,
0.38033270835876465,
-0.1665109097957611,
-0.32202020287513733,
0.022701634094119072,
-0.687343180179596,
-0.1949538290500641,
1.1029294729232788,
0.0528121180832386,
0.4087887406349182,
0.13881434500217438,
0.5835046172142029,
0.2071922868490219,
0.42801329493522644,
-0.5315257906913757,
0.5397921204566956,
-0.17999114096164703,
-0.7898113131523132,
-0.21615424752235413,
-0.6074178218841553,
-1.1676911115646362,
-0.06898004561662674,
-0.1649276465177536,
-0.22232910990715027,
0.44233253598213196,
0.14523154497146606,
-0.5402581691741943,
0.26909178495407104,
-0.38517799973487854,
0.5363720655441284,
-0.37258923053741455,
-0.18117092549800873,
-0.24527113139629364,
-0.9529778361320496,
0.8673050999641418,
-0.15038157999515533,
0.47385311126708984,
-0.03305717185139656,
0.2290915995836258,
0.5924515128135681,
-0.6137037873268127,
0.6537668704986572,
-0.1390456259250641,
0.04260139539837837,
0.04892513528466225,
0.09105215221643448,
0.5822596549987793,
-0.01415445189923048,
-0.1568589061498642,
0.12598392367362976,
0.09643840789794922,
0.0018294702749699354,
-0.24504956603050232,
0.5746520757675171,
-0.36749711632728577,
-0.4922885298728943,
-0.5233839154243469,
-0.3918397128582001,
0.39373964071273804,
0.28724703192710876,
0.20033186674118042,
0.5293374061584473,
-0.01477003563195467,
0.08456818014383316,
0.27944299578666687,
-0.37151896953582764,
0.5173556208610535,
0.5375672578811646,
-0.4322550892829895,
-0.7260149121284485,
0.5606669187545776,
0.29260286688804626,
0.04824289306998253,
0.25841715931892395,
0.24323229491710663,
0.09540950506925583,
-0.2840733528137207,
-0.20894859731197357,
0.6060143709182739,
-0.4435431659221649,
-0.19654837250709534,
-0.5171525478363037,
-0.2548958957195282,
-0.551967203617096,
-0.2021270990371704,
-0.4477789103984833,
-0.2855999767780304,
-0.305368036031723,
0.19183675944805145,
0.18108631670475006,
0.3833179771900177,
-0.13695542514324188,
0.18809005618095398,
-0.8010004758834839,
0.5388524532318115,
0.22370688617229462,
0.3292480707168579,
-0.0007213142816908658,
-0.6398217082023621,
-0.1741018444299698,
0.0716242715716362,
-0.05389568582177162,
-0.901201069355011,
0.434441477060318,
0.17445914447307587,
0.24166256189346313,
0.517138659954071,
0.3761734664440155,
0.7284976840019226,
-0.3343780040740967,
0.8236125707626343,
0.22154173254966736,
-0.9673479199409485,
0.5204776525497437,
-0.2805502414703369,
0.17798224091529846,
0.2721783220767975,
0.4239460825920105,
-0.47903403639793396,
-0.33512982726097107,
-0.6437023282051086,
-0.756213366985321,
0.8624790906906128,
0.2564597427845001,
0.2650364339351654,
0.0816589817404747,
0.5731744170188904,
-0.14632545411586761,
0.3507311940193176,
-0.9636140465736389,
-0.5559396147727966,
-0.07436097413301468,
-0.10816477239131927,
0.2614840567111969,
-0.5499451160430908,
-0.37306180596351624,
-0.7217996120452881,
0.6703383326530457,
0.34806308150291443,
0.36240440607070923,
0.2700989544391632,
-0.21777860820293427,
0.11920897662639618,
0.025179751217365265,
1.1286674737930298,
0.7515514492988586,
-0.2186095267534256,
0.1103430911898613,
0.16442668437957764,
-0.4974704086780548,
0.1773710548877716,
0.14263585209846497,
-0.2186361402273178,
0.32322072982788086,
0.36417877674102783,
0.9959028363227844,
0.24965450167655945,
-0.29321491718292236,
0.7880239486694336,
-0.11102086305618286,
-0.5582008361816406,
-0.6522716283798218,
-0.14592041075229645,
0.2649233341217041,
0.10119100660085678,
0.19004018604755402,
0.36719810962677,
0.011351706460118294,
-0.4192277491092682,
0.05785980075597763,
0.7462775111198425,
-0.023454073816537857,
-0.3164096176624298,
0.8002566695213318,
0.11214371025562286,
-0.3843771517276764,
0.2376842200756073,
-0.49148091673851013,
-0.4723377525806427,
0.2628505229949951,
0.5608050227165222,
0.4252627491950989,
-0.5063312649726868,
0.3064781427383423,
0.48766693472862244,
0.3893219530582428,
-0.39325058460235596,
0.23064231872558594,
-0.4063608646392822,
-0.8558803796768188,
-0.19496551156044006,
-0.7528715133666992,
-0.10210200399160385,
-0.009798259474337101,
-0.6256201267242432,
0.19303546845912933,
-0.22958798706531525,
-0.4777228832244873,
-0.22105231881141663,
-0.15651997923851013,
-0.2963806390762329,
-0.06945430487394333,
0.1665792167186737,
0.7873364090919495,
-0.790439248085022,
0.6182714104652405,
0.40683862566947937,
-0.14447025954723358,
-0.8061202764511108,
-0.2773163318634033,
0.006363603286445141,
-0.3749309778213501,
0.5209898948669434,
-0.197404682636261,
-0.2683468759059906,
0.22716732323169708,
-0.4490850567817688,
-1.0347458124160767,
0.8597626686096191,
0.6698882579803467,
-0.7299280166625977,
-0.059745341539382935,
0.15537004172801971,
0.3783164322376251,
-0.3029192090034485,
0.23841288685798645,
0.5999477505683899,
0.6139565706253052,
0.004213570151478052,
-0.9830154180526733,
-0.02407902479171753,
-0.3029537796974182,
-0.04019419476389885,
0.0336032472550869,
-0.5940079689025879,
0.8787767291069031,
-0.10578826814889908,
-0.1907472163438797,
-0.052331406623125076,
0.20192241668701172,
0.21241317689418793,
0.4552881717681885,
0.5576528310775757,
0.890085756778717,
0.5451028347015381,
-0.18397806584835052,
0.8438518047332764,
-0.3732089698314667,
0.4139091372489929,
1.0322901010513306,
-0.08305534720420837,
0.6153575778007507,
0.23914025723934174,
-0.5245622992515564,
0.4603029191493988,
0.29412633180618286,
-0.0603664368391037,
0.30359357595443726,
0.0011240002932026982,
0.10467614978551865,
0.01830965280532837,
0.1551724225282669,
-0.2372715175151825,
0.6115624904632568,
0.10673095285892487,
-0.5640271306037903,
-0.1602913737297058,
0.05284625664353371,
0.505588173866272,
-0.16184216737747192,
-0.029750201851129532,
0.4285365343093872,
0.35248345136642456,
-0.6887134909629822,
0.6345365643501282,
-0.009952552616596222,
0.6423320770263672,
-0.5330150723457336,
0.1593218892812729,
-0.41772353649139404,
-0.14476250112056732,
-0.3060929775238037,
-0.4330880343914032,
0.355816513299942,
-0.013058715499937534,
-0.22133620083332062,
-0.19934876263141632,
0.4597161114215851,
-0.49466097354888916,
-0.4312610924243927,
0.28144463896751404,
0.3243955671787262,
0.2662647068500519,
-0.022890465334057808,
-0.4761274456977844,
-0.06921425461769104,
0.22923636436462402,
-0.6447687745094299,
-0.09470980614423752,
0.3416512906551361,
0.12077531963586807,
0.6618375182151794,
0.7425352931022644,
0.32282787561416626,
0.3194201588630676,
-0.20423530042171478,
0.6356152892112732,
-0.7000240087509155,
-0.3421292304992676,
-0.855384349822998,
0.7719264626502991,
-0.22489796578884125,
-0.44381946325302124,
0.6679509878158569,
0.8304482102394104,
0.6625634431838989,
-0.15419502556324005,
0.35908132791519165,
0.012447918765246868,
0.5657185912132263,
-0.13289542496204376,
0.605048656463623,
-0.5369932651519775,
0.307721346616745,
-0.4319910407066345,
-0.8205974102020264,
-0.6931729912757874,
0.3465926945209503,
-0.3328405022621155,
-0.12719236314296722,
0.7659052014350891,
0.6299028992652893,
-0.05705684795975685,
-0.21127140522003174,
0.4504900574684143,
0.39963221549987793,
0.0904872938990593,
0.12095338106155396,
0.5140590667724609,
-0.4807875454425812,
0.6565097570419312,
-0.1946951299905777,
0.03342577815055847,
-0.41168323159217834,
-0.46662744879722595,
-0.6577545404434204,
-0.6055741310119629,
-0.03754586726427078,
0.17829884588718414,
-0.10482137650251389,
0.5102161765098572,
0.35619938373565674,
-0.42988452315330505,
-0.2380046844482422,
-0.20806440711021423,
0.017863156273961067,
-0.3474799394607544,
-0.24646666646003723,
0.10453467816114426,
-0.04666575416922569,
-0.36279866099357605,
0.29308491945266724,
0.4205833673477173,
0.13225412368774414,
-0.05236688628792763,
0.03477504104375839,
-0.41158100962638855,
0.04816391319036484,
0.5887879729270935,
0.10689590871334076,
-0.7222227454185486,
-0.022530678659677505,
0.08522994816303253,
-0.004631062038242817,
0.3061833381652832,
0.3231757879257202,
-0.6312198042869568,
0.334685355424881,
0.4956120252609253,
0.2507607042789459,
0.5927309989929199,
0.23212729394435883,
0.40441617369651794,
-0.5804887413978577,
0.05741899088025093,
0.20001082122325897,
0.470476895570755,
0.17192159593105316,
-0.369804710149765,
0.37166306376457214,
0.4940791130065918,
-0.4733288884162903,
-0.9535968899726868,
0.09081614762544632,
-1.0531474351882935,
-0.04932234808802605,
0.5508783459663391,
-0.1320752054452896,
0.14726005494594574,
-0.3009612560272217,
0.12885835766792297,
0.4614619016647339,
-0.2904706299304962,
0.6227596402168274,
0.6670507788658142,
-0.09258338809013367,
-0.2613881826400757,
-0.5326648354530334,
0.30620822310447693,
0.4648168087005615,
-0.5415067076683044,
0.008286732248961926,
0.1573755294084549,
0.2698466181755066,
0.5326347947120667,
0.7741909027099609,
-0.07908906787633896,
0.13788776099681854,
0.09015090763568878,
0.12384212017059326,
-0.18940883874893188,
-0.17844319343566895,
-0.2414843887090683,
0.3078407943248749,
-0.16864235699176788,
-0.0651663988828659
] |
microsoft/resnet-50 | microsoft | "2023-03-10T17:35:03Z" | 7,442,731 | 174 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"resnet",
"image-classification",
"vision",
"dataset:imagenet-1k",
"arxiv:1512.03385",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | image-classification | "2022-03-16T15:42:43Z" | ---
license: apache-2.0
tags:
- vision
- image-classification
datasets:
- imagenet-1k
---
# ResNet-50 v1.5
ResNet model pre-trained on ImageNet-1k at resolution 224x224. It was introduced in the paper [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) by He et al.
Disclaimer: The team releasing ResNet did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
ResNet (Residual Network) is a convolutional neural network that democratized the concepts of residual learning and skip connections. This enables to train much deeper models.
This is ResNet v1.5, which differs from the original model: in the bottleneck blocks which require downsampling, v1 has stride = 2 in the first 1x1 convolution, whereas v1.5 has stride = 2 in the 3x3 convolution. This difference makes ResNet50 v1.5 slightly more accurate (\~0.5% top1) than v1, but comes with a small performance drawback (~5% imgs/sec) according to [Nvidia](https://catalog.ngc.nvidia.com/orgs/nvidia/resources/resnet_50_v1_5_for_pytorch).
![model image](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/resnet_architecture.png)
## Intended uses & limitations
You can use the raw model for image classification. See the [model hub](https://huggingface.co/models?search=resnet) to look for
fine-tuned versions on a task that interests you.
### How to use
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
```python
from transformers import AutoImageProcessor, ResNetForImageClassification
import torch
from datasets import load_dataset
dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]
processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50")
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])
```
For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/main/en/model_doc/resnet).
### BibTeX entry and citation info
```bibtex
@inproceedings{he2016deep,
title={Deep residual learning for image recognition},
author={He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
pages={770--778},
year={2016}
}
```
| [
-0.6228454113006592,
-0.13954868912696838,
-0.21387724578380585,
-0.09084169566631317,
-0.28794339299201965,
-0.14664319157600403,
-0.08141709119081497,
-0.6906808018684387,
0.30955904722213745,
0.43072310090065,
-0.5989305973052979,
-0.31050950288772583,
-0.5381338000297546,
0.16376647353172302,
-0.37213438749313354,
0.7290385365486145,
0.02931179851293564,
0.07603569328784943,
-0.569707453250885,
-0.2792724072933197,
-0.24476727843284607,
-0.41595587134361267,
-0.9365447163581848,
-0.4758525490760803,
0.6604782342910767,
0.34575149416923523,
0.41923701763153076,
0.4600725471973419,
0.751846432685852,
0.44055336713790894,
-0.03297510743141174,
-0.005535407457500696,
-0.4452107846736908,
-0.2751372456550598,
0.21622584760189056,
-0.39766502380371094,
-0.25418636202812195,
0.21385802328586578,
0.4240134656429291,
0.21992358565330505,
0.06355146318674088,
0.47478771209716797,
0.014406287111341953,
0.7823858261108398,
-0.5402567982673645,
0.11441851407289505,
-0.4050824046134949,
0.18524426221847534,
-0.03948059305548668,
0.028565455228090286,
-0.46590209007263184,
-0.1798103153705597,
0.16670624911785126,
-0.4619942903518677,
0.5723779797554016,
-0.03737381100654602,
1.3977446556091309,
0.23538422584533691,
-0.047698985785245895,
0.25493162870407104,
-0.4122469127178192,
0.7001163363456726,
-0.6623624563217163,
0.4295530617237091,
0.32717108726501465,
0.5393614172935486,
0.059436868876218796,
-1.3710821866989136,
-0.4642166197299957,
-0.278298020362854,
-0.12762044370174408,
0.06398826092481613,
-0.5198394060134888,
0.07027091085910797,
0.31527987122535706,
0.4704543352127075,
-0.4724302589893341,
0.15341277420520782,
-0.8720852136611938,
-0.3305306136608124,
0.5939422249794006,
-0.009806548245251179,
0.13385602831840515,
-0.07418078184127808,
-0.6477190256118774,
-0.2147952914237976,
-0.3973107933998108,
0.25545981526374817,
0.13079670071601868,
0.14895717799663544,
-0.34485745429992676,
0.31472140550613403,
-0.3262672424316406,
0.712658166885376,
0.09702763706445694,
-0.07301198691129684,
0.43522903323173523,
-0.04313243553042412,
-0.44711393117904663,
0.032896097749471664,
0.9119994640350342,
0.365464448928833,
0.36560994386672974,
0.0979398563504219,
-0.04871561750769615,
-0.004938859026879072,
0.3520391285419464,
-1.0517984628677368,
-0.45669347047805786,
0.13374966382980347,
-0.6658003330230713,
-0.5558866262435913,
0.06817176192998886,
-0.39448538422584534,
-0.23468396067619324,
-0.4005264341831207,
0.15363763272762299,
-0.3551613688468933,
-0.2873395085334778,
0.0903744325041771,
-0.030693549662828445,
0.34318554401397705,
0.3425368666648865,
-0.29894447326660156,
0.3274553418159485,
0.42713236808776855,
0.9135067462921143,
0.04340445622801781,
-0.3018854558467865,
-0.052246663719415665,
-0.730536699295044,
-0.2170214056968689,
0.6102062463760376,
-0.24161285161972046,
0.10878308862447739,
-0.33592459559440613,
0.5018585324287415,
0.15084843337535858,
-0.5333116054534912,
0.43344783782958984,
-0.7706725001335144,
0.22258692979812622,
-0.11744549125432968,
-0.27715426683425903,
-0.6419079899787903,
0.2807351350784302,
-0.7880672812461853,
0.9572473764419556,
0.20386940240859985,
-1.0286579132080078,
0.2468336820602417,
-0.15411445498466492,
0.027984853833913803,
-0.09086742252111435,
0.19023814797401428,
-0.7308636903762817,
0.03627856820821762,
-0.06368667632341385,
0.5356288552284241,
-0.3539060950279236,
0.12973853945732117,
-0.602180004119873,
-0.39498621225357056,
0.26855677366256714,
-0.4018823802471161,
0.9405658841133118,
0.36214929819107056,
-0.17592184245586395,
0.08338076621294022,
-0.6296606063842773,
0.07413831353187561,
0.2411482334136963,
-0.04733116179704666,
0.04513015225529671,
-0.5095624923706055,
0.08345598727464676,
0.46414053440093994,
0.14509546756744385,
-0.6780778169631958,
0.17844389379024506,
-0.15397579967975616,
0.4224644601345062,
0.5211817026138306,
-0.13367469608783722,
0.3159762918949127,
-0.40190112590789795,
0.5383374691009521,
-0.007085693068802357,
0.3091762959957123,
-0.15037645399570465,
-0.4815005660057068,
-0.8783779144287109,
-0.29856622219085693,
0.4799205958843231,
0.41653579473495483,
-0.6770078539848328,
0.23044712841510773,
-0.21090562641620636,
-0.7947415113449097,
-0.3963315486907959,
-0.19156040251255035,
0.4703618288040161,
0.7379603981971741,
0.4467766582965851,
-0.5258661508560181,
-0.9230268001556396,
-1.0028148889541626,
0.18557244539260864,
0.046508949249982834,
0.1695941686630249,
0.35748884081840515,
0.5362374782562256,
-0.1811414510011673,
0.9484310746192932,
-0.27256032824516296,
-0.2266319841146469,
-0.011314901523292065,
0.00878839660435915,
0.38504600524902344,
0.6118363738059998,
0.4846339523792267,
-0.8609493970870972,
-0.409574419260025,
-0.07032423466444016,
-0.9377865791320801,
0.31230631470680237,
0.053588517010211945,
-0.05100046843290329,
0.18967117369174957,
0.5458224415779114,
-0.2400846779346466,
0.7086673378944397,
0.4754878878593445,
-0.08452686667442322,
0.6782117486000061,
-0.02458152361214161,
0.09443143755197525,
-1.0809699296951294,
0.21388885378837585,
0.2571188509464264,
-0.33540070056915283,
-0.47023871541023254,
0.009103653952479362,
0.05702982470393181,
-0.21575379371643066,
-0.7429604530334473,
0.5176200270652771,
-0.49702125787734985,
-0.1116628497838974,
-0.3197038173675537,
-0.38480615615844727,
0.10669467598199844,
0.6113309264183044,
0.22509269416332245,
0.34616371989250183,
0.7278354167938232,
-0.6407540440559387,
0.7993475794792175,
0.057248104363679886,
-0.29090985655784607,
0.2597068250179291,
-0.8520523905754089,
0.16321544349193573,
-0.15217375755310059,
0.4901805818080902,
-0.9810308218002319,
-0.14943964779376984,
0.3711872696876526,
-0.7557501792907715,
0.5938495397567749,
-0.27529361844062805,
-0.04287822172045708,
-0.7780300378799438,
-0.12938107550144196,
0.652309775352478,
0.6735729575157166,
-0.6273460984230042,
0.3538650572299957,
0.008642883040010929,
0.48814377188682556,
-0.873954176902771,
-0.8527146577835083,
-0.0068934266455471516,
-0.22745530307292938,
-0.5807963013648987,
0.38520383834838867,
0.18351200222969055,
0.16892243921756744,
0.24945931136608124,
-0.09400313347578049,
-0.15763472020626068,
0.0011346853571012616,
0.5450039505958557,
0.30620279908180237,
-0.22134919464588165,
0.12323403358459473,
-0.4443497955799103,
-0.2785736620426178,
-0.026640214025974274,
-0.32797202467918396,
0.4682704508304596,
-0.41501688957214355,
-0.10392817109823227,
-0.9110109806060791,
-0.1361890286207199,
0.5975637435913086,
-0.2897636294364929,
0.7289859652519226,
0.9458046555519104,
-0.6282370090484619,
0.07932373881340027,
-0.5285332798957825,
-0.3828957974910736,
-0.49635738134384155,
0.3185268044471741,
-0.33890092372894287,
-0.6506308913230896,
0.6310184001922607,
-0.08598560094833374,
-0.09785996377468109,
0.5963979959487915,
0.10184857249259949,
-0.1374782919883728,
0.3902464210987091,
0.7039094567298889,
0.03667372837662697,
0.6192991137504578,
-0.8180224895477295,
-0.14347395300865173,
-0.9790945649147034,
-0.4726606607437134,
-0.37539976835250854,
-0.7082589268684387,
-0.6434636116027832,
-0.3261379301548004,
0.08249901235103607,
0.19224035739898682,
-0.58344966173172,
0.7365257143974304,
-0.8110354542732239,
0.16267254948616028,
0.6297993659973145,
0.6410353183746338,
-0.1545153707265854,
0.3790246248245239,
0.04434273764491081,
0.033074747771024704,
-0.8688541054725647,
-0.26246359944343567,
0.8042296767234802,
0.6255553364753723,
0.691642165184021,
-0.28921782970428467,
0.7070107460021973,
0.12116043269634247,
0.5631313323974609,
-0.7382938861846924,
0.5311132073402405,
-0.29400473833084106,
-0.6357927918434143,
-0.14764468371868134,
-0.3869480788707733,
-1.0394809246063232,
-0.051223259419202805,
-0.2663266956806183,
-0.5576534867286682,
0.6384066343307495,
0.22539302706718445,
-0.20202799141407013,
0.5424315929412842,
-0.5641831159591675,
0.8888157606124878,
-0.053646236658096313,
-0.434079110622406,
0.07699788361787796,
-0.6632737517356873,
0.3953576982021332,
0.21103107929229736,
-0.24445010721683502,
-0.08600526303052902,
0.16293703019618988,
0.8083930015563965,
-0.4229370951652527,
1.098575472831726,
-0.17173288762569427,
0.3554685115814209,
0.7063831090927124,
-0.013565249741077423,
0.31460171937942505,
-0.11264590919017792,
-0.12045998126268387,
0.5399993062019348,
-0.05319010466337204,
-0.4561702013015747,
-0.4288189113140106,
0.550810694694519,
-0.7640982270240784,
-0.2906033992767334,
-0.43305501341819763,
-0.09048307687044144,
0.1697041094303131,
0.20211747288703918,
0.8002673983573914,
0.7684305310249329,
0.03227626159787178,
0.4562854468822479,
0.52422696352005,
-0.4188048243522644,
0.47795411944389343,
0.005828646942973137,
-0.1039179190993309,
-0.48506230115890503,
0.8951618671417236,
0.19117219746112823,
0.23272669315338135,
0.22863741219043732,
0.18102288246154785,
-0.27265286445617676,
-0.09706737846136093,
-0.1916579157114029,
0.33620399236679077,
-0.6827559471130371,
-0.6451604962348938,
-0.468191921710968,
-0.4614526927471161,
-0.3140232264995575,
-0.13278460502624512,
-0.6878643035888672,
-0.20674553513526917,
-0.5427583456039429,
0.03138231486082077,
0.5071619153022766,
0.4867345094680786,
-0.07758864015340805,
0.2672766447067261,
-0.6205348372459412,
0.05033738166093826,
0.30581894516944885,
0.580508291721344,
0.17811518907546997,
-0.8605980277061462,
-0.187095046043396,
0.10756587237119675,
-0.22742359340190887,
-0.617400586605072,
0.4010622501373291,
0.2079557478427887,
0.3810124695301056,
0.37797683477401733,
0.07087207585573196,
0.5894507169723511,
-0.16033461689949036,
0.5786547064781189,
0.6417329907417297,
-0.5118988752365112,
0.27863460779190063,
0.1206442341208458,
0.1885092854499817,
0.31588295102119446,
0.601886510848999,
-0.4981119930744171,
0.21721769869327545,
-1.004902720451355,
-0.5353639721870422,
0.7163246273994446,
-0.09872438758611679,
0.10794621706008911,
0.25614070892333984,
0.6294422149658203,
-0.06949814409017563,
0.10577456653118134,
-0.7543973326683044,
-0.4238857626914978,
-0.41752418875694275,
0.02708280086517334,
-0.11877181380987167,
-0.33851829171180725,
0.05602065101265907,
-0.5906200408935547,
0.5941774845123291,
-0.03738783299922943,
0.6925227642059326,
0.4020726680755615,
0.22495555877685547,
0.0065743327140808105,
-0.44011232256889343,
0.5391925573348999,
0.3258754014968872,
-0.27907681465148926,
0.13428367674350739,
0.20325611531734467,
-0.59080570936203,
0.1312265545129776,
0.024998368695378304,
0.029758941382169724,
0.02869601920247078,
0.6486263275146484,
0.986617922782898,
-0.10005734860897064,
-0.04706227034330368,
0.36897769570350647,
-0.316461443901062,
-0.43802139163017273,
-0.4976605474948883,
-0.056787267327308655,
-0.04845629259943962,
0.2852884829044342,
0.1457105278968811,
0.5029340386390686,
0.024304242804646492,
-0.24553197622299194,
0.528244137763977,
0.195148304104805,
-0.7725104093551636,
-0.2533007562160492,
0.5133597254753113,
-0.008166254498064518,
-0.2192215472459793,
1.031874418258667,
-0.23192749917507172,
-0.5556092858314514,
1.188749074935913,
0.386370450258255,
1.0839369297027588,
-0.07290579378604889,
0.2259850651025772,
1.0231356620788574,
0.2388748824596405,
-0.12880824506282806,
0.04079093784093857,
0.09251196682453156,
-0.8222463726997375,
-0.32613131403923035,
-0.5040695667266846,
-0.01713332161307335,
0.22403040528297424,
-0.6953362226486206,
0.4145043194293976,
-0.43724843859672546,
-0.40621691942214966,
-0.09232582896947861,
0.09594644606113434,
-0.9602832794189453,
0.5106715559959412,
0.263014018535614,
1.177260398864746,
-0.7191521525382996,
0.7048055529594421,
0.709907591342926,
-0.4053429663181305,
-0.9802165031433105,
-0.39515602588653564,
-0.27416086196899414,
-0.7316524386405945,
0.7203369140625,
0.391891747713089,
0.09366698563098907,
0.05854806303977966,
-0.9430903792381287,
-0.9109355807304382,
1.357138752937317,
0.3561461567878723,
-0.40642568469047546,
0.3603775203227997,
-0.3495156466960907,
0.44335857033729553,
-0.4477684497833252,
0.39547470211982727,
0.04901595786213875,
0.226348876953125,
0.47527796030044556,
-0.6554703116416931,
0.1920892298221588,
-0.3390536308288574,
0.01604447141289711,
-0.060879696160554886,
-0.8481752872467041,
0.8867933750152588,
-0.40295088291168213,
-0.27895021438598633,
0.08820392936468124,
0.8483865857124329,
0.07462131232023239,
0.45394062995910645,
0.4574959874153137,
0.770534098148346,
0.5839107632637024,
-0.28160518407821655,
1.1100541353225708,
-0.10021015256643295,
0.5704317092895508,
0.9263098835945129,
0.34377527236938477,
0.6023985147476196,
0.14523646235466003,
-0.24092206358909607,
0.4827626943588257,
1.1752147674560547,
-0.2876318693161011,
0.3496255576610565,
0.36823031306266785,
-0.1329740583896637,
-0.30226191878318787,
-0.1666819453239441,
-0.6352688074111938,
0.501872718334198,
0.06188545376062393,
-0.542300820350647,
-0.10485053807497025,
0.22700239717960358,
-0.09828390181064606,
-0.31218278408050537,
-0.28695324063301086,
0.4491141140460968,
0.115953728556633,
-0.4231313169002533,
0.9799442887306213,
-0.04235761612653732,
0.6815752387046814,
-0.32545170187950134,
-0.1561102271080017,
-0.378609836101532,
0.1252567619085312,
-0.5230392217636108,
-0.6224021315574646,
0.29379531741142273,
-0.34329599142074585,
-0.06933135539293289,
0.07312732934951782,
0.9371961355209351,
-0.18235233426094055,
-0.5448514223098755,
0.10629063099622726,
-0.03188454732298851,
0.4425024390220642,
-0.05320904776453972,
-0.9829491376876831,
0.2613786458969116,
0.011923466809093952,
-0.3553958237171173,
0.15519793331623077,
0.2674839198589325,
0.1168065145611763,
0.983138918876648,
0.5273424386978149,
-0.19671957194805145,
-0.009377541951835155,
-0.3092736601829529,
0.9484868049621582,
-0.4141778349876404,
-0.14971774816513062,
-0.5624345541000366,
0.6060096025466919,
-0.0843636691570282,
-0.40750402212142944,
0.5180973410606384,
0.5265228748321533,
0.9264695644378662,
-0.18017719686031342,
0.4428596496582031,
-0.2461642175912857,
-0.0003958211455028504,
-0.20408226549625397,
0.4921373724937439,
-0.7440782785415649,
-0.07865497469902039,
-0.14686425030231476,
-0.6565271019935608,
-0.33581113815307617,
0.6741724014282227,
-0.16015641391277313,
0.3795880377292633,
0.4889465570449829,
0.8952853083610535,
-0.23257970809936523,
-0.1647147834300995,
0.3015729784965515,
-0.06121067702770233,
0.0335635244846344,
0.4512590169906616,
0.5080102682113647,
-0.8500115275382996,
0.29935750365257263,
-0.827415406703949,
-0.23407843708992004,
-0.1980976164340973,
-0.921105146408081,
-0.6441013813018799,
-0.8075941205024719,
-0.5786387324333191,
-0.7757205367088318,
-0.22932633757591248,
0.6294182538986206,
1.1143392324447632,
-0.7401012778282166,
-0.05597944185137749,
-0.256384015083313,
0.0951700285077095,
-0.34370434284210205,
-0.22024431824684143,
0.43931639194488525,
-0.10275427997112274,
-0.5936386585235596,
-0.22281208634376526,
-0.07909796386957169,
0.07044284045696259,
-0.16602686047554016,
-0.18780000507831573,
-0.21177837252616882,
-0.3804565668106079,
0.3191829323768616,
0.6640822291374207,
-0.5331413149833679,
-0.24130287766456604,
0.03142288699746132,
-0.15760526061058044,
0.04268445074558258,
0.4851093590259552,
-0.9181739091873169,
0.5131549835205078,
0.5220617651939392,
0.5839400887489319,
0.6823224425315857,
-0.03181658312678337,
0.08692935854196548,
-0.5722096562385559,
0.27208441495895386,
0.15690748393535614,
0.39428022503852844,
0.2848540246486664,
-0.41663622856140137,
0.6674455404281616,
0.5097551941871643,
-0.596652626991272,
-0.6727849245071411,
0.18375547230243683,
-1.0843502283096313,
-0.21493974328041077,
0.9749209880828857,
-0.2636323571205139,
-0.5409815311431885,
0.31224533915519714,
-0.19468660652637482,
0.4552851915359497,
-0.1047886535525322,
0.3614642918109894,
0.32358938455581665,
-0.09864827245473862,
-0.7004196047782898,
-0.3786507248878479,
0.4804030656814575,
0.03608034551143646,
-0.3741207718849182,
-0.28078779578208923,
0.2517242431640625,
0.4316363036632538,
0.2721156179904938,
0.40187397599220276,
-0.14300081133842468,
0.36291900277137756,
0.1422421783208847,
0.624286413192749,
-0.5030951499938965,
-0.38109922409057617,
-0.4092286229133606,
0.08342529088258743,
-0.16785414516925812,
-0.6190788149833679
] |
runwayml/stable-diffusion-v1-5 | runwayml | "2023-08-23T21:14:19Z" | 7,261,639 | 9,670 | diffusers | [
"diffusers",
"stable-diffusion",
"stable-diffusion-diffusers",
"text-to-image",
"arxiv:2207.12598",
"arxiv:2112.10752",
"arxiv:2103.00020",
"arxiv:2205.11487",
"arxiv:1910.09700",
"license:creativeml-openrail-m",
"endpoints_compatible",
"has_space",
"diffusers:StableDiffusionPipeline",
"region:us"
] | text-to-image | "2022-10-19T23:38:35Z" | ---
license: creativeml-openrail-m
tags:
- stable-diffusion
- stable-diffusion-diffusers
- text-to-image
inference: true
extra_gated_prompt: |-
This model is open access and available to all, with a CreativeML OpenRAIL-M license further specifying rights and usage.
The CreativeML OpenRAIL License specifies:
1. You can't use the model to deliberately produce nor share illegal or harmful outputs or content
2. CompVis claims no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in the license
3. You may re-distribute the weights and use the model commercially and/or as a service. If you do, please be aware you have to include the same use restrictions as the ones in the license and share a copy of the CreativeML OpenRAIL-M to all your users (please read the license entirely and carefully)
Please read the full license carefully here: https://huggingface.co/spaces/CompVis/stable-diffusion-license
extra_gated_heading: Please read the LICENSE to access this model
---
# Stable Diffusion v1-5 Model Card
Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input.
For more information about how Stable Diffusion functions, please have a look at [🤗's Stable Diffusion blog](https://huggingface.co/blog/stable_diffusion).
The **Stable-Diffusion-v1-5** checkpoint was initialized with the weights of the [Stable-Diffusion-v1-2](https:/steps/huggingface.co/CompVis/stable-diffusion-v1-2)
checkpoint and subsequently fine-tuned on 595k steps at resolution 512x512 on "laion-aesthetics v2 5+" and 10% dropping of the text-conditioning to improve [classifier-free guidance sampling](https://arxiv.org/abs/2207.12598).
You can use this both with the [🧨Diffusers library](https://github.com/huggingface/diffusers) and the [RunwayML GitHub repository](https://github.com/runwayml/stable-diffusion).
### Diffusers
```py
from diffusers import StableDiffusionPipeline
import torch
model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
```
For more detailed instructions, use-cases and examples in JAX follow the instructions [here](https://github.com/huggingface/diffusers#text-to-image-generation-with-stable-diffusion)
### Original GitHub Repository
1. Download the weights
- [v1-5-pruned-emaonly.ckpt](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt) - 4.27GB, ema-only weight. uses less VRAM - suitable for inference
- [v1-5-pruned.ckpt](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.ckpt) - 7.7GB, ema+non-ema weights. uses more VRAM - suitable for fine-tuning
2. Follow instructions [here](https://github.com/runwayml/stable-diffusion).
## Model Details
- **Developed by:** Robin Rombach, Patrick Esser
- **Model type:** Diffusion-based text-to-image generation model
- **Language(s):** English
- **License:** [The CreativeML OpenRAIL M license](https://huggingface.co/spaces/CompVis/stable-diffusion-license) is an [Open RAIL M license](https://www.licenses.ai/blog/2022/8/18/naming-convention-of-responsible-ai-licenses), adapted from the work that [BigScience](https://bigscience.huggingface.co/) and [the RAIL Initiative](https://www.licenses.ai/) are jointly carrying in the area of responsible AI licensing. See also [the article about the BLOOM Open RAIL license](https://bigscience.huggingface.co/blog/the-bigscience-rail-license) on which our license is based.
- **Model Description:** This is a model that can be used to generate and modify images based on text prompts. It is a [Latent Diffusion Model](https://arxiv.org/abs/2112.10752) that uses a fixed, pretrained text encoder ([CLIP ViT-L/14](https://arxiv.org/abs/2103.00020)) as suggested in the [Imagen paper](https://arxiv.org/abs/2205.11487).
- **Resources for more information:** [GitHub Repository](https://github.com/CompVis/stable-diffusion), [Paper](https://arxiv.org/abs/2112.10752).
- **Cite as:**
@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}
# Uses
## Direct Use
The model is intended for research purposes only. Possible research areas and
tasks include
- Safe deployment of models which have the potential to generate harmful content.
- Probing and understanding the limitations and biases of generative models.
- Generation of artworks and use in design and other artistic processes.
- Applications in educational or creative tools.
- Research on generative models.
Excluded uses are described below.
### Misuse, Malicious Use, and Out-of-Scope Use
_Note: This section is taken from the [DALLE-MINI model card](https://huggingface.co/dalle-mini/dalle-mini), but applies in the same way to Stable Diffusion v1_.
The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating images that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.
#### Out-of-Scope Use
The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
#### Misuse and Malicious Use
Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:
- Generating demeaning, dehumanizing, or otherwise harmful representations of people or their environments, cultures, religions, etc.
- Intentionally promoting or propagating discriminatory content or harmful stereotypes.
- Impersonating individuals without their consent.
- Sexual content without consent of the people who might see it.
- Mis- and disinformation
- Representations of egregious violence and gore
- Sharing of copyrighted or licensed material in violation of its terms of use.
- Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.
## Limitations and Bias
### Limitations
- The model does not achieve perfect photorealism
- The model cannot render legible text
- The model does not perform well on more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
- Faces and people in general may not be generated properly.
- The model was trained mainly with English captions and will not work as well in other languages.
- The autoencoding part of the model is lossy
- The model was trained on a large-scale dataset
[LAION-5B](https://laion.ai/blog/laion-5b/) which contains adult material
and is not fit for product use without additional safety mechanisms and
considerations.
- No additional measures were used to deduplicate the dataset. As a result, we observe some degree of memorization for images that are duplicated in the training data.
The training data can be searched at [https://rom1504.github.io/clip-retrieval/](https://rom1504.github.io/clip-retrieval/) to possibly assist in the detection of memorized images.
### Bias
While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.
Stable Diffusion v1 was trained on subsets of [LAION-2B(en)](https://laion.ai/blog/laion-5b/),
which consists of images that are primarily limited to English descriptions.
Texts and images from communities and cultures that use other languages are likely to be insufficiently accounted for.
This affects the overall output of the model, as white and western cultures are often set as the default. Further, the
ability of the model to generate content with non-English prompts is significantly worse than with English-language prompts.
### Safety Module
The intended use of this model is with the [Safety Checker](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/safety_checker.py) in Diffusers.
This checker works by checking model outputs against known hard-coded NSFW concepts.
The concepts are intentionally hidden to reduce the likelihood of reverse-engineering this filter.
Specifically, the checker compares the class probability of harmful concepts in the embedding space of the `CLIPTextModel` *after generation* of the images.
The concepts are passed into the model with the generated image and compared to a hand-engineered weight for each NSFW concept.
## Training
**Training Data**
The model developers used the following dataset for training the model:
- LAION-2B (en) and subsets thereof (see next section)
**Training Procedure**
Stable Diffusion v1-5 is a latent diffusion model which combines an autoencoder with a diffusion model that is trained in the latent space of the autoencoder. During training,
- Images are encoded through an encoder, which turns images into latent representations. The autoencoder uses a relative downsampling factor of 8 and maps images of shape H x W x 3 to latents of shape H/f x W/f x 4
- Text prompts are encoded through a ViT-L/14 text-encoder.
- The non-pooled output of the text encoder is fed into the UNet backbone of the latent diffusion model via cross-attention.
- The loss is a reconstruction objective between the noise that was added to the latent and the prediction made by the UNet.
Currently six Stable Diffusion checkpoints are provided, which were trained as follows.
- [`stable-diffusion-v1-1`](https://huggingface.co/CompVis/stable-diffusion-v1-1): 237,000 steps at resolution `256x256` on [laion2B-en](https://huggingface.co/datasets/laion/laion2B-en).
194,000 steps at resolution `512x512` on [laion-high-resolution](https://huggingface.co/datasets/laion/laion-high-resolution) (170M examples from LAION-5B with resolution `>= 1024x1024`).
- [`stable-diffusion-v1-2`](https://huggingface.co/CompVis/stable-diffusion-v1-2): Resumed from `stable-diffusion-v1-1`.
515,000 steps at resolution `512x512` on "laion-improved-aesthetics" (a subset of laion2B-en,
filtered to images with an original size `>= 512x512`, estimated aesthetics score `> 5.0`, and an estimated watermark probability `< 0.5`. The watermark estimate is from the LAION-5B metadata, the aesthetics score is estimated using an [improved aesthetics estimator](https://github.com/christophschuhmann/improved-aesthetic-predictor)).
- [`stable-diffusion-v1-3`](https://huggingface.co/CompVis/stable-diffusion-v1-3): Resumed from `stable-diffusion-v1-2` - 195,000 steps at resolution `512x512` on "laion-improved-aesthetics" and 10 % dropping of the text-conditioning to improve [classifier-free guidance sampling](https://arxiv.org/abs/2207.12598).
- [`stable-diffusion-v1-4`](https://huggingface.co/CompVis/stable-diffusion-v1-4) Resumed from `stable-diffusion-v1-2` - 225,000 steps at resolution `512x512` on "laion-aesthetics v2 5+" and 10 % dropping of the text-conditioning to improve [classifier-free guidance sampling](https://arxiv.org/abs/2207.12598).
- [`stable-diffusion-v1-5`](https://huggingface.co/runwayml/stable-diffusion-v1-5) Resumed from `stable-diffusion-v1-2` - 595,000 steps at resolution `512x512` on "laion-aesthetics v2 5+" and 10 % dropping of the text-conditioning to improve [classifier-free guidance sampling](https://arxiv.org/abs/2207.12598).
- [`stable-diffusion-inpainting`](https://huggingface.co/runwayml/stable-diffusion-inpainting) Resumed from `stable-diffusion-v1-5` - then 440,000 steps of inpainting training at resolution 512x512 on “laion-aesthetics v2 5+” and 10% dropping of the text-conditioning. For inpainting, the UNet has 5 additional input channels (4 for the encoded masked-image and 1 for the mask itself) whose weights were zero-initialized after restoring the non-inpainting checkpoint. During training, we generate synthetic masks and in 25% mask everything.
- **Hardware:** 32 x 8 x A100 GPUs
- **Optimizer:** AdamW
- **Gradient Accumulations**: 2
- **Batch:** 32 x 8 x 2 x 4 = 2048
- **Learning rate:** warmup to 0.0001 for 10,000 steps and then kept constant
## Evaluation Results
Evaluations with different classifier-free guidance scales (1.5, 2.0, 3.0, 4.0,
5.0, 6.0, 7.0, 8.0) and 50 PNDM/PLMS sampling
steps show the relative improvements of the checkpoints:
![pareto](https://huggingface.co/CompVis/stable-diffusion/resolve/main/v1-1-to-v1-5.png)
Evaluated using 50 PLMS steps and 10000 random prompts from the COCO2017 validation set, evaluated at 512x512 resolution. Not optimized for FID scores.
## Environmental Impact
**Stable Diffusion v1** **Estimated Emissions**
Based on that information, we estimate the following CO2 emissions using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.
- **Hardware Type:** A100 PCIe 40GB
- **Hours used:** 150000
- **Cloud Provider:** AWS
- **Compute Region:** US-east
- **Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid):** 11250 kg CO2 eq.
## Citation
```bibtex
@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}
```
*This model card was written by: Robin Rombach and Patrick Esser and is based on the [DALL-E Mini model card](https://huggingface.co/dalle-mini/dalle-mini).* | [
-0.37994083762168884,
-0.9187833070755005,
0.4418250322341919,
0.2584875226020813,
-0.2324058562517166,
-0.37639373540878296,
0.08209457993507385,
-0.42550569772720337,
-0.17664596438407898,
0.43061110377311707,
-0.30325940251350403,
-0.5391732454299927,
-0.6823850274085999,
-0.16417132318019867,
-0.4583382308483124,
0.9065454602241516,
-0.11754544079303741,
-0.023173943161964417,
-0.23091721534729004,
-0.09298037737607956,
-0.2449990212917328,
-0.1941576451063156,
-1.0009229183197021,
-0.199213445186615,
0.47145459055900574,
-0.012630260549485683,
0.6280748248100281,
0.5718503594398499,
0.4465671479701996,
0.2703801095485687,
-0.3772270679473877,
-0.1002737283706665,
-0.5297139286994934,
-0.07445113360881805,
-0.14571088552474976,
-0.13680334389209747,
-0.4954841434955597,
0.12742747366428375,
0.6124926805496216,
0.24004016816616058,
-0.059175439178943634,
0.0011226742062717676,
-0.03242700919508934,
0.5403724908828735,
-0.5430651903152466,
-0.1691562831401825,
-0.3323363959789276,
0.08912273496389389,
-0.1607474535703659,
0.2044406533241272,
-0.3303372263908386,
-0.1234295666217804,
0.1589002013206482,
-0.7433493733406067,
0.38500431180000305,
-0.22677740454673767,
1.1326402425765991,
0.2659957706928253,
-0.33315950632095337,
-0.15609139204025269,
-0.6857097744941711,
0.6456250548362732,
-0.6437095999717712,
0.18414826691150665,
0.30504944920539856,
0.11052915453910828,
-0.04477526992559433,
-1.0177061557769775,
-0.6373387575149536,
-0.08360500633716583,
0.09980706870555878,
0.41970404982566833,
-0.21413999795913696,
0.0029074116609990597,
0.37575018405914307,
0.2831321358680725,
-0.5605384707450867,
-0.0818437710404396,
-0.43266773223876953,
-0.0766105130314827,
0.6148395538330078,
0.02459653839468956,
0.4177870452404022,
-0.21365244686603546,
-0.46642762422561646,
-0.1161317452788353,
-0.5396840572357178,
-0.1378209888935089,
0.3460283875465393,
-0.19986554980278015,
-0.4043946862220764,
0.4128880798816681,
0.15957267582416534,
0.5337034463882446,
0.11387329548597336,
-0.23014046251773834,
0.30282697081565857,
-0.305185467004776,
-0.2166702300310135,
-0.46350327134132385,
0.9167516231536865,
0.5050085186958313,
0.0005712361307814717,
0.14698074758052826,
-0.22711417078971863,
0.05452674627304077,
0.07649975270032883,
-1.177802324295044,
-0.3742366433143616,
0.11714434623718262,
-0.7171640992164612,
-0.5516819953918457,
-0.16538403928279877,
-0.8736781477928162,
-0.1543312817811966,
0.18850308656692505,
0.5923416614532471,
-0.47082042694091797,
-0.48308318853378296,
0.06982570141553879,
-0.43198665976524353,
0.0999717265367508,
0.5243400931358337,
-0.5052157044410706,
-0.016506953164935112,
0.0020936306100338697,
1.0851048231124878,
-0.2895229756832123,
-0.059852924197912216,
0.07854239642620087,
0.16610653698444366,
-0.28656119108200073,
0.6618783473968506,
-0.2684425115585327,
-0.6406199336051941,
-0.14518994092941284,
0.2950894236564636,
0.11406654864549637,
-0.5110892057418823,
0.5754203200340271,
-0.48238426446914673,
0.3213657736778259,
0.0034944037906825542,
-0.4758824408054352,
-0.18277277052402496,
-0.006447777152061462,
-0.7100051045417786,
0.9561238884925842,
0.15578459203243256,
-0.8865253329277039,
0.18885450065135956,
-0.6847822666168213,
-0.26120027899742126,
-0.039759401232004166,
0.03279279172420502,
-0.7379803657531738,
-0.2517399489879608,
-0.010909556411206722,
0.39737167954444885,
-0.07978975027799606,
0.2489667385816574,
-0.2799750566482544,
-0.1896260529756546,
-0.03466024622321129,
-0.5469540953636169,
1.0059961080551147,
0.41390782594680786,
-0.31714197993278503,
0.016933860257267952,
-0.6699389815330505,
-0.3225671947002411,
0.47934868931770325,
-0.33694010972976685,
-0.3364191949367523,
-0.11989063769578934,
0.3739941120147705,
0.33786582946777344,
0.11453058570623398,
-0.419707328081131,
0.0011815474135801196,
-0.20996591448783875,
0.4373701214790344,
0.7372632622718811,
0.3488021194934845,
0.6234766244888306,
-0.4528496563434601,
0.5510659217834473,
0.40729033946990967,
0.18622131645679474,
-0.36673980951309204,
-0.8264375925064087,
-0.6528121829032898,
-0.39353370666503906,
0.21002598106861115,
0.501288652420044,
-0.7861581444740295,
0.2548733651638031,
0.029442384839057922,
-0.6491093635559082,
-0.21329571306705475,
-0.09187736362218857,
0.3381694555282593,
0.6623992919921875,
0.30886340141296387,
-0.3896504342556,
-0.21456174552440643,
-0.728426456451416,
0.18875449895858765,
-0.12198386341333389,
0.12615275382995605,
0.3418501019477844,
0.7058203220367432,
-0.34583476185798645,
0.5465134382247925,
-0.5260555744171143,
-0.3080671429634094,
0.061577849090099335,
0.2106003612279892,
-0.012584254145622253,
0.8142156600952148,
0.7719182372093201,
-0.973079264163971,
-0.5373325347900391,
-0.20627860724925995,
-0.7843557000160217,
0.08039721846580505,
-0.20300590991973877,
-0.3234511911869049,
0.3358182907104492,
0.5042207837104797,
-0.7901888489723206,
0.6899890303611755,
0.47116324305534363,
-0.3548635244369507,
0.48420581221580505,
-0.34867680072784424,
0.07758576422929764,
-1.1254438161849976,
0.19616055488586426,
0.384866863489151,
-0.37179991602897644,
-0.4984193444252014,
0.19165219366550446,
-0.06415113806724548,
-0.17008060216903687,
-0.6878354549407959,
0.8013878464698792,
-0.34169358015060425,
0.4272277057170868,
-0.27659934759140015,
-0.030723832547664642,
0.14491932094097137,
0.26240140199661255,
0.350943386554718,
0.6873354911804199,
0.77037513256073,
-0.6711357831954956,
0.0726075991988182,
0.2646985352039337,
-0.21461807191371918,
0.5526210069656372,
-0.8185529112815857,
0.11327094584703445,
-0.4157451093196869,
0.30504563450813293,
-0.9535292387008667,
-0.19854599237442017,
0.47007620334625244,
-0.39389118552207947,
0.3228894770145416,
-0.28545206785202026,
-0.44285163283348083,
-0.38416242599487305,
-0.08058984577655792,
0.5695867538452148,
0.956176221370697,
-0.4057024419307709,
0.46799057722091675,
0.3531096279621124,
0.11728902906179428,
-0.38876718282699585,
-0.784271240234375,
-0.12175007164478302,
-0.39764970541000366,
-0.7673850059509277,
0.5976203680038452,
-0.25875625014305115,
-0.06138313561677933,
0.18130628764629364,
0.2635117173194885,
-0.14989641308784485,
-0.054337725043296814,
0.3230433166027069,
0.2521664798259735,
-0.04248547926545143,
0.02163681946694851,
0.12818531692028046,
-0.008730457164347172,
-0.06656481325626373,
-0.1935901790857315,
0.22545871138572693,
0.14731605350971222,
-0.1022014170885086,
-0.6138127446174622,
0.3650192320346832,
0.5177211165428162,
0.07778678834438324,
0.855561375617981,
0.9337641596794128,
-0.4860665500164032,
-0.08244775235652924,
-0.31757277250289917,
-0.12967360019683838,
-0.4903833270072937,
0.35244208574295044,
-0.20857636630535126,
-0.5520747900009155,
0.5989741086959839,
-0.11656400561332703,
-0.019734427332878113,
0.6276727318763733,
0.6853773593902588,
-0.20480471849441528,
1.0637197494506836,
0.5993399024009705,
0.32076963782310486,
0.7298691272735596,
-0.6531376242637634,
-0.05514965206384659,
-0.7869544625282288,
-0.23056037724018097,
-0.23543819785118103,
-0.1480754017829895,
-0.41299885511398315,
-0.6362400054931641,
0.34362921118736267,
0.16864527761936188,
-0.22509382665157318,
0.08335871249437332,
-0.5529541373252869,
0.36456555128097534,
0.27320849895477295,
0.21196116507053375,
0.1096864715218544,
0.09243004769086838,
-0.1048458144068718,
-0.09015335142612457,
-0.7125150561332703,
-0.6423103213310242,
0.9341332912445068,
0.5024411678314209,
0.9136912822723389,
0.05168467015028,
0.5645089745521545,
0.40534016489982605,
0.4184950590133667,
-0.5032851696014404,
0.5920154452323914,
-0.26185834407806396,
-0.7370868921279907,
-0.11263787001371384,
-0.3008020222187042,
-0.882869303226471,
0.17413252592086792,
-0.3011935353279114,
-0.3704979717731476,
0.3578321635723114,
0.2991226315498352,
-0.12457169592380524,
0.401468962430954,
-0.7071292400360107,
0.9409395456314087,
-0.022766081616282463,
-0.6902498602867126,
-0.08489102125167847,
-0.5349535346031189,
0.43703967332839966,
-0.011943183839321136,
0.21168512105941772,
-0.020968055352568626,
-0.053645484149456024,
0.8219001889228821,
-0.31904149055480957,
0.8761054277420044,
-0.406198650598526,
0.01452042255550623,
0.4115176200866699,
-0.06256077438592911,
0.3166734278202057,
0.10091476142406464,
-0.060902565717697144,
0.31027647852897644,
0.1176435798406601,
-0.4048808515071869,
-0.2744506001472473,
0.6777896285057068,
-0.8964548707008362,
-0.4287303388118744,
-0.3950817883014679,
-0.285143107175827,
0.4901008903980255,
0.39295029640197754,
0.7722724080085754,
0.28041574358940125,
-0.29371270537376404,
-0.0354701392352581,
0.8476952314376831,
-0.5110734105110168,
0.4010089039802551,
0.22693395614624023,
-0.4031026065349579,
-0.47424665093421936,
0.8927410840988159,
0.10613540560007095,
0.47916319966316223,
-0.07304007560014725,
0.13864287734031677,
-0.13826106488704681,
-0.5925323963165283,
-0.587748110294342,
0.2992910146713257,
-0.8763372898101807,
-0.17736080288887024,
-0.750374436378479,
-0.41994568705558777,
-0.39039337635040283,
-0.11559776216745377,
-0.3635193109512329,
-0.3327654004096985,
-0.8782401084899902,
0.0945315808057785,
0.24192070960998535,
0.5869268178939819,
-0.1535649448633194,
0.3706778287887573,
-0.46873635053634644,
0.33759281039237976,
0.13499878346920013,
0.2545267641544342,
0.13587543368339539,
-0.692817747592926,
-0.24865210056304932,
0.04591554403305054,
-0.6669396758079529,
-0.877784252166748,
0.41283878684043884,
0.0882769450545311,
0.5012885928153992,
0.4844492971897125,
-0.12582309544086456,
0.5937461853027344,
-0.4390353858470917,
1.0116569995880127,
0.20743094384670258,
-0.6255736947059631,
0.6394757628440857,
-0.47921669483184814,
0.1985575407743454,
0.1478739082813263,
0.5563032627105713,
-0.2777421772480011,
-0.4290618896484375,
-0.814520001411438,
-0.9280887246131897,
0.4822733700275421,
0.414081335067749,
0.3458326756954193,
-0.13160833716392517,
0.6500003337860107,
-0.10171695053577423,
-0.08867327868938446,
-1.0360896587371826,
-0.4048205018043518,
-0.39316871762275696,
-0.060614317655563354,
0.14714667201042175,
-0.2807462811470032,
-0.1207987368106842,
-0.3697234094142914,
0.9096672534942627,
0.1440582424402237,
0.496056467294693,
0.438565731048584,
0.000435569352703169,
-0.30039525032043457,
-0.23244409263134003,
0.5325313806533813,
0.36394500732421875,
-0.16533726453781128,
-0.031002864241600037,
-0.1255241334438324,
-0.49172887206077576,
0.24179963767528534,
0.027029765769839287,
-0.6724140644073486,
0.051221344619989395,
0.05791721120476723,
0.7942289710044861,
-0.3141043484210968,
-0.5028131008148193,
0.6879661679267883,
-0.2104000449180603,
-0.3914863169193268,
-0.4847346246242523,
0.14291523396968842,
0.08889615535736084,
0.13587380945682526,
0.10746517032384872,
0.47897544503211975,
0.21644961833953857,
-0.2611648738384247,
0.1157870963215828,
0.5976466536521912,
-0.2990412712097168,
-0.3027454614639282,
1.031738519668579,
0.1427568644285202,
-0.277478963136673,
0.45827174186706543,
-0.4368293881416321,
-0.18184247612953186,
0.6600120067596436,
0.7483948469161987,
0.7677581906318665,
-0.19546663761138916,
0.43664121627807617,
0.6828979253768921,
0.27226439118385315,
-0.2810157239437103,
0.1257738173007965,
0.19328884780406952,
-0.7905644774436951,
-0.07586012035608292,
-0.43663713335990906,
0.028795022517442703,
0.26524344086647034,
-0.4134760797023773,
0.43066927790641785,
-0.5738780498504639,
-0.5147485136985779,
-0.016332201659679413,
-0.39187535643577576,
-0.5562396049499512,
0.2678791880607605,
0.25530731678009033,
0.8699406981468201,
-1.0280816555023193,
0.7804068326950073,
0.7716407179832458,
-0.7046617269515991,
-0.5293728113174438,
0.15161098539829254,
-0.11893165111541748,
-0.2521425187587738,
0.5584622025489807,
0.05122345685958862,
0.08680404722690582,
0.10999149084091187,
-0.8062946796417236,
-0.7995359897613525,
1.1776584386825562,
0.22249622642993927,
-0.1723545491695404,
-0.07546199858188629,
-0.254077285528183,
0.598616361618042,
-0.4220331311225891,
0.24179625511169434,
0.16622820496559143,
0.30089902877807617,
0.4668963551521301,
-0.4285942018032074,
0.1410866528749466,
-0.31661859154701233,
0.44214916229248047,
-0.22999651730060577,
-0.8206483125686646,
0.9277921915054321,
-0.293087899684906,
-0.3838655948638916,
0.4269424378871918,
0.5946524739265442,
0.27109208703041077,
0.30238112807273865,
0.40063202381134033,
0.8241678476333618,
0.510140597820282,
-0.027120336890220642,
1.031102180480957,
-0.026475152000784874,
0.3890545666217804,
0.6939842104911804,
0.006995248142629862,
0.6619000434875488,
0.4143962264060974,
-0.08598415553569794,
0.629858136177063,
0.6554102301597595,
-0.23705893754959106,
0.7225949168205261,
-0.050830237567424774,
-0.2915751039981842,
-0.09871748834848404,
-0.027253249660134315,
-0.35839974880218506,
0.01181215513497591,
0.35254785418510437,
-0.6706422567367554,
-0.07847663760185242,
0.21461284160614014,
0.0005527552566491067,
-0.17623987793922424,
-0.06653468310832977,
0.6074993014335632,
0.06114833801984787,
-0.4026850759983063,
0.5927597880363464,
0.20777244865894318,
0.7828047275543213,
-0.39383336901664734,
-0.17652279138565063,
-0.08324495702981949,
0.10627882182598114,
-0.19670063257217407,
-0.7804691791534424,
0.4108327329158783,
-0.12400563806295395,
-0.19797319173812866,
-0.26364463567733765,
0.8800816535949707,
-0.39326760172843933,
-0.5649218559265137,
0.29279616475105286,
0.2768513560295105,
0.2706041932106018,
0.18892446160316467,
-1.054714322090149,
0.1914799064397812,
-0.0537891760468483,
-0.354281485080719,
0.21614326536655426,
0.2463701367378235,
0.0839819610118866,
0.6189277768135071,
0.5659765601158142,
0.06806743144989014,
0.04212033003568649,
-0.08684548735618591,
0.7713266015052795,
-0.4190128445625305,
-0.3920600116252899,
-0.68720543384552,
0.7739193439483643,
-0.08934323489665985,
-0.1580992341041565,
0.6190800070762634,
0.5528935194015503,
0.7179186344146729,
-0.27632617950439453,
0.872563898563385,
-0.21515481173992157,
0.09369667619466782,
-0.5250922441482544,
0.9176755547523499,
-0.8540499806404114,
0.1500045508146286,
-0.509318470954895,
-0.758830726146698,
-0.2509435713291168,
0.9047985076904297,
-0.21042156219482422,
0.31381481885910034,
0.42969149351119995,
0.9774196743965149,
-0.1940862387418747,
-0.2912312150001526,
0.3510311245918274,
0.27200740575790405,
0.44739192724227905,
0.2533175051212311,
0.8222817182540894,
-0.6797526478767395,
0.4091629981994629,
-0.3605083227157593,
-0.23897401988506317,
-0.002031311159953475,
-0.9197884798049927,
-0.8816136717796326,
-0.7678477168083191,
-0.7676036953926086,
-0.736634373664856,
-0.024742191657423973,
0.368247389793396,
0.9808244705200195,
-0.4228251874446869,
0.025873983278870583,
-0.33309921622276306,
0.09986910969018936,
0.0644591748714447,
-0.28072643280029297,
0.2652125358581543,
0.055321287363767624,
-0.8045629858970642,
-0.14474213123321533,
0.24122583866119385,
0.7120208144187927,
-0.4147625267505646,
-0.17331352829933167,
-0.3045017421245575,
0.023782745003700256,
0.5115848779678345,
0.19210503995418549,
-0.6377736330032349,
0.012004990130662918,
-0.24739409983158112,
-0.16094079613685608,
0.06995593011379242,
0.3502354919910431,
-0.6238588094711304,
0.4068509042263031,
0.49405422806739807,
0.2326468676328659,
0.7618775963783264,
-0.0004958907957188785,
0.16391289234161377,
-0.5819770097732544,
0.43220680952072144,
0.14706192910671234,
0.3129660487174988,
0.368066668510437,
-0.5211396813392639,
0.354837566614151,
0.6005179286003113,
-0.7523964047431946,
-0.6498939990997314,
0.19747264683246613,
-0.9870441555976868,
-0.33999931812286377,
1.2106707096099854,
-0.3045188784599304,
-0.3755165934562683,
0.12265477329492569,
-0.3706047236919403,
0.21179531514644623,
-0.3245560824871063,
0.5616071820259094,
0.5444349646568298,
-0.024774806573987007,
-0.5051424503326416,
-0.5052720904350281,
0.5818690061569214,
0.1288374811410904,
-0.6500517725944519,
-0.2600940465927124,
0.649111270904541,
0.6948394775390625,
0.2652937173843384,
0.9531570076942444,
-0.34412747621536255,
0.25362521409988403,
0.03503795713186264,
0.09673993289470673,
0.16537690162658691,
-0.1630883514881134,
-0.40378856658935547,
0.008033878169953823,
-0.02325197495520115,
-0.021858051419258118
] |
tiiuae/falcon-7b-instruct | tiiuae | "2023-09-29T14:32:23Z" | 7,034,797 | 755 | transformers | [
"transformers",
"pytorch",
"coreml",
"falcon",
"text-generation",
"custom_code",
"en",
"dataset:tiiuae/falcon-refinedweb",
"arxiv:2205.14135",
"arxiv:1911.02150",
"arxiv:2005.14165",
"arxiv:2104.09864",
"arxiv:2306.01116",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text-generation | "2023-04-25T06:21:01Z" | ---
datasets:
- tiiuae/falcon-refinedweb
language:
- en
inference: true
widget:
- text: "Hey Falcon! Any recommendations for my holidays in Abu Dhabi?"
example_title: "Abu Dhabi Trip"
- text: "What's the Everett interpretation of quantum mechanics?"
example_title: "Q/A: Quantum & Answers"
- text: "Give me a list of the top 10 dive sites you would recommend around the world."
example_title: "Diving Top 10"
- text: "Can you tell me more about deep-water soloing?"
example_title: "Extreme sports"
- text: "Can you write a short tweet about the Apache 2.0 release of our latest AI model, Falcon LLM?"
example_title: "Twitter Helper"
- text: "What are the responsabilities of a Chief Llama Officer?"
example_title: "Trendy Jobs"
license: apache-2.0
---
# ✨ Falcon-7B-Instruct
**Falcon-7B-Instruct is a 7B parameters causal decoder-only model built by [TII](https://www.tii.ae) based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) and finetuned on a mixture of chat/instruct datasets. It is made available under the Apache 2.0 license.**
*Paper coming soon 😊.*
🤗 To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost fron HF](https://huggingface.co/blog/falcon)!
## Why use Falcon-7B-Instruct?
* **You are looking for a ready-to-use chat/instruct model based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).**
* **Falcon-7B is a strong base model, outperforming comparable open-source models** (e.g., [MPT-7B](https://huggingface.co/mosaicml/mpt-7b), [StableLM](https://github.com/Stability-AI/StableLM), [RedPajama](https://huggingface.co/togethercomputer/RedPajama-INCITE-Base-7B-v0.1) etc.), thanks to being trained on 1,500B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
* **It features an architecture optimized for inference**, with FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135)) and multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)).
💬 **This is an instruct model, which may not be ideal for further finetuning.** If you are interested in building your own instruct/chat model, we recommend starting from [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
🔥 **Looking for an even more powerful model?** [Falcon-40B-Instruct](https://huggingface.co/tiiuae/falcon-40b-instruct) is Falcon-7B-Instruct's big brother!
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "tiiuae/falcon-7b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
sequences = pipeline(
"Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
max_length=200,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
```
💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
For fast inference with Falcon, check-out [Text Generation Inference](https://github.com/huggingface/text-generation-inference)! Read more in this [blogpost]((https://huggingface.co/blog/falcon).
You will need **at least 16GB of memory** to swiftly run inference with Falcon-7B-Instruct.
# Model Card for Falcon-7B-Instruct
## Model Details
### Model Description
- **Developed by:** [https://www.tii.ae](https://www.tii.ae);
- **Model type:** Causal decoder-only;
- **Language(s) (NLP):** English and French;
- **License:** Apache 2.0;
- **Finetuned from model:** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
### Model Source
- **Paper:** *coming soon*.
## Uses
### Direct Use
Falcon-7B-Instruct has been finetuned on a mixture of instruct and chat datasets.
### Out-of-Scope Use
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
## Bias, Risks, and Limitations
Falcon-7B-Instruct is mostly trained on English data, and will not generalize appropriately to other languages. Furthermore, as it is trained on a large-scale corpora representative of the web, it will carry the stereotypes and biases commonly encountered online.
### Recommendations
We recommend users of Falcon-7B-Instruct to develop guardrails and to take appropriate precautions for any production use.
## How to Get Started with the Model
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "tiiuae/falcon-7b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
sequences = pipeline(
"Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
max_length=200,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
```
## Training Details
### Training Data
Falcon-7B-Instruct was finetuned on a 250M tokens mixture of instruct/chat datasets.
| **Data source** | **Fraction** | **Tokens** | **Description** |
|--------------------|--------------|------------|-----------------------------------|
| [Bai ze](https://github.com/project-baize/baize-chatbot) | 65% | 164M | chat |
| [GPT4All](https://github.com/nomic-ai/gpt4all) | 25% | 62M | instruct |
| [GPTeacher](https://github.com/teknium1/GPTeacher) | 5% | 11M | instruct |
| [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 5% | 13M | massive web crawl |
The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
## Evaluation
*Paper coming soon.*
See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
Note that this model variant is not optimized for NLP benchmarks.
## Technical Specifications
For more information about pretraining, see [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
### Model Architecture and Objective
Falcon-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
* **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
* **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
* **Decoder-block:** parallel attention/MLP with a single layer norm.
| **Hyperparameter** | **Value** | **Comment** |
|--------------------|-----------|----------------------------------------|
| Layers | 32 | |
| `d_model` | 4544 | Increased to compensate for multiquery |
| `head_dim` | 64 | Reduced to optimise for FlashAttention |
| Vocabulary | 65024 | |
| Sequence length | 2048 | |
### Compute Infrastructure
#### Hardware
Falcon-7B-Instruct was trained on AWS SageMaker, on 32 A100 40GB GPUs in P4d instances.
#### Software
Falcon-7B-Instruct was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
## Citation
*Paper coming soon* 😊. In the meanwhile, you can use the following information to cite:
```
@article{falcon40b,
title={{Falcon-40B}: an open large language model with state-of-the-art performance},
author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Debbah, Merouane and Goffinet, Etienne and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
year={2023}
}
```
To learn more about the pretraining dataset, see the 📓 [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
```
@article{refinedweb,
title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
journal={arXiv preprint arXiv:2306.01116},
eprint={2306.01116},
eprinttype = {arXiv},
url={https://arxiv.org/abs/2306.01116},
year={2023}
}
```
## License
Falcon-7B-Instruct is made available under the Apache 2.0 license.
## Contact
[email protected] | [
-0.4791226387023926,
-0.9742989540100098,
0.07581397891044617,
0.3736799955368042,
-0.09798933565616608,
-0.09743838012218475,
-0.12375251948833466,
-0.4656293988227844,
0.22187945246696472,
0.38349342346191406,
-0.4570043385028839,
-0.4862375855445862,
-0.7623247504234314,
0.07478653639554977,
-0.3976084589958191,
0.9917904138565063,
0.24890245497226715,
-0.15208137035369873,
0.19361527264118195,
0.04455365240573883,
-0.2893708050251007,
-0.5462205410003662,
-0.9722766280174255,
-0.01673564314842224,
0.39229798316955566,
0.23697441816329956,
0.5994933247566223,
0.9022983312606812,
0.6789300441741943,
0.4041733741760254,
-0.2548501193523407,
0.24593645334243774,
-0.5797081589698792,
-0.19534732401371002,
-0.01563122309744358,
-0.28156623244285583,
-0.2709285318851471,
-0.031716279685497284,
0.7560684680938721,
0.4833224415779114,
0.017111998051404953,
0.23835697770118713,
-0.027343017980456352,
0.49834558367729187,
-0.6208656430244446,
0.5632240176200867,
-0.5689239501953125,
-0.11303457617759705,
-0.2483447641134262,
0.1405286341905594,
-0.521977424621582,
0.09070727229118347,
-0.2941846251487732,
-0.8163937926292419,
0.2312006950378418,
0.25578799843788147,
1.2385375499725342,
0.33924049139022827,
-0.3847196698188782,
-0.2640414535999298,
-0.4197089672088623,
0.6923670172691345,
-0.8816365599632263,
0.41890189051628113,
0.1824050098657608,
0.38786178827285767,
-0.41254922747612,
-1.0905096530914307,
-0.5348072052001953,
-0.18280592560768127,
-0.0467776283621788,
0.32311269640922546,
-0.13794852793216705,
0.1133904904127121,
0.46968913078308105,
0.17565850913524628,
-0.41082367300987244,
0.007570257876068354,
-0.5061741471290588,
-0.20318791270256042,
0.5838600397109985,
-0.010902606882154942,
0.24436452984809875,
-0.31618934869766235,
-0.33840852975845337,
-0.30341923236846924,
-0.3691859543323517,
0.24589796364307404,
0.3984220623970032,
0.37496933341026306,
-0.2894006073474884,
0.4797876477241516,
-0.29794803261756897,
0.5783532857894897,
0.4769142270088196,
-0.07283182442188263,
0.4066564738750458,
-0.3384993076324463,
-0.4350029528141022,
0.037221357226371765,
1.1861212253570557,
0.19714093208312988,
0.08289286494255066,
-0.11634624004364014,
0.023159917443990707,
0.038445815443992615,
0.116346076130867,
-0.9797240495681763,
0.1482943892478943,
0.23157386481761932,
-0.5400562286376953,
-0.3181527853012085,
0.361644446849823,
-0.7060829997062683,
-0.07064247876405716,
0.12221694737672806,
0.19864776730537415,
-0.5013691782951355,
-0.3985420763492584,
0.2559528648853302,
-0.15957079827785492,
0.19324538111686707,
-0.05726167559623718,
-0.8167992234230042,
0.1906953752040863,
0.6347992420196533,
0.8915867805480957,
0.14030876755714417,
-0.652424156665802,
-0.7534929513931274,
0.04798642173409462,
-0.26944947242736816,
0.5776218771934509,
-0.4907957911491394,
-0.32169991731643677,
-0.10100856423377991,
0.31795987486839294,
-0.37290382385253906,
-0.1609693169593811,
0.8445910811424255,
-0.37414032220840454,
0.2784695029258728,
-0.3530197739601135,
-0.6476054191589355,
-0.4091474413871765,
-0.030086960643529892,
-0.5723875164985657,
0.9737703204154968,
-0.048211559653282166,
-1.1112818717956543,
0.20552988350391388,
-0.9008302688598633,
-0.27728891372680664,
-0.21624313294887543,
-0.006923086475580931,
-0.45196452736854553,
-0.15728554129600525,
0.46281492710113525,
0.6512830853462219,
-0.3595045804977417,
0.5094112157821655,
-0.6647232174873352,
-0.5990865230560303,
-0.00870757456868887,
-0.2338898628950119,
0.8931814432144165,
0.5505729913711548,
-0.5686182975769043,
0.14982207119464874,
-0.5747275352478027,
-0.24567990005016327,
0.21004921197891235,
0.00358894863165915,
0.16537357866764069,
-0.01730785332620144,
0.03631060943007469,
0.2844748795032501,
0.06437674909830093,
-0.5855914950370789,
0.061598654836416245,
-0.6261122822761536,
0.5978968739509583,
0.3952637314796448,
-0.023196712136268616,
0.37217381596565247,
-0.5096625089645386,
0.369052916765213,
0.4864192605018616,
0.34802424907684326,
-0.2573573589324951,
-0.6158042550086975,
-0.9982035756111145,
-0.2991396188735962,
0.11958305537700653,
0.4058208167552948,
-0.7257083058357239,
0.47049182653427124,
-0.14748069643974304,
-0.6526671051979065,
-0.4712817072868347,
-0.22381281852722168,
0.507759153842926,
0.6694357395172119,
0.5050296187400818,
0.1431432068347931,
-0.6607061624526978,
-0.8058900237083435,
-0.07828798145055771,
-0.2782052457332611,
0.29275089502334595,
0.1400536596775055,
0.5906726121902466,
-0.3363931179046631,
0.640678346157074,
-0.2760351002216339,
-0.25533920526504517,
-0.24273060262203217,
0.07044544070959091,
0.3494139015674591,
0.5422021150588989,
0.7906010150909424,
-0.5248478055000305,
-0.30269676446914673,
-0.06474560499191284,
-0.9505164623260498,
-0.06922215968370438,
-0.19713561236858368,
-0.3545756936073303,
0.46165183186531067,
0.6003187298774719,
-0.7897222638130188,
0.3731275796890259,
0.3227510154247284,
-0.35230565071105957,
0.37262433767318726,
0.021555738523602486,
0.19852149486541748,
-1.3035260438919067,
0.21532493829727173,
0.15554308891296387,
0.1050303503870964,
-0.4782165288925171,
0.19666409492492676,
-0.0029475351329892874,
-0.03138619288802147,
-0.6472097635269165,
0.8036901950836182,
-0.5394214987754822,
-0.0007911014836281538,
-0.09613607823848724,
-0.08297920972108841,
-0.15967904031276703,
0.6746368408203125,
0.07909619808197021,
0.8331799507141113,
0.5993710160255432,
-0.40561652183532715,
0.027479171752929688,
0.39340832829475403,
-0.02770915813744068,
0.1150231584906578,
-0.8484750390052795,
0.025052515789866447,
-0.11445415019989014,
0.39010757207870483,
-0.8742283582687378,
-0.2664223909378052,
0.5371308922767639,
-0.7108829617500305,
0.3222786784172058,
-0.2448015809059143,
-0.41205137968063354,
-0.5657882690429688,
-0.21977141499519348,
0.025284046307206154,
0.5137258172035217,
-0.5652590394020081,
0.4765077531337738,
0.2701980173587799,
0.11232303828001022,
-0.9800251126289368,
-0.6260793209075928,
0.04959339275956154,
-0.2954360544681549,
-0.8337092995643616,
0.29475608468055725,
-0.017200829461216927,
0.06709501147270203,
-0.06287273019552231,
0.1591908037662506,
0.0886615589261055,
0.057717982679605484,
0.5693848133087158,
0.18766823410987854,
-0.2954106628894806,
-0.07558292150497437,
0.1351502388715744,
-0.10577452927827835,
0.0699252337217331,
-0.30421918630599976,
0.48905104398727417,
-0.6323695182800293,
-0.2877484858036041,
-0.45749467611312866,
0.36675170063972473,
0.5576791763305664,
-0.2133428454399109,
0.8731106519699097,
1.062168002128601,
-0.33337315917015076,
0.09170028567314148,
-0.6694048047065735,
-0.11823729425668716,
-0.5187512040138245,
0.44741302728652954,
-0.4727991819381714,
-0.8815748691558838,
0.7005268335342407,
0.23832793533802032,
0.05544451251626015,
0.8909474015235901,
0.4813876152038574,
0.12005031853914261,
1.1233489513397217,
0.3328739404678345,
-0.13919217884540558,
0.47408708930015564,
-0.5351265072822571,
0.014687216840684414,
-0.7612114548683167,
-0.23535539209842682,
-0.6945018768310547,
-0.08494940400123596,
-0.6723790168762207,
-0.20141322910785675,
-0.0058803800493478775,
0.33436158299446106,
-0.897514283657074,
0.2552523910999298,
-0.6330965161323547,
0.20653563737869263,
0.6098042726516724,
-0.006869141478091478,
-0.013199679553508759,
-0.0560944639146328,
-0.19614200294017792,
0.2549970746040344,
-0.9038546085357666,
-0.5631895065307617,
1.0732632875442505,
0.3900173008441925,
0.637485682964325,
-0.06421500444412231,
0.866253674030304,
-0.024810565635561943,
0.3120519816875458,
-0.4989173710346222,
0.5150933861732483,
-0.12577617168426514,
-0.5241600871086121,
-0.10781742632389069,
-0.5447684526443481,
-1.010068655014038,
0.10824079066514969,
-0.1653638631105423,
-0.8400943875312805,
0.051153674721717834,
-0.055183541029691696,
-0.10009238123893738,
0.30654406547546387,
-1.0223722457885742,
0.9613980054855347,
-0.012942937202751637,
-0.33649641275405884,
0.16657236218452454,
-0.7667452096939087,
0.5912696719169617,
0.043365806341171265,
0.23022612929344177,
0.028191637247800827,
0.08581150323152542,
0.969071626663208,
-0.5910082459449768,
0.8541119694709778,
-0.3748779594898224,
0.46978655457496643,
0.4960813820362091,
-0.2778409719467163,
0.6580562591552734,
0.14086440205574036,
-0.2243548035621643,
0.38201797008514404,
0.28663018345832825,
-0.3954031765460968,
-0.48229607939720154,
0.8546715974807739,
-1.2284127473831177,
-0.6374679803848267,
-0.5738512277603149,
-0.5012425780296326,
-0.10141327977180481,
0.32943567633628845,
0.4093018174171448,
0.34958767890930176,
0.06126024201512337,
0.3658480644226074,
0.18666434288024902,
-0.3529664874076843,
0.730768620967865,
0.3577173054218292,
-0.25084665417671204,
-0.5049223303794861,
0.7521999478340149,
0.0719146579504013,
0.016346579417586327,
0.34481868147850037,
0.2430444210767746,
-0.6837507486343384,
-0.47509095072746277,
-0.5166001915931702,
0.46568647027015686,
-0.662591814994812,
-0.3114869296550751,
-0.959893524646759,
-0.585000216960907,
-0.6228674650192261,
-0.10732060670852661,
-0.3748108148574829,
-0.254202276468277,
-0.6231134533882141,
-0.003275438444688916,
0.4565287232398987,
0.5434795022010803,
0.0321793258190155,
0.503524899482727,
-0.8740786910057068,
0.11536652594804764,
-0.12892350554466248,
0.18869301676750183,
0.11441294848918915,
-0.6727906465530396,
-0.23831185698509216,
0.4837316572666168,
-0.39092299342155457,
-0.6699762344360352,
0.49880072474479675,
0.2634862959384918,
0.7235558032989502,
0.4104156792163849,
0.1466602236032486,
0.7835859060287476,
-0.1805458664894104,
0.8135291934013367,
0.24630151689052582,
-0.9084392786026001,
0.34506362676620483,
-0.5250746011734009,
0.25710365176200867,
0.33411526679992676,
0.38407689332962036,
-0.4205006957054138,
-0.5308616757392883,
-0.9295160174369812,
-0.46834442019462585,
0.9275507926940918,
0.40501996874809265,
-0.060211338102817535,
-0.30078554153442383,
0.41164031624794006,
-0.1673051416873932,
-0.004375799093395472,
-0.48361364006996155,
-0.20962361991405487,
-0.7338947057723999,
-0.39162588119506836,
-0.17154285311698914,
-0.04564227536320686,
0.24475045502185822,
-0.26492053270339966,
0.8321449160575867,
-0.1501099020242691,
0.6989377737045288,
0.17649537324905396,
-0.19499434530735016,
0.13726241886615753,
-0.09079383313655853,
0.7044156193733215,
0.39179137349128723,
-0.27237051725387573,
-0.04783014580607414,
0.06124284118413925,
-0.6366992592811584,
0.04543669894337654,
0.404308021068573,
-0.1789364516735077,
-0.13776667416095734,
0.41565683484077454,
1.0668102502822876,
0.13114362955093384,
-0.3637574017047882,
0.43685346841812134,
-0.11201179772615433,
-0.29109323024749756,
-0.0655246451497078,
0.2714560329914093,
0.2703225016593933,
0.3573437035083771,
0.22648747265338898,
-0.09593769907951355,
0.12877604365348816,
-0.2366873323917389,
0.177137091755867,
0.20008523762226105,
-0.2650570869445801,
-0.2152518779039383,
1.0502686500549316,
0.19166520237922668,
-0.2307131290435791,
0.5458574891090393,
-0.35877788066864014,
-0.413659930229187,
0.8941132426261902,
0.6693363189697266,
0.8964322805404663,
0.07823129743337631,
0.2883521318435669,
0.7019664645195007,
0.25202611088752747,
-0.21116921305656433,
0.2162580043077469,
0.2528361976146698,
-0.6604620218276978,
-0.4538100063800812,
-0.726058304309845,
-0.23989441990852356,
0.11626935750246048,
-0.512786328792572,
0.38969871401786804,
-0.4727975130081177,
-0.2585700452327728,
0.2479710578918457,
0.33365750312805176,
-0.6882758140563965,
0.16376399993896484,
-0.12001832574605942,
0.9207481145858765,
-0.5271156430244446,
0.849436342716217,
0.6987189650535583,
-0.8289008140563965,
-1.1249165534973145,
-0.2609378695487976,
-0.08534010499715805,
-0.8750472068786621,
0.7271813154220581,
0.39311790466308594,
0.033045701682567596,
0.27191299200057983,
-0.49979323148727417,
-0.867361843585968,
1.0399261713027954,
0.4137965142726898,
-0.5465549826622009,
-0.06296044588088989,
0.1964138299226761,
0.4447101950645447,
-0.40268006920814514,
0.8080430030822754,
0.3505696952342987,
0.4802089035511017,
0.4076523780822754,
-0.7834957242012024,
0.21770399808883667,
-0.5652304291725159,
0.07308363914489746,
0.10159821808338165,
-1.0087742805480957,
0.8655200600624084,
-0.23400209844112396,
-0.161116823554039,
-0.038437675684690475,
0.8641517162322998,
0.3371666669845581,
0.2210073471069336,
0.37080928683280945,
0.4820407032966614,
0.6457984447479248,
-0.1232852041721344,
0.9833028316497803,
-0.5930337309837341,
0.6054855585098267,
0.9390094876289368,
0.027368351817131042,
0.7250935435295105,
0.248751699924469,
-0.0005926421727053821,
0.23085781931877136,
0.8937272429466248,
-0.034206654876470566,
0.23478172719478607,
-0.11115553975105286,
0.16753436625003815,
-0.13980109989643097,
-0.03003743290901184,
-0.6423763036727905,
0.4870482087135315,
0.2680091857910156,
-0.32988953590393066,
-0.1549992710351944,
-0.04257217049598694,
0.38869309425354004,
-0.3363746404647827,
-0.07030650973320007,
0.5557919144630432,
0.033313848078250885,
-0.7912722826004028,
0.9916313290596008,
0.14700639247894287,
0.8009076714515686,
-0.5987415313720703,
0.11474145203828812,
-0.4517313838005066,
0.21644122898578644,
-0.164370596408844,
-0.6148195862770081,
0.4453457295894623,
-0.06703595817089081,
-0.027841975912451744,
0.047066930681467056,
0.6866179704666138,
-0.2958807349205017,
-0.7294137477874756,
0.2417420744895935,
0.27093741297721863,
0.24357430636882782,
-0.23782196640968323,
-0.8800088763237,
0.3867073357105255,
-0.13710682094097137,
-0.3539961576461792,
0.21271644532680511,
0.2693895101547241,
-0.057912878692150116,
0.7585176825523376,
0.768477737903595,
-0.13204282522201538,
0.1972951591014862,
-0.0014733244897797704,
0.7716505527496338,
-0.7653498649597168,
-0.47328898310661316,
-0.6760322451591492,
0.44809892773628235,
-0.1758909374475479,
-0.4021435081958771,
0.7499887943267822,
0.6334932446479797,
0.7779541015625,
-0.058537762612104416,
0.6812543272972107,
-0.12178658694028854,
0.2869766056537628,
-0.46946632862091064,
0.8029983043670654,
-0.5190510749816895,
0.08036495000123978,
-0.3975840210914612,
-0.7284594178199768,
-0.20364253222942352,
0.6124482750892639,
-0.1783367544412613,
0.24410392343997955,
0.7885551452636719,
1.0678778886795044,
-0.11399715393781662,
0.3013818562030792,
0.17721232771873474,
0.41000398993492126,
0.5197625756263733,
0.7464944124221802,
0.7665907740592957,
-0.7804822325706482,
0.6841150522232056,
-0.27451053261756897,
-0.16684553027153015,
-0.28094807267189026,
-0.8262455463409424,
-1.2077586650848389,
-0.6902133822441101,
-0.2785462737083435,
-0.41582557559013367,
0.14383268356323242,
0.8768073320388794,
0.7815925478935242,
-0.6137462258338928,
-0.25491902232170105,
-0.23155814409255981,
0.041968923062086105,
-0.28297728300094604,
-0.2140289843082428,
0.5248470306396484,
-0.5839937925338745,
-0.762354850769043,
0.14535373449325562,
0.03624807298183441,
0.10093977302312851,
-0.06286241114139557,
-0.25175315141677856,
-0.4286894202232361,
0.026865273714065552,
0.5793079733848572,
0.31869077682495117,
-0.8260331153869629,
-0.39859193563461304,
0.2543211877346039,
-0.14141425490379333,
-0.008799996227025986,
0.24516746401786804,
-0.5367055535316467,
0.2797452211380005,
0.4318273961544037,
0.7161484360694885,
0.8849437832832336,
-0.07941858470439911,
0.2340865284204483,
-0.2526669204235077,
0.41158148646354675,
-0.14360687136650085,
0.48098063468933105,
0.16347819566726685,
-0.3932773768901825,
0.5781253576278687,
0.42434754967689514,
-0.5388669371604919,
-0.7298958897590637,
-0.23870526254177094,
-1.266945242881775,
-0.11432643979787827,
1.3344208002090454,
-0.2177465409040451,
-0.44954705238342285,
0.13042818009853363,
-0.4504254460334778,
0.5515527129173279,
-0.6246204376220703,
0.6055871844291687,
0.5754192471504211,
0.06721912324428558,
-0.17937104403972626,
-0.33694490790367126,
0.3696838617324829,
0.07690117508172989,
-0.9712778925895691,
-0.23792913556098938,
0.3607828915119171,
0.30018776655197144,
-0.08271871507167816,
0.5488094091415405,
0.08488015085458755,
0.11524461209774017,
0.2568938136100769,
-0.043866999447345734,
-0.6134434938430786,
-0.25320491194725037,
0.03092142939567566,
0.18656359612941742,
-0.2843515872955322,
-0.41554781794548035
] |
cl-tohoku/bert-base-japanese | cl-tohoku | "2021-09-23T13:45:36Z" | 7,006,975 | 16 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"bert",
"fill-mask",
"ja",
"dataset:wikipedia",
"license:cc-by-sa-4.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:05Z" | ---
language: ja
license: cc-by-sa-4.0
datasets:
- wikipedia
widget:
- text: 東北大学で[MASK]の研究をしています。
---
# BERT base Japanese (IPA dictionary)
This is a [BERT](https://github.com/google-research/bert) model pretrained on texts in the Japanese language.
This version of the model processes input texts with word-level tokenization based on the IPA dictionary, followed by the WordPiece subword tokenization.
The codes for the pretraining are available at [cl-tohoku/bert-japanese](https://github.com/cl-tohoku/bert-japanese/tree/v1.0).
## Model architecture
The model architecture is the same as the original BERT base model; 12 layers, 768 dimensions of hidden states, and 12 attention heads.
## Training Data
The model is trained on Japanese Wikipedia as of September 1, 2019.
To generate the training corpus, [WikiExtractor](https://github.com/attardi/wikiextractor) is used to extract plain texts from a dump file of Wikipedia articles.
The text files used for the training are 2.6GB in size, consisting of approximately 17M sentences.
## Tokenization
The texts are first tokenized by [MeCab](https://taku910.github.io/mecab/) morphological parser with the IPA dictionary and then split into subwords by the WordPiece algorithm.
The vocabulary size is 32000.
## Training
The model is trained with the same configuration as the original BERT; 512 tokens per instance, 256 instances per batch, and 1M training steps.
## Licenses
The pretrained models are distributed under the terms of the [Creative Commons Attribution-ShareAlike 3.0](https://creativecommons.org/licenses/by-sa/3.0/).
## Acknowledgments
For training models, we used Cloud TPUs provided by [TensorFlow Research Cloud](https://www.tensorflow.org/tfrc/) program.
| [
-0.48709484934806824,
-0.7303788065910339,
0.3274160325527191,
0.24097615480422974,
-0.6851524114608765,
-0.23972973227500916,
-0.22710870206356049,
-0.5099837779998779,
0.46850067377090454,
0.45562049746513367,
-0.7149782776832581,
-0.45628342032432556,
-0.6342303156852722,
-0.003771996358409524,
-0.1929694414138794,
1.2074122428894043,
-0.028168831020593643,
0.2721918821334839,
0.17101992666721344,
0.18245987594127655,
-0.3386439383029938,
-0.39924356341362,
-0.6659901738166809,
-0.4533661901950836,
0.4897197484970093,
0.2695697247982025,
0.5692404508590698,
0.58358234167099,
0.43470829725265503,
0.22552122175693512,
-0.02335883490741253,
-0.25221267342567444,
-0.567225456237793,
-0.3125031590461731,
-0.09563800692558289,
-0.41666755080223083,
-0.22826597094535828,
-0.11829957365989685,
0.5757972002029419,
0.680313229560852,
0.08777856081724167,
0.1166873425245285,
-0.18161877989768982,
0.3067816495895386,
-0.5763896107673645,
0.21736717224121094,
-0.6942707300186157,
0.03324589505791664,
-0.32301899790763855,
0.25012752413749695,
-0.32240575551986694,
-0.17426790297031403,
0.35172346234321594,
-0.8239992260932922,
0.27181461453437805,
-0.16014985740184784,
1.3093382120132446,
0.13960187137126923,
-0.06538882106542587,
-0.3192211091518402,
-0.33996301889419556,
0.6794828772544861,
-0.7068299055099487,
0.46105027198791504,
0.6495085954666138,
0.010356312617659569,
0.007127902004867792,
-1.0019956827163696,
-0.7232598662376404,
-0.18086792528629303,
0.11200647801160812,
0.16537103056907654,
0.003865838050842285,
0.10446884483098984,
0.28891316056251526,
0.33036860823631287,
-0.615229070186615,
0.2844690680503845,
-0.5165478587150574,
-0.15548160672187805,
0.4548586905002594,
-0.07881654798984528,
0.5145910978317261,
-0.4832274317741394,
-0.41387903690338135,
-0.47325029969215393,
-0.5586394667625427,
0.05704817548394203,
0.26654884219169617,
0.16973313689231873,
-0.2873707115650177,
0.6793243885040283,
0.127762109041214,
0.4338575005531311,
-0.0537346750497818,
-0.3313485383987427,
0.4663056433200836,
-0.28995975852012634,
-0.21941281855106354,
0.1507014036178589,
0.9403279423713684,
0.1604580134153366,
0.3333785831928253,
-0.12218780070543289,
-0.17206674814224243,
-0.09368560463190079,
0.5473771691322327,
-0.7862077355384827,
-0.2527206838130951,
0.07565337419509888,
-0.6845955848693848,
-0.27792835235595703,
-0.12226489931344986,
-0.3025842308998108,
0.08705763518810272,
-0.007552924565970898,
0.784858226776123,
-1.0749051570892334,
-0.3202069103717804,
-0.05022738501429558,
-0.46684297919273376,
0.3562508225440979,
0.06292062252759933,
-1.0747272968292236,
0.12254209071397781,
0.5897846817970276,
0.8097294569015503,
0.11956088989973068,
-0.5436539053916931,
0.38139259815216064,
0.25637879967689514,
-0.5097110867500305,
0.44669342041015625,
-0.233082115650177,
-0.6694179773330688,
-0.12510502338409424,
-0.019410545006394386,
-0.05248555168509483,
-0.20914316177368164,
0.5507286787033081,
-0.4599437117576599,
0.21544265747070312,
-0.25357088446617126,
-0.7948217391967773,
-0.14758749306201935,
0.24256066977977753,
-0.6416491866111755,
1.086348533630371,
0.16325993835926056,
-0.8757617473602295,
0.4491031765937805,
-0.9398031830787659,
-0.533210039138794,
0.3889523446559906,
0.05817629396915436,
-0.3005015552043915,
0.135709747672081,
0.24083693325519562,
0.3286444842815399,
0.13647183775901794,
0.20787373185157776,
-0.24406775832176208,
-0.4352537989616394,
-0.07795745879411697,
-0.1824566274881363,
1.2473034858703613,
0.26995110511779785,
-0.29013779759407043,
-0.07540266960859299,
-0.870356023311615,
0.0331144779920578,
0.2051694393157959,
-0.5023676156997681,
-0.6304942965507507,
-0.10593680292367935,
0.18426409363746643,
-0.08429919183254242,
0.6892232894897461,
-0.8386375308036804,
0.23661185801029205,
-0.5661951899528503,
0.3593742549419403,
0.6096957325935364,
0.005679638125002384,
0.20452968776226044,
-0.09968210011720657,
0.08968334645032883,
-0.02980652265250683,
0.27833518385887146,
-0.3980104625225067,
-0.6755024790763855,
-0.8658683896064758,
-0.3251342177391052,
0.4823419451713562,
0.39545559883117676,
-0.7834339141845703,
0.9832411408424377,
-0.5973191857337952,
-0.810558557510376,
-0.8443590998649597,
-0.09182458370923996,
0.3544557988643646,
0.5002654194831848,
0.29041263461112976,
-0.4413277506828308,
-0.5582192540168762,
-0.9959085583686829,
0.20630930364131927,
-0.3517415523529053,
-0.15169836580753326,
0.02141529507935047,
0.7277314066886902,
-0.3896876573562622,
0.9123554825782776,
-0.252254843711853,
-0.21708859503269196,
-0.3363070487976074,
0.44713565707206726,
0.3374272882938385,
0.6127652525901794,
0.6377319693565369,
-0.6630260348320007,
-0.5051265358924866,
-0.16798366606235504,
-0.6069861054420471,
0.06642145663499832,
0.04842488840222359,
-0.17195945978164673,
0.05686933174729347,
0.32126519083976746,
-0.7016156315803528,
0.26153111457824707,
0.4873213768005371,
-0.12947341799736023,
0.37561050057411194,
-0.2513996660709381,
-0.2944600582122803,
-1.4651248455047607,
0.4050883650779724,
-0.20620660483837128,
-0.02682192251086235,
-0.47883081436157227,
0.3742646276950836,
0.1572159230709076,
-0.2655230164527893,
-0.39571303129196167,
0.5585575699806213,
-0.3380237817764282,
-0.017959514632821083,
-0.25379177927970886,
-0.23488324880599976,
-0.13385049998760223,
0.750784158706665,
0.2893468141555786,
0.8788493871688843,
0.41949227452278137,
-0.6082810163497925,
0.21533823013305664,
0.43629518151283264,
-0.7034471035003662,
0.0314745232462883,
-0.9014462232589722,
0.10261969268321991,
-0.10178861767053604,
0.14610542356967926,
-1.0268813371658325,
-0.2863580286502838,
0.2548189163208008,
-0.6183426380157471,
0.39573416113853455,
0.042913202196359634,
-0.7581466436386108,
-0.4849739372730255,
-0.4933583736419678,
0.04980736970901489,
0.6787965893745422,
-0.5472835302352905,
0.523551881313324,
0.49513769149780273,
-0.2628850042819977,
-0.7914593815803528,
-0.8274884223937988,
0.062804214656353,
0.24501408636569977,
-0.42487359046936035,
0.5453121066093445,
-0.10576589405536652,
0.1270744949579239,
0.2635355591773987,
0.09244668483734131,
-0.33510273694992065,
0.07460074126720428,
0.26456353068351746,
0.34791839122772217,
-0.12480884790420532,
0.1571003645658493,
0.25726738572120667,
0.13415385782718658,
-0.009454537183046341,
0.025404268875718117,
1.0545841455459595,
0.028269801288843155,
-0.0796109214425087,
-0.43655431270599365,
0.14813992381095886,
0.4580153822898865,
0.046364925801754,
0.9279103875160217,
0.813839852809906,
-0.4130932092666626,
0.10093282908201218,
-0.49209457635879517,
-0.027797212824225426,
-0.45905986428260803,
0.5985668897628784,
-0.587100625038147,
-0.5887798070907593,
0.5255017876625061,
0.30082982778549194,
0.34070587158203125,
0.6952992081642151,
0.5947457551956177,
-0.34014955163002014,
0.9186311364173889,
0.7162219285964966,
-0.565548300743103,
0.6672418713569641,
-0.3712199032306671,
-0.01790481247007847,
-0.7545918226242065,
-0.3236623704433441,
-0.43834951519966125,
-0.30382323265075684,
-0.4991852939128876,
-0.09267228096723557,
0.27036887407302856,
0.08605080097913742,
-0.46281254291534424,
0.45551079511642456,
-0.33954697847366333,
0.44804325699806213,
0.8473226428031921,
0.21604560315608978,
-0.14510297775268555,
0.25840461254119873,
-0.3448322117328644,
-0.10359233617782593,
-0.6542677283287048,
-0.3648253381252289,
1.2063205242156982,
0.5947949886322021,
0.6452187895774841,
-0.11667067557573318,
0.8085309863090515,
0.08085256814956665,
0.20748817920684814,
-0.8636141419410706,
0.5147395133972168,
-0.4470330774784088,
-1.0569391250610352,
-0.4172391891479492,
-0.1977786123752594,
-1.0220797061920166,
0.07832605391740799,
-0.24157005548477173,
-0.5693637728691101,
-0.16888055205345154,
-0.23367568850517273,
0.05079639330506325,
0.34995564818382263,
-0.7842361927032471,
0.8341176509857178,
-0.3063536584377289,
0.2030569612979889,
-0.2639877200126648,
-0.7962703108787537,
0.30477190017700195,
-0.21909485757350922,
-0.028818216174840927,
0.09757272899150848,
-0.06608278304338455,
1.0525051355361938,
-0.6021290421485901,
1.0171658992767334,
-0.3550390601158142,
-0.08395091444253922,
0.13574138283729553,
-0.35877445340156555,
0.1606031060218811,
-0.17653417587280273,
0.20964299142360687,
0.6568410992622375,
-0.06347350031137466,
-0.33166971802711487,
-0.010397383011877537,
0.5193696618080139,
-1.4412169456481934,
-0.1956029087305069,
-0.2117404192686081,
-0.3819596767425537,
-0.07124349474906921,
0.739285945892334,
0.8220071196556091,
0.15028700232505798,
-0.31776249408721924,
0.37917381525039673,
0.7568262815475464,
-0.3323560357093811,
0.45556968450546265,
0.4863622486591339,
-0.13395768404006958,
-0.45400986075401306,
0.8914168477058411,
0.24836266040802002,
-0.1207900121808052,
0.5534235835075378,
0.006427541840821505,
-0.33283281326293945,
-0.5327971577644348,
-0.4706408381462097,
0.4309622347354889,
-0.5286843776702881,
0.056806281208992004,
-0.6000698208808899,
-0.5436493158340454,
-0.6053121089935303,
0.12353181093931198,
-0.449672669172287,
-0.32417529821395874,
-0.33527499437332153,
-0.06206700950860977,
0.15857455134391785,
0.6581328511238098,
0.036906298249959946,
0.6609635949134827,
-0.8095312714576721,
0.3860653042793274,
0.20678694546222687,
0.4430720806121826,
0.008511964231729507,
-0.5309284329414368,
-0.4090076684951782,
0.1169050931930542,
-0.21879583597183228,
-0.7319543957710266,
0.3626005947589874,
0.08779726922512054,
0.6498444080352783,
0.5448001623153687,
-0.2243172526359558,
0.8249168992042542,
-0.7563955187797546,
1.12076997756958,
0.44884273409843445,
-0.9691988229751587,
0.5995327830314636,
-0.3162592053413391,
0.3837698698043823,
0.6440834999084473,
0.8058834075927734,
-0.43899813294410706,
-0.3587459921836853,
-0.8207824230194092,
-0.9066755771636963,
0.7797344923019409,
0.01042194478213787,
0.43098658323287964,
-0.13738782703876495,
0.41888269782066345,
0.2050440013408661,
0.07428990304470062,
-0.9822540283203125,
-0.31707337498664856,
-0.5993960499763489,
-0.4469311237335205,
-0.12492727488279343,
-0.4530372619628906,
0.09309647977352142,
-0.3117663860321045,
0.8742101788520813,
0.17261196672916412,
0.4976227581501007,
0.03269602358341217,
-0.2875576615333557,
-0.03746911138296127,
-0.07040876895189285,
0.4409456253051758,
0.5364006757736206,
-0.4098089933395386,
-0.3147464990615845,
0.07938754558563232,
-0.969057559967041,
-0.19807206094264984,
0.07702139019966125,
-0.315306693315506,
0.49728989601135254,
0.5387449860572815,
1.182350754737854,
0.31106430292129517,
-0.6478628516197205,
0.554147481918335,
-0.03988738730549812,
-0.3690638542175293,
-0.561812698841095,
0.17817243933677673,
0.0842248722910881,
-0.07257253676652908,
0.4962652325630188,
-0.3856301009654999,
-0.019128654152154922,
-0.4310886561870575,
-0.040841396898031235,
0.3531107008457184,
-0.06574422121047974,
-0.25801241397857666,
0.49905893206596375,
0.15836553275585175,
-0.12307118624448776,
0.9199367761611938,
0.06875752657651901,
-0.48008084297180176,
0.5482496023178101,
0.6142843961715698,
0.760503351688385,
-0.03547101467847824,
-0.006678702775388956,
0.5849834084510803,
0.3991260230541229,
0.014611007645726204,
0.32504594326019287,
-0.18614299595355988,
-1.0357015132904053,
-0.3917427361011505,
-0.7523220181465149,
-0.5053491592407227,
0.73801589012146,
-0.7434197068214417,
0.26360705494880676,
-0.7345772981643677,
-0.24895484745502472,
0.11534632742404938,
0.2405344396829605,
-0.47865721583366394,
0.4092687964439392,
0.313284695148468,
1.2347968816757202,
-0.7081538438796997,
1.2523537874221802,
0.8990064263343811,
-0.6271070837974548,
-0.9650817513465881,
-0.02710726298391819,
-0.5403792262077332,
-1.1961225271224976,
0.7251606583595276,
0.1199793890118599,
0.30864959955215454,
0.08472852408885956,
-0.7832568287849426,
-0.8851474523544312,
0.8936675190925598,
0.13958145678043365,
-0.5123260617256165,
-0.3977675139904022,
0.024937305599451065,
0.6506502628326416,
-0.05151686444878578,
0.04840400815010071,
0.3150516152381897,
0.24267199635505676,
-0.034776896238327026,
-1.0057997703552246,
-0.4807351529598236,
-0.5248704552650452,
0.38674798607826233,
0.07736475765705109,
-0.4888688623905182,
0.9717894792556763,
0.1512344926595688,
0.007192468270659447,
0.2742229402065277,
0.5693153142929077,
0.36428046226501465,
-0.1816948652267456,
0.5576130747795105,
0.949038028717041,
0.5823131203651428,
-0.03494047001004219,
1.007031798362732,
-0.5155757665634155,
0.33447137475013733,
0.9150320887565613,
0.04234522953629494,
1.011022686958313,
0.5096556544303894,
-0.12685875594615936,
0.7052226662635803,
0.8075439929962158,
-0.30359968543052673,
0.856526255607605,
-0.167937234044075,
-0.010194470174610615,
0.11897291988134384,
0.05454634875059128,
-0.5261081457138062,
0.4360729455947876,
0.5501266717910767,
-0.5497577786445618,
-0.16069260239601135,
0.14688940346240997,
0.05489303171634674,
-0.5225385427474976,
-0.5729883313179016,
0.9109089970588684,
-0.13716872036457062,
-0.7050050497055054,
0.5447908043861389,
0.2507716119289398,
0.8990007042884827,
-1.1304466724395752,
0.230680450797081,
-0.08178046345710754,
0.10999534279108047,
0.15260322391986847,
-0.9140780568122864,
0.07121752202510834,
0.2428314983844757,
-0.2421807050704956,
-0.13837870955467224,
0.7482075691223145,
-0.26439982652664185,
-0.4482201337814331,
0.16452015936374664,
0.18747347593307495,
0.4818117916584015,
0.3470320403575897,
-0.8257419466972351,
0.10708562284708023,
0.08460884541273117,
-0.4122910797595978,
0.2805909812450409,
0.31717318296432495,
0.06745659559965134,
0.4307212233543396,
0.6605281233787537,
0.2712177038192749,
0.20747482776641846,
0.21781708300113678,
0.7889752984046936,
-0.4767106771469116,
-0.8045448660850525,
-0.714897632598877,
0.330576628446579,
-0.13458605110645294,
-0.5149891376495361,
0.578793466091156,
0.5372564196586609,
1.1749883890151978,
-0.4456365406513214,
0.9014953970909119,
-0.34821587800979614,
0.6104239225387573,
-0.4445555508136749,
0.8817448616027832,
-0.7248591184616089,
-0.27417051792144775,
-0.20678217709064484,
-0.8458492755889893,
0.03424559533596039,
1.0647366046905518,
0.003934420645236969,
0.05031530186533928,
0.3706974387168884,
0.40795591473579407,
-0.004458189941942692,
-0.047160882502794266,
0.18512505292892456,
0.3153877556324005,
0.14162304997444153,
0.4307733476161957,
0.49826014041900635,
-0.48116829991340637,
0.44234970211982727,
-0.4771007001399994,
-0.07659558951854706,
-0.17244377732276917,
-0.6103506088256836,
-0.9439889192581177,
-0.6176866888999939,
0.01781361736357212,
-0.10882247984409332,
-0.018159078434109688,
0.9594472646713257,
0.7284489274024963,
-0.7304992079734802,
-0.2981615960597992,
-0.20102007687091827,
-0.37440958619117737,
0.15342622995376587,
-0.23922860622406006,
0.3613279163837433,
-0.5305088758468628,
-0.9148024916648865,
0.2108716368675232,
-0.06815429776906967,
0.1928626298904419,
-0.19575192034244537,
-0.08379750698804855,
-0.27182504534721375,
-0.13672760128974915,
0.5048741102218628,
0.20247742533683777,
-0.5889024138450623,
-0.30193382501602173,
-0.13751456141471863,
-0.30092403292655945,
-0.10643164813518524,
0.3937615156173706,
-0.4535268247127533,
0.4951551556587219,
0.43412554264068604,
0.6808884739875793,
0.8439992070198059,
-0.264170378446579,
0.43282443284988403,
-1.0833592414855957,
0.3619440495967865,
0.04849673807621002,
0.6081421971321106,
0.19005854427814484,
-0.10792352259159088,
0.5178327560424805,
0.29238027334213257,
-0.1982237994670868,
-0.7748783230781555,
-0.11102830618619919,
-1.0066858530044556,
-0.6037613153457642,
0.7863921523094177,
-0.27944275736808777,
-0.43764713406562805,
0.13027238845825195,
-0.24199217557907104,
0.5852070450782776,
-0.15270984172821045,
0.8023519515991211,
1.0472949743270874,
0.18291828036308289,
-0.16789855062961578,
-0.07999934256076813,
0.24766942858695984,
0.2546989619731903,
-0.5102400779724121,
-0.46639132499694824,
0.18899503350257874,
0.675869882106781,
0.5841653943061829,
0.7605518698692322,
-0.11390163004398346,
0.28645721077919006,
0.1503712385892868,
0.5012966990470886,
0.007059761323034763,
-0.2722027003765106,
-0.1509535163640976,
-0.007591837551444769,
-0.05236443132162094,
-0.4682510197162628
] |
roberta-large | null | "2023-03-22T09:25:01Z" | 6,875,857 | 136 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"onnx",
"safetensors",
"roberta",
"fill-mask",
"exbert",
"en",
"dataset:bookcorpus",
"dataset:wikipedia",
"arxiv:1907.11692",
"arxiv:1806.02847",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: mit
datasets:
- bookcorpus
- wikipedia
---
# RoBERTa large model
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
[this paper](https://arxiv.org/abs/1907.11692) and first released in
[this repository](https://github.com/pytorch/fairseq/tree/master/examples/roberta). This model is case-sensitive: it
makes a difference between english and English.
Disclaimer: The team releasing RoBERTa did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
RoBERTa is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means
it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model
randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict
the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one
after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to
learn a bidirectional representation of the sentence.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
classifier using the features produced by the BERT model as inputs.
## Intended uses & limitations
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task.
See the [model hub](https://huggingface.co/models?filter=roberta) to look for fine-tuned versions on a task that
interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='roberta-large')
>>> unmasker("Hello I'm a <mask> model.")
[{'sequence': "<s>Hello I'm a male model.</s>",
'score': 0.3317350447177887,
'token': 2943,
'token_str': 'Ġmale'},
{'sequence': "<s>Hello I'm a fashion model.</s>",
'score': 0.14171843230724335,
'token': 2734,
'token_str': 'Ġfashion'},
{'sequence': "<s>Hello I'm a professional model.</s>",
'score': 0.04291723668575287,
'token': 2038,
'token_str': 'Ġprofessional'},
{'sequence': "<s>Hello I'm a freelance model.</s>",
'score': 0.02134818211197853,
'token': 18150,
'token_str': 'Ġfreelance'},
{'sequence': "<s>Hello I'm a young model.</s>",
'score': 0.021098261699080467,
'token': 664,
'token_str': 'Ġyoung'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import RobertaTokenizer, RobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
model = RobertaModel.from_pretrained('roberta-large')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import RobertaTokenizer, TFRobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-large')
model = TFRobertaModel.from_pretrained('roberta-large')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
The training data used for this model contains a lot of unfiltered content from the internet, which is far from
neutral. Therefore, the model can have biased predictions:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='roberta-large')
>>> unmasker("The man worked as a <mask>.")
[{'sequence': '<s>The man worked as a mechanic.</s>',
'score': 0.08260300755500793,
'token': 25682,
'token_str': 'Ġmechanic'},
{'sequence': '<s>The man worked as a driver.</s>',
'score': 0.05736079439520836,
'token': 1393,
'token_str': 'Ġdriver'},
{'sequence': '<s>The man worked as a teacher.</s>',
'score': 0.04709019884467125,
'token': 3254,
'token_str': 'Ġteacher'},
{'sequence': '<s>The man worked as a bartender.</s>',
'score': 0.04641604796051979,
'token': 33080,
'token_str': 'Ġbartender'},
{'sequence': '<s>The man worked as a waiter.</s>',
'score': 0.04239227622747421,
'token': 38233,
'token_str': 'Ġwaiter'}]
>>> unmasker("The woman worked as a <mask>.")
[{'sequence': '<s>The woman worked as a nurse.</s>',
'score': 0.2667474150657654,
'token': 9008,
'token_str': 'Ġnurse'},
{'sequence': '<s>The woman worked as a waitress.</s>',
'score': 0.12280137836933136,
'token': 35698,
'token_str': 'Ġwaitress'},
{'sequence': '<s>The woman worked as a teacher.</s>',
'score': 0.09747499972581863,
'token': 3254,
'token_str': 'Ġteacher'},
{'sequence': '<s>The woman worked as a secretary.</s>',
'score': 0.05783602222800255,
'token': 2971,
'token_str': 'Ġsecretary'},
{'sequence': '<s>The woman worked as a cleaner.</s>',
'score': 0.05576248839497566,
'token': 16126,
'token_str': 'Ġcleaner'}]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
The RoBERTa model was pretrained on the reunion of five datasets:
- [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038 unpublished books;
- [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and headers) ;
- [CC-News](https://commoncrawl.org/2016/10/news-dataset-available/), a dataset containing 63 millions English news
articles crawled between September 2016 and February 2019.
- [OpenWebText](https://github.com/jcpeterson/openwebtext), an opensource recreation of the WebText dataset used to
train GPT-2,
- [Stories](https://arxiv.org/abs/1806.02847) a dataset containing a subset of CommonCrawl data filtered to match the
story-like style of Winograd schemas.
Together theses datasets weight 160GB of text.
## Training procedure
### Preprocessing
The texts are tokenized using a byte version of Byte-Pair Encoding (BPE) and a vocabulary size of 50,000. The inputs of
the model take pieces of 512 contiguous token that may span over documents. The beginning of a new document is marked
with `<s>` and the end of one by `</s>`
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `<mask>`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
Contrary to BERT, the masking is done dynamically during pretraining (e.g., it changes at each epoch and is not fixed).
### Pretraining
The model was trained on 1024 V100 GPUs for 500K steps with a batch size of 8K and a sequence length of 512. The
optimizer used is Adam with a learning rate of 4e-4, \\(\beta_{1} = 0.9\\), \\(\beta_{2} = 0.98\\) and
\\(\epsilon = 1e-6\\), a weight decay of 0.01, learning rate warmup for 30,000 steps and linear decay of the learning
rate after.
## Evaluation results
When fine-tuned on downstream tasks, this model achieves the following results:
Glue test results:
| Task | MNLI | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE |
|:----:|:----:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|
| | 90.2 | 92.2 | 94.7 | 96.4 | 68.0 | 96.4 | 90.9 | 86.6 |
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1907-11692,
author = {Yinhan Liu and
Myle Ott and
Naman Goyal and
Jingfei Du and
Mandar Joshi and
Danqi Chen and
Omer Levy and
Mike Lewis and
Luke Zettlemoyer and
Veselin Stoyanov},
title = {RoBERTa: {A} Robustly Optimized {BERT} Pretraining Approach},
journal = {CoRR},
volume = {abs/1907.11692},
year = {2019},
url = {http://arxiv.org/abs/1907.11692},
archivePrefix = {arXiv},
eprint = {1907.11692},
timestamp = {Thu, 01 Aug 2019 08:59:33 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1907-11692.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
<a href="https://huggingface.co/exbert/?model=roberta-base">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.17982277274131775,
-0.7766240239143372,
0.24953117966651917,
-0.003307288745418191,
-0.3167768120765686,
-0.07523341476917267,
-0.3935757875442505,
-0.3610670268535614,
0.25057652592658997,
0.4453185498714447,
-0.5581656694412231,
-0.5485971570014954,
-0.8755766749382019,
0.0864848867058754,
-0.43140533566474915,
1.3021634817123413,
0.13564817607402802,
0.26633375883102417,
0.0019578177016228437,
0.21598468720912933,
-0.2803886830806732,
-0.5273123979568481,
-0.6467963457107544,
-0.32765993475914,
0.25872647762298584,
-0.02672923170030117,
0.46831244230270386,
0.48934265971183777,
0.3448220193386078,
0.366422563791275,
-0.2880459427833557,
0.004689630586653948,
-0.3694474995136261,
0.03464898094534874,
-0.09735483676195145,
-0.4835549592971802,
-0.288642555475235,
0.2699888050556183,
0.42229798436164856,
0.5843462944030762,
-0.05411352962255478,
0.3502107262611389,
0.20010694861412048,
0.4721243977546692,
-0.0939793735742569,
0.283022403717041,
-0.5762394070625305,
0.018973030149936676,
-0.31210091710090637,
0.1831430196762085,
-0.34254464507102966,
-0.21498224139213562,
0.19133563339710236,
-0.43186166882514954,
0.38776153326034546,
-0.045888956636190414,
1.3419591188430786,
0.16970910131931305,
-0.2608102262020111,
-0.32592251896858215,
-0.5319671630859375,
0.9519996643066406,
-0.8457238674163818,
0.18155330419540405,
0.42270782589912415,
0.13669385015964508,
-0.15805108845233917,
-0.9030919075012207,
-0.5934744477272034,
-0.13637575507164001,
-0.15653261542320251,
0.14736245572566986,
-0.3272612690925598,
-0.17792245745658875,
0.28517526388168335,
0.43590909242630005,
-0.6543333530426025,
-0.0813046544790268,
-0.6035303473472595,
-0.25626063346862793,
0.5143066644668579,
-0.01675429195165634,
0.25106585025787354,
-0.4503856599330902,
-0.4380461871623993,
-0.2516515254974365,
-0.31326398253440857,
0.18879012763500214,
0.5332257151603699,
0.3488530218601227,
-0.2164350152015686,
0.5583251118659973,
-0.08874858170747757,
0.7217097878456116,
0.04082997143268585,
-0.2617262303829193,
0.5325853228569031,
-0.2283983677625656,
-0.24955350160598755,
-0.18958812952041626,
0.9968459606170654,
0.2529205083847046,
0.4499606192111969,
-0.024647269397974014,
-0.21116571128368378,
0.1945103108882904,
0.1069931909441948,
-0.7087697386741638,
-0.27714669704437256,
0.25031745433807373,
-0.4669187068939209,
-0.47527632117271423,
0.18094240128993988,
-0.797916829586029,
-0.049362000077962875,
-0.1756158471107483,
0.5363390445709229,
-0.39352667331695557,
-0.14476123452186584,
0.15170873701572418,
-0.3200124204158783,
0.12105622887611389,
0.08472366631031036,
-0.785319983959198,
0.05733879283070564,
0.47062209248542786,
0.8818721175193787,
0.11806394159793854,
-0.20923082530498505,
-0.2428130954504013,
-0.09268279373645782,
-0.03441471606492996,
0.44202712178230286,
-0.33608031272888184,
-0.033928707242012024,
-0.06894215941429138,
0.2664411962032318,
-0.18912677466869354,
-0.27882373332977295,
0.5041189789772034,
-0.3389587700366974,
0.7305033802986145,
0.21265481412410736,
-0.453008234500885,
-0.26454493403434753,
0.17067916691303253,
-0.6081136465072632,
1.1842979192733765,
0.25298699736595154,
-0.8642260432243347,
0.25339317321777344,
-0.7397721409797668,
-0.42931219935417175,
-0.1912323236465454,
0.13333548605442047,
-0.6399702429771423,
-0.08191652595996857,
0.3639522194862366,
0.4963441789150238,
-0.38612091541290283,
0.4756353497505188,
0.012593708001077175,
-0.31040510535240173,
0.35617080330848694,
-0.4684971570968628,
1.406845211982727,
0.17704492807388306,
-0.550562858581543,
0.03905956447124481,
-0.7561460137367249,
-0.04637053236365318,
0.38870969414711,
-0.4976974427700043,
-0.06997131556272507,
-0.2169596552848816,
0.2338743805885315,
0.29018735885620117,
0.24652837216854095,
-0.5446062088012695,
0.2136652022600174,
-0.5023320317268372,
0.7470938563346863,
0.7533943057060242,
-0.12442027777433395,
0.2440820187330246,
-0.4298919141292572,
0.5399467349052429,
-0.0493757501244545,
0.16632923483848572,
-0.2641174793243408,
-0.7021368145942688,
-0.6675161123275757,
-0.47888612747192383,
0.6419458985328674,
0.6564969420433044,
-0.6336290836334229,
0.5634397268295288,
-0.17592492699623108,
-0.5451793670654297,
-0.8222055435180664,
-0.03635341674089432,
0.5270327925682068,
0.5529264211654663,
0.44111284613609314,
-0.4116729199886322,
-0.6729218363761902,
-0.7187175154685974,
-0.3465993404388428,
0.07804670929908752,
-0.33622825145721436,
0.2728736102581024,
0.6275336146354675,
-0.22793442010879517,
0.7190134525299072,
-0.587195098400116,
-0.6278128027915955,
-0.3358069956302643,
0.07455486059188843,
0.5991331338882446,
0.7215930819511414,
0.47966352105140686,
-0.598436176776886,
-0.4847540557384491,
-0.3048137128353119,
-0.720481812953949,
0.15201067924499512,
-0.045357510447502136,
-0.04193587228655815,
0.3908860385417938,
0.4185551702976227,
-0.8143049478530884,
0.47708311676979065,
0.48749810457229614,
-0.35269057750701904,
0.600508451461792,
-0.26753154397010803,
-0.0661962702870369,
-1.3270982503890991,
0.17625807225704193,
0.04309281334280968,
-0.2987862825393677,
-0.7088514566421509,
0.05058494582772255,
-0.2181282937526703,
-0.19564148783683777,
-0.47933417558670044,
0.5213066935539246,
-0.6014388203620911,
0.05141294375061989,
0.08802826702594757,
0.19824472069740295,
0.06906234472990036,
0.7212563753128052,
0.003677352098748088,
0.6684681177139282,
0.5949228405952454,
-0.3244587481021881,
0.2419074922800064,
0.32206499576568604,
-0.560154139995575,
0.23732386529445648,
-0.7290611267089844,
0.23520216345787048,
-0.10081510245800018,
0.16954047977924347,
-1.0398550033569336,
-0.21343660354614258,
0.2821516990661621,
-0.7554225921630859,
0.35189124941825867,
-0.32278215885162354,
-0.5489116311073303,
-0.6398852467536926,
-0.22141030430793762,
0.15221914649009705,
0.6653106212615967,
-0.4348984360694885,
0.621158242225647,
0.3888864815235138,
-0.06056679040193558,
-0.6948930621147156,
-0.7845244407653809,
0.09190884232521057,
-0.23463276028633118,
-0.6830938458442688,
0.4497385025024414,
0.08047231286764145,
-0.08726248890161514,
-0.07642750442028046,
0.07153382152318954,
-0.17929191887378693,
0.07364360988140106,
0.2115299105644226,
0.40621820092201233,
-0.1231827586889267,
-0.10539714246988297,
-0.22917740046977997,
-0.19149434566497803,
0.09312602132558823,
-0.49158260226249695,
0.8929700255393982,
-0.11361855268478394,
-0.03166584298014641,
-0.5230692625045776,
0.1689334362745285,
0.44862309098243713,
-0.2935161590576172,
0.8238954544067383,
1.0445586442947388,
-0.3585983216762543,
0.014734936878085136,
-0.4025469422340393,
-0.2807978093624115,
-0.45495885610580444,
0.5164010524749756,
-0.32760924100875854,
-0.8199038505554199,
0.5967210531234741,
0.2796843647956848,
-0.21284696459770203,
0.7255562543869019,
0.5354793667793274,
-0.13335807621479034,
0.9610779285430908,
0.39933863282203674,
-0.16409353911876678,
0.5363456010818481,
-0.5512247681617737,
0.21030758321285248,
-0.7885803580284119,
-0.34979555010795593,
-0.5388409495353699,
-0.23508252203464508,
-0.6216701865196228,
-0.40810999274253845,
0.3029559552669525,
0.11376332491636276,
-0.28113967180252075,
0.49810710549354553,
-0.752337634563446,
0.3498828709125519,
0.8778270483016968,
0.35395413637161255,
0.018491415306925774,
0.046366993337869644,
-0.16435782611370087,
-0.04408979043364525,
-0.6037856936454773,
-0.45783963799476624,
1.2643202543258667,
0.493470162153244,
0.5548400282859802,
0.07939463108778,
0.6322410106658936,
0.2311103641986847,
0.011468428187072277,
-0.47041669487953186,
0.45091357827186584,
-0.32224565744400024,
-0.8864217400550842,
-0.3605637848377228,
-0.3098786175251007,
-1.0490812063217163,
0.22789785265922546,
-0.31748852133750916,
-0.8545739650726318,
-0.03259962797164917,
-0.09009184688329697,
-0.12593963742256165,
0.3880343437194824,
-0.6615082621574402,
0.9629489183425903,
-0.1619717925786972,
-0.3671168386936188,
-0.0014327064855024219,
-0.8728281855583191,
0.3348531723022461,
0.08467545360326767,
0.15942515432834625,
0.06307784467935562,
0.3703048527240753,
1.0368015766143799,
-0.5001426935195923,
1.0315402746200562,
-0.26864975690841675,
0.04095560312271118,
0.24115577340126038,
-0.10879626125097275,
0.5322261452674866,
-0.13668079674243927,
0.025191843509674072,
0.5322651863098145,
-0.08987009525299072,
-0.4507691264152527,
-0.2786709666252136,
0.43225976824760437,
-0.8983063101768494,
-0.627137303352356,
-0.6646347641944885,
-0.604053258895874,
0.2491639405488968,
0.4060882329940796,
0.5429737567901611,
0.5456573963165283,
0.09514361619949341,
0.14097604155540466,
0.4578811824321747,
-0.24911928176879883,
0.5406034588813782,
0.2959449887275696,
-0.14315778017044067,
-0.44861239194869995,
0.7323715090751648,
0.08151349425315857,
0.19479019939899445,
0.29269689321517944,
0.15950246155261993,
-0.41244781017303467,
-0.45087340474128723,
-0.39332684874534607,
0.3161470890045166,
-0.5676497220993042,
-0.28434062004089355,
-0.7288947701454163,
-0.39846867322921753,
-0.5653716325759888,
-0.0657304897904396,
-0.17032736539840698,
-0.49805325269699097,
-0.5499899387359619,
0.013404219411313534,
0.4233158528804779,
0.7557277679443359,
-0.04786812886595726,
0.27753767371177673,
-0.5159487128257751,
0.16012850403785706,
0.22728462517261505,
0.14201128482818604,
-0.07583355158567429,
-0.9317586421966553,
-0.26490408182144165,
0.1503448486328125,
-0.27058494091033936,
-0.7830761671066284,
0.7192983627319336,
0.06808041781187057,
0.4312193989753723,
0.39656829833984375,
-0.12120471149682999,
0.5857113599777222,
-0.3770420551300049,
0.9826584458351135,
0.18529421091079712,
-0.9785755276679993,
0.5257682204246521,
-0.4417467415332794,
0.16778643429279327,
0.24731853604316711,
0.3122689127922058,
-0.4755372703075409,
-0.5440417528152466,
-0.8620527982711792,
-1.0286040306091309,
0.9194770455360413,
0.28123342990875244,
0.16727344691753387,
0.04457380622625351,
0.20786458253860474,
-0.03116757981479168,
0.32073941826820374,
-1.1200506687164307,
-0.38977596163749695,
-0.3937666416168213,
-0.387255996465683,
-0.20805223286151886,
-0.16466839611530304,
-0.11698681861162186,
-0.4480600953102112,
0.8141739368438721,
0.12109534442424774,
0.5857816338539124,
0.23296763002872467,
-0.341113805770874,
0.19513413310050964,
0.19230322539806366,
0.7217469215393066,
0.5190701484680176,
-0.384947806596756,
0.14342595636844635,
0.1337117850780487,
-0.7021496295928955,
0.010502442717552185,
0.28108280897140503,
-0.25641971826553345,
0.1398240476846695,
0.49608567357063293,
0.8942907452583313,
0.10544522851705551,
-0.5525736808776855,
0.7268452644348145,
0.09974473714828491,
-0.29634132981300354,
-0.4981319308280945,
0.06415174156427383,
0.0657925233244896,
0.31401556730270386,
0.4507492780685425,
0.13980625569820404,
-0.1725608855485916,
-0.5673613548278809,
0.22983910143375397,
0.41480788588523865,
-0.39490553736686707,
-0.2339438498020172,
0.9582425951957703,
-0.11259426921606064,
-0.5386606454849243,
0.6976067423820496,
-0.32165977358818054,
-0.822589635848999,
0.7290530204772949,
0.742906391620636,
0.8112778067588806,
-0.19817601144313812,
0.2812197506427765,
0.576833188533783,
0.4155701994895935,
-0.0670403465628624,
0.07959520816802979,
0.17732499539852142,
-0.6370155215263367,
-0.3449428975582123,
-0.7451894283294678,
0.13885222375392914,
0.34254419803619385,
-0.6693922281265259,
0.18999482691287994,
-0.4209577143192291,
-0.2410464584827423,
0.06079000607132912,
0.12697021663188934,
-0.80879145860672,
0.22332675755023956,
-0.12670621275901794,
0.8043121695518494,
-1.0950877666473389,
0.9202619791030884,
0.6062403321266174,
-0.7590801119804382,
-0.8574368357658386,
-0.04102399945259094,
-0.12215360254049301,
-1.0052670240402222,
0.8220223784446716,
0.2670115828514099,
0.31392207741737366,
0.05954434350132942,
-0.49567458033561707,
-0.8883655071258545,
1.193028450012207,
0.1921849101781845,
-0.4921700954437256,
-0.19931860268115997,
0.16986677050590515,
0.6239579319953918,
-0.45210355520248413,
0.6370559930801392,
0.4835090637207031,
0.39358752965927124,
-0.15098868310451508,
-0.8821889162063599,
0.17436926066875458,
-0.2763749361038208,
0.07512661814689636,
0.048611294478178024,
-0.6414493322372437,
1.2862915992736816,
-0.1541220098733902,
-0.03576001897454262,
0.08360319584608078,
0.421826034784317,
-0.005783858243376017,
0.12229587137699127,
0.4368629455566406,
0.724958062171936,
0.8387624025344849,
-0.299123615026474,
1.0297119617462158,
-0.3641066253185272,
0.6721156239509583,
0.8565430641174316,
0.20716935396194458,
0.7784364819526672,
0.3301827013492584,
-0.4197191298007965,
0.7545350193977356,
0.5863869786262512,
-0.34247899055480957,
0.5415238738059998,
0.1837415248155594,
-0.09777243435382843,
-0.011808967217803001,
0.080292709171772,
-0.3046360909938812,
0.5206233263015747,
0.021745974197983742,
-0.5726625323295593,
-0.05039538815617561,
0.12234198302030563,
0.36971184611320496,
-0.05999381095170975,
-0.178129181265831,
0.6844914555549622,
-0.033281706273555756,
-0.655689537525177,
0.6894287467002869,
0.1668519228696823,
0.817936897277832,
-0.4947432577610016,
0.09369980543851852,
-0.1796312779188156,
0.2260512113571167,
-0.10106104612350464,
-0.7695956826210022,
0.08318047970533371,
0.0576530396938324,
-0.37087899446487427,
-0.2281247079372406,
0.6363458037376404,
-0.6427395939826965,
-0.5594958662986755,
0.19961430132389069,
0.26796185970306396,
0.43172794580459595,
-0.058212120085954666,
-0.8521575331687927,
-0.1078062504529953,
0.3306942880153656,
-0.25545281171798706,
0.2936014235019684,
0.27473464608192444,
0.1421816200017929,
0.5874885320663452,
0.849261999130249,
0.09945060312747955,
0.05100434646010399,
-0.0020620382856577635,
0.8460924625396729,
-0.6866447925567627,
-0.5492631196975708,
-0.8574486374855042,
0.6812905669212341,
-0.08075594156980515,
-0.41177502274513245,
0.7659183740615845,
0.6500480771064758,
0.8974506855010986,
-0.3195085823535919,
0.696552574634552,
-0.14820268750190735,
0.5629023313522339,
-0.6384578943252563,
0.8570711612701416,
-0.5062850117683411,
0.1441574990749359,
-0.3787587285041809,
-0.8682360649108887,
-0.1949661523103714,
0.9125298857688904,
-0.2481316328048706,
0.20618639886379242,
0.6458523273468018,
0.8792218565940857,
-0.06044374406337738,
-0.25610092282295227,
0.04214513301849365,
0.4039056897163391,
0.23023879528045654,
0.6718745827674866,
0.5269676446914673,
-0.7703575491905212,
0.6278808116912842,
-0.2066369652748108,
-0.16149082779884338,
-0.2761315405368805,
-0.7802057862281799,
-1.1254901885986328,
-0.7388967871665955,
-0.26216116547584534,
-0.722152590751648,
0.04878288879990578,
0.8574082255363464,
0.6866624355316162,
-0.8147474527359009,
-0.16504913568496704,
-0.10143321752548218,
0.10747146606445312,
-0.2971670627593994,
-0.3371109068393707,
0.5705167055130005,
-0.2501295506954193,
-0.8826265931129456,
0.13027286529541016,
-0.139452263712883,
0.18945680558681488,
-0.208149716258049,
-0.015270131640136242,
-0.426919549703598,
-0.04044342413544655,
0.446812242269516,
0.1017051413655281,
-0.7504419088363647,
-0.3117934465408325,
0.00760030560195446,
-0.08177483826875687,
0.14385317265987396,
0.42532700300216675,
-0.651440441608429,
0.307620108127594,
0.22809073328971863,
0.3485930263996124,
0.9364068508148193,
-0.023762967437505722,
0.2908709943294525,
-0.8389495611190796,
0.29824191331863403,
0.12292163074016571,
0.36400309205055237,
0.367767870426178,
-0.4047686755657196,
0.5314794778823853,
0.46803370118141174,
-0.6104944944381714,
-0.912394106388092,
-0.07607676833868027,
-0.9356180429458618,
-0.3535051941871643,
1.0726077556610107,
-0.23107542097568512,
-0.3727336525917053,
-0.07617858797311783,
-0.20239798724651337,
0.43679097294807434,
-0.3923395276069641,
0.8513990640640259,
0.6957043409347534,
0.13590501248836517,
-0.08253512531518936,
-0.5649018287658691,
0.5258508920669556,
0.3997657597064972,
-0.4631681442260742,
-0.20034447312355042,
0.18174131214618683,
0.6836497187614441,
0.304672509431839,
0.6126388311386108,
-0.0768500491976738,
-0.0050519658252596855,
0.07861216366291046,
0.29657748341560364,
-0.14890024065971375,
-0.17571768164634705,
-0.4022361934185028,
0.14360107481479645,
-0.2357315570116043,
-0.34715962409973145
] |
cardiffnlp/twitter-roberta-base-irony | cardiffnlp | "2023-08-02T00:36:09Z" | 6,796,271 | 14 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"roberta",
"text-classification",
"en",
"dataset:tweet_eval",
"arxiv:2010.12421",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:05Z" | ---
datasets:
- tweet_eval
language:
- en
---
# Twitter-roBERTa-base for Irony Detection
This is a roBERTa-base model trained on ~58M tweets and finetuned for irony detection with the TweetEval benchmark.
This model has integrated into the [TweetNLP Python library](https://github.com/cardiffnlp/tweetnlp/).
- Paper: [_TweetEval_ benchmark (Findings of EMNLP 2020)](https://arxiv.org/pdf/2010.12421.pdf).
- Git Repo: [Tweeteval official repository](https://github.com/cardiffnlp/tweeteval).
## Example of classification
```python
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer
import numpy as np
from scipy.special import softmax
import csv
import urllib.request
# Preprocess text (username and link placeholders)
def preprocess(text):
new_text = [
]
for t in text.split(" "):
t = '@user' if t.startswith('@') and len(t) > 1 else t
t = 'http' if t.startswith('http') else t
new_text.append(t)
return " ".join(new_text)
# Tasks:
# emoji, emotion, hate, irony, offensive, sentiment
# stance/abortion, stance/atheism, stance/climate, stance/feminist, stance/hillary
task='irony'
MODEL = f"cardiffnlp/twitter-roberta-base-{task}"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
# download label mapping
labels=[]
mapping_link = f"https://raw.githubusercontent.com/cardiffnlp/tweeteval/main/datasets/{task}/mapping.txt"
with urllib.request.urlopen(mapping_link) as f:
html = f.read().decode('utf-8').split("\n")
csvreader = csv.reader(html, delimiter='\t')
labels = [row[1] for row in csvreader if len(row) > 1]
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
model.save_pretrained(MODEL)
text = "Great, it broke the first day..."
text = preprocess(text)
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = softmax(scores)
# # TF
# model = TFAutoModelForSequenceClassification.from_pretrained(MODEL)
# model.save_pretrained(MODEL)
# text = "Great, it broke the first day..."
# encoded_input = tokenizer(text, return_tensors='tf')
# output = model(encoded_input)
# scores = output[0][0].numpy()
# scores = softmax(scores)
ranking = np.argsort(scores)
ranking = ranking[::-1]
for i in range(scores.shape[0]):
l = labels[ranking[i]]
s = scores[ranking[i]]
print(f"{i+1}) {l} {np.round(float(s), 4)}")
```
Output:
```
1) irony 0.914
2) non_irony 0.086
```
### Reference
Please cite the [reference paper](https://aclanthology.org/2020.findings-emnlp.148/) if you use this model.
```bibtex
@inproceedings{barbieri-etal-2020-tweeteval,
title = "{T}weet{E}val: Unified Benchmark and Comparative Evaluation for Tweet Classification",
author = "Barbieri, Francesco and
Camacho-Collados, Jose and
Espinosa Anke, Luis and
Neves, Leonardo",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.findings-emnlp.148",
doi = "10.18653/v1/2020.findings-emnlp.148",
pages = "1644--1650"
}
``` | [
0.033425141125917435,
-0.6753321886062622,
0.2983172833919525,
0.3764384984970093,
-0.10266564041376114,
0.0074552567675709724,
-0.31367364525794983,
-0.27630677819252014,
0.2132779061794281,
0.05215977504849434,
-0.2954155504703522,
-0.780415415763855,
-0.6136558055877686,
0.21437259018421173,
-0.3876762390136719,
0.9097901582717896,
0.17353658378124237,
-0.09591986238956451,
0.13084913790225983,
-0.19617994129657745,
0.08269376307725906,
-0.3952448070049286,
-0.8136337399482727,
-0.1639348864555359,
0.45683491230010986,
0.3394770622253418,
0.40360596776008606,
0.40358638763427734,
0.30626362562179565,
0.4968295395374298,
-0.06760566681623459,
-0.10693995654582977,
-0.36783984303474426,
0.16021029651165009,
-0.024984123185276985,
-0.42826157808303833,
-0.5278558731079102,
0.18868979811668396,
0.504331648349762,
0.4705401062965393,
0.08341847360134125,
0.3805520832538605,
-0.07834812998771667,
0.4216962456703186,
-0.5886852741241455,
0.06262877583503723,
-0.4057804048061371,
-0.01159802358597517,
-0.18382787704467773,
-0.19049949944019318,
-0.46056875586509705,
-0.6685571670532227,
-0.002859804080799222,
-0.4764215350151062,
0.10178453475236893,
0.007777958642691374,
1.0724307298660278,
0.3308738172054291,
-0.1394212245941162,
-0.1888059377670288,
-0.3012498915195465,
1.113971471786499,
-0.8751952052116394,
0.07545363903045654,
0.13097615540027618,
0.1368919163942337,
0.04517076537013054,
-0.6332153081893921,
-0.5862399339675903,
-0.16754983365535736,
0.14418566226959229,
0.210067480802536,
-0.46497464179992676,
-0.13918614387512207,
0.32847973704338074,
0.18035627901554108,
-0.6009520292282104,
-0.09039487689733505,
-0.21819674968719482,
0.022458938881754875,
0.5464882850646973,
0.029315216466784477,
0.3539818227291107,
-0.45833566784858704,
-0.27649205923080444,
-0.10368819534778595,
-0.1542486995458603,
0.09818551689386368,
0.2759522497653961,
0.1810334324836731,
-0.24958522617816925,
0.4922094941139221,
-0.1463519185781479,
0.4624955356121063,
0.03306497260928154,
-0.05325556546449661,
0.6158550381660461,
-0.0061419992707669735,
-0.20053955912590027,
-0.17554835975170135,
1.0784040689468384,
0.2497638612985611,
0.5092922449111938,
-0.07781011611223221,
-0.1819460690021515,
0.0025864155031740665,
-0.15279729664325714,
-0.7311172485351562,
-0.36268141865730286,
0.3920964002609253,
-0.4405911862850189,
-0.6118376851081848,
-0.05225549638271332,
-0.6424663066864014,
-0.1861937791109085,
-0.03717681020498276,
0.6688756346702576,
-0.6930001974105835,
-0.34552136063575745,
-0.03422170877456665,
-0.5095182657241821,
0.015527641400694847,
0.22962510585784912,
-0.573708176612854,
-0.03308653458952904,
0.5778742432594299,
0.8602586984634399,
0.23073582351207733,
-0.3769109547138214,
-0.28002679347991943,
0.057557541877031326,
-0.12765181064605713,
0.7949153780937195,
-0.44081911444664,
-0.027264075353741646,
-0.03272107616066933,
-0.12304192036390305,
-0.2954777181148529,
-0.3072710931301117,
0.6102862358093262,
-0.1751692146062851,
0.2172468900680542,
-0.10122521221637726,
-0.6317245960235596,
-0.1385941207408905,
0.354474276304245,
-0.5701102018356323,
1.1632351875305176,
0.1776181161403656,
-0.9958925843238831,
0.028844285756349564,
-0.7675665020942688,
-0.3700564205646515,
-0.13965553045272827,
0.05388687551021576,
-0.5411630272865295,
-0.04752381518483162,
0.21863459050655365,
0.5461755990982056,
-0.33195075392723083,
0.1256042867898941,
-0.6992140412330627,
-0.33237507939338684,
0.4962582290172577,
-0.2773650586605072,
1.437806487083435,
0.2041700929403305,
-0.4940246045589447,
-0.09636341035366058,
-0.763314962387085,
0.21000614762306213,
0.19369255006313324,
-0.31382113695144653,
-0.27530890703201294,
-0.23129472136497498,
0.2392750382423401,
0.29600176215171814,
0.28468507528305054,
-0.6281077861785889,
0.020405657589435577,
-0.3618743121623993,
0.5947890281677246,
0.8529826998710632,
-0.16207827627658844,
0.14884312450885773,
-0.5238767862319946,
0.3334502875804901,
0.060379911214113235,
0.29432588815689087,
0.14711035788059235,
-0.4548986554145813,
-0.8888435959815979,
-0.21840009093284607,
0.45098021626472473,
0.6160826086997986,
-0.5925693511962891,
0.6514931917190552,
-0.4370318353176117,
-0.5430721044540405,
-0.7059997916221619,
-0.1654096096754074,
0.31419363617897034,
0.5532903671264648,
0.5493735074996948,
0.08291764557361603,
-0.6925498843193054,
-0.5887290239334106,
-0.6811997890472412,
-0.23301146924495697,
0.13840235769748688,
0.30399230122566223,
0.7263074517250061,
-0.030041905120015144,
0.6885371804237366,
-0.41678908467292786,
-0.24004265666007996,
-0.22062921524047852,
0.514432966709137,
0.4338453412055969,
0.709280788898468,
0.7092472910881042,
-0.7031875252723694,
-0.6993654370307922,
-0.3065589368343353,
-0.886584460735321,
-0.29328784346580505,
0.2488943189382553,
-0.07640426605939865,
0.5086561441421509,
0.28230714797973633,
-0.46517500281333923,
0.478469580411911,
0.18605023622512817,
-0.4239199757575989,
0.4304850697517395,
0.15466605126857758,
0.3716210722923279,
-1.1856220960617065,
0.30282503366470337,
0.06771299242973328,
-0.04701884835958481,
-0.5839018225669861,
-0.28031444549560547,
-0.12176593393087387,
0.1704850196838379,
-0.3929109573364258,
0.4937884509563446,
-0.32284650206565857,
0.0447813980281353,
0.11525517702102661,
0.11341860890388489,
-0.03282920643687248,
0.37188199162483215,
-0.2798879146575928,
0.292995423078537,
0.4114842712879181,
-0.2144710272550583,
0.2996014952659607,
0.11316034197807312,
-0.14590783417224884,
0.612280547618866,
-0.7134428024291992,
0.02051636017858982,
0.11944711208343506,
0.22926069796085358,
-1.2125062942504883,
-0.15446779131889343,
0.3017110824584961,
-0.9165905117988586,
0.19957567751407623,
-0.33851972222328186,
-0.5990167856216431,
-0.39910224080085754,
-0.5324816107749939,
0.43442922830581665,
0.5639274716377258,
-0.4444130063056946,
0.720675528049469,
0.29161617159843445,
0.06131749227643013,
-0.871427595615387,
-0.8650702834129333,
0.08917652070522308,
-0.22148606181144714,
-0.8769164681434631,
0.2144148200750351,
-0.11797235906124115,
-0.17270641028881073,
0.23154327273368835,
0.10929247736930847,
-0.06612400710582733,
0.16751626133918762,
0.16068726778030396,
0.15155552327632904,
-0.2226753979921341,
0.18724367022514343,
-0.22849693894386292,
-0.08528172224760056,
-0.00798986479640007,
-0.3479014039039612,
0.5905306935310364,
-0.33446386456489563,
0.09185351431369781,
-0.7095028162002563,
0.2958131730556488,
0.3921877443790436,
0.03749332204461098,
0.8799532055854797,
1.0261446237564087,
-0.36088207364082336,
-0.3142889738082886,
-0.6521393060684204,
0.016486546024680138,
-0.47439107298851013,
0.25365033745765686,
-0.27774494886398315,
-0.5744165778160095,
0.6337386965751648,
0.04496185854077339,
-0.059042688459157944,
0.7928169369697571,
0.44676440954208374,
-0.2599209249019623,
0.92860347032547,
0.5044293999671936,
-0.07747847586870193,
0.613301157951355,
-0.6526967287063599,
0.08671429753303528,
-0.7080256342887878,
-0.08916354924440384,
-0.7430705428123474,
-0.3003537356853485,
-0.6960045099258423,
-0.2714981138706207,
0.20114512741565704,
-0.023724738508462906,
-0.5862099528312683,
0.15440598130226135,
-0.5591064095497131,
0.2940766215324402,
0.37365347146987915,
0.17775703966617584,
-0.034831516444683075,
-0.09731628745794296,
-0.014481421560049057,
-0.06515367329120636,
-0.6481212377548218,
-0.4360884130001068,
1.1878834962844849,
0.22684650123119354,
0.6279813051223755,
0.1864025741815567,
0.9043000340461731,
0.19542504847049713,
0.5008348822593689,
-0.6142513751983643,
0.5995568037033081,
-0.48858892917633057,
-0.469378799200058,
-0.1370299607515335,
-0.6581929922103882,
-0.6931763291358948,
0.051598962396383286,
-0.1547880470752716,
-0.7654520273208618,
0.1487104445695877,
0.050721634179353714,
-0.2067747414112091,
0.3836020827293396,
-0.7139484882354736,
0.9467118978500366,
-0.039685118943452835,
-0.2952832281589508,
0.018057070672512054,
-0.6155634522438049,
0.3210829496383667,
0.25202327966690063,
0.2600058913230896,
-0.31234896183013916,
-0.051373787224292755,
0.9845629930496216,
-0.42445486783981323,
0.857702374458313,
-0.20612002909183502,
0.31331247091293335,
0.11639457195997238,
-0.06690463423728943,
0.2707293629646301,
-0.17885415256023407,
-0.466614305973053,
0.16220654547214508,
-0.2266303151845932,
-0.5331695675849915,
-0.3076675236225128,
0.7959974408149719,
-0.9709697365760803,
-0.3817440867424011,
-0.6495534777641296,
-0.5518654584884644,
0.19172616302967072,
0.27564388513565063,
0.5009848475456238,
0.3696703016757965,
-0.1081249937415123,
0.3399967551231384,
0.4762575924396515,
-0.17429164052009583,
0.6315610408782959,
0.2447400689125061,
0.11250203102827072,
-0.4785473942756653,
0.7566004395484924,
0.34983593225479126,
0.0522514171898365,
0.4352005124092102,
0.3461155593395233,
-0.28253373503685,
-0.255986750125885,
-0.015616146847605705,
0.24062491953372955,
-0.8931670784950256,
-0.2687983810901642,
-0.9111154675483704,
-0.27906662225723267,
-0.8269276022911072,
-0.11914031952619553,
-0.25495263934135437,
-0.839760959148407,
-0.5660070776939392,
0.20602792501449585,
0.5136078000068665,
0.7230417132377625,
-0.3446348011493683,
0.19786925613880157,
-0.4216882288455963,
0.16501352190971375,
0.02981126494705677,
0.1641743928194046,
0.13710103929042816,
-0.8564257025718689,
-0.16678351163864136,
-0.04000803083181381,
-0.3984008729457855,
-0.917624294757843,
0.5391141772270203,
0.3394349217414856,
0.41863784193992615,
0.3498561978340149,
0.31280040740966797,
0.5622005462646484,
-0.13506604731082916,
0.7133666276931763,
0.17839118838310242,
-1.0472239255905151,
0.5553022623062134,
-0.3592919111251831,
0.1687452495098114,
0.3775605261325836,
0.4123445749282837,
-0.46946725249290466,
-0.5410952568054199,
-0.8624934554100037,
-1.0007764101028442,
0.775666356086731,
0.24818772077560425,
-0.1662883311510086,
-0.09339319914579391,
0.17009378969669342,
-0.24027930200099945,
0.06791071593761444,
-0.9124545454978943,
-0.42956167459487915,
-0.4109596014022827,
-0.6612007021903992,
-0.006699340417981148,
-0.13228875398635864,
-0.19882330298423767,
-0.4287615120410919,
0.8421744108200073,
0.07826407998800278,
0.4504839777946472,
0.17863871157169342,
-0.3631575107574463,
-0.03953453525900841,
0.19021891057491302,
0.4188227951526642,
0.5039016604423523,
-0.4466420114040375,
0.13951833546161652,
0.13439032435417175,
-0.35631927847862244,
-0.0697372630238533,
0.2287539690732956,
-0.06307864189147949,
0.18170873820781708,
0.5169510841369629,
0.4922126829624176,
0.3332970440387726,
-0.15732714533805847,
0.7082523107528687,
-0.049986232072114944,
-0.17579197883605957,
-0.5911573171615601,
0.05002822354435921,
0.05535810440778732,
0.34789255261421204,
0.609214186668396,
0.21478532254695892,
0.18371111154556274,
-0.50423663854599,
0.17401103675365448,
0.17739450931549072,
-0.2184448391199112,
-0.45740312337875366,
0.6250788569450378,
0.019415155053138733,
-0.41847413778305054,
0.48829713463783264,
-0.17681458592414856,
-0.9532942771911621,
0.7731293439865112,
0.48984840512275696,
1.2213166952133179,
-0.23819100856781006,
0.29705604910850525,
0.6288278102874756,
0.3198550343513489,
0.027037139981985092,
0.5871487259864807,
0.07208394259214401,
-0.5626339912414551,
0.019755862653255463,
-0.6574071645736694,
-0.09186003357172012,
-0.040067993104457855,
-0.44103437662124634,
0.2300034910440445,
-0.5102304220199585,
-0.33928990364074707,
0.36092913150787354,
0.15200254321098328,
-0.7094562649726868,
0.2505186200141907,
-0.004916872829198837,
0.7398906350135803,
-1.0388449430465698,
0.6937114000320435,
0.654323935508728,
-0.6768923401832581,
-0.8564304709434509,
0.1145782470703125,
-0.014836005866527557,
-0.6665214896202087,
0.8369842171669006,
0.34820663928985596,
-0.0526951365172863,
0.1541987657546997,
-0.8327761888504028,
-0.7747977375984192,
1.0774770975112915,
0.3389286696910858,
-0.03453677147626877,
0.09644661843776703,
0.07817240059375763,
0.5710287094116211,
-0.43013015389442444,
0.700118362903595,
0.4930265545845032,
0.567247211933136,
-0.028274832293391228,
-0.5844482779502869,
0.30546557903289795,
-0.48581892251968384,
-0.11558224260807037,
-0.002786261262372136,
-0.8873605132102966,
1.3512482643127441,
-0.24031364917755127,
-0.06553712487220764,
0.13487298786640167,
0.5555369853973389,
0.23751254379749298,
0.3536865711212158,
0.5333991646766663,
0.8643829822540283,
0.6730660796165466,
-0.3102152943611145,
0.8595673441886902,
-0.1818680316209793,
0.7917131185531616,
0.7728897929191589,
0.257426917552948,
0.9398950934410095,
0.4241275489330292,
-0.17086033523082733,
0.6705318689346313,
0.5381765961647034,
-0.13800892233848572,
0.3106185495853424,
0.11445926874876022,
-0.11467751860618591,
-0.29491284489631653,
-0.13332435488700867,
-0.37540552020072937,
0.2963828146457672,
0.32923632860183716,
-0.46550503373146057,
-0.2427934855222702,
-0.2128688097000122,
0.30982881784439087,
-0.07049401849508286,
-0.10863865166902542,
0.46338769793510437,
0.1736593246459961,
-0.46894127130508423,
0.8912811875343323,
-0.13758179545402527,
0.7252926230430603,
-0.11787334829568863,
0.040060412138700485,
-0.02324388548731804,
0.4099288880825043,
-0.38011136651039124,
-0.8231847882270813,
0.0012243305100128055,
0.1444326639175415,
-0.08549199998378754,
0.00034490186953917146,
0.4668012261390686,
-0.5006572604179382,
-0.506912350654602,
0.4695281386375427,
0.1853770762681961,
0.36205676198005676,
0.18088862299919128,
-1.1907470226287842,
0.06547088921070099,
-0.05300385504961014,
-0.6306769847869873,
-0.08385350555181503,
0.6526331305503845,
0.2513751685619354,
0.5977250337600708,
0.6169211268424988,
-0.06489462405443192,
0.25509926676750183,
0.23524118959903717,
0.8371405005455017,
-0.7425071597099304,
-0.4839353859424591,
-0.8735173940658569,
0.4784903824329376,
-0.3557131588459015,
-0.5325717329978943,
0.7539694309234619,
0.5461554527282715,
0.591189980506897,
-0.022147634997963905,
0.9205201268196106,
-0.46630915999412537,
0.5354599952697754,
-0.25601938366889954,
0.911004900932312,
-0.8286939859390259,
0.11871547996997833,
-0.40667587518692017,
-0.6334002614021301,
-0.3645390570163727,
0.7181904315948486,
-0.4924484193325043,
0.3468860983848572,
0.7185290455818176,
0.6364870071411133,
-0.06561984121799469,
-0.08566325902938843,
0.12428463995456696,
0.6883985996246338,
0.3222404718399048,
0.8081703782081604,
0.6745818257331848,
-0.8444730043411255,
0.6894373893737793,
-0.45435500144958496,
-0.2671920955181122,
-0.5478065609931946,
-0.8766764998435974,
-1.052291750907898,
-0.551062285900116,
-0.3803785443305969,
-0.7950621843338013,
0.06918646395206451,
0.9641830325126648,
0.32323306798934937,
-0.8955438137054443,
-0.20185093581676483,
0.09752784669399261,
0.25771862268447876,
-0.10195647180080414,
-0.28534236550331116,
0.6980178356170654,
-0.4389236867427826,
-0.7946259379386902,
-0.09327027946710587,
0.0279852282255888,
0.03853866457939148,
0.12773394584655762,
0.0792822614312172,
-0.6327469944953918,
0.07450021058320999,
0.32748985290527344,
0.26738473773002625,
-0.675534188747406,
-0.357613205909729,
0.006011869292706251,
-0.3565554618835449,
0.02624642476439476,
0.20583556592464447,
-0.4015684127807617,
0.2296978235244751,
0.7266585230827332,
0.3100617229938507,
0.3845818042755127,
0.00878630205988884,
0.27953389286994934,
-0.6121842861175537,
0.1442139744758606,
0.41560888290405273,
0.4101724326610565,
0.4855296313762665,
-0.2010301947593689,
0.5900663137435913,
0.5303789973258972,
-0.6926437616348267,
-1.0419700145721436,
-0.26584869623184204,
-1.1402910947799683,
-0.21068832278251648,
1.0559000968933105,
-0.414669930934906,
-0.6489401459693909,
-0.1251654475927353,
0.16438576579093933,
0.7143492698669434,
-0.6079020500183105,
0.9266464710235596,
0.45155230164527893,
0.038833290338516235,
0.0203834380954504,
-0.4250951409339905,
0.5325123071670532,
0.4189716875553131,
-0.6268812417984009,
-0.15333600342273712,
0.06568831205368042,
0.5721694827079773,
0.23010745644569397,
0.6937097907066345,
0.020612020045518875,
0.49783098697662354,
0.050398219376802444,
0.2726830840110779,
-0.04580533131957054,
-0.1067301407456398,
-0.28228724002838135,
0.19438201189041138,
-0.36456432938575745,
-0.15463849902153015
] |
mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis | mrm8488 | "2023-03-16T20:03:13Z" | 6,550,039 | 123 | transformers | [
"transformers",
"pytorch",
"tensorboard",
"safetensors",
"roberta",
"text-classification",
"generated_from_trainer",
"financial",
"stocks",
"sentiment",
"dataset:financial_phrasebank",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:05Z" | ---
license: apache-2.0
tags:
- generated_from_trainer
- financial
- stocks
- sentiment
widget:
- text: "Operating profit totaled EUR 9.4 mn , down from EUR 11.7 mn in 2004 ."
datasets:
- financial_phrasebank
metrics:
- accuracy
model-index:
- name: distilRoberta-financial-sentiment
results:
- task:
name: Text Classification
type: text-classification
dataset:
name: financial_phrasebank
type: financial_phrasebank
args: sentences_allagree
metrics:
- name: Accuracy
type: accuracy
value: 0.9823008849557522
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# distilRoberta-financial-sentiment
This model is a fine-tuned version of [distilroberta-base](https://huggingface.co/distilroberta-base) on the financial_phrasebank dataset.
It achieves the following results on the evaluation set:
- Loss: 0.1116
- Accuracy: 0.9823
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 5
### Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| No log | 1.0 | 255 | 0.1670 | 0.9646 |
| 0.209 | 2.0 | 510 | 0.2290 | 0.9558 |
| 0.209 | 3.0 | 765 | 0.2044 | 0.9558 |
| 0.0326 | 4.0 | 1020 | 0.1116 | 0.9823 |
| 0.0326 | 5.0 | 1275 | 0.1127 | 0.9779 |
### Framework versions
- Transformers 4.10.2
- Pytorch 1.9.0+cu102
- Datasets 1.12.1
- Tokenizers 0.10.3
| [
-0.4302907884120941,
-0.6286759972572327,
-0.014874963089823723,
0.4192722737789154,
-0.36996448040008545,
-0.09113570302724838,
-0.10067697614431381,
-0.015241319313645363,
0.0903741791844368,
0.16841593384742737,
-0.6947463750839233,
-0.7709058523178101,
-0.8554448485374451,
-0.1544986516237259,
-0.3327349126338959,
1.5439763069152832,
0.22085651755332947,
0.5173439383506775,
0.01325912307947874,
0.08518149703741074,
-0.3257526457309723,
-0.7047274708747864,
-0.949869692325592,
-0.7770932912826538,
0.3410269618034363,
0.09084419161081314,
0.8162128925323486,
0.5417412519454956,
0.6620262861251831,
0.2742806077003479,
-0.5507880449295044,
-0.3714176118373871,
-0.663342297077179,
-0.49121880531311035,
0.004328419454395771,
-0.5846219658851624,
-0.6992202401161194,
0.129055455327034,
0.4353618919849396,
0.5471483469009399,
-0.3686464726924896,
0.6152307987213135,
0.3450767695903778,
0.8616307973861694,
-0.45758891105651855,
0.5607677698135376,
-0.42778581380844116,
0.25273457169532776,
-0.15050114691257477,
-0.18060541152954102,
-0.34787094593048096,
-0.21470175683498383,
0.32874786853790283,
-0.5141241550445557,
0.41467949748039246,
0.023897657170891762,
1.367010235786438,
0.4729240834712982,
-0.4243094027042389,
-0.16268733143806458,
-0.7060898542404175,
0.6784014105796814,
-0.8005231618881226,
0.12729378044605255,
0.38504528999328613,
0.42136090993881226,
0.1479986310005188,
-0.7213462591171265,
-0.5468974709510803,
0.07488089799880981,
-0.07145503163337708,
0.37663477659225464,
-0.37396690249443054,
-0.027211086824536324,
0.6092380285263062,
0.6599287986755371,
-0.40571197867393494,
0.014595563523471355,
-0.6143678426742554,
-0.12923000752925873,
0.6114286184310913,
0.3716404438018799,
-0.5395113229751587,
-0.4037359952926636,
-0.6357350945472717,
-0.33731958270072937,
-0.2101041078567505,
0.27945345640182495,
0.7713390588760376,
0.3875598907470703,
-0.40326640009880066,
0.47773411870002747,
-0.2691906988620758,
0.6888952255249023,
0.3538298010826111,
-0.34780898690223694,
0.7344086766242981,
0.056029919534921646,
-0.5349118113517761,
0.13701099157333374,
0.906710684299469,
0.721161425113678,
0.18593429028987885,
0.32975324988365173,
-0.47028806805610657,
-0.047412678599357605,
0.3039838671684265,
-0.909613847732544,
-0.4094795882701874,
0.08107880502939224,
-0.7843058705329895,
-0.8601322770118713,
0.28411442041397095,
-0.7562006711959839,
0.0910724475979805,
-0.5615514516830444,
0.42078354954719543,
-0.546928346157074,
-0.3002487123012543,
0.2815123200416565,
-0.2643519639968872,
0.3404993414878845,
0.16759023070335388,
-0.9247435331344604,
0.32603123784065247,
0.6039813756942749,
0.663024365901947,
0.3634178936481476,
-0.11500882357358932,
-0.13704103231430054,
-0.12107010930776596,
-0.18645821511745453,
0.57230544090271,
-0.008268902078270912,
-0.5871682167053223,
-0.20219701528549194,
-0.041419971734285355,
-0.08942384272813797,
-0.46128687262535095,
0.7539176344871521,
-0.2657295763492584,
0.4555036425590515,
-0.1944258213043213,
-0.6032951474189758,
-0.34045088291168213,
0.4876731336116791,
-0.664820671081543,
1.3392829895019531,
0.1938960999250412,
-1.135936975479126,
0.5845789313316345,
-0.743279755115509,
-0.16941508650779724,
-0.20988218486309052,
-0.03453749790787697,
-0.7863346934318542,
-0.006645853631198406,
-0.009807661175727844,
0.5170888900756836,
-0.32608798146247864,
0.4987435042858124,
-0.4050177037715912,
-0.38574546575546265,
0.30324822664260864,
-0.7172532081604004,
0.9598469734191895,
0.2291819006204605,
-0.5884945392608643,
-0.030020860955119133,
-1.2865432500839233,
-0.0606905072927475,
0.1952810138463974,
-0.5138316750526428,
-0.2514142692089081,
-0.22844642400741577,
0.5462622046470642,
0.30220675468444824,
0.5017455816268921,
-0.583195686340332,
0.19123798608779907,
-0.5439635515213013,
0.329392671585083,
0.9068505764007568,
-0.04940975829958916,
0.12401264905929565,
-0.3925306499004364,
0.4072015583515167,
0.4374198317527771,
0.5429103970527649,
0.2783079147338867,
-0.31501278281211853,
-0.8929260969161987,
-0.29944708943367004,
0.2854975461959839,
0.6046024560928345,
-0.3162532150745392,
0.8353809714317322,
-0.2230062037706375,
-0.7610899209976196,
-0.22577086091041565,
0.0986163318157196,
0.4031119644641876,
0.9623115062713623,
0.36613622307777405,
0.013553385622799397,
-0.5372264385223389,
-1.2325172424316406,
0.1265524923801422,
-0.27149760723114014,
0.2177376002073288,
0.013879908248782158,
0.6851335167884827,
-0.14778101444244385,
0.9838684797286987,
-0.7667455673217773,
-0.25612539052963257,
-0.14148543775081635,
0.19295258820056915,
0.8519243001937866,
0.5940484404563904,
0.8574549555778503,
-0.7650985717773438,
-0.31819671392440796,
-0.19508884847164154,
-0.7999187111854553,
0.4389309287071228,
-0.19139020144939423,
-0.15808632969856262,
-0.013969873078167439,
0.25409582257270813,
-0.534503161907196,
0.7308112978935242,
0.4512077867984772,
-0.4994750916957855,
0.6871025562286377,
-0.2658289670944214,
-0.2546232342720032,
-1.5584532022476196,
0.28778132796287537,
0.3965156674385071,
-0.12408451735973358,
-0.24926184117794037,
-0.265286386013031,
-0.009179922752082348,
-0.06578154116868973,
-0.32547807693481445,
0.5411102771759033,
0.03672810271382332,
0.18401063978672028,
-0.1639549434185028,
-0.38508373498916626,
0.12025090306997299,
0.803913950920105,
0.049941446632146835,
0.6234625577926636,
0.7824512720108032,
-0.4563519358634949,
0.5614894032478333,
0.49517056345939636,
-0.3431003987789154,
0.7312214970588684,
-0.9987441897392273,
-0.04160606116056442,
-0.05778484046459198,
0.11640991270542145,
-0.9843156933784485,
-0.06181780993938446,
0.41852691769599915,
-0.4831172823905945,
0.367786169052124,
-0.15743423998355865,
-0.28739574551582336,
-0.564723789691925,
-0.1501111537218094,
0.04491525888442993,
0.5280187129974365,
-0.4993632733821869,
0.4788133203983307,
-0.06755737960338593,
0.06625616550445557,
-0.9715284109115601,
-0.8789529800415039,
-0.144437775015831,
-0.4390512704849243,
-0.376765638589859,
0.14461290836334229,
0.10869819670915604,
-0.19667725265026093,
-0.00678904727101326,
-0.11671016365289688,
-0.15536758303642273,
0.05236181616783142,
0.513936460018158,
0.6873095631599426,
-0.11221182346343994,
0.02133876085281372,
-0.038915473967790604,
-0.42408958077430725,
0.3222745954990387,
-0.12587334215641022,
0.6255699992179871,
-0.4298802316188812,
-0.16149257123470306,
-0.8045444488525391,
-0.11402212828397751,
0.44119545817375183,
-0.1037355437874794,
1.0390490293502808,
0.5416869521141052,
-0.4202416241168976,
0.08903616666793823,
-0.44027623534202576,
-0.06344625353813171,
-0.48667049407958984,
0.602106511592865,
-0.5049619674682617,
-0.4000416398048401,
0.832584023475647,
-0.12286984920501709,
0.011405359022319317,
1.0870697498321533,
0.6145422458648682,
-0.06608898192644119,
1.0537608861923218,
0.40841296315193176,
-0.43283697962760925,
0.32428357005119324,
-0.9328969717025757,
0.04225674271583557,
-0.5608652830123901,
-0.5448065996170044,
-0.6906857490539551,
-0.425456166267395,
-0.6495524048805237,
0.12957347929477692,
0.1625637710094452,
0.18782643973827362,
-0.7522845268249512,
0.30464863777160645,
-0.5069880485534668,
0.23491914570331573,
0.732430636882782,
0.3466245234012604,
0.043199002742767334,
0.07582569122314453,
-0.41471827030181885,
-0.013835206627845764,
-0.7766152620315552,
-0.647812008857727,
1.3228956460952759,
0.7283582091331482,
1.0327057838439941,
-0.2501755952835083,
0.908220648765564,
0.1623736023902893,
0.18667596578598022,
-0.7864316701889038,
0.27482300996780396,
-0.09001588821411133,
-0.8880146145820618,
-0.18177233636379242,
-0.5466420650482178,
-0.5261504650115967,
-0.07546839863061905,
-0.26952728629112244,
-0.3703276515007019,
0.3465432822704315,
0.26145264506340027,
-0.6777170300483704,
0.40433385968208313,
-0.41469597816467285,
1.245200753211975,
-0.3031468689441681,
-0.23456744849681854,
-0.2378407120704651,
-0.5643496513366699,
0.17035172879695892,
0.007880991324782372,
0.018231913447380066,
-0.0031331791542470455,
0.20837385952472687,
0.780573308467865,
-0.6456189155578613,
0.956253170967102,
-0.5331066846847534,
0.06418421119451523,
0.32130298018455505,
-0.311918169260025,
0.5465993881225586,
0.3467414975166321,
-0.26130935549736023,
0.3362830579280853,
0.02092006802558899,
-0.578831136226654,
-0.4702813923358917,
0.5882299542427063,
-1.210500717163086,
-0.16030585765838623,
-0.7941813468933105,
-0.37617138028144836,
-0.05558011680841446,
0.04965152591466904,
0.5804014205932617,
0.6520345211029053,
-0.2692427635192871,
0.3353818953037262,
0.5597988963127136,
-0.012274517677724361,
0.30643558502197266,
0.14108318090438843,
-0.190365731716156,
-0.7596333026885986,
0.8047384023666382,
-0.2243349701166153,
0.18511071801185608,
0.08270050585269928,
0.18508386611938477,
-0.6317434906959534,
-0.3347916305065155,
-0.5297831296920776,
0.14258621633052826,
-0.8710657954216003,
-0.36740201711654663,
-0.33291691541671753,
-0.40449202060699463,
-0.3925846815109253,
0.006871835328638554,
-0.5560797452926636,
-0.3758043646812439,
-0.669704258441925,
-0.48796796798706055,
0.6446778178215027,
0.5731077790260315,
0.02252824418246746,
0.6258655190467834,
-0.7112568020820618,
-0.13953173160552979,
0.20624887943267822,
0.3167274594306946,
0.042884815484285355,
-0.8724554777145386,
-0.48859354853630066,
0.11142441630363464,
-0.4571434557437897,
-0.6830558776855469,
0.5974690318107605,
0.09485960006713867,
0.5341886878013611,
0.9013442397117615,
-0.1266448050737381,
1.015171766281128,
-0.045507434755563736,
0.7348929047584534,
0.5041566491127014,
-0.8109662532806396,
0.5322802662849426,
-0.2509140074253082,
0.1344074010848999,
0.8311175107955933,
0.6510123610496521,
-0.33904746174812317,
-0.16364598274230957,
-1.0945262908935547,
-0.868217945098877,
0.7814347743988037,
0.20508265495300293,
0.21148328483104706,
-0.07132834941148758,
0.43886250257492065,
-0.013191032223403454,
0.5397336483001709,
-0.9808473587036133,
-0.6792358160018921,
-0.661217987537384,
-0.3762151896953583,
-0.04249229282140732,
-0.343340665102005,
-0.15117299556732178,
-0.5542559623718262,
1.0640206336975098,
-0.016454042866826057,
0.18347296118736267,
0.08558235317468643,
0.31831616163253784,
0.051666177809238434,
0.022406572476029396,
0.4571292996406555,
0.7081879377365112,
-0.649666428565979,
-0.10192641615867615,
0.17040739953517914,
-0.5137639045715332,
0.11642707884311676,
0.34637323021888733,
-0.1543206125497818,
0.18835784494876862,
0.23236100375652313,
1.2725709676742554,
0.20878973603248596,
-0.2950105369091034,
0.6262236833572388,
-0.19931776821613312,
-0.5574054718017578,
-0.7683252096176147,
-0.1271991729736328,
-0.029025252908468246,
0.35564085841178894,
0.5623258948326111,
0.6375828981399536,
0.14160379767417908,
-0.29596415162086487,
0.1006254330277443,
0.18446503579616547,
-0.7149356603622437,
-0.23767241835594177,
0.8230700492858887,
0.12413739413022995,
-0.018639955669641495,
0.8809983134269714,
-0.1437990814447403,
-0.3617110550403595,
0.7502769827842712,
0.33507633209228516,
1.0665792226791382,
-0.11059555411338806,
0.17890724539756775,
0.8404713273048401,
0.091032974421978,
-0.2909921705722809,
0.6048338413238525,
0.2830238342285156,
-0.6178844571113586,
-0.34745484590530396,
-1.094179630279541,
-0.19243311882019043,
0.4288329482078552,
-1.3747265338897705,
0.4649718701839447,
-0.6882292032241821,
-0.7401531934738159,
0.15543727576732635,
-0.04192989319562912,
-0.9239051938056946,
0.620764434337616,
0.1590859293937683,
1.305445671081543,
-0.9568832516670227,
0.7666642665863037,
0.7015052437782288,
-0.6013343334197998,
-1.115738868713379,
-0.3251297175884247,
-0.059879496693611145,
-0.7774343490600586,
0.9493086338043213,
0.15781205892562866,
0.2511124014854431,
0.04431707784533501,
-0.40769898891448975,
-0.7316491007804871,
1.104627013206482,
0.20867404341697693,
-0.9898000359535217,
-0.21897155046463013,
0.3700259327888489,
0.6822999119758606,
-0.19888105988502502,
0.37775540351867676,
0.34455999732017517,
0.3255898952484131,
0.21849852800369263,
-0.9058665037155151,
-0.2881753742694855,
-0.41849878430366516,
0.07379834353923798,
0.15330682694911957,
-0.7934359312057495,
1.1406420469284058,
0.1320745199918747,
0.4589785039424896,
-0.010168986395001411,
0.7114936709403992,
0.17770659923553467,
0.388939768075943,
0.5967039465904236,
1.0879974365234375,
0.5889350771903992,
-0.29860299825668335,
1.0417002439498901,
-0.7163829803466797,
0.9734349250793457,
1.1689456701278687,
-0.02837236225605011,
0.7689102292060852,
0.460910826921463,
-0.43868300318717957,
0.572109580039978,
0.9257376194000244,
-0.3018847405910492,
0.47712966799736023,
0.18460524082183838,
-0.15238288044929504,
-0.3271785378456116,
0.31620001792907715,
-0.49984976649284363,
0.5396862626075745,
0.06597157567739487,
-0.7644467353820801,
-0.2981734573841095,
0.00631913123652339,
0.03506983444094658,
-0.1308431476354599,
-0.42637619376182556,
0.7018741369247437,
0.0033652528654783964,
-0.12956878542900085,
0.6303834915161133,
0.05581638589501381,
0.6168836355209351,
-0.6641291975975037,
0.06502552330493927,
-0.17545631527900696,
0.49754464626312256,
-0.19695676863193512,
-0.6399918794631958,
0.3472607433795929,
0.09680218249559402,
-0.32075613737106323,
-0.1285458356142044,
0.4377877116203308,
-0.07979688048362732,
-1.1075928211212158,
0.21354860067367554,
0.35996365547180176,
0.022502673789858818,
-0.14170517027378082,
-1.2124296426773071,
-0.2951257824897766,
0.12174690514802933,
-0.683964192867279,
0.08831273764371872,
0.4787616431713104,
0.21464483439922333,
0.524232029914856,
0.6873660087585449,
0.030083132907748222,
-0.0981440469622612,
0.27802470326423645,
1.1547342538833618,
-0.7864410877227783,
-0.7896620631217957,
-1.003096103668213,
0.5778610706329346,
-0.370928019285202,
-0.7776613831520081,
0.7161362767219543,
1.1715105772018433,
1.0354806184768677,
-0.2961284816265106,
0.7286465167999268,
0.09364209324121475,
0.49480193853378296,
-0.4421003758907318,
0.7998236417770386,
-0.3937914967536926,
-0.05699177458882332,
-0.377716988325119,
-0.9758799076080322,
0.013964756391942501,
0.9475542306900024,
-0.4819445013999939,
-0.030863666906952858,
0.3587459623813629,
0.7541126012802124,
0.003267826745286584,
0.14038847386837006,
0.11476509273052216,
0.07726621627807617,
0.03385802358388901,
0.2996833324432373,
0.6572933793067932,
-0.8155425786972046,
0.5345063209533691,
-0.7106400728225708,
-0.16474981606006622,
-0.10888683050870895,
-0.8374685049057007,
-1.024714708328247,
-0.3041365146636963,
-0.5033502578735352,
-0.5697033405303955,
-0.14891622960567474,
1.1158380508422852,
0.6282830238342285,
-0.7997503280639648,
-0.4761706590652466,
0.030996907502412796,
-0.5602884888648987,
-0.28861573338508606,
-0.28859397768974304,
0.42851021885871887,
-0.2136775404214859,
-0.774730920791626,
-0.20770762860774994,
-0.026213470846414566,
0.4014277160167694,
-0.41785213351249695,
-0.21160024404525757,
-0.07284992188215256,
-0.22935543954372406,
0.3247016668319702,
-0.14339618384838104,
-0.37003183364868164,
-0.16173972189426422,
0.034639786928892136,
-0.14785641431808472,
0.1769074648618698,
0.28036367893218994,
-0.42674314975738525,
0.21025200188159943,
0.28031063079833984,
0.3120741546154022,
0.7673535346984863,
0.08613628894090652,
0.20741453766822815,
-0.7652894854545593,
0.5836247205734253,
0.1982278823852539,
0.5834649205207825,
0.12089758366346359,
-0.45268675684928894,
0.3625398576259613,
0.47975897789001465,
-0.5161470174789429,
-0.6480156779289246,
-0.308253675699234,
-1.1822165250778198,
0.040561359375715256,
1.0437102317810059,
-0.11296886205673218,
-0.5661845803260803,
0.3632645308971405,
-0.389984130859375,
0.26019054651260376,
-0.5068396925926208,
0.8091211318969727,
0.8453344702720642,
0.048052407801151276,
0.26838693022727966,
-0.5073432326316833,
0.5379101037979126,
0.16692396998405457,
-0.47599467635154724,
-0.16537512838840485,
0.54178786277771,
0.49874505400657654,
0.2125866711139679,
0.42844855785369873,
-0.11767803877592087,
0.2832200825214386,
0.27842703461647034,
0.3803901672363281,
-0.28699445724487305,
-0.1740114986896515,
-0.42329666018486023,
0.10507873445749283,
0.13396196067333221,
-0.5131459832191467
] |
lxyuan/distilbert-base-multilingual-cased-sentiments-student | lxyuan | "2023-06-24T04:09:07Z" | 6,548,691 | 56 | transformers | [
"transformers",
"pytorch",
"safetensors",
"distilbert",
"text-classification",
"sentiment-analysis",
"zero-shot-distillation",
"distillation",
"zero-shot-classification",
"debarta-v3",
"en",
"ar",
"de",
"es",
"fr",
"ja",
"zh",
"id",
"hi",
"it",
"ms",
"pt",
"dataset:tyqiangz/multilingual-sentiments",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2023-05-05T16:22:55Z" | ---
license: apache-2.0
tags:
- sentiment-analysis
- text-classification
- zero-shot-distillation
- distillation
- zero-shot-classification
- debarta-v3
model-index:
- name: distilbert-base-multilingual-cased-sentiments-student
results: []
datasets:
- tyqiangz/multilingual-sentiments
language:
- en
- ar
- de
- es
- fr
- ja
- zh
- id
- hi
- it
- ms
- pt
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# distilbert-base-multilingual-cased-sentiments-student
This model is distilled from the zero-shot classification pipeline on the Multilingual Sentiment
dataset using this [script](https://github.com/huggingface/transformers/tree/main/examples/research_projects/zero-shot-distillation).
In reality the multilingual-sentiment dataset is annotated of course,
but we'll pretend and ignore the annotations for the sake of example.
Teacher model: MoritzLaurer/mDeBERTa-v3-base-mnli-xnli
Teacher hypothesis template: "The sentiment of this text is {}."
Student model: distilbert-base-multilingual-cased
## Inference example
```python
from transformers import pipeline
distilled_student_sentiment_classifier = pipeline(
model="lxyuan/distilbert-base-multilingual-cased-sentiments-student",
return_all_scores=True
)
# english
distilled_student_sentiment_classifier ("I love this movie and i would watch it again and again!")
>> [[{'label': 'positive', 'score': 0.9731044769287109},
{'label': 'neutral', 'score': 0.016910076141357422},
{'label': 'negative', 'score': 0.009985478594899178}]]
# malay
distilled_student_sentiment_classifier("Saya suka filem ini dan saya akan menontonnya lagi dan lagi!")
[[{'label': 'positive', 'score': 0.9760093688964844},
{'label': 'neutral', 'score': 0.01804516464471817},
{'label': 'negative', 'score': 0.005945465061813593}]]
# japanese
distilled_student_sentiment_classifier("私はこの映画が大好きで、何度も見ます!")
>> [[{'label': 'positive', 'score': 0.9342429041862488},
{'label': 'neutral', 'score': 0.040193185210227966},
{'label': 'negative', 'score': 0.025563929229974747}]]
```
## Training procedure
Notebook link: [here](https://github.com/LxYuan0420/nlp/blob/main/notebooks/Distilling_Zero_Shot_multilingual_distilbert_sentiments_student.ipynb)
### Training hyperparameters
Result can be reproduce using the following commands:
```bash
python transformers/examples/research_projects/zero-shot-distillation/distill_classifier.py \
--data_file ./multilingual-sentiments/train_unlabeled.txt \
--class_names_file ./multilingual-sentiments/class_names.txt \
--hypothesis_template "The sentiment of this text is {}." \
--teacher_name_or_path MoritzLaurer/mDeBERTa-v3-base-mnli-xnli \
--teacher_batch_size 32 \
--student_name_or_path distilbert-base-multilingual-cased \
--output_dir ./distilbert-base-multilingual-cased-sentiments-student \
--per_device_train_batch_size 16 \
--fp16
```
If you are training this model on Colab, make the following code changes to avoid Out-of-memory error message:
```bash
###### modify L78 to disable fast tokenizer
default=False,
###### update dataset map part at L313
dataset = dataset.map(tokenizer, input_columns="text", fn_kwargs={"padding": "max_length", "truncation": True, "max_length": 512})
###### add following lines to L213
del model
print(f"Manually deleted Teacher model, free some memory for student model.")
###### add following lines to L337
trainer.push_to_hub()
tokenizer.push_to_hub("distilbert-base-multilingual-cased-sentiments-student")
```
### Training log
```bash
Training completed. Do not forget to share your model on huggingface.co/models =)
{'train_runtime': 2009.8864, 'train_samples_per_second': 73.0, 'train_steps_per_second': 4.563, 'train_loss': 0.6473459283913797, 'epoch': 1.0}
100%|███████████████████████████████████████| 9171/9171 [33:29<00:00, 4.56it/s]
[INFO|trainer.py:762] 2023-05-06 10:56:18,555 >> The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.
[INFO|trainer.py:3129] 2023-05-06 10:56:18,557 >> ***** Running Evaluation *****
[INFO|trainer.py:3131] 2023-05-06 10:56:18,557 >> Num examples = 146721
[INFO|trainer.py:3134] 2023-05-06 10:56:18,557 >> Batch size = 128
100%|███████████████████████████████████████| 1147/1147 [08:59<00:00, 2.13it/s]
05/06/2023 11:05:18 - INFO - __main__ - Agreement of student and teacher predictions: 88.29%
[INFO|trainer.py:2868] 2023-05-06 11:05:18,251 >> Saving model checkpoint to ./distilbert-base-multilingual-cased-sentiments-student
[INFO|configuration_utils.py:457] 2023-05-06 11:05:18,251 >> Configuration saved in ./distilbert-base-multilingual-cased-sentiments-student/config.json
[INFO|modeling_utils.py:1847] 2023-05-06 11:05:18,905 >> Model weights saved in ./distilbert-base-multilingual-cased-sentiments-student/pytorch_model.bin
[INFO|tokenization_utils_base.py:2171] 2023-05-06 11:05:18,905 >> tokenizer config file saved in ./distilbert-base-multilingual-cased-sentiments-student/tokenizer_config.json
[INFO|tokenization_utils_base.py:2178] 2023-05-06 11:05:18,905 >> Special tokens file saved in ./distilbert-base-multilingual-cased-sentiments-student/special_tokens_map.json
```
### Framework versions
- Transformers 4.28.1
- Pytorch 2.0.0+cu118
- Datasets 2.11.0
- Tokenizers 0.13.3 | [
-0.405286967754364,
-0.7423002123832703,
0.23364600539207458,
0.37132173776626587,
-0.20056839287281036,
0.0042899907566607,
-0.30528658628463745,
0.042576953768730164,
0.13890016078948975,
0.13750828802585602,
-0.4759770333766937,
-0.7798067331314087,
-0.7353076338768005,
0.062199655920267105,
-0.10422233492136002,
1.3327515125274658,
-0.23373830318450928,
0.3372393846511841,
-0.20215508341789246,
-0.2712225914001465,
-0.38573983311653137,
-0.8807841539382935,
-0.7859961986541748,
-0.3306069076061249,
0.22318817675113678,
0.29037541151046753,
0.2986135184764862,
0.36535948514938354,
0.38544905185699463,
0.3907693028450012,
-0.3729937970638275,
-0.23089000582695007,
-0.200587198138237,
-0.08216147124767303,
0.03955963999032974,
-0.7222544550895691,
-0.6097034811973572,
0.17893676459789276,
0.7860991954803467,
0.5128151774406433,
-0.011083046905696392,
0.2795601785182953,
0.02331054024398327,
0.5017322301864624,
-0.43252596259117126,
0.48493093252182007,
-0.41589921712875366,
0.11970039457082748,
-0.13387279212474823,
0.022564074024558067,
-0.3448432683944702,
-0.15005427598953247,
0.052126623690128326,
-0.32013529539108276,
0.46279096603393555,
-0.2724814713001251,
1.2352683544158936,
0.10579863935709,
-0.258949339389801,
-0.11250603944063187,
-0.3128564953804016,
0.9145276546478271,
-0.9481571912765503,
0.059389226138591766,
0.3330858051776886,
0.049992505460977554,
-0.18331651389598846,
-0.6023113131523132,
-0.848476767539978,
-0.10725796222686768,
-0.20429375767707825,
0.3903169631958008,
-0.10618703067302704,
-0.0070802560076117516,
0.6257027983665466,
0.5338449478149414,
-0.3575112819671631,
-0.12438742071390152,
-0.5549141764640808,
-0.35942795872688293,
0.598785400390625,
0.2779221832752228,
0.09611405432224274,
-0.47976720333099365,
-0.2409546673297882,
-0.4748484492301941,
-0.08338186144828796,
0.3404194414615631,
0.5882681608200073,
0.44642430543899536,
-0.44282448291778564,
0.5732621550559998,
-0.2661604881286621,
0.5700962543487549,
0.12068025022745132,
-0.37237221002578735,
0.8199913501739502,
-0.23909173905849457,
-0.2411375343799591,
0.2854780852794647,
1.2318183183670044,
0.4997280538082123,
0.2650306820869446,
0.37517881393432617,
-0.09097935259342194,
0.20218738913536072,
-0.25190332531929016,
-1.0160470008850098,
-0.22721436619758606,
0.473802775144577,
-0.2813700735569,
-0.36208564043045044,
0.020568741485476494,
-0.9427499771118164,
-0.024060184136033058,
-0.160949245095253,
0.39185595512390137,
-0.5002195835113525,
-0.41022467613220215,
0.18007689714431763,
-0.2529834508895874,
0.06783634424209595,
-0.024782119318842888,
-0.9717333912849426,
0.07536932080984116,
0.3224676549434662,
0.7980319857597351,
0.13856621086597443,
-0.6952987909317017,
-0.2248198539018631,
-0.24168993532657623,
-0.11185012757778168,
0.3049984872341156,
-0.16146968305110931,
-0.4623350203037262,
-0.06770973652601242,
0.29865211248397827,
-0.32033205032348633,
-0.5476039052009583,
0.7032583355903625,
-0.09399200975894928,
0.5751771330833435,
-0.22338654100894928,
-0.4835422933101654,
-0.23707950115203857,
0.4360879361629486,
-0.42560872435569763,
1.4527554512023926,
0.19577337801456451,
-1.0659980773925781,
0.32357257604599,
-0.5385249853134155,
-0.3662547767162323,
-0.22926944494247437,
0.1258484274148941,
-0.7063224911689758,
-0.11535318195819855,
0.2074887901544571,
0.688817024230957,
0.03906818479299545,
0.5168581604957581,
-0.2577940821647644,
-0.3859351575374603,
0.20404163002967834,
-0.4110628664493561,
1.2847322225570679,
0.12645192444324493,
-0.4331357777118683,
-0.06493634730577469,
-1.049088716506958,
-0.11262098699808121,
0.3273368775844574,
-0.7241313457489014,
-0.3380880057811737,
-0.4091617166996002,
0.17115719616413116,
0.24175558984279633,
0.3874700665473938,
-0.5754343867301941,
0.4399408996105194,
-0.3655151426792145,
0.3326511085033417,
0.6861613392829895,
-0.033389680087566376,
0.25470060110092163,
-0.10988005995750427,
0.3667781352996826,
0.6552728414535522,
0.09200559556484222,
-0.24013438820838928,
-0.35908442735671997,
-1.2825679779052734,
-0.2276952564716339,
0.191849023103714,
0.6835653185844421,
-0.540343165397644,
0.5634767413139343,
-0.24607537686824799,
-0.6517527103424072,
-0.5275554060935974,
0.041574422270059586,
0.2685469090938568,
0.8865997791290283,
0.516694188117981,
-0.18779678642749786,
-0.7154311537742615,
-0.829002320766449,
-0.16567881405353546,
-0.43123772740364075,
0.3180263936519623,
0.04198471084237099,
0.8158414959907532,
-0.3285379707813263,
0.819050669670105,
-0.6916912198066711,
-0.3018593192100525,
-0.43215200304985046,
0.22533804178237915,
0.6891235709190369,
0.6749515533447266,
0.7738959789276123,
-0.529201865196228,
-0.6324508786201477,
-0.24669618904590607,
-0.8731020092964172,
0.04561099410057068,
-0.34258121252059937,
-0.12258069962263107,
0.3751808702945709,
0.22711801528930664,
-0.679164469242096,
0.40447279810905457,
0.17386439442634583,
-0.40463846921920776,
0.5884866714477539,
-0.3044930398464203,
0.14342081546783447,
-1.4924159049987793,
-0.026319315657019615,
0.3020429313182831,
0.06350457668304443,
-0.5146099328994751,
-0.15826362371444702,
0.03429345041513443,
0.037025656551122665,
-0.5904970765113831,
0.6671408414840698,
-0.3072093427181244,
0.3766489028930664,
-0.03483572229743004,
0.011546014808118343,
0.1795368641614914,
0.7742876410484314,
0.20478731393814087,
0.47823822498321533,
1.0565780401229858,
-0.5489673018455505,
0.4947156608104706,
0.4110449254512787,
-0.15946677327156067,
0.6117566227912903,
-0.49028387665748596,
-0.11651827394962311,
-0.20242047309875488,
0.16456261277198792,
-1.046607494354248,
-0.17021311819553375,
0.5394555330276489,
-0.5798127055168152,
0.5094132423400879,
-0.36558347940444946,
-0.4111066460609436,
-0.5477431416511536,
-0.23179183900356293,
0.17780548334121704,
0.5334274768829346,
-0.5197737216949463,
0.5433135628700256,
0.09931229054927826,
0.012458658777177334,
-0.8220103979110718,
-0.8416129946708679,
-0.13360735774040222,
-0.43649908900260925,
-0.3143593966960907,
0.0662197470664978,
-0.04810987412929535,
-0.14220212399959564,
-0.16980914771556854,
0.04895379766821861,
-0.09817426651716232,
-0.037403419613838196,
0.23037630319595337,
0.6167507767677307,
-0.0840337872505188,
0.024146834388375282,
0.088313028216362,
-0.13697528839111328,
0.2825872600078583,
-0.00613996060565114,
0.726861834526062,
-0.3430855870246887,
-0.1115041971206665,
-0.605016827583313,
0.07290267199277878,
0.6686370372772217,
-0.1625898778438568,
1.011648416519165,
0.8928975462913513,
-0.3090614676475525,
0.2054380178451538,
-0.4805453419685364,
-0.15487077832221985,
-0.46443289518356323,
0.7647757530212402,
-0.3370456397533417,
-0.4262871742248535,
0.655996561050415,
0.016282984986901283,
-0.021412258967757225,
0.7784789204597473,
0.6438211798667908,
-0.013329635374248028,
1.0578548908233643,
0.402500182390213,
-0.4028906524181366,
0.518169641494751,
-0.8170050978660583,
0.07940339297056198,
-0.813376784324646,
-0.472538024187088,
-0.5947590470314026,
-0.19091057777404785,
-0.6284322738647461,
-0.05448625609278679,
0.21421624720096588,
0.3449607193470001,
-0.4409116208553314,
0.3471085727214813,
-0.6100245118141174,
0.2096313238143921,
0.5536919832229614,
-0.022439084947109222,
0.0000019868648450938053,
0.1367054134607315,
-0.455816388130188,
-0.11930766701698303,
-0.6109405159950256,
-0.45331278443336487,
1.1934517621994019,
0.5002962946891785,
0.544383704662323,
-0.25841933488845825,
0.9329877495765686,
-0.20253072679042816,
0.13593055307865143,
-0.8678184151649475,
0.597660481929779,
0.055201344192028046,
-0.6843124628067017,
-0.04392404481768608,
-0.5438390970230103,
-0.663605809211731,
0.26518571376800537,
-0.10582780092954636,
-0.8464519381523132,
0.10392727702856064,
-0.003883750643581152,
-0.15726856887340546,
0.47668808698654175,
-0.7430782318115234,
1.0795636177062988,
-0.2869724631309509,
-0.5180591940879822,
0.0017700165044516325,
-0.5456413626670837,
0.22625786066055298,
0.07168905436992645,
0.12730400264263153,
-0.10734465718269348,
0.3676530420780182,
1.1238915920257568,
-0.5725852847099304,
0.9179830551147461,
-0.5900859236717224,
0.21927332878112793,
0.4783172309398651,
-0.24798746407032013,
0.3681569993495941,
0.11099783331155777,
-0.22181424498558044,
0.5061706304550171,
0.2008087933063507,
-0.4547550082206726,
-0.3689343333244324,
0.8025877475738525,
-1.0826606750488281,
-0.5596033930778503,
-0.8962591886520386,
-0.47932592034339905,
-0.06454396992921829,
0.2746424973011017,
0.4115177392959595,
0.3038800358772278,
0.04987620934844017,
0.030876951292157173,
0.47472521662712097,
-0.33285999298095703,
0.6501190662384033,
0.4695257842540741,
-0.19449572265148163,
-0.40712013840675354,
0.9310046434402466,
0.15243187546730042,
0.1049860417842865,
0.12614291906356812,
0.2941862642765045,
-0.5167462229728699,
-0.35023629665374756,
-0.6546961069107056,
0.3110356032848358,
-0.9395108222961426,
-0.10249856859445572,
-0.8376535773277283,
-0.21132582426071167,
-0.5980247855186462,
0.08252711594104767,
-0.48724365234375,
-0.3683452606201172,
-0.5054958462715149,
-0.31560665369033813,
0.6747506856918335,
0.2986595928668976,
-0.03395215421915054,
0.43981054425239563,
-0.7806041836738586,
-0.007339690811932087,
-0.025449279695749283,
0.24174168705940247,
0.10033091902732849,
-0.8636226058006287,
-0.38182875514030457,
0.21964503824710846,
-0.5517026782035828,
-0.788862943649292,
0.6254121661186218,
0.06258028745651245,
0.5354520082473755,
0.3880329430103302,
-0.0950305238366127,
0.8892557621002197,
-0.09744285047054291,
0.9343542456626892,
0.3208199739456177,
-0.9660277366638184,
0.7015038132667542,
-0.203999862074852,
0.3479664921760559,
0.7139454483985901,
0.7180793285369873,
-0.6759774684906006,
-0.2814334034919739,
-0.6524807810783386,
-1.041753888130188,
1.0127017498016357,
-0.008382504805922508,
0.3956972062587738,
-0.11921685189008713,
0.38573598861694336,
-0.08182943612337112,
0.1931678056716919,
-1.013801097869873,
-0.661194920539856,
-0.5162009000778198,
-0.370460569858551,
-0.12946534156799316,
-0.12141738831996918,
-0.05911977216601372,
-0.8446475267410278,
1.0116380453109741,
0.007436632644385099,
0.016583221033215523,
0.2248038947582245,
0.10371647775173187,
0.08519818633794785,
0.2315388321876526,
0.25156351923942566,
0.2572520673274994,
-0.399242103099823,
-0.11305199563503265,
0.4683854579925537,
-0.8243314623832703,
0.42101413011550903,
0.11180196702480316,
-0.16694380342960358,
0.2147085815668106,
0.20480790734291077,
1.068890929222107,
-0.1418091207742691,
-0.40251365303993225,
0.6123364567756653,
-0.20927082002162933,
-0.29535701870918274,
-0.5635491609573364,
0.00003129182005068287,
0.07350143790245056,
0.10168246924877167,
0.26478710770606995,
0.20785149931907654,
-0.21041493117809296,
-0.6850137710571289,
-0.07905244827270508,
0.1506514996290207,
-0.4747576415538788,
-0.29015564918518066,
0.7590258717536926,
-0.13429468870162964,
-0.016984552145004272,
0.8973324298858643,
-0.16552358865737915,
-0.6777505278587341,
0.6652430295944214,
0.46849116683006287,
0.8025674819946289,
-0.05117015540599823,
0.18485493957996368,
1.0341814756393433,
-0.04992195591330528,
-0.24772050976753235,
0.3568253219127655,
0.21329455077648163,
-0.7495002150535583,
-0.05992706120014191,
-1.0142840147018433,
-0.011901428923010826,
0.2458997517824173,
-0.8433337807655334,
0.5054144263267517,
-0.5087416768074036,
-0.36235350370407104,
0.026797998696565628,
0.20443837344646454,
-0.653426468372345,
0.4176720678806305,
0.0774349570274353,
0.7782259583473206,
-1.1264231204986572,
1.0222762823104858,
0.857324481010437,
-0.8258009552955627,
-1.144237756729126,
-0.1725180745124817,
-0.08329498022794724,
-0.570935845375061,
0.791363000869751,
0.26529785990715027,
0.2910483479499817,
-0.076692134141922,
-0.26553183794021606,
-0.495652437210083,
1.0448499917984009,
0.24578547477722168,
-0.587749183177948,
0.1321491152048111,
0.40724194049835205,
0.7370767593383789,
-0.11424974352121353,
0.6281313300132751,
0.6127136945724487,
0.5176052451133728,
0.20197847485542297,
-0.662254810333252,
0.02198966220021248,
-0.47323840856552124,
-0.24693606793880463,
0.061684370040893555,
-0.8706133365631104,
1.3369196653366089,
-0.19981873035430908,
0.03171564266085625,
-0.07413803786039352,
0.5001288056373596,
0.3622297942638397,
0.32862451672554016,
0.2868562936782837,
0.8850472569465637,
0.7482246160507202,
-0.3929866552352905,
0.8826268315315247,
-0.3952358663082123,
0.793142557144165,
0.8278114199638367,
-0.07067899405956268,
0.7333569526672363,
0.7148194313049316,
-0.42318588495254517,
0.596023440361023,
0.8419816493988037,
-0.4016205370426178,
0.4354598820209503,
0.1768418699502945,
-0.31667158007621765,
-0.13320301473140717,
0.0848551020026207,
-0.47647416591644287,
0.5647650957107544,
0.010929062962532043,
-0.5471029281616211,
-0.06897538155317307,
-0.010871986858546734,
0.4648008644580841,
-0.22473762929439545,
-0.2791406810283661,
0.6025123000144958,
-0.0772523432970047,
-0.8317470550537109,
0.9527260661125183,
0.07552453875541687,
0.9273698329925537,
-0.6418828368186951,
-0.013856993988156319,
-0.35043570399284363,
0.5746862292289734,
-0.3722313940525055,
-0.6798180341720581,
0.17201028764247894,
-0.035682566463947296,
-0.26044386625289917,
-0.021668167784810066,
0.32211926579475403,
-0.5295326709747314,
-0.8918417692184448,
0.38675594329833984,
0.38063204288482666,
0.3957178294658661,
0.04749513790011406,
-0.8992863297462463,
0.027944251894950867,
0.2869929075241089,
-0.4668998718261719,
0.4806798994541168,
0.430240273475647,
0.07214802503585815,
0.43074294924736023,
0.65126633644104,
0.17481094598770142,
0.05980389192700386,
0.13853409886360168,
0.9816836714744568,
-0.572273313999176,
-0.24422471225261688,
-1.2335807085037231,
0.7280188798904419,
-0.10347729921340942,
-0.6435832381248474,
0.9488844871520996,
0.9191951155662537,
1.198740839958191,
-0.29713544249534607,
0.9544982314109802,
-0.1955738365650177,
0.2654883563518524,
-0.2440430223941803,
0.9164099097251892,
-0.7152960896492004,
0.059195902198553085,
-0.44258078932762146,
-0.8122182488441467,
-0.08296316117048264,
0.8081680536270142,
-0.5123816132545471,
0.129696324467659,
0.6305716037750244,
0.838033139705658,
-0.07381979376077652,
-0.2620726227760315,
0.054606933146715164,
0.3316575288772583,
0.23271247744560242,
0.5932343006134033,
0.682802677154541,
-0.8647160530090332,
0.5393580198287964,
-0.6960259079933167,
-0.17227809131145477,
-0.024788543581962585,
-0.7334735989570618,
-1.1791545152664185,
-0.7173511981964111,
-0.5733997821807861,
-0.5799549221992493,
-0.35316258668899536,
0.9741923213005066,
0.48439329862594604,
-1.010640263557434,
-0.3843822479248047,
-0.007045652251690626,
-0.08661789447069168,
-0.1785144954919815,
-0.3450290560722351,
0.5267276167869568,
-0.268673300743103,
-1.1466535329818726,
-0.09054581820964813,
-0.16868655383586884,
0.36490267515182495,
-0.25388243794441223,
-0.22894440591335297,
-0.3630455434322357,
-0.2673009932041168,
0.290761798620224,
0.11101903766393661,
-0.5098236799240112,
-0.06202064827084541,
-0.028792111203074455,
-0.19226549565792084,
0.28916501998901367,
0.2651863694190979,
-0.5874618887901306,
0.5180894136428833,
0.4790142774581909,
0.0812065601348877,
0.6772502064704895,
-0.2677573561668396,
0.1918034553527832,
-0.8015450835227966,
0.643942654132843,
0.07278020679950714,
0.7818395495414734,
0.41277456283569336,
-0.3513282835483551,
0.31316715478897095,
0.5843989253044128,
-0.3656604290008545,
-0.8531849980354309,
-0.31715476512908936,
-1.003671407699585,
-0.14089086651802063,
1.1674187183380127,
-0.41896915435791016,
-0.39004284143447876,
0.12253837287425995,
-0.526698887348175,
0.6319882869720459,
-0.42213988304138184,
0.844411313533783,
0.9462198615074158,
0.1169399619102478,
-0.03800344467163086,
-0.4550760090351105,
0.37900012731552124,
0.40188518166542053,
-0.5396080017089844,
-0.022506410256028175,
0.2153031975030899,
0.5748738646507263,
0.29080790281295776,
0.5769646763801575,
-0.07765994966030121,
0.03394843265414238,
0.23439712822437286,
0.3977535665035248,
-0.17894451320171356,
-0.03991014510393143,
-0.3481060266494751,
-0.05459234490990639,
-0.12807132303714752,
-0.36843934655189514
] |
SamLowe/roberta-base-go_emotions | SamLowe | "2023-10-04T10:00:58Z" | 6,502,514 | 191 | transformers | [
"transformers",
"pytorch",
"safetensors",
"roberta",
"text-classification",
"emotions",
"multi-class-classification",
"multi-label-classification",
"en",
"dataset:go_emotions",
"license:mit",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-09-15T13:04:21Z" | ---
language: en
tags:
- text-classification
- pytorch
- roberta
- emotions
- multi-class-classification
- multi-label-classification
datasets:
- go_emotions
license: mit
widget:
- text: I am not having a great day.
---
#### Overview
Model trained from [roberta-base](https://huggingface.co/roberta-base) on the [go_emotions](https://huggingface.co/datasets/go_emotions) dataset for multi-label classification.
##### ONNX version also available
A version of this model in ONNX format (including an INT8 quantized ONNX version) is now available at [https://huggingface.co/SamLowe/roberta-base-go_emotions-onnx](https://huggingface.co/SamLowe/roberta-base-go_emotions-onnx). These are faster for inference, esp for smaller batch sizes, massively reduce the size of the dependencies required for inference, make inference of the model more multi-platform, and in the case of the quantized version reduce the model file/download size by 75% whilst retaining almost all the accuracy if you only need inference.
#### Dataset used for the model
[go_emotions](https://huggingface.co/datasets/go_emotions) is based on Reddit data and has 28 labels. It is a multi-label dataset where one or multiple labels may apply for any given input text, hence this model is a multi-label classification model with 28 'probability' float outputs for any given input text. Typically a threshold of 0.5 is applied to the probabilities for the prediction for each label.
#### How the model was created
The model was trained using `AutoModelForSequenceClassification.from_pretrained` with `problem_type="multi_label_classification"` for 3 epochs with a learning rate of 2e-5 and weight decay of 0.01.
#### Inference
There are multiple ways to use this model in Huggingface Transformers. Possibly the simplest is using a pipeline:
```python
from transformers import pipeline
classifier = pipeline(task="text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None)
sentences = ["I am not having a great day"]
model_outputs = classifier(sentences)
print(model_outputs[0])
# produces a list of dicts for each of the labels
```
#### Evaluation / metrics
Evaluation of the model is available at
- https://github.com/samlowe/go_emotions-dataset/blob/main/eval-roberta-base-go_emotions.ipynb
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/samlowe/go_emotions-dataset/blob/main/eval-roberta-base-go_emotions.ipynb)
##### Summary
As provided in the above notebook, evaluation of the multi-label output (of the 28 dim output via a threshold of 0.5 to binarize each) using the dataset test split gives:
- Accuracy: 0.474
- Precision: 0.575
- Recall: 0.396
- F1: 0.450
But the metrics are more meaningful when measured per label given the multi-label nature (each label is effectively an independent binary classification) and the fact that there is drastically different representations of the labels in the dataset.
With a threshold of 0.5 applied to binarize the model outputs, as per the above notebook, the metrics per label are:
| | accuracy | precision | recall | f1 | mcc | support | threshold |
| -------------- | -------- | --------- | ------ | ----- | ----- | ------- | --------- |
| admiration | 0.946 | 0.725 | 0.675 | 0.699 | 0.670 | 504 | 0.5 |
| amusement | 0.982 | 0.790 | 0.871 | 0.829 | 0.821 | 264 | 0.5 |
| anger | 0.970 | 0.652 | 0.379 | 0.479 | 0.483 | 198 | 0.5 |
| annoyance | 0.940 | 0.472 | 0.159 | 0.238 | 0.250 | 320 | 0.5 |
| approval | 0.942 | 0.609 | 0.302 | 0.404 | 0.403 | 351 | 0.5 |
| caring | 0.973 | 0.448 | 0.319 | 0.372 | 0.364 | 135 | 0.5 |
| confusion | 0.972 | 0.500 | 0.431 | 0.463 | 0.450 | 153 | 0.5 |
| curiosity | 0.950 | 0.537 | 0.356 | 0.428 | 0.412 | 284 | 0.5 |
| desire | 0.987 | 0.630 | 0.410 | 0.496 | 0.502 | 83 | 0.5 |
| disappointment | 0.974 | 0.625 | 0.199 | 0.302 | 0.343 | 151 | 0.5 |
| disapproval | 0.950 | 0.494 | 0.307 | 0.379 | 0.365 | 267 | 0.5 |
| disgust | 0.982 | 0.707 | 0.333 | 0.453 | 0.478 | 123 | 0.5 |
| embarrassment | 0.994 | 0.750 | 0.243 | 0.367 | 0.425 | 37 | 0.5 |
| excitement | 0.983 | 0.603 | 0.340 | 0.435 | 0.445 | 103 | 0.5 |
| fear | 0.992 | 0.758 | 0.603 | 0.671 | 0.672 | 78 | 0.5 |
| gratitude | 0.990 | 0.960 | 0.881 | 0.919 | 0.914 | 352 | 0.5 |
| grief | 0.999 | 0.000 | 0.000 | 0.000 | 0.000 | 6 | 0.5 |
| joy | 0.978 | 0.647 | 0.559 | 0.600 | 0.590 | 161 | 0.5 |
| love | 0.982 | 0.773 | 0.832 | 0.802 | 0.793 | 238 | 0.5 |
| nervousness | 0.996 | 0.600 | 0.130 | 0.214 | 0.278 | 23 | 0.5 |
| optimism | 0.972 | 0.667 | 0.376 | 0.481 | 0.488 | 186 | 0.5 |
| pride | 0.997 | 0.000 | 0.000 | 0.000 | 0.000 | 16 | 0.5 |
| realization | 0.974 | 0.541 | 0.138 | 0.220 | 0.264 | 145 | 0.5 |
| relief | 0.998 | 0.000 | 0.000 | 0.000 | 0.000 | 11 | 0.5 |
| remorse | 0.991 | 0.553 | 0.750 | 0.636 | 0.640 | 56 | 0.5 |
| sadness | 0.977 | 0.621 | 0.494 | 0.550 | 0.542 | 156 | 0.5 |
| surprise | 0.981 | 0.750 | 0.404 | 0.525 | 0.542 | 141 | 0.5 |
| neutral | 0.782 | 0.694 | 0.604 | 0.646 | 0.492 | 1787 | 0.5 |
Optimizing the threshold per label for the one that gives the optimum F1 metrics gives slightly better metrics - sacrificing some precision for a greater gain in recall, hence to the benefit of F1 (how this was done is shown in the above notebook):
| | accuracy | precision | recall | f1 | mcc | support | threshold |
| -------------- | -------- | --------- | ------ | ----- | ----- | ------- | --------- |
| admiration | 0.940 | 0.651 | 0.776 | 0.708 | 0.678 | 504 | 0.25 |
| amusement | 0.982 | 0.781 | 0.890 | 0.832 | 0.825 | 264 | 0.45 |
| anger | 0.959 | 0.454 | 0.601 | 0.517 | 0.502 | 198 | 0.15 |
| annoyance | 0.864 | 0.243 | 0.619 | 0.349 | 0.328 | 320 | 0.10 |
| approval | 0.926 | 0.432 | 0.442 | 0.437 | 0.397 | 351 | 0.30 |
| caring | 0.972 | 0.426 | 0.385 | 0.405 | 0.391 | 135 | 0.40 |
| confusion | 0.974 | 0.548 | 0.412 | 0.470 | 0.462 | 153 | 0.55 |
| curiosity | 0.943 | 0.473 | 0.711 | 0.568 | 0.552 | 284 | 0.25 |
| desire | 0.985 | 0.518 | 0.530 | 0.524 | 0.516 | 83 | 0.25 |
| disappointment | 0.974 | 0.562 | 0.298 | 0.390 | 0.398 | 151 | 0.40 |
| disapproval | 0.941 | 0.414 | 0.468 | 0.439 | 0.409 | 267 | 0.30 |
| disgust | 0.978 | 0.523 | 0.463 | 0.491 | 0.481 | 123 | 0.20 |
| embarrassment | 0.994 | 0.567 | 0.459 | 0.507 | 0.507 | 37 | 0.10 |
| excitement | 0.981 | 0.500 | 0.417 | 0.455 | 0.447 | 103 | 0.35 |
| fear | 0.991 | 0.712 | 0.667 | 0.689 | 0.685 | 78 | 0.40 |
| gratitude | 0.990 | 0.957 | 0.889 | 0.922 | 0.917 | 352 | 0.45 |
| grief | 0.999 | 0.333 | 0.333 | 0.333 | 0.333 | 6 | 0.05 |
| joy | 0.978 | 0.623 | 0.646 | 0.634 | 0.623 | 161 | 0.40 |
| love | 0.982 | 0.740 | 0.899 | 0.812 | 0.807 | 238 | 0.25 |
| nervousness | 0.996 | 0.571 | 0.348 | 0.432 | 0.444 | 23 | 0.25 |
| optimism | 0.971 | 0.580 | 0.565 | 0.572 | 0.557 | 186 | 0.20 |
| pride | 0.998 | 0.875 | 0.438 | 0.583 | 0.618 | 16 | 0.10 |
| realization | 0.961 | 0.270 | 0.262 | 0.266 | 0.246 | 145 | 0.15 |
| relief | 0.992 | 0.152 | 0.636 | 0.246 | 0.309 | 11 | 0.05 |
| remorse | 0.991 | 0.541 | 0.946 | 0.688 | 0.712 | 56 | 0.10 |
| sadness | 0.977 | 0.599 | 0.583 | 0.591 | 0.579 | 156 | 0.40 |
| surprise | 0.977 | 0.543 | 0.674 | 0.601 | 0.593 | 141 | 0.15 |
| neutral | 0.758 | 0.598 | 0.810 | 0.688 | 0.513 | 1787 | 0.25 |
This improves the overall metrics:
- Precision: 0.542
- Recall: 0.577
- F1: 0.541
Or if calculated weighted by the relative size of the support of each label:
- Precision: 0.572
- Recall: 0.677
- F1: 0.611
#### Commentary on the dataset
Some labels (E.g. gratitude) when considered independently perform very strongly with F1 exceeding 0.9, whilst others (E.g. relief) perform very poorly.
This is a challenging dataset. Labels such as relief do have much fewer examples in the training data (less than 100 out of the 40k+, and only 11 in the test split).
But there is also some ambiguity and/or labelling errors visible in the training data of go_emotions that is suspected to constrain the performance. Data cleaning on the dataset to reduce some of the mistakes, ambiguity, conflicts and duplication in the labelling would produce a higher performing model. | [
-0.5685542821884155,
-0.5224471092224121,
0.16980227828025818,
0.2412414848804474,
-0.008656367659568787,
0.11321122199296951,
0.099518783390522,
-0.33568471670150757,
0.7067083716392517,
0.3838074207305908,
-0.416912317276001,
-0.7787486910820007,
-0.8770251274108887,
-0.02863449603319168,
0.049702439457178116,
1.2237138748168945,
-0.08701402693986893,
-0.07944588363170624,
0.03475314378738403,
-0.42497819662094116,
-0.3146204352378845,
-0.30473703145980835,
-0.6484969258308411,
-0.16723500192165375,
0.3814612030982971,
0.4959549009799957,
0.7229071855545044,
0.4901033937931061,
0.562218964099884,
0.47586438059806824,
-0.33608341217041016,
-0.03786308690905571,
-0.3148886561393738,
-0.3588007688522339,
0.29796692728996277,
-0.5736772418022156,
-0.5545112490653992,
0.27175864577293396,
0.29117119312286377,
0.6971438527107239,
0.006013965699821711,
0.4037908911705017,
-0.05018054321408272,
1.1922284364700317,
-0.4726521074771881,
0.16634896397590637,
-0.13057321310043335,
0.057455409318208694,
0.09208561480045319,
-0.04998575896024704,
-0.12656202912330627,
-0.7974928021430969,
0.11095663905143738,
-0.5947578549385071,
0.22939305007457733,
0.09791474789381027,
1.4322024583816528,
0.1980428248643875,
-0.36852025985717773,
-0.4210313856601715,
-0.2856094241142273,
0.7004835605621338,
-0.7498067617416382,
0.3389478623867035,
0.5690163969993591,
-0.02795509062707424,
-0.11416032910346985,
-0.5589703917503357,
-0.6175594329833984,
0.23142392933368683,
-0.5703551769256592,
0.36324024200439453,
-0.21272405982017517,
-0.3525032699108124,
0.4781450629234314,
0.7033828496932983,
-0.7609862089157104,
-0.3661161959171295,
-0.3860585391521454,
-0.2585175335407257,
0.6729011535644531,
0.01277970988303423,
0.28975236415863037,
-0.4944377839565277,
-0.5320039987564087,
-0.23664309084415436,
-0.12382738292217255,
0.614143967628479,
0.27330613136291504,
0.021690763533115387,
-0.4620850384235382,
0.4896332323551178,
-0.2296290248632431,
0.5435478091239929,
0.24530011415481567,
-0.4175257384777069,
1.038394808769226,
-0.5360574722290039,
-0.2336231768131256,
-0.017915206030011177,
0.9243283271789551,
0.5210553407669067,
0.06200940161943436,
0.19752542674541473,
-0.01873861439526081,
0.14117148518562317,
-0.08371148258447647,
-0.7142008543014526,
-0.3998836278915405,
0.6191181540489197,
-0.5794132351875305,
-0.2934997081756592,
0.19469036161899567,
-0.7585964202880859,
0.0763603150844574,
-0.2521025538444519,
0.6106569170951843,
-0.4461960196495056,
-0.14438766241073608,
-0.019688840955495834,
-0.3961966037750244,
-0.09845521301031113,
0.23960015177726746,
-1.0480141639709473,
-0.03493032231926918,
0.24411611258983612,
0.8421015739440918,
0.03142384812235832,
0.015891801565885544,
-0.010917623527348042,
0.22695674002170563,
-0.5551553964614868,
0.6197102665901184,
-0.2348964661359787,
-0.40137720108032227,
-0.5612779855728149,
0.36746466159820557,
-0.18049095571041107,
-0.44144394993782043,
0.7259357571601868,
-0.2834850549697876,
0.3767942190170288,
-0.31233903765678406,
-0.35753437876701355,
-0.327680766582489,
0.35311487317085266,
-0.8899390697479248,
1.4596506357192993,
0.4444619119167328,
-0.9278964996337891,
0.5351051688194275,
-0.7004924416542053,
0.021308118477463722,
-0.2495770901441574,
0.268576055765152,
-0.7775558829307556,
-0.167546808719635,
0.3472626209259033,
0.35602009296417236,
-0.26621049642562866,
0.17934204638004303,
-0.12174497544765472,
-0.07763940095901489,
0.19640418887138367,
-0.24363355338573456,
1.3554104566574097,
0.22033554315567017,
-0.4511982500553131,
0.09224210679531097,
-1.1709977388381958,
0.18600045144557953,
0.13631770014762878,
-0.6586935520172119,
-0.24196739494800568,
-0.5717575550079346,
-0.10653538256883621,
0.3131910562515259,
0.3433295488357544,
-0.5212266445159912,
0.0814632996916771,
-0.09021829068660736,
0.5321957468986511,
0.6214818954467773,
0.12701058387756348,
0.2881562113761902,
-0.7403218746185303,
0.3610398769378662,
0.4608672261238098,
0.28252094984054565,
-0.07221531122922897,
-0.6558046340942383,
-0.846312403678894,
-0.6193381547927856,
0.38533905148506165,
0.6802266240119934,
-0.2324216663837433,
0.6875526905059814,
-0.17914129793643951,
-0.7526462078094482,
-0.590415358543396,
0.11417654901742935,
0.3323591649532318,
0.7576640248298645,
0.44190651178359985,
-0.40168866515159607,
-0.3937892019748688,
-0.931206464767456,
-0.08880671113729477,
-0.22775977849960327,
0.06024637818336487,
0.7888957858085632,
1.0102530717849731,
-0.29254093766212463,
1.0842859745025635,
-0.8331640362739563,
-0.6253892183303833,
0.15780892968177795,
0.11808466911315918,
0.5998317003250122,
0.5831244587898254,
0.8372527956962585,
-0.9750241041183472,
-0.8560196161270142,
0.039695125073194504,
-0.7124724388122559,
0.2134792059659958,
-0.11191114783287048,
-0.2708837389945984,
0.2706632912158966,
0.13445362448692322,
-0.5696512460708618,
0.8816486597061157,
0.5076183676719666,
-0.5013313293457031,
0.7937608957290649,
-0.4745234549045563,
0.4773308038711548,
-1.0186071395874023,
0.29594188928604126,
0.015640374273061752,
-0.06411080062389374,
-0.5735630989074707,
-0.4729909598827362,
0.31916573643684387,
0.20052146911621094,
-0.35526853799819946,
0.5638458728790283,
-0.6196063160896301,
0.08390320092439651,
0.39189478754997253,
0.03041054494678974,
0.24853184819221497,
0.7262868881225586,
0.13369120657444,
0.7666224241256714,
0.76032954454422,
-0.6662248373031616,
0.4674428701400757,
0.30774497985839844,
-0.5754055976867676,
0.9247964024543762,
-0.528221607208252,
-0.09229937940835953,
-0.18148235976696014,
0.2292460948228836,
-1.537901520729065,
-0.4315515458583832,
0.36516913771629333,
-0.8463174700737,
0.23033550381660461,
0.2721523940563202,
-0.2368595451116562,
-0.9387645721435547,
-0.5425633788108826,
0.045622628182172775,
0.35677990317344666,
-0.39399856328964233,
0.505614161491394,
0.5355792045593262,
-0.023718850687146187,
-0.7277606129646301,
-0.8554607033729553,
-0.17871111631393433,
-0.36095738410949707,
-0.6361147165298462,
0.3645305335521698,
-0.3165295720100403,
-0.037916071712970734,
-0.002298529725521803,
-0.022371046245098114,
-0.12652269005775452,
0.00875991303473711,
0.33855026960372925,
0.2416865974664688,
-0.14539572596549988,
0.03198613226413727,
-0.17905588448047638,
-0.37892282009124756,
-0.035841505974531174,
0.06782989948987961,
0.3031153678894043,
-0.3389063775539398,
0.023502130061388016,
-0.6563785672187805,
0.08498907834291458,
0.5385844707489014,
-0.2696731388568878,
0.9693747758865356,
0.6333545446395874,
-0.40518736839294434,
0.2504412531852722,
-0.5285332202911377,
0.035714682191610336,
-0.4523659646511078,
0.039593230932950974,
-0.6259278655052185,
-0.8331451416015625,
0.8004442453384399,
0.019534165039658546,
-0.10981435328722,
0.7423227429389954,
0.5931932330131531,
-0.20188643038272858,
0.9146737456321716,
0.4238448143005371,
-0.13027505576610565,
0.23886394500732422,
-0.6483795046806335,
0.18847297132015228,
-0.7996026873588562,
-0.792830228805542,
-0.5498220920562744,
-0.4725829064846039,
-0.40286293625831604,
-0.31552308797836304,
0.4776431620121002,
0.11669768393039703,
-0.7091583013534546,
0.3365805745124817,
-1.0734184980392456,
0.3179500997066498,
0.9189684987068176,
0.3445960581302643,
0.13292290270328522,
-0.0745813250541687,
-0.24926476180553436,
-0.23383010923862457,
-0.5770804286003113,
-0.4450759291648865,
1.1985737085342407,
0.3028782606124878,
0.47400206327438354,
0.38444212079048157,
0.6799222826957703,
0.3406732976436615,
0.4344501197338104,
-0.6816225647926331,
0.2732403576374054,
0.0020593965891748667,
-1.0491433143615723,
-0.3295719027519226,
-0.39010462164878845,
-1.1711527109146118,
0.33767157793045044,
-0.26032963395118713,
-1.2685778141021729,
0.48870599269866943,
0.14869113266468048,
-0.40736931562423706,
0.3979487717151642,
-0.8477334380149841,
1.0471417903900146,
-0.4506448209285736,
-0.3458136320114136,
0.285734087228775,
-1.0230125188827515,
0.3856745660305023,
-0.17509564757347107,
0.6194885969161987,
-0.3230893015861511,
0.0705353394150734,
0.9064010381698608,
-0.6487769484519958,
0.6098146438598633,
0.10933265835046768,
0.1665845364332199,
0.5345648527145386,
-0.22952590882778168,
0.38709115982055664,
-0.049590881913900375,
-0.0865614041686058,
-0.16376954317092896,
0.11991888284683228,
-0.4086540639400482,
-0.304047554731369,
0.9391484260559082,
-0.9886844754219055,
-0.5142592191696167,
-0.6783089637756348,
-0.6208102703094482,
0.024099843576550484,
0.424155056476593,
0.4815826714038849,
0.3411514163017273,
0.08541508764028549,
0.2901749610900879,
0.6974090337753296,
-0.3290018141269684,
0.5467134714126587,
0.22922950983047485,
-0.2717447876930237,
-0.9263956546783447,
1.1320958137512207,
0.19506798684597015,
0.3588806390762329,
0.39591068029403687,
0.36143606901168823,
-0.5777001976966858,
0.034747011959552765,
-0.337841272354126,
0.3479517102241516,
-0.4806023836135864,
-0.34157678484916687,
-0.8425676226615906,
0.020322948694229126,
-0.8324684500694275,
-0.3675316870212555,
-0.28361210227012634,
-0.4856135845184326,
-0.6288264393806458,
-0.21084895730018616,
0.742266833782196,
0.7544828057289124,
-0.37150493264198303,
0.3967006206512451,
-0.7557475566864014,
0.4605991244316101,
0.16060352325439453,
0.3369835615158081,
-0.10762979835271835,
-0.5468584299087524,
0.03927244618535042,
-0.08812464773654938,
-0.46468979120254517,
-1.0878825187683105,
0.8576078414916992,
-0.006905526854097843,
0.43972763419151306,
0.5751306414604187,
-0.019909048452973366,
0.9201107621192932,
-0.03481245040893555,
0.8779407143592834,
0.7800546884536743,
-1.0246049165725708,
0.7813498377799988,
-0.21277731657028198,
0.25425177812576294,
0.6194925904273987,
0.7330703735351562,
-0.6339146494865417,
-0.2903411090373993,
-1.0607713460922241,
-1.0851175785064697,
0.9255332350730896,
0.2755430042743683,
-0.2637445032596588,
0.1689407229423523,
0.11901963502168655,
-0.10574048012495041,
0.3916076123714447,
-1.079824447631836,
-1.0600639581680298,
-0.20590117573738098,
-0.3184562623500824,
-0.3761790096759796,
-0.23065373301506042,
-0.23722246289253235,
-0.670114278793335,
0.7905484437942505,
0.15275180339813232,
0.3444580137729645,
0.2936919927597046,
0.05371903255581856,
0.16563156247138977,
0.20603156089782715,
0.582014799118042,
0.5695138573646545,
-0.5634958148002625,
0.038759101182222366,
-0.0548911914229393,
-0.615628182888031,
0.3873991370201111,
-0.22654828429222107,
-0.41995179653167725,
0.05392899736762047,
0.12096428126096725,
0.7570112347602844,
0.06051945313811302,
-0.21410396695137024,
0.40677815675735474,
-0.006339401938021183,
-0.47577714920043945,
-0.33432117104530334,
-0.014537010341882706,
0.2658156156539917,
0.17550915479660034,
0.2262018620967865,
0.20902249217033386,
0.1015653908252716,
-0.7218092679977417,
0.32906296849250793,
0.4200330674648285,
-0.686945378780365,
0.1938214898109436,
0.9481567740440369,
0.024917883798480034,
-0.31766483187675476,
0.47724220156669617,
-0.12026815861463547,
-0.8582754135131836,
1.0485974550247192,
0.547746479511261,
0.3298633396625519,
-0.3800545036792755,
0.5022322535514832,
1.1078163385391235,
0.314323753118515,
0.011216557584702969,
0.4605239927768707,
0.20729690790176392,
-0.45532891154289246,
0.3291800320148468,
-0.8641645908355713,
-0.28722065687179565,
0.2097667008638382,
-0.694240391254425,
0.028016066178679466,
-0.37726858258247375,
-0.6314642429351807,
0.05863242223858833,
0.2540668547153473,
-0.7066527605056763,
0.7403444051742554,
-0.11583385616540909,
0.9286872744560242,
-0.8611338138580322,
0.6473449468612671,
0.6214867234230042,
-0.6821397542953491,
-1.2020881175994873,
-0.6779589056968689,
0.13088783621788025,
-0.5844870805740356,
0.788219690322876,
0.31232234835624695,
0.23187242448329926,
0.06878989189863205,
-0.37571194767951965,
-1.3516184091567993,
1.2829444408416748,
-0.17888332903385162,
-0.5035374164581299,
0.40807458758354187,
0.14090923964977264,
0.5214118361473083,
-0.13925211131572723,
0.6672961711883545,
0.9483975172042847,
0.7149487137794495,
0.20447339117527008,
-1.02141273021698,
0.032264094799757004,
-0.5236380696296692,
-0.1718323975801468,
0.29672861099243164,
-0.9983373284339905,
1.082103967666626,
-0.4594483971595764,
0.15821921825408936,
-0.06749318540096283,
0.6192444562911987,
0.49639540910720825,
0.30114036798477173,
0.39588209986686707,
1.073819637298584,
1.3292264938354492,
-0.5590481758117676,
1.0013254880905151,
-0.31522342562675476,
0.807933509349823,
0.7145565748214722,
0.30430272221565247,
0.6776529550552368,
0.4115298390388489,
-0.7028722763061523,
0.6278260946273804,
1.036057472229004,
-0.024283038452267647,
0.4986792802810669,
0.08852575719356537,
-0.2588859796524048,
0.05305315926671028,
0.1324905902147293,
-0.6123042106628418,
0.06667976826429367,
0.5287662744522095,
-0.5978066325187683,
0.02124851383268833,
-0.06837582588195801,
0.248969167470932,
-0.22035320103168488,
-0.519441545009613,
0.411068856716156,
-0.055600643157958984,
-0.5871714353561401,
0.609230637550354,
-0.13589274883270264,
0.7363165616989136,
-0.5184107422828674,
0.3146246373653412,
-0.13088467717170715,
0.6422345638275146,
-0.5815075039863586,
-1.1511746644973755,
0.14963731169700623,
-0.116877481341362,
-0.3333759009838104,
-0.14828377962112427,
0.40082257986068726,
-0.36109140515327454,
-0.6280496120452881,
0.14736463129520416,
0.0318589024245739,
0.42051225900650024,
0.20746181905269623,
-1.1574821472167969,
0.011122548021376133,
0.3902851641178131,
-0.6894670128822327,
0.08348651975393295,
0.5640032291412354,
0.12000798434019089,
0.6278238892555237,
0.7323552370071411,
0.005301629193127155,
0.09257953613996506,
-0.26096227765083313,
0.8218343257904053,
-0.8832746148109436,
-0.6420871019363403,
-0.7149198055267334,
0.5998086333274841,
-0.18817543983459473,
-0.7203982472419739,
0.863750159740448,
0.8604609966278076,
0.6187959909439087,
-0.2382703721523285,
0.7751221656799316,
-0.3771604895591736,
0.770476222038269,
-0.3566908836364746,
0.7948611378669739,
-0.8698117733001709,
-0.3180340826511383,
-0.3682296872138977,
-0.6796234846115112,
-0.7595743536949158,
0.9972535967826843,
-0.5883172750473022,
0.2328033149242401,
0.7098193764686584,
0.9249995350837708,
0.3669746518135071,
0.06817716360092163,
-0.06471951305866241,
0.23410016298294067,
0.09126847982406616,
0.91903156042099,
0.45618313550949097,
-0.7767785787582397,
0.4645563066005707,
-0.6737584471702576,
-0.27747347950935364,
-0.31083735823631287,
-0.8598273992538452,
-0.6997548937797546,
-0.5644171833992004,
-0.7001522183418274,
-0.6396772265434265,
-0.3527281880378723,
0.7455605864524841,
0.5549314022064209,
-0.8727903366088867,
-0.33366310596466064,
0.12815715372562408,
0.2800949811935425,
-0.12483907490968704,
-0.1672864407300949,
0.8822117447853088,
0.05707298591732979,
-0.7846251130104065,
-0.22730644047260284,
0.3299141228199005,
0.43691936135292053,
0.18167240917682648,
-0.23013338446617126,
-0.3418292701244354,
0.056213025003671646,
0.5825651288032532,
0.29758360981941223,
-0.6764048337936401,
-0.2095184326171875,
-0.07435189932584763,
-0.4968971014022827,
0.642533540725708,
0.06799435615539551,
-0.7292740345001221,
0.4597109258174896,
0.4837285876274109,
0.2737867832183838,
0.6445617079734802,
0.20794779062271118,
-0.04171430692076683,
-0.39636772871017456,
-0.06427176296710968,
-0.06594167649745941,
0.17848873138427734,
0.2598910331726074,
-0.4677579402923584,
0.8545459508895874,
0.5328994393348694,
-0.725647509098053,
-0.8247284293174744,
-0.1593232899904251,
-1.437454104423523,
-0.17131736874580383,
1.0633701086044312,
-0.21527202427387238,
-0.7348203063011169,
0.06298276036977768,
-0.3570789098739624,
0.12752372026443481,
-0.568078339099884,
0.40303051471710205,
0.975942850112915,
-0.34723830223083496,
-0.05256323516368866,
-0.7812464237213135,
0.4754699766635895,
0.2458585500717163,
-0.8960441946983337,
-0.2023780196905136,
0.49625343084335327,
0.44328373670578003,
0.5580965876579285,
0.9485836625099182,
-0.16363410651683807,
0.06510138511657715,
0.2901112139225006,
0.2823200523853302,
0.2640009820461273,
-0.028793344274163246,
0.09904742985963821,
0.34230294823646545,
-0.283801406621933,
-0.524368166923523
] |
marieke93/MiniLM-evidence-types | marieke93 | "2022-06-11T13:32:27Z" | 6,416,609 | 5 | transformers | [
"transformers",
"pytorch",
"tensorboard",
"bert",
"text-classification",
"generated_from_trainer",
"license:mit",
"endpoints_compatible",
"region:us"
] | text-classification | "2022-06-07T14:19:25Z" | ---
license: mit
tags:
- generated_from_trainer
metrics:
- accuracy
model-index:
- name: MiniLM-evidence-types
results: []
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# MiniLM-evidence-types
This model is a fine-tuned version of [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) on the evidence types dataset.
It achieved the following results on the evaluation set:
- Loss: 1.8672
- Macro f1: 0.3726
- Weighted f1: 0.7030
- Accuracy: 0.7161
- Balanced accuracy: 0.3616
## Training and evaluation data
The data set, as well as the code that was used to fine tune this model can be found in the GitHub repository [BA-Thesis-Information-Science-Persuasion-Strategies](https://github.com/mariekevdh/BA-Thesis-Information-Science-Persuasion-Strategies)
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 20
- mixed_precision_training: Native AMP
### Training results
| Training Loss | Epoch | Step | Validation Loss | Macro f1 | Weighted f1 | Accuracy | Balanced accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:-----------:|:--------:|:-----------------:|
| 1.4106 | 1.0 | 250 | 1.2698 | 0.1966 | 0.6084 | 0.6735 | 0.2195 |
| 1.1437 | 2.0 | 500 | 1.0985 | 0.3484 | 0.6914 | 0.7116 | 0.3536 |
| 0.9714 | 3.0 | 750 | 1.0901 | 0.2606 | 0.6413 | 0.6446 | 0.2932 |
| 0.8382 | 4.0 | 1000 | 1.0197 | 0.2764 | 0.7024 | 0.7237 | 0.2783 |
| 0.7192 | 5.0 | 1250 | 1.0895 | 0.2847 | 0.6824 | 0.6963 | 0.2915 |
| 0.6249 | 6.0 | 1500 | 1.1296 | 0.3487 | 0.6888 | 0.6948 | 0.3377 |
| 0.5336 | 7.0 | 1750 | 1.1515 | 0.3591 | 0.6982 | 0.7024 | 0.3496 |
| 0.4694 | 8.0 | 2000 | 1.1962 | 0.3626 | 0.7185 | 0.7314 | 0.3415 |
| 0.4058 | 9.0 | 2250 | 1.3313 | 0.3121 | 0.6920 | 0.7085 | 0.3033 |
| 0.3746 | 10.0 | 2500 | 1.3993 | 0.3628 | 0.6976 | 0.7047 | 0.3495 |
| 0.3267 | 11.0 | 2750 | 1.5078 | 0.3560 | 0.6958 | 0.7055 | 0.3464 |
| 0.2939 | 12.0 | 3000 | 1.5875 | 0.3685 | 0.6968 | 0.7062 | 0.3514 |
| 0.2677 | 13.0 | 3250 | 1.6470 | 0.3606 | 0.6976 | 0.7070 | 0.3490 |
| 0.2425 | 14.0 | 3500 | 1.7164 | 0.3714 | 0.7069 | 0.7207 | 0.3551 |
| 0.2301 | 15.0 | 3750 | 1.8151 | 0.3597 | 0.6975 | 0.7123 | 0.3466 |
| 0.2268 | 16.0 | 4000 | 1.7838 | 0.3940 | 0.7034 | 0.7123 | 0.3869 |
| 0.201 | 17.0 | 4250 | 1.8328 | 0.3725 | 0.6964 | 0.7062 | 0.3704 |
| 0.1923 | 18.0 | 4500 | 1.8788 | 0.3708 | 0.7019 | 0.7154 | 0.3591 |
| 0.1795 | 19.0 | 4750 | 1.8574 | 0.3752 | 0.7031 | 0.7161 | 0.3619 |
| 0.1713 | 20.0 | 5000 | 1.8672 | 0.3726 | 0.7030 | 0.7161 | 0.3616 |
### Framework versions
- Transformers 4.19.2
- Pytorch 1.11.0+cu113
- Datasets 2.2.2
- Tokenizers 0.12.1
| [
-0.6040719747543335,
-0.5923892855644226,
0.28548353910446167,
-0.01651153899729252,
-0.052557945251464844,
-0.18988734483718872,
0.05741618201136589,
-0.12304792553186417,
0.48467984795570374,
0.30147993564605713,
-0.6968698501586914,
-0.7641069889068604,
-0.7401612997055054,
-0.16779080033302307,
-0.19471392035484314,
0.9549517631530762,
0.21127119660377502,
-0.08988901227712631,
-0.23035307228565216,
-0.23813477158546448,
-0.33919912576675415,
-0.28082913160324097,
-0.8302242159843445,
-0.36786922812461853,
0.22328825294971466,
0.5613148212432861,
0.9472633600234985,
0.7726939916610718,
0.444340318441391,
0.36956825852394104,
-0.3189612329006195,
0.18250595033168793,
-0.4015331268310547,
-0.7216693162918091,
0.028335249051451683,
-0.5845920443534851,
-0.5952388644218445,
0.0938248485326767,
0.5519744753837585,
0.5636141300201416,
-0.1350647211074829,
0.6406038403511047,
0.141282320022583,
0.9515199661254883,
-0.40431156754493713,
0.31230267882347107,
-0.44005244970321655,
0.06381436437368393,
-0.31117767095565796,
-0.355908066034317,
-0.10728771984577179,
-0.4106568396091461,
0.16389498114585876,
-0.5364785194396973,
0.5327866673469543,
0.2895018756389618,
1.497743010520935,
0.1954043060541153,
-0.49159497022628784,
-0.07544763386249542,
-0.3516109883785248,
0.6511186361312866,
-0.7992310523986816,
0.19286581873893738,
0.5624857544898987,
0.12690183520317078,
-0.13784846663475037,
-0.8193956613540649,
-0.7779293656349182,
0.21935410797595978,
-0.5381332635879517,
0.25979241728782654,
-0.38291245698928833,
-0.30227628350257874,
0.7679662704467773,
0.6657034754753113,
-0.7748669385910034,
-0.0435187928378582,
-0.5095618963241577,
-0.30389052629470825,
0.7272900342941284,
0.5212963223457336,
0.18841424584388733,
-0.6618109941482544,
-0.49027442932128906,
-0.18440108001232147,
-0.5448781847953796,
0.6839247941970825,
0.5332579016685486,
0.24516434967517853,
-0.5713650584220886,
0.6245843768119812,
-0.15515634417533875,
0.68250972032547,
0.2045675814151764,
-0.23376956582069397,
0.6720269322395325,
-0.5486117601394653,
-0.39055100083351135,
-0.1068078875541687,
0.9314953088760376,
0.6442184448242188,
-0.19569823145866394,
0.3919937014579773,
-0.06121162697672844,
0.046269405633211136,
0.0021259873174130917,
-1.0017876625061035,
-0.4067631661891937,
0.46744871139526367,
-0.7858165502548218,
-0.4409962594509125,
0.03245944902300835,
-0.9451398849487305,
0.009114782325923443,
-0.36957210302352905,
0.3664481043815613,
-0.30654144287109375,
-0.42585986852645874,
-0.06926744431257248,
-0.17075398564338684,
0.313886821269989,
0.29238802194595337,
-1.094229817390442,
0.32955726981163025,
0.4498882293701172,
0.9484075307846069,
-0.048352617770433426,
0.010245412588119507,
-0.0022970372810959816,
0.2720696032047272,
-0.40565624833106995,
0.8875640630722046,
-0.20225317776203156,
-0.48668432235717773,
-0.20559048652648926,
0.29225194454193115,
-0.2745610773563385,
-0.43550214171409607,
0.6927898526191711,
-0.3080400824546814,
0.4137501120567322,
-0.4456232190132141,
-0.5604856610298157,
-0.22513198852539062,
0.49390777945518494,
-0.7752484083175659,
1.4196453094482422,
0.17804472148418427,
-1.2383426427841187,
0.6295233964920044,
-0.8646907806396484,
0.07825476676225662,
-0.11616917699575424,
-0.1891525387763977,
-0.9888362884521484,
-0.23253794014453888,
0.29450732469558716,
0.22553841769695282,
-0.4123089909553528,
0.27223604917526245,
-0.09311040490865707,
-0.24466776847839355,
-0.22770102322101593,
-0.3555251955986023,
1.350820779800415,
0.23601648211479187,
-0.7102365493774414,
0.30947738885879517,
-1.2734063863754272,
0.21061241626739502,
0.30129605531692505,
-0.4394739270210266,
-0.08395055681467056,
-0.2345046103000641,
0.1216648668050766,
0.32556289434432983,
0.33841970562934875,
-0.539230465888977,
0.2806645929813385,
-0.2758985161781311,
0.46991997957229614,
0.7279677987098694,
0.14518460631370544,
0.3928223252296448,
-0.7139507532119751,
0.3775005340576172,
0.4245629906654358,
0.34387269616127014,
0.16249027848243713,
-0.6551084518432617,
-0.9800936579704285,
-0.5078860521316528,
0.12965810298919678,
0.5557017922401428,
-0.3929574489593506,
0.5879526138305664,
-0.26681312918663025,
-0.7240012884140015,
-0.5635073184967041,
-0.06831353902816772,
0.24821913242340088,
0.8083826899528503,
0.4314713478088379,
-0.01610436663031578,
-0.619261622428894,
-1.1665948629379272,
-0.12275266647338867,
-0.1334356665611267,
0.2992252707481384,
0.476564884185791,
1.0233962535858154,
-0.3668663799762726,
1.3011457920074463,
-0.6793209910392761,
-0.6099645495414734,
-0.09139565378427505,
0.026891041547060013,
0.7114500403404236,
0.7089096307754517,
0.9510992169380188,
-0.8321415185928345,
-0.7201936841011047,
-0.1414705514907837,
-0.6660245656967163,
0.34153079986572266,
-0.12820307910442352,
-0.11338591575622559,
0.05677986145019531,
0.09986663609743118,
-0.6562784314155579,
1.0861976146697998,
0.5562319755554199,
-0.7071394920349121,
0.9356290698051453,
-0.41645532846450806,
0.24646611511707306,
-1.1422795057296753,
0.3301909565925598,
-0.09838207811117172,
-0.28779536485671997,
-0.4415360987186432,
-0.20222553610801697,
0.11954672634601593,
-0.15826989710330963,
-0.3333677351474762,
0.746680736541748,
-0.5312215685844421,
0.1561797857284546,
-0.0024407883174717426,
-0.10067150741815567,
0.02854306623339653,
0.6570764780044556,
0.08773438632488251,
1.0054500102996826,
0.8298393487930298,
-0.5819822549819946,
0.1791405975818634,
0.3307735025882721,
-0.598687469959259,
0.6745023727416992,
-0.666713535785675,
0.0092413779348135,
-0.06235409900546074,
-0.04390759766101837,
-1.282275915145874,
-0.2705068588256836,
0.35391491651535034,
-0.4577604830265045,
0.2176717221736908,
-0.14544959366321564,
-0.316570520401001,
-0.9384385347366333,
-0.4137720465660095,
0.022988568991422653,
0.41822877526283264,
-0.4521488547325134,
0.6491222381591797,
0.21645767986774445,
0.19808973371982574,
-0.5748485922813416,
-0.9010608792304993,
-0.0654139295220375,
-0.18130651116371155,
-0.910895824432373,
0.40766018629074097,
-0.15409955382347107,
-0.1686563342809677,
0.12869104743003845,
-0.06556541472673416,
-0.01014635432511568,
-0.03342078998684883,
0.3942550718784332,
0.26354652643203735,
-0.21198716759681702,
-0.2635156512260437,
-0.12665681540966034,
-0.4335910379886627,
-0.002526672091335058,
0.05045432597398758,
0.4950506091117859,
-0.3418887257575989,
-0.6488756537437439,
-0.7380247712135315,
0.16901035606861115,
0.6580397486686707,
-0.2302638590335846,
1.2356822490692139,
0.5912338495254517,
-0.40829119086265564,
0.13329549133777618,
-0.5667750835418701,
-0.21050024032592773,
-0.48757123947143555,
0.2353735715150833,
-0.6738861799240112,
-0.8029695749282837,
0.8796332478523254,
-0.13474425673484802,
0.23006968200206757,
0.9820968508720398,
0.6507709622383118,
-0.026825333014130592,
1.148088812828064,
0.3646053373813629,
-0.026844630017876625,
0.360122948884964,
-0.9796829223632812,
0.11544372886419296,
-0.8223926424980164,
-0.6874281764030457,
-0.6246074438095093,
-0.41096925735473633,
-0.5031784176826477,
-0.13327400386333466,
0.3582567274570465,
0.007360359188169241,
-0.5959683656692505,
0.2210475504398346,
-0.8955491781234741,
0.1711854487657547,
0.9329837560653687,
0.34478384256362915,
0.170265793800354,
-0.027794891968369484,
-0.4644322395324707,
-0.28151649236679077,
-0.8278841972351074,
-0.6642898917198181,
1.3617289066314697,
0.25310030579566956,
0.5503700375556946,
0.32033640146255493,
0.8948128819465637,
0.3919803202152252,
0.2566462755203247,
-0.5812876224517822,
0.2971665859222412,
0.1495702862739563,
-1.042633056640625,
-0.24296796321868896,
-0.3237367272377014,
-1.0747268199920654,
0.4741760194301605,
-0.37856000661849976,
-0.9111054539680481,
0.8135601282119751,
0.3858563303947449,
-0.5605500936508179,
0.6037656664848328,
-0.6873127818107605,
1.0723124742507935,
-0.10955826938152313,
-0.6721936464309692,
-0.11614467948675156,
-0.7192662954330444,
0.3936273157596588,
0.12371432781219482,
0.3492714762687683,
-0.160639688372612,
0.11975979804992676,
0.9724054336547852,
-0.8975309133529663,
0.622480571269989,
-0.280362606048584,
0.33788201212882996,
0.5075100660324097,
-0.12215405702590942,
0.8836948275566101,
0.2035033404827118,
-0.31070756912231445,
-0.06004098802804947,
0.34182316064834595,
-0.7118803262710571,
-0.3307740092277527,
0.8669336438179016,
-1.1450059413909912,
-0.9435550570487976,
-0.7721000909805298,
-0.4539908468723297,
0.247147798538208,
0.4332168698310852,
0.5731623768806458,
0.6325138211250305,
0.03930698707699776,
0.30401843786239624,
0.7044799327850342,
0.05297126621007919,
0.6316056251525879,
0.5331217050552368,
-0.1689833402633667,
-0.8593848943710327,
0.7877313494682312,
0.1300540715456009,
0.30105075240135193,
0.05069541931152344,
0.32016175985336304,
-0.5539159178733826,
-0.5287129878997803,
-0.36857154965400696,
0.14443039894104004,
-0.47367173433303833,
-0.3546938896179199,
-0.8000252842903137,
-0.16743764281272888,
-0.8094905614852905,
-0.24652907252311707,
-0.4017953872680664,
-0.2126264125108719,
-0.669740617275238,
-0.2741331458091736,
0.6444928050041199,
0.616460382938385,
-0.18793484568595886,
0.38436973094940186,
-0.5882675051689148,
0.18443842232227325,
0.19267724454402924,
0.025842025876045227,
0.07963338494300842,
-0.6721071004867554,
-0.2274431735277176,
0.10617561638355255,
-0.45199790596961975,
-0.8657470941543579,
0.8117544054985046,
-0.039849765598773956,
0.6966984272003174,
0.7549231648445129,
0.014057137072086334,
1.1914103031158447,
-0.20716464519500732,
0.9499323964118958,
0.46122145652770996,
-0.8399303555488586,
0.6832069158554077,
-0.24612656235694885,
0.3099645972251892,
0.8519835472106934,
0.4699552059173584,
-0.44022226333618164,
-0.190635547041893,
-1.2345812320709229,
-0.8711811900138855,
0.9439695477485657,
0.3754124641418457,
-0.1685495674610138,
-0.008162813261151314,
0.2533181607723236,
-0.35282453894615173,
0.33542484045028687,
-1.0478599071502686,
-0.9657384753227234,
-0.17872336506843567,
-0.13170664012432098,
0.1441155970096588,
-0.4244748055934906,
-0.4448702931404114,
-0.7572125196456909,
0.7316316366195679,
0.1594572812318802,
0.36388489603996277,
0.35582682490348816,
0.16266854107379913,
-0.06119925528764725,
0.1864718496799469,
0.7953821420669556,
0.930590808391571,
-0.5953294634819031,
0.2057793140411377,
0.1202288419008255,
-0.5288538932800293,
0.17346106469631195,
0.038587696850299835,
-0.5411272048950195,
0.050597358494997025,
0.3923935890197754,
0.7779142260551453,
0.017309114336967468,
0.06899958848953247,
0.705636739730835,
0.07451106607913971,
-0.5304740071296692,
-0.5975227355957031,
-0.09961827099323273,
0.12572023272514343,
0.2524113655090332,
0.4739115238189697,
0.576257050037384,
0.08820797502994537,
-0.6773465275764465,
0.18748195469379425,
0.562257707118988,
-0.5999385714530945,
-0.01696489378809929,
1.0234748125076294,
0.017021048814058304,
-0.31397122144699097,
0.5327889919281006,
-0.18265226483345032,
-0.6283442378044128,
0.9549235105514526,
0.5204548835754395,
0.6053771376609802,
-0.1771736890077591,
0.017253432422876358,
1.0052378177642822,
0.48164352774620056,
0.014105381444096565,
0.6050854325294495,
0.1461290419101715,
-0.344595342874527,
0.21340236067771912,
-0.664230465888977,
-0.14721937477588654,
0.2938448488712311,
-0.8883731961250305,
0.4547094404697418,
-0.40827998518943787,
-0.6103348731994629,
-0.1922796070575714,
0.500726044178009,
-1.035465955734253,
0.39067545533180237,
-0.1410071849822998,
1.3728368282318115,
-1.0955958366394043,
0.8516996502876282,
0.6660900712013245,
-0.690041720867157,
-1.2127058506011963,
-0.5840392112731934,
0.14599527418613434,
-0.8004657626152039,
0.7303434610366821,
0.05392437428236008,
0.20415166020393372,
0.16645805537700653,
-0.6718283891677856,
-1.2801434993743896,
1.5359089374542236,
-0.11789630353450775,
-0.7512174248695374,
0.2163064032793045,
0.15282174944877625,
0.46225351095199585,
-0.2475152313709259,
0.6528381109237671,
0.6201456189155579,
0.683258593082428,
0.1522986888885498,
-0.8147832751274109,
0.2970067858695984,
-0.4710880219936371,
-0.01897607184946537,
0.12993872165679932,
-0.9566003680229187,
1.245772123336792,
-0.2374083250761032,
0.04132142663002014,
0.03637159615755081,
0.7953494787216187,
0.4758312702178955,
0.36865559220314026,
0.48936033248901367,
1.110288381576538,
1.0499868392944336,
-0.36069878935813904,
1.140244722366333,
-0.5152484178543091,
0.8640148043632507,
1.0972139835357666,
0.1940191239118576,
0.8358793258666992,
0.5390225648880005,
-0.6530565023422241,
0.6270043253898621,
1.0213680267333984,
-0.18719160556793213,
0.5800511837005615,
-0.005491352640092373,
-0.3364112377166748,
-0.20874929428100586,
0.21601800620555878,
-0.819993793964386,
0.03258528560400009,
0.3285196125507355,
-0.6281431913375854,
-0.21674594283103943,
-0.16061344742774963,
0.10395260155200958,
-0.10541784763336182,
-0.5444653630256653,
0.5789982676506042,
-0.21009047329425812,
-0.3307367265224457,
0.4894483685493469,
-0.12797753512859344,
0.7496808767318726,
-0.712612509727478,
0.027369726449251175,
-0.1278630942106247,
0.4678415358066559,
-0.8086913228034973,
-0.9949811697006226,
0.2984301447868347,
-0.2132454365491867,
-0.4161961078643799,
0.032895296812057495,
0.5899701714515686,
-0.27647680044174194,
-0.7208318710327148,
0.04437018185853958,
0.27159151434898376,
0.0779944509267807,
0.15740390121936798,
-1.0881779193878174,
-0.22141948342323303,
0.2703112065792084,
-0.6763256788253784,
0.21017706394195557,
0.48926860094070435,
0.04587223753333092,
0.490922749042511,
0.9702998995780945,
0.08620491623878479,
0.2000756710767746,
-0.17992755770683289,
1.2987444400787354,
-0.7188903093338013,
-0.6043012738227844,
-0.9017146825790405,
0.597179114818573,
-0.4528248906135559,
-0.5917076468467712,
1.0681208372116089,
1.0459493398666382,
0.5145987272262573,
-0.10355722904205322,
0.6294572353363037,
-0.4598579406738281,
0.6590239405632019,
-0.30908921360969543,
0.8244741559028625,
-0.8564685583114624,
-0.08653293550014496,
-0.20285959541797638,
-0.7281673550605774,
-0.31590384244918823,
0.7500892877578735,
-0.777456521987915,
0.02083570323884487,
0.6920715570449829,
1.1384036540985107,
0.15930843353271484,
0.07451339066028595,
0.12377198040485382,
0.051850177347660065,
0.32435694336891174,
0.5548919439315796,
0.4995473027229309,
-0.687012791633606,
0.6048260927200317,
-0.6904784440994263,
-0.17323824763298035,
-0.2990386486053467,
-0.8231124877929688,
-0.9489158391952515,
-0.3933487832546234,
-0.6884464025497437,
-0.6340466737747192,
-0.2707405984401703,
1.0959243774414062,
0.8627731204032898,
-0.993838906288147,
-0.2938874661922455,
-0.06298235803842545,
0.13314883410930634,
-0.3272290527820587,
-0.2648858428001404,
1.1499601602554321,
0.03113717958331108,
-0.7313205003738403,
-0.14939922094345093,
0.13253635168075562,
0.3938797414302826,
-0.06786911189556122,
-0.12418248504400253,
-0.44848984479904175,
-0.025601735338568687,
0.5129876136779785,
0.30425387620925903,
-0.7411373853683472,
-0.28297433257102966,
-0.15508148074150085,
-0.4306012988090515,
0.40098828077316284,
0.3780190348625183,
-0.5815412402153015,
0.4590417444705963,
0.4803175926208496,
0.2769395411014557,
0.9031625986099243,
0.1163395419716835,
-0.046821530908346176,
-0.46892642974853516,
0.3248435854911804,
0.0027871357742697,
0.4800644814968109,
0.02707807347178459,
-0.5528113842010498,
0.6680078506469727,
0.6680088043212891,
-0.7126161456108093,
-0.8653435707092285,
-0.24094033241271973,
-1.2826368808746338,
0.08690458536148071,
1.110076904296875,
-0.14847800135612488,
-0.6018881797790527,
-0.11503956466913223,
-0.37397462129592896,
0.02464102767407894,
-0.5331170558929443,
0.4885205328464508,
0.7792673110961914,
-0.4118158221244812,
-0.15281088650226593,
-0.6466692686080933,
0.7303693890571594,
0.12102403491735458,
-0.875775933265686,
-0.2958754897117615,
0.3519083857536316,
0.47768718004226685,
0.3883470594882965,
0.787555456161499,
-0.12617485225200653,
0.2025078535079956,
0.37687069177627563,
0.19840921461582184,
-0.2270582616329193,
0.06943826377391815,
-0.10061230510473251,
0.28776639699935913,
-0.016263538971543312,
-0.40887993574142456
] |
microsoft/layoutlmv3-base | microsoft | "2023-04-12T12:49:21Z" | 6,021,905 | 209 | transformers | [
"transformers",
"pytorch",
"tf",
"onnx",
"layoutlmv3",
"en",
"arxiv:2204.08387",
"license:cc-by-nc-sa-4.0",
"endpoints_compatible",
"has_space",
"region:us"
] | null | "2022-04-18T06:53:05Z" | ---
language: en
license: cc-by-nc-sa-4.0
---
# LayoutLMv3
[Microsoft Document AI](https://www.microsoft.com/en-us/research/project/document-ai/) | [GitHub](https://aka.ms/layoutlmv3)
## Model description
LayoutLMv3 is a pre-trained multimodal Transformer for Document AI with unified text and image masking. The simple unified architecture and training objectives make LayoutLMv3 a general-purpose pre-trained model. For example, LayoutLMv3 can be fine-tuned for both text-centric tasks, including form understanding, receipt understanding, and document visual question answering, and image-centric tasks such as document image classification and document layout analysis.
[LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking](https://arxiv.org/abs/2204.08387)
Yupan Huang, Tengchao Lv, Lei Cui, Yutong Lu, Furu Wei, ACM Multimedia 2022.
## Citation
If you find LayoutLM useful in your research, please cite the following paper:
```
@inproceedings{huang2022layoutlmv3,
author={Yupan Huang and Tengchao Lv and Lei Cui and Yutong Lu and Furu Wei},
title={LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking},
booktitle={Proceedings of the 30th ACM International Conference on Multimedia},
year={2022}
}
```
## License
The content of this project itself is licensed under the [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/).
Portions of the source code are based on the [transformers](https://github.com/huggingface/transformers) project.
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct)
| [
-0.3843768835067749,
-0.37922823429107666,
0.4191456437110901,
0.4241741895675659,
-0.22060993313789368,
-0.1401519477367401,
0.22712405025959015,
-0.1399936079978943,
-0.15698814392089844,
0.5354766249656677,
-0.5785039067268372,
-0.5539814233779907,
-0.5112203359603882,
-0.1905621886253357,
-0.3090837895870209,
0.7504498362541199,
-0.41745445132255554,
0.17800988256931305,
-0.5176795721054077,
-0.17528340220451355,
-0.4095546305179596,
-0.468027263879776,
-0.13184954226016998,
-0.3306707441806793,
0.2060375213623047,
0.009017962962388992,
0.6842408776283264,
0.5654436945915222,
0.7285671830177307,
0.4058942198753357,
0.1499943882226944,
0.270810067653656,
-0.15133175253868103,
-0.1679493933916092,
0.29977521300315857,
-0.18212926387786865,
-0.7021548748016357,
0.2842785120010376,
0.69574373960495,
0.2593899369239807,
-0.02555643394589424,
0.07936333864927292,
0.235772043466568,
0.7196389436721802,
-0.6656171083450317,
0.05580577254295349,
-0.30240485072135925,
0.28741028904914856,
-0.19813701510429382,
-0.2935289740562439,
-0.49218884110450745,
-0.14489175379276276,
-0.14262858033180237,
-0.9316589832305908,
0.2465667873620987,
0.27951592206954956,
1.0858492851257324,
0.33064427971839905,
-0.23118644952774048,
-0.010086248628795147,
-0.6363958120346069,
0.7577584385871887,
-0.5735010504722595,
0.5834831595420837,
0.4293944835662842,
0.18115155398845673,
0.15750205516815186,
-1.0542539358139038,
-0.624366044998169,
-0.054452165961265564,
-0.519442617893219,
0.37275251746177673,
-0.3339982330799103,
0.18683947622776031,
0.4042050540447235,
0.36663079261779785,
-1.011073112487793,
0.11876900494098663,
-0.617581844329834,
-0.4976145625114441,
0.49448156356811523,
-0.048538029193878174,
0.6693370938301086,
-0.22470103204250336,
-0.5328443050384521,
-0.19622310996055603,
-0.3433587849140167,
0.0024164170026779175,
0.4862021803855896,
-0.20324595272541046,
-0.3306272029876709,
0.3784083127975464,
0.3464547395706177,
0.8273209929466248,
-0.195042222738266,
-0.3775849938392639,
0.6740010976791382,
-0.1567520797252655,
-0.505785346031189,
-0.21825814247131348,
0.8649473786354065,
0.23376743495464325,
-0.12179563194513321,
-0.061667632311582565,
-0.20832057297229767,
-0.1243264228105545,
0.6830074191093445,
-0.7831119298934937,
-0.26109811663627625,
0.14117036759853363,
-0.7693002223968506,
-0.13918112218379974,
0.38430458307266235,
-0.4434475004673004,
-0.27362799644470215,
-0.5212257504463196,
0.6042293906211853,
-0.67392897605896,
-0.04639338329434395,
-0.13371048867702484,
-0.08564268052577972,
0.5585007071495056,
0.6532768607139587,
-0.474941611289978,
-0.02746991440653801,
0.5209844708442688,
1.040027141571045,
-0.5349432826042175,
-0.575794517993927,
-0.5093855857849121,
0.27094796299934387,
-0.11047689616680145,
0.7947947978973389,
-0.23401866853237152,
-0.429315984249115,
0.15381814539432526,
0.259435772895813,
-0.2599480450153351,
-0.3882364332675934,
0.6139228343963623,
-0.6076343059539795,
0.8168433308601379,
0.428838849067688,
-0.2578844428062439,
-0.10821801424026489,
0.42028048634529114,
-0.9272297024726868,
0.8690486550331116,
0.1975145936012268,
-0.9139821529388428,
0.1431789994239807,
-0.8976137042045593,
-0.39109528064727783,
0.14599326252937317,
-0.1682206392288208,
-0.9195367693901062,
-0.2226373553276062,
0.2918884754180908,
0.3656528890132904,
0.08190099895000458,
0.0862196609377861,
-0.18523216247558594,
-0.4138476848602295,
-0.12836574018001556,
-0.40384095907211304,
0.9077824354171753,
0.3730933964252472,
-0.12564045190811157,
0.48238781094551086,
-0.8833578824996948,
-0.06316904723644257,
0.0893954262137413,
-0.25755926966667175,
-0.22975797951221466,
-0.41752904653549194,
0.24967928230762482,
0.3056126832962036,
0.2646242082118988,
-0.4261852502822876,
0.2318747341632843,
-0.17901253700256348,
0.1385059505701065,
0.7301245331764221,
-0.3194356858730316,
0.8956478238105774,
-0.41782844066619873,
0.7276892066001892,
-0.07513207942247391,
0.4797634184360504,
-0.49097591638565063,
-0.5523432493209839,
-0.5130650401115417,
-0.5147391557693481,
-0.006277123466134071,
0.6177544593811035,
-0.9496075510978699,
0.39493274688720703,
-0.06395827978849411,
-0.540691077709198,
-0.4637525975704193,
0.15323135256767273,
0.6130713820457458,
0.5163416862487793,
0.5484030246734619,
-0.18438848853111267,
-0.7237110137939453,
-0.9468141794204712,
-0.16423271596431732,
0.025933127850294113,
-0.26861146092414856,
0.013791964389383793,
0.4045715630054474,
-0.2540799081325531,
0.7010469436645508,
-0.4029662609100342,
-0.8120564818382263,
-0.07564523071050644,
0.20089921355247498,
-0.02447032742202282,
0.6509207487106323,
0.5258078575134277,
-1.224680781364441,
-0.5515725016593933,
-0.13846246898174286,
-0.8177038431167603,
0.0421568937599659,
-0.127138152718544,
-0.27502313256263733,
0.38962870836257935,
0.6692461371421814,
-0.720641553401947,
0.7559794783592224,
0.6073870658874512,
-0.205715149641037,
0.4930153489112854,
-0.46504220366477966,
0.022327253594994545,
-1.3562990427017212,
0.16960208117961884,
0.0012259427458047867,
-0.16354899108409882,
-0.6806116700172424,
-0.0026967423036694527,
0.4096309542655945,
-0.23857542872428894,
-0.7318554520606995,
0.6413288712501526,
-0.7434453368186951,
-0.11426713317632675,
-0.1740940809249878,
0.021513737738132477,
0.4350510239601135,
0.664322018623352,
-0.07057014852762222,
0.757091760635376,
0.3546816408634186,
-0.3128305673599243,
0.1465359479188919,
0.5862562656402588,
-0.28429296612739563,
0.6586689352989197,
-0.5296971797943115,
0.3223516047000885,
-0.16798049211502075,
0.4167729616165161,
-0.9014061093330383,
-0.16633133590221405,
0.2683087885379791,
-0.48530954122543335,
0.48713353276252747,
0.1292610615491867,
-0.5618757605552673,
-0.710807204246521,
-0.4940324127674103,
0.28834280371665955,
0.4932221472263336,
-0.5319458246231079,
1.109347939491272,
0.2743189334869385,
0.3209456205368042,
-0.5328439474105835,
-0.7857224941253662,
-0.29413077235221863,
-0.2466556280851364,
-0.7649646401405334,
0.7497094869613647,
-0.30835509300231934,
0.004231738392263651,
-0.06338971853256226,
-0.11061396449804306,
-0.11506258696317673,
-0.06436361372470856,
0.5605220794677734,
0.5228926539421082,
-0.1607884168624878,
-0.06444032490253448,
-0.26941362023353577,
-0.23368071019649506,
-0.017195746302604675,
-0.27501219511032104,
0.5605165362358093,
-0.27108561992645264,
-0.6797251105308533,
-0.5894807577133179,
0.38611191511154175,
0.5796783566474915,
-0.41392919421195984,
0.5309073328971863,
1.0868093967437744,
-0.3311561644077301,
0.11501987278461456,
-0.6552790999412537,
0.36296460032463074,
-0.5203234553337097,
0.3952503204345703,
-0.22764046490192413,
-0.7968328595161438,
0.3832913935184479,
0.19703969359397888,
0.056442130357027054,
0.6608323454856873,
0.5564807653427124,
-0.3433026671409607,
1.0396422147750854,
0.7686210870742798,
0.18092231452465057,
0.7160091400146484,
-0.3637871742248535,
0.0806991457939148,
-1.0019601583480835,
-0.5409188270568848,
-0.48773279786109924,
-0.3422977030277252,
-0.35070013999938965,
-0.5317702293395996,
0.2953357994556427,
0.026964567601680756,
-0.4810604751110077,
0.26035618782043457,
-0.8299228549003601,
0.3505275845527649,
0.7544137239456177,
-0.06905362010002136,
0.26830682158470154,
0.0346284918487072,
-0.09218166768550873,
0.039214931428432465,
-0.342644602060318,
-0.6756307482719421,
0.7513396143913269,
0.39711952209472656,
0.7414247393608093,
0.09456562250852585,
0.7210465669631958,
0.3423781394958496,
0.3781852424144745,
-0.5311893224716187,
0.38351330161094666,
-0.021971069276332855,
-0.37603113055229187,
-0.3368868827819824,
-0.022392043843865395,
-1.115281581878662,
0.2196187824010849,
-0.052830636501312256,
-0.7267389893531799,
0.05121181160211563,
0.21823523938655853,
-0.09152328222990036,
0.5524719953536987,
-0.9254268407821655,
0.9701724052429199,
-0.34965959191322327,
-0.1563846617937088,
0.3356543481349945,
-0.8172913193702698,
0.30762842297554016,
-0.21056649088859558,
0.22323232889175415,
0.20574143528938293,
0.10023384541273117,
0.9139354228973389,
-0.5157088041305542,
0.6633458137512207,
-0.29777583479881287,
-0.15399877727031708,
0.0909210592508316,
-0.017301460728049278,
0.4631429612636566,
-0.1358679085969925,
0.10777787864208221,
0.07496610283851624,
-0.0031401736196130514,
-0.3637121915817261,
-0.7915825843811035,
0.5758470892906189,
-1.2438901662826538,
-0.6646460294723511,
-0.3737591505050659,
-0.6335024237632751,
-0.10759419947862625,
0.5365495681762695,
0.506871223449707,
0.2777024507522583,
-0.13836833834648132,
0.3505793511867523,
0.6774592995643616,
-0.2558458149433136,
0.6326631307601929,
0.4287261664867401,
-0.31282302737236023,
-0.4018245041370392,
0.9118830561637878,
-0.11893873661756516,
-0.05642150714993477,
0.6008376479148865,
0.051966916769742966,
-0.17916850745677948,
-0.5329254269599915,
-0.3494323790073395,
0.09960873425006866,
-0.7208749055862427,
-0.39354217052459717,
-0.8872198462486267,
-0.7534842491149902,
-0.38273823261260986,
-0.36692431569099426,
-0.24082213640213013,
-0.062399767339229584,
-0.6119916439056396,
0.07883885502815247,
-0.07277248054742813,
0.6790797710418701,
0.1307697892189026,
0.4061921536922455,
-0.824529230594635,
0.5277894139289856,
0.37937211990356445,
0.4132530391216278,
-0.1688954085111618,
-0.6288083791732788,
-0.1992458552122116,
-0.17811278998851776,
-0.8289341926574707,
-0.6541213989257812,
0.4657515287399292,
-0.039210714399814606,
0.9797219038009644,
0.26124006509780884,
-0.21039770543575287,
0.4840795695781708,
-0.5953552722930908,
0.9488345980644226,
0.5167748332023621,
-0.8222277760505676,
0.5156867504119873,
-0.2265685796737671,
0.5171250700950623,
0.23238734900951385,
0.43839216232299805,
-0.21596403419971466,
-0.1265467405319214,
-0.8487480282783508,
-0.7844433784484863,
0.9096169471740723,
0.45721036195755005,
0.09460289776325226,
0.6282199025154114,
0.05507981404662132,
0.009832946583628654,
0.1677444726228714,
-0.9006743431091309,
-0.36300554871559143,
-0.774681568145752,
-0.11615756154060364,
0.07920090854167938,
-0.21671625971794128,
-0.1843259036540985,
-0.40637537837028503,
0.7459982633590698,
-0.1737174391746521,
0.5772177577018738,
0.15458564460277557,
-0.48893803358078003,
0.10258132219314575,
0.0649455189704895,
0.9886807799339294,
0.6334396600723267,
-0.2536826431751251,
0.09875983744859695,
-0.12762674689292908,
-0.7758232951164246,
0.08074144273996353,
0.41071489453315735,
-0.04577280953526497,
-0.0214359313249588,
0.6842911243438721,
1.1980971097946167,
-0.15853995084762573,
-0.11367804557085037,
0.8603579998016357,
-0.20353177189826965,
-0.7549570798873901,
-0.36557650566101074,
-0.2098795622587204,
-0.10054037719964981,
0.20937661826610565,
0.4498913288116455,
0.2695043683052063,
0.02214427851140499,
-0.10016180574893951,
0.22021426260471344,
0.34652021527290344,
-0.5627610683441162,
-0.2131926715373993,
0.8247257471084595,
0.14146819710731506,
-0.7321664690971375,
0.5371160507202148,
-0.1596502661705017,
-0.5123554468154907,
0.5452880859375,
0.7238060235977173,
0.8976290822029114,
-0.17933352291584015,
0.39810022711753845,
0.12909460067749023,
0.384766161441803,
0.23775076866149902,
0.10055865347385406,
-0.0960598737001419,
-0.6982783675193787,
-0.3024379312992096,
-0.5744397640228271,
-0.19425244629383087,
0.42339491844177246,
-0.48439154028892517,
0.3882111608982086,
-0.3070647418498993,
0.21680229902267456,
-0.100596584379673,
-0.07761136442422867,
-1.0432143211364746,
0.22332540154457092,
0.5189185738563538,
0.9576531648635864,
-0.5792520046234131,
0.883385181427002,
1.0060516595840454,
-0.49360278248786926,
-0.877780556678772,
0.11238647997379303,
0.14014369249343872,
-1.038264513015747,
0.5918351411819458,
0.33897799253463745,
-0.027834422886371613,
0.005277382209897041,
-0.7097548842430115,
-0.8590547442436218,
1.3994098901748657,
0.232788547873497,
-0.16093742847442627,
-0.3757321536540985,
0.009559976868331432,
0.5282033681869507,
-0.4808838963508606,
0.37096938490867615,
0.11698949337005615,
0.5959818959236145,
0.3008464574813843,
-0.80002760887146,
0.04631626233458519,
-0.672762393951416,
0.34371212124824524,
-0.1183260828256607,
-0.6405525207519531,
0.8130297660827637,
0.027646707370877266,
-0.06868189573287964,
0.08322612941265106,
0.8226920366287231,
0.38795047998428345,
0.3348380923271179,
0.5939679145812988,
0.47408756613731384,
0.7037044763565063,
-0.08493020385503769,
1.1237115859985352,
-0.2145053893327713,
0.2566075026988983,
1.1044268608093262,
-0.06126920506358147,
0.34424036741256714,
0.46541765332221985,
-0.1438339203596115,
0.6731447577476501,
0.5112687945365906,
-0.23182719945907593,
0.5365462899208069,
0.0002948302135337144,
0.2962858974933624,
-0.04818245768547058,
0.2015315294265747,
-0.5630294680595398,
0.3607831299304962,
0.12923955917358398,
-0.4798515737056732,
-0.1652829349040985,
0.3485451340675354,
0.04797776788473129,
-0.059995461255311966,
-0.16812604665756226,
0.7500658631324768,
-0.027741972357034683,
-0.4961642920970917,
0.3923375904560089,
-0.10359503328800201,
0.6872785687446594,
-0.7790981531143188,
-0.0193127803504467,
-0.2496521770954132,
0.06945797801017761,
-0.3366377651691437,
-0.8692996501922607,
0.2820655107498169,
-0.3712185025215149,
-0.2685689330101013,
-0.5767979621887207,
0.9140465259552002,
-0.18758830428123474,
-0.4085688889026642,
0.10848893225193024,
0.44161662459373474,
-0.08328027278184891,
-0.027063611894845963,
-0.8410205841064453,
0.27268660068511963,
0.05260026082396507,
-0.38912275433540344,
0.5433461666107178,
0.3658808469772339,
-0.2269665151834488,
0.46212708950042725,
0.7132476568222046,
-0.25153303146362305,
-0.0437023788690567,
0.23635552823543549,
1.0080716609954834,
-0.33816319704055786,
-0.7292582392692566,
-0.7239710688591003,
0.8139622211456299,
-0.36987054347991943,
-0.24282673001289368,
0.950023353099823,
0.7349920868873596,
0.8671155571937561,
-0.22687847912311554,
0.7572344541549683,
0.15911701321601868,
0.08345191180706024,
-0.5624767541885376,
0.967201292514801,
-0.87332683801651,
-0.014913313090801239,
-0.6097350120544434,
-1.1154417991638184,
-0.7294474244117737,
0.5747884511947632,
-0.2407902479171753,
0.10924748331308365,
0.8535969853401184,
0.7719694972038269,
-0.21751171350479126,
-0.12298591434955597,
0.5999892950057983,
-0.02162012830376625,
0.6055145859718323,
0.04399224743247032,
0.789061963558197,
-0.4938301146030426,
0.708775520324707,
-0.24923482537269592,
-0.1100168377161026,
-0.15134458243846893,
-0.9040306210517883,
-0.9724031090736389,
-0.9473940134048462,
-0.31206002831459045,
-0.5053274035453796,
-0.3505939245223999,
0.5040139555931091,
0.9645029902458191,
-0.6184472441673279,
0.17446213960647583,
0.050194039940834045,
0.19025816023349762,
-0.02047126740217209,
-0.20934121310710907,
0.7634902000427246,
-0.16572466492652893,
-0.5676731467247009,
0.03914346918463707,
0.39009588956832886,
0.3783131539821625,
-0.3641113340854645,
-0.3595673739910126,
-0.205695241689682,
-0.11782799661159515,
0.5921033620834351,
0.27857667207717896,
-0.7868907451629639,
-0.07834473997354507,
-0.14800235629081726,
-0.2815319895744324,
0.3131999969482422,
0.8942587375640869,
-0.5492417216300964,
0.4865686595439911,
0.47399404644966125,
0.500779926776886,
0.4936205744743347,
0.03882426768541336,
0.4131516218185425,
-0.9263002276420593,
0.4229962229728699,
0.002288986463099718,
0.5024124383926392,
0.5212092399597168,
-0.3912286162376404,
0.41996389627456665,
0.2058285027742386,
-0.5593714118003845,
-0.7699905037879944,
-0.005216946359723806,
-1.0584659576416016,
-0.13978202641010284,
1.2222516536712646,
-0.08806989341974258,
-0.3937843143939972,
0.018824473023414612,
-0.5880157947540283,
0.2440018504858017,
-0.12956900894641876,
0.3703472912311554,
0.45165205001831055,
-0.0843743309378624,
-0.453401654958725,
-0.4118334650993347,
0.6269380450248718,
0.002462724456563592,
-0.9291377067565918,
-0.47855687141418457,
0.2781904935836792,
-0.11739617586135864,
0.686109721660614,
0.7722068428993225,
-0.18092554807662964,
0.17295733094215393,
-0.3282138705253601,
0.41618961095809937,
-0.5210423469543457,
-0.250506728887558,
-0.3120132386684418,
0.2607332468032837,
-0.3366069793701172,
-0.3974270820617676
] |
stabilityai/stable-diffusion-2-1 | stabilityai | "2023-07-05T16:19:17Z" | 5,511,350 | 3,346 | diffusers | [
"diffusers",
"stable-diffusion",
"text-to-image",
"arxiv:2112.10752",
"arxiv:2202.00512",
"arxiv:1910.09700",
"license:openrail++",
"endpoints_compatible",
"has_space",
"diffusers:StableDiffusionPipeline",
"region:us"
] | text-to-image | "2022-12-06T17:24:51Z" | ---
license: openrail++
tags:
- stable-diffusion
- text-to-image
pinned: true
---
# Stable Diffusion v2-1 Model Card
This model card focuses on the model associated with the Stable Diffusion v2-1 model, codebase available [here](https://github.com/Stability-AI/stablediffusion).
This `stable-diffusion-2-1` model is fine-tuned from [stable-diffusion-2](https://huggingface.co/stabilityai/stable-diffusion-2) (`768-v-ema.ckpt`) with an additional 55k steps on the same dataset (with `punsafe=0.1`), and then fine-tuned for another 155k extra steps with `punsafe=0.98`.
- Use it with the [`stablediffusion`](https://github.com/Stability-AI/stablediffusion) repository: download the `v2-1_768-ema-pruned.ckpt` [here](https://huggingface.co/stabilityai/stable-diffusion-2-1/blob/main/v2-1_768-ema-pruned.ckpt).
- Use it with 🧨 [`diffusers`](#examples)
## Model Details
- **Developed by:** Robin Rombach, Patrick Esser
- **Model type:** Diffusion-based text-to-image generation model
- **Language(s):** English
- **License:** [CreativeML Open RAIL++-M License](https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE-MODEL)
- **Model Description:** This is a model that can be used to generate and modify images based on text prompts. It is a [Latent Diffusion Model](https://arxiv.org/abs/2112.10752) that uses a fixed, pretrained text encoder ([OpenCLIP-ViT/H](https://github.com/mlfoundations/open_clip)).
- **Resources for more information:** [GitHub Repository](https://github.com/Stability-AI/).
- **Cite as:**
@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}
## Examples
Using the [🤗's Diffusers library](https://github.com/huggingface/diffusers) to run Stable Diffusion 2 in a simple and efficient manner.
```bash
pip install diffusers transformers accelerate scipy safetensors
```
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to DPMSolverMultistepScheduler):
```python
import torch
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
model_id = "stabilityai/stable-diffusion-2-1"
# Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
```
**Notes**:
- Despite not being a dependency, we highly recommend you to install [xformers](https://github.com/facebookresearch/xformers) for memory efficient attention (better performance)
- If you have low GPU RAM available, make sure to add a `pipe.enable_attention_slicing()` after sending it to `cuda` for less VRAM usage (to the cost of speed)
# Uses
## Direct Use
The model is intended for research purposes only. Possible research areas and tasks include
- Safe deployment of models which have the potential to generate harmful content.
- Probing and understanding the limitations and biases of generative models.
- Generation of artworks and use in design and other artistic processes.
- Applications in educational or creative tools.
- Research on generative models.
Excluded uses are described below.
### Misuse, Malicious Use, and Out-of-Scope Use
_Note: This section is originally taken from the [DALLE-MINI model card](https://huggingface.co/dalle-mini/dalle-mini), was used for Stable Diffusion v1, but applies in the same way to Stable Diffusion v2_.
The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating images that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.
#### Out-of-Scope Use
The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
#### Misuse and Malicious Use
Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:
- Generating demeaning, dehumanizing, or otherwise harmful representations of people or their environments, cultures, religions, etc.
- Intentionally promoting or propagating discriminatory content or harmful stereotypes.
- Impersonating individuals without their consent.
- Sexual content without consent of the people who might see it.
- Mis- and disinformation
- Representations of egregious violence and gore
- Sharing of copyrighted or licensed material in violation of its terms of use.
- Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.
## Limitations and Bias
### Limitations
- The model does not achieve perfect photorealism
- The model cannot render legible text
- The model does not perform well on more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
- Faces and people in general may not be generated properly.
- The model was trained mainly with English captions and will not work as well in other languages.
- The autoencoding part of the model is lossy
- The model was trained on a subset of the large-scale dataset
[LAION-5B](https://laion.ai/blog/laion-5b/), which contains adult, violent and sexual content. To partially mitigate this, we have filtered the dataset using LAION's NFSW detector (see Training section).
### Bias
While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.
Stable Diffusion was primarily trained on subsets of [LAION-2B(en)](https://laion.ai/blog/laion-5b/),
which consists of images that are limited to English descriptions.
Texts and images from communities and cultures that use other languages are likely to be insufficiently accounted for.
This affects the overall output of the model, as white and western cultures are often set as the default. Further, the
ability of the model to generate content with non-English prompts is significantly worse than with English-language prompts.
Stable Diffusion v2 mirrors and exacerbates biases to such a degree that viewer discretion must be advised irrespective of the input or its intent.
## Training
**Training Data**
The model developers used the following dataset for training the model:
- LAION-5B and subsets (details below). The training data is further filtered using LAION's NSFW detector, with a "p_unsafe" score of 0.1 (conservative). For more details, please refer to LAION-5B's [NeurIPS 2022](https://openreview.net/forum?id=M3Y74vmsMcY) paper and reviewer discussions on the topic.
**Training Procedure**
Stable Diffusion v2 is a latent diffusion model which combines an autoencoder with a diffusion model that is trained in the latent space of the autoencoder. During training,
- Images are encoded through an encoder, which turns images into latent representations. The autoencoder uses a relative downsampling factor of 8 and maps images of shape H x W x 3 to latents of shape H/f x W/f x 4
- Text prompts are encoded through the OpenCLIP-ViT/H text-encoder.
- The output of the text encoder is fed into the UNet backbone of the latent diffusion model via cross-attention.
- The loss is a reconstruction objective between the noise that was added to the latent and the prediction made by the UNet. We also use the so-called _v-objective_, see https://arxiv.org/abs/2202.00512.
We currently provide the following checkpoints:
- `512-base-ema.ckpt`: 550k steps at resolution `256x256` on a subset of [LAION-5B](https://laion.ai/blog/laion-5b/) filtered for explicit pornographic material, using the [LAION-NSFW classifier](https://github.com/LAION-AI/CLIP-based-NSFW-Detector) with `punsafe=0.1` and an [aesthetic score](https://github.com/christophschuhmann/improved-aesthetic-predictor) >= `4.5`.
850k steps at resolution `512x512` on the same dataset with resolution `>= 512x512`.
- `768-v-ema.ckpt`: Resumed from `512-base-ema.ckpt` and trained for 150k steps using a [v-objective](https://arxiv.org/abs/2202.00512) on the same dataset. Resumed for another 140k steps on a `768x768` subset of our dataset.
- `512-depth-ema.ckpt`: Resumed from `512-base-ema.ckpt` and finetuned for 200k steps. Added an extra input channel to process the (relative) depth prediction produced by [MiDaS](https://github.com/isl-org/MiDaS) (`dpt_hybrid`) which is used as an additional conditioning.
The additional input channels of the U-Net which process this extra information were zero-initialized.
- `512-inpainting-ema.ckpt`: Resumed from `512-base-ema.ckpt` and trained for another 200k steps. Follows the mask-generation strategy presented in [LAMA](https://github.com/saic-mdal/lama) which, in combination with the latent VAE representations of the masked image, are used as an additional conditioning.
The additional input channels of the U-Net which process this extra information were zero-initialized. The same strategy was used to train the [1.5-inpainting checkpoint](https://huggingface.co/runwayml/stable-diffusion-inpainting).
- `x4-upscaling-ema.ckpt`: Trained for 1.25M steps on a 10M subset of LAION containing images `>2048x2048`. The model was trained on crops of size `512x512` and is a text-guided [latent upscaling diffusion model](https://arxiv.org/abs/2112.10752).
In addition to the textual input, it receives a `noise_level` as an input parameter, which can be used to add noise to the low-resolution input according to a [predefined diffusion schedule](configs/stable-diffusion/x4-upscaling.yaml).
- **Hardware:** 32 x 8 x A100 GPUs
- **Optimizer:** AdamW
- **Gradient Accumulations**: 1
- **Batch:** 32 x 8 x 2 x 4 = 2048
- **Learning rate:** warmup to 0.0001 for 10,000 steps and then kept constant
## Evaluation Results
Evaluations with different classifier-free guidance scales (1.5, 2.0, 3.0, 4.0,
5.0, 6.0, 7.0, 8.0) and 50 steps DDIM sampling steps show the relative improvements of the checkpoints:
![pareto](model-variants.jpg)
Evaluated using 50 DDIM steps and 10000 random prompts from the COCO2017 validation set, evaluated at 512x512 resolution. Not optimized for FID scores.
## Environmental Impact
**Stable Diffusion v1** **Estimated Emissions**
Based on that information, we estimate the following CO2 emissions using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.
- **Hardware Type:** A100 PCIe 40GB
- **Hours used:** 200000
- **Cloud Provider:** AWS
- **Compute Region:** US-east
- **Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid):** 15000 kg CO2 eq.
## Citation
@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}
*This model card was written by: Robin Rombach, Patrick Esser and David Ha and is based on the [Stable Diffusion v1](https://github.com/CompVis/stable-diffusion/blob/main/Stable_Diffusion_v1_Model_Card.md) and [DALL-E Mini model card](https://huggingface.co/dalle-mini/dalle-mini).*
| [
-0.3695681691169739,
-0.8252284526824951,
0.3427104353904724,
0.18827693164348602,
-0.23837435245513916,
-0.35212984681129456,
0.09912405908107758,
-0.3806692659854889,
-0.10752823948860168,
0.36848267912864685,
-0.4294458031654358,
-0.36916348338127136,
-0.7324264645576477,
-0.10265906155109406,
-0.3703347444534302,
0.8782634139060974,
-0.12434719502925873,
0.03057105280458927,
-0.15257743000984192,
0.0009498047293163836,
-0.3266313672065735,
-0.10916806757450104,
-0.9594005942344666,
-0.270338237285614,
0.4754142165184021,
0.08588770031929016,
0.6922314167022705,
0.5430318117141724,
0.487004816532135,
0.25900620222091675,
-0.2740045487880707,
0.006282756105065346,
-0.7012457251548767,
-0.04528361186385155,
-0.040287215262651443,
-0.2716502845287323,
-0.4939524829387665,
0.1657485067844391,
0.6109622120857239,
0.23878085613250732,
-0.09873193502426147,
0.03849330171942711,
0.017595287412405014,
0.5467720627784729,
-0.5343175530433655,
-0.09918145835399628,
-0.32147255539894104,
0.17503191530704498,
-0.16863258183002472,
0.19784724712371826,
-0.3581605553627014,
-0.12449327856302261,
0.08233287185430527,
-0.739413857460022,
0.322743684053421,
-0.27153676748275757,
0.9898092746734619,
0.4572841227054596,
-0.3188704252243042,
-0.08763699978590012,
-0.7283103466033936,
0.5502757430076599,
-0.5865532159805298,
0.25163424015045166,
0.38223785161972046,
0.0789605900645256,
-0.02628685161471367,
-0.9294669032096863,
-0.620862603187561,
-0.05980319157242775,
0.0074892062693834305,
0.46180978417396545,
-0.41623738408088684,
-0.028321189805865288,
0.4458458125591278,
0.18885043263435364,
-0.5877377986907959,
0.03852970153093338,
-0.5358164310455322,
-0.04457871615886688,
0.6171405911445618,
0.16098685562610626,
0.22652079164981842,
-0.18560311198234558,
-0.39970168471336365,
-0.04937971755862236,
-0.48655927181243896,
-0.037379734218120575,
0.38715365529060364,
-0.3195553123950958,
-0.39833149313926697,
0.3995976448059082,
0.11882038414478302,
0.4806798994541168,
0.2861240804195404,
-0.1687796264886856,
0.2922036349773407,
-0.2327507883310318,
-0.19707779586315155,
-0.44754841923713684,
0.8178524971008301,
0.6070513725280762,
-0.0746200755238533,
0.12956401705741882,
-0.11115851253271103,
0.21501795947551727,
0.050646521151065826,
-1.16679048538208,
-0.46883708238601685,
0.13345074653625488,
-0.6454226970672607,
-0.5506742000579834,
-0.15569163858890533,
-0.9654616117477417,
-0.18585477769374847,
0.13566291332244873,
0.45937585830688477,
-0.3258630037307739,
-0.4517834186553955,
-0.023028716444969177,
-0.36551132798194885,
0.13589385151863098,
0.4324043393135071,
-0.6826249957084656,
0.15955252945423126,
0.08607664704322815,
1.0785400867462158,
-0.3360377848148346,
-0.04411903768777847,
-0.1432258039712906,
0.10651630163192749,
-0.26635095477104187,
0.6369791030883789,
-0.34489092230796814,
-0.4781990945339203,
-0.23840056359767914,
0.28562623262405396,
0.10153307765722275,
-0.46952566504478455,
0.5755501389503479,
-0.4437934160232544,
0.34686386585235596,
-0.0369025319814682,
-0.39836376905441284,
-0.1980782300233841,
-0.007732435129582882,
-0.6861214637756348,
1.0657809972763062,
0.2435995191335678,
-0.8679768443107605,
0.1131962388753891,
-0.7116448879241943,
-0.22653277218341827,
-0.09127352386713028,
0.027170279994606972,
-0.6286793351173401,
-0.13916365802288055,
0.045768920332193375,
0.39293593168258667,
-0.1388787031173706,
0.24683432281017303,
-0.2575053870677948,
-0.25911927223205566,
-0.016310153529047966,
-0.6224626898765564,
0.950025737285614,
0.36869165301322937,
-0.40511566400527954,
-0.004062109161168337,
-0.6198599338531494,
-0.35479652881622314,
0.5072425603866577,
-0.21194468438625336,
-0.16677582263946533,
-0.14148667454719543,
0.2886848449707031,
0.3464522659778595,
0.06596707552671432,
-0.440824955701828,
0.03338337317109108,
-0.2840682566165924,
0.5797224640846252,
0.7291061282157898,
0.19797037541866302,
0.6449809670448303,
-0.39522919058799744,
0.5354118347167969,
0.3225899040699005,
0.2900881767272949,
-0.13915923237800598,
-0.8064313530921936,
-0.6433499455451965,
-0.2164228856563568,
0.17797476053237915,
0.534966230392456,
-0.7359567284584045,
0.16839218139648438,
0.06693974137306213,
-0.6887410879135132,
-0.23570957779884338,
-0.08416024595499039,
0.25407910346984863,
0.6851531863212585,
0.288845419883728,
-0.3227025866508484,
-0.32533273100852966,
-0.7124688625335693,
0.37063366174697876,
-0.09082598239183426,
0.17397639155387878,
0.2415129840373993,
0.6344464421272278,
-0.3664095103740692,
0.5548861622810364,
-0.6445364952087402,
-0.2749927043914795,
0.11340994387865067,
0.11788707226514816,
0.008522668853402138,
0.6448587775230408,
0.7746114134788513,
-1.007878303527832,
-0.6135138273239136,
-0.3026473820209503,
-0.7722533345222473,
-0.036488939076662064,
0.005155721213668585,
-0.31885525584220886,
0.38732650876045227,
0.46183034777641296,
-0.7175101041793823,
0.594271183013916,
0.6080337762832642,
-0.319934219121933,
0.4405297040939331,
-0.32524892687797546,
0.004207195248454809,
-1.0213260650634766,
0.1360035091638565,
0.28317421674728394,
-0.29090848565101624,
-0.5678569674491882,
-0.01013859547674656,
-0.05222228914499283,
-0.1973169445991516,
-0.5802620053291321,
0.7813176512718201,
-0.34967491030693054,
0.427912175655365,
-0.42552030086517334,
0.005386148113757372,
0.17340095341205597,
0.3043738007545471,
0.3064170479774475,
0.6252965331077576,
0.8211638927459717,
-0.5834356546401978,
0.19221875071525574,
0.25760260224342346,
-0.06858654320240021,
0.48533135652542114,
-0.8141055703163147,
0.16802383959293365,
-0.43034881353378296,
0.30500489473342896,
-1.0034412145614624,
-0.15410210192203522,
0.6310979723930359,
-0.3800528049468994,
0.37330031394958496,
-0.1828942596912384,
-0.40242353081703186,
-0.4367871582508087,
-0.15271498262882233,
0.5070383548736572,
0.9503783583641052,
-0.3654279112815857,
0.4612034559249878,
0.42471370100975037,
0.1365669220685959,
-0.44569575786590576,
-0.7337488532066345,
-0.12299460172653198,
-0.3482799530029297,
-0.7902621626853943,
0.6066393852233887,
-0.25760576128959656,
-0.15376955270767212,
0.1559903770685196,
0.14804372191429138,
-0.04526667296886444,
-0.049783337861299515,
0.40822944045066833,
0.22434230148792267,
0.04076550900936127,
-0.0619719959795475,
0.216300368309021,
-0.2590407431125641,
-0.01113144215196371,
-0.12167239189147949,
0.37411531805992126,
0.22231876850128174,
-0.11103776842355728,
-0.6401915550231934,
0.42592233419418335,
0.49310243129730225,
-0.0074227349832654,
0.7066736817359924,
1.020501971244812,
-0.5528813600540161,
0.011858507990837097,
-0.35976946353912354,
-0.2605094909667969,
-0.46930742263793945,
0.41055020689964294,
-0.15487448871135712,
-0.5809385776519775,
0.5610883235931396,
0.024305149912834167,
0.027977952733635902,
0.6498528718948364,
0.7661911249160767,
-0.1958899348974228,
1.0801390409469604,
0.631172776222229,
0.2680157423019409,
0.6891860961914062,
-0.6980462670326233,
-0.027899978682398796,
-0.8079718351364136,
-0.2695451080799103,
-0.15955032408237457,
-0.2790122330188751,
-0.4320557713508606,
-0.6454688906669617,
0.324553906917572,
0.15694040060043335,
-0.13655778765678406,
0.17771407961845398,
-0.5785708427429199,
0.2999562919139862,
0.29170462489128113,
0.21311064064502716,
0.033008042722940445,
0.13640952110290527,
0.10415180772542953,
-0.1984754055738449,
-0.7962751388549805,
-0.5953362584114075,
0.9596064686775208,
0.512332022190094,
0.9015594720840454,
0.01584453508257866,
0.4902418553829193,
0.40830883383750916,
0.35567280650138855,
-0.4411061704158783,
0.4887336790561676,
-0.3612610101699829,
-0.6382259726524353,
-0.1113370880484581,
-0.2271331250667572,
-0.8927395343780518,
0.1850229948759079,
-0.20224735140800476,
-0.40881025791168213,
0.454026997089386,
0.1978880912065506,
-0.29716721177101135,
0.32941216230392456,
-0.6912665367126465,
0.9412985444068909,
-0.10323246568441391,
-0.7170634269714355,
-0.1640060842037201,
-0.6209850907325745,
0.31219810247421265,
0.00012853016960434616,
0.13063427805900574,
-0.13625147938728333,
-0.11611490696668625,
0.8346043229103088,
-0.2626798450946808,
0.9085115194320679,
-0.3958725035190582,
-0.009444694966077805,
0.3729061484336853,
-0.09318389743566513,
0.36369290947914124,
0.262442946434021,
-0.12351186573505402,
0.3580911159515381,
0.034936729818582535,
-0.35525619983673096,
-0.3410786986351013,
0.7104633450508118,
-0.9343369603157043,
-0.4419685900211334,
-0.43788787722587585,
-0.3856852948665619,
0.5550829768180847,
0.1740458458662033,
0.7674906849861145,
0.3857221305370331,
-0.21059246361255646,
-0.09407629817724228,
0.7984622120857239,
-0.2425067275762558,
0.44891664385795593,
0.24123971164226532,
-0.26679497957229614,
-0.4845813512802124,
0.7032930850982666,
0.2192704677581787,
0.4668753743171692,
0.006607976276427507,
0.15550200641155243,
-0.20476296544075012,
-0.5207344889640808,
-0.575432538986206,
0.27286574244499207,
-0.8171135783195496,
-0.20774167776107788,
-0.7836124300956726,
-0.3236039876937866,
-0.4359446167945862,
-0.12483026832342148,
-0.320678174495697,
-0.2760968506336212,
-0.8442546129226685,
0.08913302421569824,
0.3085002601146698,
0.535277247428894,
-0.3123074471950531,
0.36735814809799194,
-0.40813153982162476,
0.39868271350860596,
0.15446220338344574,
0.1828479766845703,
0.03483300656080246,
-0.7605706453323364,
-0.14777691662311554,
0.10392547398805618,
-0.6428220272064209,
-0.9763936400413513,
0.3587918281555176,
0.10407630354166031,
0.5756998062133789,
0.5177919864654541,
-0.027971098199486732,
0.5292233824729919,
-0.4040309488773346,
0.9147197008132935,
0.18040348589420319,
-0.5902802348136902,
0.6356813311576843,
-0.40172436833381653,
0.14319592714309692,
0.19517263770103455,
0.5615604519844055,
-0.29127341508865356,
-0.2922345995903015,
-0.738412618637085,
-0.8099009394645691,
0.6510907411575317,
0.4291161894798279,
0.3427142798900604,
-0.12581390142440796,
0.658247709274292,
0.0004435415903571993,
-0.08668935298919678,
-1.0362273454666138,
-0.5320460200309753,
-0.3195149004459381,
0.043858569115400314,
0.09458020329475403,
-0.4171110987663269,
-0.1781320422887802,
-0.4740956425666809,
0.8802093267440796,
0.08830554783344269,
0.5216324925422668,
0.3920437693595886,
0.00009487353963777423,
-0.3787940740585327,
-0.3389637768268585,
0.5247939825057983,
0.39474231004714966,
-0.13375280797481537,
-0.0359107181429863,
-0.037156637758016586,
-0.5349262356758118,
0.27857714891433716,
0.20293863117694855,
-0.6472745537757874,
0.03950921446084976,
-0.04704117774963379,
0.8965952396392822,
-0.2270476520061493,
-0.4234241545200348,
0.5890681147575378,
-0.1675354242324829,
-0.34915685653686523,
-0.43299323320388794,
0.14612378180027008,
0.07194922119379044,
0.3261007070541382,
0.13289904594421387,
0.4618698060512543,
0.18400141596794128,
-0.28620317578315735,
0.10434337705373764,
0.43740639090538025,
-0.3512815535068512,
-0.31618532538414,
1.034726619720459,
0.16149604320526123,
-0.3375798165798187,
0.5406742691993713,
-0.4887101352214813,
-0.23785153031349182,
0.651849091053009,
0.7493271827697754,
0.7681605219841003,
-0.17123906314373016,
0.4605836272239685,
0.6852378845214844,
0.3156058192253113,
-0.23241718113422394,
0.16700127720832825,
0.2194061130285263,
-0.6808028221130371,
-0.1154380664229393,
-0.4148273169994354,
-0.04179634898900986,
0.16538798809051514,
-0.44417810440063477,
0.49281784892082214,
-0.44156765937805176,
-0.4278308153152466,
-0.0060911523178219795,
-0.2666843831539154,
-0.5761843919754028,
0.14334562420845032,
0.35860610008239746,
0.7691656351089478,
-1.0781477689743042,
0.7748510837554932,
0.7058699131011963,
-0.5978585481643677,
-0.45498529076576233,
0.04380819946527481,
-0.09577133506536484,
-0.3537612855434418,
0.4974890351295471,
0.12588651478290558,
0.058941613882780075,
0.13669562339782715,
-0.7192468643188477,
-0.9220417141914368,
1.2315547466278076,
0.3712482750415802,
-0.3213370442390442,
-0.045823849737644196,
-0.23734194040298462,
0.5565382242202759,
-0.4288357198238373,
0.2966381311416626,
0.2940497398376465,
0.38956204056739807,
0.34461918473243713,
-0.49622809886932373,
0.1395522505044937,
-0.351910799741745,
0.29884812235832214,
-0.06846483051776886,
-0.8951686024665833,
0.9486671686172485,
-0.3361925482749939,
-0.3176155984401703,
0.237502321600914,
0.6214097738265991,
0.1978081911802292,
0.33647820353507996,
0.3975442945957184,
0.8115256428718567,
0.5344142317771912,
-0.13344863057136536,
0.9314518570899963,
-0.07289000600576401,
0.39517083764076233,
0.724875807762146,
-0.08762674033641815,
0.620826005935669,
0.42182329297065735,
-0.17770157754421234,
0.5495727062225342,
0.6998235583305359,
-0.35379886627197266,
0.7644791007041931,
-0.01164416503161192,
-0.1604675054550171,
-0.054565317928791046,
0.00976248737424612,
-0.4670705497264862,
0.17066606879234314,
0.2896919846534729,
-0.5409224033355713,
-0.2101624757051468,
0.27485933899879456,
0.03187986835837364,
-0.165205180644989,
-0.09546514600515366,
0.5527795553207397,
0.052886489778757095,
-0.4313409924507141,
0.5673978924751282,
0.19738827645778656,
0.84677654504776,
-0.4578096568584442,
-0.1726626306772232,
-0.10079283267259598,
0.14790146052837372,
-0.23666545748710632,
-0.733156144618988,
0.4646323323249817,
-0.11088114231824875,
-0.3062184154987335,
-0.2311427742242813,
0.8761089444160461,
-0.3534680902957916,
-0.6302354335784912,
0.36816075444221497,
0.2789207696914673,
0.29157644510269165,
0.03378705680370331,
-1.0138412714004517,
0.19687548279762268,
-0.05320676043629646,
-0.3355403244495392,
0.240770161151886,
0.19399039447307587,
0.10661127418279648,
0.5041969418525696,
0.5258376598358154,
-0.0721578598022461,
0.0760115459561348,
-0.050108976662158966,
0.824780285358429,
-0.2867904603481293,
-0.3236905038356781,
-0.8091281652450562,
0.6896870732307434,
-0.06098009645938873,
-0.271859347820282,
0.6378573179244995,
0.5636493563652039,
0.7469169497489929,
-0.12393995374441147,
0.7265775203704834,
-0.3017071485519409,
0.0017535423394292593,
-0.47640761733055115,
0.8160426020622253,
-0.7225546836853027,
0.04895217716693878,
-0.369098037481308,
-0.8568729758262634,
-0.14848800003528595,
0.8751688599586487,
-0.25923678278923035,
0.22870996594429016,
0.4532589018344879,
0.9595935940742493,
-0.12318761646747589,
-0.20498399436473846,
0.32541245222091675,
0.23667189478874207,
0.34308403730392456,
0.32229769229888916,
0.7484352588653564,
-0.7443040013313293,
0.40602853894233704,
-0.5259062647819519,
-0.2859264612197876,
-0.016863293945789337,
-0.8321899175643921,
-0.811549186706543,
-0.6710258722305298,
-0.7736493945121765,
-0.635714054107666,
-0.05440283566713333,
0.4247518479824066,
0.920445442199707,
-0.4369346797466278,
-0.006839437410235405,
-0.19020843505859375,
0.003218645928427577,
-0.08429944515228271,
-0.2668497860431671,
0.27015072107315063,
0.09227368235588074,
-0.8923947215080261,
-0.07546991854906082,
0.28103023767471313,
0.5210542678833008,
-0.5275030136108398,
-0.19222457706928253,
-0.2787418067455292,
-0.12218103557825089,
0.5400924682617188,
0.06624338030815125,
-0.6401940584182739,
0.01373689528554678,
-0.037853118032217026,
-0.07397305965423584,
0.14266115427017212,
0.3326398432254791,
-0.5982053279876709,
0.378496378660202,
0.5142813920974731,
0.1734420508146286,
0.8089367151260376,
-0.10768748819828033,
0.15435165166854858,
-0.45717406272888184,
0.3329327404499054,
0.15895648300647736,
0.36925801634788513,
0.3037574291229248,
-0.5746014714241028,
0.4799242913722992,
0.5910014510154724,
-0.7135428786277771,
-0.7460271120071411,
0.20069582760334015,
-1.02080237865448,
-0.24925315380096436,
1.2587647438049316,
-0.15572860836982727,
-0.2811291217803955,
0.04138517379760742,
-0.39810270071029663,
0.2983124554157257,
-0.3518977463245392,
0.5557995438575745,
0.5466989874839783,
-0.13732872903347015,
-0.48624712228775024,
-0.6004984378814697,
0.49892458319664,
0.1410307139158249,
-0.586851179599762,
-0.2136392444372177,
0.5979934930801392,
0.6513673067092896,
0.2148607224225998,
0.9440538883209229,
-0.2857304513454437,
0.26139435172080994,
0.12457668781280518,
-0.018093397840857506,
0.011888162232935429,
-0.20454086363315582,
-0.4358500838279724,
0.008518166840076447,
-0.17437374591827393,
-0.052150577306747437
] |
sentence-transformers/all-MiniLM-L6-v2 | sentence-transformers | "2022-11-07T08:44:33Z" | 5,487,445 | 1,150 | sentence-transformers | [
"sentence-transformers",
"pytorch",
"tf",
"rust",
"bert",
"feature-extraction",
"sentence-similarity",
"en",
"dataset:s2orc",
"dataset:flax-sentence-embeddings/stackexchange_xml",
"dataset:ms_marco",
"dataset:gooaq",
"dataset:yahoo_answers_topics",
"dataset:code_search_net",
"dataset:search_qa",
"dataset:eli5",
"dataset:snli",
"dataset:multi_nli",
"dataset:wikihow",
"dataset:natural_questions",
"dataset:trivia_qa",
"dataset:embedding-data/sentence-compression",
"dataset:embedding-data/flickr30k-captions",
"dataset:embedding-data/altlex",
"dataset:embedding-data/simple-wiki",
"dataset:embedding-data/QQP",
"dataset:embedding-data/SPECTER",
"dataset:embedding-data/PAQ_pairs",
"dataset:embedding-data/WikiAnswers",
"arxiv:1904.06472",
"arxiv:2102.07033",
"arxiv:2104.08727",
"arxiv:1704.05179",
"arxiv:1810.09305",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | sentence-similarity | "2022-03-02T23:29:05Z" | ---
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- feature-extraction
- sentence-similarity
language: en
license: apache-2.0
datasets:
- s2orc
- flax-sentence-embeddings/stackexchange_xml
- ms_marco
- gooaq
- yahoo_answers_topics
- code_search_net
- search_qa
- eli5
- snli
- multi_nli
- wikihow
- natural_questions
- trivia_qa
- embedding-data/sentence-compression
- embedding-data/flickr30k-captions
- embedding-data/altlex
- embedding-data/simple-wiki
- embedding-data/QQP
- embedding-data/SPECTER
- embedding-data/PAQ_pairs
- embedding-data/WikiAnswers
---
# all-MiniLM-L6-v2
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.
## Usage (Sentence-Transformers)
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
```
pip install -U sentence-transformers
```
Then you can use the model like this:
```python
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
embeddings = model.encode(sentences)
print(embeddings)
```
## Usage (HuggingFace Transformers)
Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
```python
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']
# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
model = AutoModel.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
# Normalize embeddings
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
print("Sentence embeddings:")
print(sentence_embeddings)
```
## Evaluation Results
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=sentence-transformers/all-MiniLM-L6-v2)
------
## Background
The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised
contrastive learning objective. We used the pretrained [`nreimers/MiniLM-L6-H384-uncased`](https://huggingface.co/nreimers/MiniLM-L6-H384-uncased) model and fine-tuned in on a
1B sentence pairs dataset. We use a contrastive learning objective: given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.
We developped this model during the
[Community week using JAX/Flax for NLP & CV](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/7104),
organized by Hugging Face. We developped this model as part of the project:
[Train the Best Sentence Embedding Model Ever with 1B Training Pairs](https://discuss.huggingface.co/t/train-the-best-sentence-embedding-model-ever-with-1b-training-pairs/7354). We benefited from efficient hardware infrastructure to run the project: 7 TPUs v3-8, as well as intervention from Googles Flax, JAX, and Cloud team member about efficient deep learning frameworks.
## Intended uses
Our model is intented to be used as a sentence and short paragraph encoder. Given an input text, it ouptuts a vector which captures
the semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.
By default, input text longer than 256 word pieces is truncated.
## Training procedure
### Pre-training
We use the pretrained [`nreimers/MiniLM-L6-H384-uncased`](https://huggingface.co/nreimers/MiniLM-L6-H384-uncased) model. Please refer to the model card for more detailed information about the pre-training procedure.
### Fine-tuning
We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each possible sentence pairs from the batch.
We then apply the cross entropy loss by comparing with true pairs.
#### Hyper parameters
We trained ou model on a TPU v3-8. We train the model during 100k steps using a batch size of 1024 (128 per TPU core).
We use a learning rate warm up of 500. The sequence length was limited to 128 tokens. We used the AdamW optimizer with
a 2e-5 learning rate. The full training script is accessible in this current repository: `train_script.py`.
#### Training data
We use the concatenation from multiple datasets to fine-tune our model. The total number of sentence pairs is above 1 billion sentences.
We sampled each dataset given a weighted probability which configuration is detailed in the `data_config.json` file.
| Dataset | Paper | Number of training tuples |
|--------------------------------------------------------|:----------------------------------------:|:--------------------------:|
| [Reddit comments (2015-2018)](https://github.com/PolyAI-LDN/conversational-datasets/tree/master/reddit) | [paper](https://arxiv.org/abs/1904.06472) | 726,484,430 |
| [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Abstracts) | [paper](https://aclanthology.org/2020.acl-main.447/) | 116,288,806 |
| [WikiAnswers](https://github.com/afader/oqa#wikianswers-corpus) Duplicate question pairs | [paper](https://doi.org/10.1145/2623330.2623677) | 77,427,422 |
| [PAQ](https://github.com/facebookresearch/PAQ) (Question, Answer) pairs | [paper](https://arxiv.org/abs/2102.07033) | 64,371,441 |
| [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Titles) | [paper](https://aclanthology.org/2020.acl-main.447/) | 52,603,982 |
| [S2ORC](https://github.com/allenai/s2orc) (Title, Abstract) | [paper](https://aclanthology.org/2020.acl-main.447/) | 41,769,185 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Body) pairs | - | 25,316,456 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title+Body, Answer) pairs | - | 21,396,559 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Answer) pairs | - | 21,396,559 |
| [MS MARCO](https://microsoft.github.io/msmarco/) triplets | [paper](https://doi.org/10.1145/3404835.3462804) | 9,144,553 |
| [GOOAQ: Open Question Answering with Diverse Answer Types](https://github.com/allenai/gooaq) | [paper](https://arxiv.org/pdf/2104.08727.pdf) | 3,012,496 |
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 1,198,260 |
| [Code Search](https://huggingface.co/datasets/code_search_net) | - | 1,151,414 |
| [COCO](https://cocodataset.org/#home) Image captions | [paper](https://link.springer.com/chapter/10.1007%2F978-3-319-10602-1_48) | 828,395|
| [SPECTER](https://github.com/allenai/specter) citation triplets | [paper](https://doi.org/10.18653/v1/2020.acl-main.207) | 684,100 |
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Question, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 681,164 |
| [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Question) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 659,896 |
| [SearchQA](https://huggingface.co/datasets/search_qa) | [paper](https://arxiv.org/abs/1704.05179) | 582,261 |
| [Eli5](https://huggingface.co/datasets/eli5) | [paper](https://doi.org/10.18653/v1/p19-1346) | 325,475 |
| [Flickr 30k](https://shannon.cs.illinois.edu/DenotationGraph/) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/229/33) | 317,695 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles) | | 304,525 |
| AllNLI ([SNLI](https://nlp.stanford.edu/projects/snli/) and [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) | [paper SNLI](https://doi.org/10.18653/v1/d15-1075), [paper MultiNLI](https://doi.org/10.18653/v1/n18-1101) | 277,230 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (bodies) | | 250,519 |
| [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles+bodies) | | 250,460 |
| [Sentence Compression](https://github.com/google-research-datasets/sentence-compression) | [paper](https://www.aclweb.org/anthology/D13-1155/) | 180,000 |
| [Wikihow](https://github.com/pvl/wikihow_pairs_dataset) | [paper](https://arxiv.org/abs/1810.09305) | 128,542 |
| [Altlex](https://github.com/chridey/altlex/) | [paper](https://aclanthology.org/P16-1135.pdf) | 112,696 |
| [Quora Question Triplets](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs) | - | 103,663 |
| [Simple Wikipedia](https://cs.pomona.edu/~dkauchak/simplification/) | [paper](https://www.aclweb.org/anthology/P11-2117/) | 102,225 |
| [Natural Questions (NQ)](https://ai.google.com/research/NaturalQuestions) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/1455) | 100,231 |
| [SQuAD2.0](https://rajpurkar.github.io/SQuAD-explorer/) | [paper](https://aclanthology.org/P18-2124.pdf) | 87,599 |
| [TriviaQA](https://huggingface.co/datasets/trivia_qa) | - | 73,346 |
| **Total** | | **1,170,060,424** | | [
-0.3425259590148926,
-0.8404478430747986,
0.319079726934433,
0.10410725325345993,
-0.13494659960269928,
-0.27600976824760437,
-0.22713953256607056,
-0.277400940656662,
0.33308425545692444,
0.18307343125343323,
-0.4866493046283722,
-0.525094747543335,
-0.6338952779769897,
0.12160180509090424,
-0.2829033434391022,
1.0938547849655151,
-0.018270300701260567,
-0.07639306038618088,
-0.39928629994392395,
-0.31019991636276245,
-0.1139964684844017,
-0.4798870384693146,
-0.5131672620773315,
-0.028545670211315155,
0.4654391407966614,
0.35552656650543213,
0.47057536244392395,
0.49663785099983215,
0.36445605754852295,
0.25293537974357605,
-0.08048871159553528,
0.30484315752983093,
-0.5997600555419922,
-0.15477971732616425,
0.16038310527801514,
-0.4024101197719574,
-0.19001029431819916,
0.0455964058637619,
0.45972442626953125,
0.5935574173927307,
-0.02299436368048191,
0.2681593894958496,
0.2079254686832428,
0.4812077283859253,
-0.3991047441959381,
0.2602258324623108,
-0.5277519822120667,
0.04580951854586601,
-0.17721077799797058,
0.024052130058407784,
-0.3787743151187897,
-0.361668199300766,
0.27041447162628174,
-0.5195401310920715,
0.1812712550163269,
0.2858712673187256,
0.9957239031791687,
0.2612239122390747,
-0.34079644083976746,
-0.44530656933784485,
-0.15080901980400085,
0.7783249020576477,
-0.7507832646369934,
0.22708146274089813,
0.48444053530693054,
-0.12146858125925064,
0.010886520147323608,
-0.7538496851921082,
-0.7355725169181824,
-0.08444244414567947,
-0.4942932724952698,
0.17496433854103088,
-0.33117178082466125,
-0.12776616215705872,
0.2673148512840271,
0.3774397373199463,
-0.8201063275337219,
0.04615737870335579,
-0.3652030825614929,
-0.1223241314291954,
0.7186445593833923,
0.12860646843910217,
0.2511913776397705,
-0.5750148296356201,
-0.28433409333229065,
-0.2618482708930969,
-0.32494837045669556,
0.1777554750442505,
0.30240508913993835,
0.18692423403263092,
-0.4836851954460144,
0.7005704045295715,
-0.011653133668005466,
0.5966664552688599,
0.034671805799007416,
0.05774392560124397,
0.5565311908721924,
-0.6172930002212524,
-0.17113642394542694,
-0.2692737281322479,
1.1713635921478271,
0.3290117383003235,
0.11394612491130829,
0.07632400840520859,
0.114719919860363,
-0.06044468283653259,
-0.13793298602104187,
-0.7655386328697205,
-0.29108941555023193,
0.2998088598251343,
-0.42605000734329224,
-0.36601969599723816,
0.08587804436683655,
-0.8028386831283569,
-0.1365811675786972,
0.016941988840699196,
0.3479767143726349,
-0.5420415997505188,
-0.13530400395393372,
0.19898736476898193,
-0.1422882080078125,
0.26475682854652405,
-0.057235684245824814,
-0.7102559208869934,
0.2646207809448242,
0.3921408951282501,
0.9011133313179016,
-0.014495544135570526,
-0.2547217309474945,
-0.29073232412338257,
-0.1361558735370636,
-0.0610051229596138,
0.7005268931388855,
-0.42297857999801636,
-0.10028266906738281,
0.011026805266737938,
0.08920891582965851,
-0.45497190952301025,
-0.3451814651489258,
0.5757514834403992,
-0.2707333564758301,
0.6382432579994202,
-0.17116761207580566,
-0.8008418679237366,
-0.03786764666438103,
0.1969311535358429,
-0.4829261302947998,
1.2626551389694214,
0.17284934222698212,
-1.128706932067871,
0.010067411698400974,
-0.5976421236991882,
-0.18426188826560974,
-0.22421307861804962,
-0.21529272198677063,
-0.5992026925086975,
-0.04793539270758629,
0.4619264006614685,
0.5277379751205444,
-0.21579454839229584,
0.113649882376194,
-0.3823523223400116,
-0.24715997278690338,
0.2172715812921524,
-0.061817750334739685,
1.1550226211547852,
0.12669476866722107,
-0.30241286754608154,
-0.05780605226755142,
-0.6153528094291687,
-0.10203032195568085,
0.363211989402771,
-0.101034976541996,
-0.22809883952140808,
-0.2643682360649109,
0.18428246676921844,
0.3450446128845215,
0.2557220458984375,
-0.6418836712837219,
0.18567675352096558,
-0.5925617218017578,
0.6309555172920227,
0.6825746297836304,
-0.013596445322036743,
0.3326309621334076,
-0.47145408391952515,
0.3786909282207489,
0.13194124400615692,
-0.006532551720738411,
-0.06390336155891418,
-0.5511384010314941,
-1.0773495435714722,
-0.18051841855049133,
0.39549627900123596,
0.537382960319519,
-0.7789846062660217,
0.7793264985084534,
-0.5010178685188293,
-0.5282896757125854,
-0.8696218729019165,
0.1072738990187645,
0.4401635527610779,
0.5480942726135254,
0.6512234807014465,
-0.013175471685826778,
-0.612317681312561,
-0.9708166122436523,
-0.1657811850309372,
-0.036539170891046524,
0.027974789962172508,
0.5020747184753418,
0.790390133857727,
-0.3309239447116852,
0.9153520464897156,
-0.732205867767334,
-0.39896976947784424,
-0.2874208688735962,
0.06183190271258354,
0.23426710069179535,
0.5650323033332825,
0.5914137363433838,
-0.6818138360977173,
-0.6441888213157654,
-0.4095153212547302,
-0.8466144800186157,
0.04790510982275009,
-0.01541202049702406,
-0.25279420614242554,
0.32922986149787903,
0.664650559425354,
-0.7115120887756348,
0.38676121830940247,
0.5067527294158936,
-0.40623876452445984,
0.2849780023097992,
-0.13303183019161224,
-0.18724004924297333,
-1.2887167930603027,
0.21133825182914734,
0.05442431941628456,
-0.13447384536266327,
-0.47444406151771545,
-0.019700556993484497,
-0.1058601662516594,
-0.040675386786460876,
-0.3679085969924927,
0.539129912853241,
-0.44070008397102356,
0.08275864273309708,
0.13824741542339325,
0.3743767738342285,
0.02782290428876877,
0.7389866709709167,
-0.1081925705075264,
0.6431699991226196,
0.3883659541606903,
-0.36444297432899475,
0.19615094363689423,
0.6099963188171387,
-0.40815603733062744,
0.2924177646636963,
-0.8086276054382324,
0.26902973651885986,
-0.15985733270645142,
0.4729139506816864,
-1.0216485261917114,
-0.06796929985284805,
0.2870137393474579,
-0.5864877700805664,
0.06701165437698364,
0.08621121942996979,
-0.6542764902114868,
-0.5193666815757751,
-0.5550901889801025,
0.3172181248664856,
0.4368116557598114,
-0.4304260313510895,
0.39259690046310425,
0.34072592854499817,
-0.04949488863348961,
-0.5375983715057373,
-0.9828335642814636,
-0.16521579027175903,
-0.13637800514698029,
-0.8079235553741455,
0.3867112994194031,
-0.26195573806762695,
0.021779144182801247,
0.2045794129371643,
0.1349654197692871,
0.1758721023797989,
-0.20193542540073395,
0.13852708041667938,
0.11875814199447632,
-0.09418979287147522,
0.24386882781982422,
-0.04089699685573578,
-0.09490740299224854,
-0.16874027252197266,
-0.2015095055103302,
0.7258956432342529,
-0.4190877079963684,
0.0001623743592062965,
-0.5639967322349548,
0.35643965005874634,
0.2906450033187866,
-0.129879891872406,
1.0017507076263428,
0.8713871836662292,
-0.3649853467941284,
0.1449437439441681,
-0.5398467183113098,
-0.1611253321170807,
-0.4539593756198883,
0.34439414739608765,
-0.3326414227485657,
-1.0943025350570679,
0.4194771945476532,
0.4206411838531494,
0.07810564339160919,
0.8297703862190247,
0.4477849304676056,
-0.3094097673892975,
0.8038330674171448,
0.4149576723575592,
-0.08046674728393555,
0.4673137962818146,
-0.6646733283996582,
0.30688032507896423,
-0.9117087125778198,
-0.26296478509902954,
-0.4002892076969147,
-0.297086238861084,
-0.8695001602172852,
-0.6246190071105957,
0.3512258231639862,
-0.05576063320040703,
-0.19525925815105438,
0.3861675262451172,
-0.5119538903236389,
0.09902750700712204,
0.5810835957527161,
0.296174019575119,
-0.03917793929576874,
0.06456467509269714,
-0.2563922703266144,
-0.15155687928199768,
-0.8273797631263733,
-0.34476444125175476,
1.140457034111023,
0.3633773624897003,
0.48305684328079224,
-0.04481040686368942,
0.7669130563735962,
0.15538670122623444,
-0.06875848025083542,
-0.5442599654197693,
0.5680281519889832,
-0.309687077999115,
-0.4321926534175873,
-0.17490965127944946,
-0.5374351739883423,
-0.9907187819480896,
0.2079956978559494,
-0.3257403075695038,
-0.6631928086280823,
0.3020347058773041,
0.017110927030444145,
-0.4702698886394501,
0.1907646805047989,
-0.7477276921272278,
1.0001277923583984,
-0.07537396997213364,
-0.3511134684085846,
-0.07374048233032227,
-0.8296979665756226,
0.17254741489887238,
0.23603659868240356,
0.21304278075695038,
-0.06614044308662415,
-0.0748201534152031,
1.0366252660751343,
-0.4350249171257019,
0.7548800110816956,
-0.1243179589509964,
0.2642761766910553,
0.3549402058124542,
-0.2788986563682556,
0.48976463079452515,
0.02397560141980648,
-0.14520256221294403,
0.17439088225364685,
0.04298274591565132,
-0.6592647433280945,
-0.5082459449768066,
0.81908118724823,
-1.0191872119903564,
-0.4022415578365326,
-0.6139681935310364,
-0.4606182873249054,
-0.07233991473913193,
0.09893468767404556,
0.43557098507881165,
0.38920581340789795,
-0.04512667655944824,
0.547379732131958,
0.6454505324363708,
-0.40741679072380066,
0.48194625973701477,
0.11014964431524277,
-0.04894856736063957,
-0.5492305755615234,
0.7126933336257935,
0.1280510425567627,
0.04321828484535217,
0.4980917274951935,
0.2664436101913452,
-0.32906004786491394,
-0.3849140405654907,
-0.2602718472480774,
0.42782488465309143,
-0.5558662414550781,
-0.2209535539150238,
-1.1687926054000854,
-0.3417557179927826,
-0.7378730177879333,
-0.06413954496383667,
-0.2311413437128067,
-0.47774001955986023,
-0.5960661768913269,
-0.3302345275878906,
0.38668912649154663,
0.4472740590572357,
0.011846721172332764,
0.18483465909957886,
-0.4285334348678589,
0.23773837089538574,
0.2545351982116699,
-0.008449184708297253,
-0.1612064689397812,
-0.7231866717338562,
-0.30006179213523865,
0.14975827932357788,
-0.2581917643547058,
-0.6510105133056641,
0.44019269943237305,
0.3487001657485962,
0.45791909098625183,
0.12832868099212646,
0.14635150134563446,
0.7735719084739685,
-0.21201534569263458,
0.9457206726074219,
0.07453039288520813,
-0.7327041029930115,
0.6669939756393433,
-0.22679036855697632,
0.40234294533729553,
0.7670583128929138,
0.4913967251777649,
-0.4525890052318573,
-0.33962440490722656,
-0.8543968200683594,
-0.9770881533622742,
0.6700893640518188,
0.44287559390068054,
0.19279387593269348,
-0.1189020425081253,
0.35120460391044617,
-0.08099424839019775,
0.07001122832298279,
-0.9319477081298828,
-0.4423481523990631,
-0.2045879065990448,
-0.5944058299064636,
-0.2570793032646179,
-0.3410828113555908,
-0.08499033004045486,
-0.495412141084671,
0.7556251883506775,
-0.14773772656917572,
0.6518517732620239,
0.39903366565704346,
-0.4129372537136078,
0.29740485548973083,
0.07828206568956375,
0.5482224822044373,
0.2922620177268982,
-0.2540813088417053,
0.13330671191215515,
0.2446303814649582,
-0.29714012145996094,
-0.19708575308322906,
0.36519739031791687,
-0.20350314676761627,
-0.03467368707060814,
0.4950079917907715,
0.882489800453186,
0.1999257653951645,
-0.5749594569206238,
0.7704184055328369,
-0.2443709373474121,
-0.26280975341796875,
-0.43372875452041626,
-0.09177353233098984,
0.2049364596605301,
0.14695511758327484,
0.190679669380188,
-0.027003489434719086,
0.02588222362101078,
-0.5053378343582153,
0.27553901076316833,
0.23739954829216003,
-0.38537463545799255,
-0.1219836175441742,
0.5178907513618469,
0.04174093157052994,
-0.05041925236582756,
0.7578667402267456,
-0.22246751189231873,
-0.4603089690208435,
0.5134111642837524,
0.416385293006897,
0.7287003397941589,
0.17141921818256378,
0.1276950240135193,
0.6811901330947876,
0.3435434103012085,
0.17272073030471802,
0.11049176752567291,
0.1319541335105896,
-0.7109502553939819,
0.03122704103589058,
-0.7142050862312317,
0.027637118473649025,
0.1086338683962822,
-0.5985302925109863,
0.22703199088573456,
-0.30225640535354614,
0.03235095739364624,
0.0628424808382988,
0.2893229126930237,
-0.8414599895477295,
0.015238724648952484,
0.04185128211975098,
0.8690465092658997,
-0.9217358231544495,
0.8152709603309631,
0.5967017412185669,
-0.6621636748313904,
-0.6790754199028015,
-0.00012825586600229144,
-0.07047189772129059,
-0.8581131100654602,
0.33400392532348633,
0.3710969388484955,
0.10487504303455353,
0.089323028922081,
-0.6180053353309631,
-0.9135596752166748,
1.2879390716552734,
0.280859112739563,
-0.4442233443260193,
-0.1332349330186844,
0.14289146661758423,
0.675199031829834,
-0.5327722430229187,
0.49633529782295227,
0.5653700828552246,
0.3340674638748169,
-0.04254866763949394,
-0.71048903465271,
0.18947456777095795,
-0.5327078104019165,
0.174490824341774,
-0.21721123158931732,
-0.8706556558609009,
0.7300984263420105,
-0.0816020742058754,
-0.1321221888065338,
0.10593671351671219,
0.7714868783950806,
0.3834318220615387,
0.22780807316303253,
0.5077695846557617,
0.9481135010719299,
0.717792272567749,
-0.10192646831274033,
1.120894193649292,
-0.23807524144649506,
0.5992606282234192,
1.118870496749878,
0.1900491714477539,
0.9838184714317322,
0.4705612063407898,
-0.1634598672389984,
0.807240903377533,
0.8051958680152893,
-0.09352349489927292,
0.5342305898666382,
0.10250211507081985,
0.058555807918310165,
-0.08355378359556198,
-0.1396322101354599,
-0.43242916464805603,
0.45114144682884216,
0.27538201212882996,
-0.4669274389743805,
0.09846442937850952,
0.1322202831506729,
0.3170403838157654,
0.05712306872010231,
0.08790164440870285,
0.7920013666152954,
0.21059854328632355,
-0.5629844069480896,
0.648534893989563,
-0.08245109021663666,
0.9424176216125488,
-0.4742225706577301,
0.31230267882347107,
-0.34230345487594604,
0.20100383460521698,
-0.32269027829170227,
-0.6540136337280273,
0.3823179006576538,
-0.011495889164507389,
-0.14313644170761108,
-0.24310630559921265,
0.48722153902053833,
-0.6074401140213013,
-0.6589786410331726,
0.3870881497859955,
0.40501669049263,
0.11750248819589615,
0.19582197070121765,
-1.0674970149993896,
0.03862167149782181,
0.11720604449510574,
-0.4327583312988281,
0.22660517692565918,
0.18457059562206268,
0.30010315775871277,
0.45591631531715393,
0.6122775673866272,
-0.22144228219985962,
0.11587522178888321,
-0.0714232325553894,
0.8850852847099304,
-0.6690347194671631,
-0.5356405973434448,
-0.7946133613586426,
0.5926728248596191,
-0.33994507789611816,
-0.44216084480285645,
0.8185581564903259,
0.811980664730072,
0.975450336933136,
0.04001517966389656,
0.6784861087799072,
-0.396188884973526,
0.5176581144332886,
-0.4669424295425415,
0.578805685043335,
-0.7286590337753296,
0.0924229547381401,
-0.23837041854858398,
-0.6547872424125671,
-0.28502488136291504,
0.7326224446296692,
-0.4342801570892334,
0.0971037894487381,
0.9130068421363831,
0.9447317123413086,
0.0010136980563402176,
-0.03795783594250679,
-0.000509156845510006,
0.3866955041885376,
0.21900802850723267,
0.7972397208213806,
0.42920273542404175,
-0.9363574981689453,
0.7756690382957458,
-0.4414713978767395,
-0.12699635326862335,
-0.3512554466724396,
-0.6368120908737183,
-0.8871709108352661,
-0.7586177587509155,
-0.45851558446884155,
-0.4948871433734894,
0.0255576279014349,
1.0561063289642334,
0.6817153096199036,
-0.8270042538642883,
-0.17958742380142212,
-0.13409613072872162,
-0.019740568473935127,
-0.06737499684095383,
-0.2800869643688202,
0.7007322311401367,
-0.17184969782829285,
-0.6552082300186157,
0.15783323347568512,
-0.06186852604150772,
-0.04964236915111542,
-0.01720038428902626,
-0.07417437434196472,
-0.7140229940414429,
0.02522953413426876,
0.5684274435043335,
0.14482872188091278,
-0.6619049906730652,
-0.2951674461364746,
0.051130060106515884,
-0.38512030243873596,
0.13868188858032227,
0.46604040265083313,
-0.4756726324558258,
0.3575533628463745,
0.5855662822723389,
0.5672760605812073,
0.9075313210487366,
-0.1108456552028656,
0.2521531283855438,
-0.7640693783760071,
0.2600078284740448,
0.24386635422706604,
0.42194557189941406,
0.46707814931869507,
-0.398107647895813,
0.7059575319290161,
0.4091426432132721,
-0.556647539138794,
-0.7050108313560486,
-0.10538841038942337,
-1.194440484046936,
-0.14614182710647583,
1.2921701669692993,
-0.3109339475631714,
-0.19846971333026886,
0.08039838075637817,
-0.14963723719120026,
0.29998472332954407,
-0.37412992119789124,
0.5867934823036194,
0.6342968940734863,
-0.27787846326828003,
-0.3917412757873535,
-0.3981461226940155,
0.46058017015457153,
0.5201699137687683,
-0.9156067967414856,
-0.22446611523628235,
0.2532854676246643,
0.36260026693344116,
0.22791557013988495,
0.729469358921051,
-0.04937676712870598,
-0.04204556345939636,
-0.019476257264614105,
-0.10502536594867706,
-0.04308279603719711,
0.043398547917604446,
-0.33956241607666016,
0.21435390412807465,
-0.33935457468032837,
-0.20906150341033936
] |
distilbert-base-multilingual-cased | null | "2023-04-06T13:40:24Z" | 5,421,444 | 78 | transformers | [
"transformers",
"pytorch",
"tf",
"onnx",
"safetensors",
"distilbert",
"fill-mask",
"multilingual",
"af",
"sq",
"ar",
"an",
"hy",
"ast",
"az",
"ba",
"eu",
"bar",
"be",
"bn",
"inc",
"bs",
"br",
"bg",
"my",
"ca",
"ceb",
"ce",
"zh",
"cv",
"hr",
"cs",
"da",
"nl",
"en",
"et",
"fi",
"fr",
"gl",
"ka",
"de",
"el",
"gu",
"ht",
"he",
"hi",
"hu",
"is",
"io",
"id",
"ga",
"it",
"ja",
"jv",
"kn",
"kk",
"ky",
"ko",
"la",
"lv",
"lt",
"roa",
"nds",
"lm",
"mk",
"mg",
"ms",
"ml",
"mr",
"mn",
"min",
"ne",
"new",
"nb",
"nn",
"oc",
"fa",
"pms",
"pl",
"pt",
"pa",
"ro",
"ru",
"sco",
"sr",
"scn",
"sk",
"sl",
"aze",
"es",
"su",
"sw",
"sv",
"tl",
"tg",
"th",
"ta",
"tt",
"te",
"tr",
"uk",
"ud",
"uz",
"vi",
"vo",
"war",
"cy",
"fry",
"pnb",
"yo",
"dataset:wikipedia",
"arxiv:1910.01108",
"arxiv:1910.09700",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language:
- multilingual
- af
- sq
- ar
- an
- hy
- ast
- az
- ba
- eu
- bar
- be
- bn
- inc
- bs
- br
- bg
- my
- ca
- ceb
- ce
- zh
- cv
- hr
- cs
- da
- nl
- en
- et
- fi
- fr
- gl
- ka
- de
- el
- gu
- ht
- he
- hi
- hu
- is
- io
- id
- ga
- it
- ja
- jv
- kn
- kk
- ky
- ko
- la
- lv
- lt
- roa
- nds
- lm
- mk
- mg
- ms
- ml
- mr
- mn
- min
- ne
- new
- nb
- nn
- oc
- fa
- pms
- pl
- pt
- pa
- ro
- ru
- sco
- sr
- hr
- scn
- sk
- sl
- aze
- es
- su
- sw
- sv
- tl
- tg
- th
- ta
- tt
- te
- tr
- uk
- ud
- uz
- vi
- vo
- war
- cy
- fry
- pnb
- yo
license: apache-2.0
datasets:
- wikipedia
---
# Model Card for DistilBERT base multilingual (cased)
# Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
4. [Training Details](#training-details)
5. [Evaluation](#evaluation)
6. [Environmental Impact](#environmental-impact)
7. [Citation](#citation)
8. [How To Get Started With the Model](#how-to-get-started-with-the-model)
# Model Details
## Model Description
This model is a distilled version of the [BERT base multilingual model](https://huggingface.co/bert-base-multilingual-cased/). The code for the distillation process can be found [here](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation). This model is cased: it does make a difference between english and English.
The model is trained on the concatenation of Wikipedia in 104 different languages listed [here](https://github.com/google-research/bert/blob/master/multilingual.md#list-of-languages).
The model has 6 layers, 768 dimension and 12 heads, totalizing 134M parameters (compared to 177M parameters for mBERT-base).
On average, this model, referred to as DistilmBERT, is twice as fast as mBERT-base.
We encourage potential users of this model to check out the [BERT base multilingual model card](https://huggingface.co/bert-base-multilingual-cased) to learn more about usage, limitations and potential biases.
- **Developed by:** Victor Sanh, Lysandre Debut, Julien Chaumond, Thomas Wolf (Hugging Face)
- **Model type:** Transformer-based language model
- **Language(s) (NLP):** 104 languages; see full list [here](https://github.com/google-research/bert/blob/master/multilingual.md#list-of-languages)
- **License:** Apache 2.0
- **Related Models:** [BERT base multilingual model](https://huggingface.co/bert-base-multilingual-cased)
- **Resources for more information:**
- [GitHub Repository](https://github.com/huggingface/transformers/blob/main/examples/research_projects/distillation/README.md)
- [Associated Paper](https://arxiv.org/abs/1910.01108)
# Uses
## Direct Use and Downstream Use
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=bert) to look for fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation you should look at model like GPT2.
## Out of Scope Use
The model should not be used to intentionally create hostile or alienating environments for people. The model was not trained to be factual or true representations of people or events, and therefore using the models to generate such content is out-of-scope for the abilities of this model.
# Bias, Risks, and Limitations
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
## Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
# Training Details
- The model was pretrained with the supervision of [bert-base-multilingual-cased](https://huggingface.co/bert-base-multilingual-cased) on the concatenation of Wikipedia in 104 different languages
- The model has 6 layers, 768 dimension and 12 heads, totalizing 134M parameters.
- Further information about the training procedure and data is included in the [bert-base-multilingual-cased](https://huggingface.co/bert-base-multilingual-cased) model card.
# Evaluation
The model developers report the following accuracy results for DistilmBERT (see [GitHub Repo](https://github.com/huggingface/transformers/blob/main/examples/research_projects/distillation/README.md)):
> Here are the results on the test sets for 6 of the languages available in XNLI. The results are computed in the zero shot setting (trained on the English portion and evaluated on the target language portion):
| Model | English | Spanish | Chinese | German | Arabic | Urdu |
| :---: | :---: | :---: | :---: | :---: | :---: | :---:|
| mBERT base cased (computed) | 82.1 | 74.6 | 69.1 | 72.3 | 66.4 | 58.5 |
| mBERT base uncased (reported)| 81.4 | 74.3 | 63.8 | 70.5 | 62.1 | 58.3 |
| DistilmBERT | 78.2 | 69.1 | 64.0 | 66.3 | 59.1 | 54.7 |
# Environmental Impact
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** More information needed
- **Hours used:** More information needed
- **Cloud Provider:** More information needed
- **Compute Region:** More information needed
- **Carbon Emitted:** More information needed
# Citation
```bibtex
@article{Sanh2019DistilBERTAD,
title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
author={Victor Sanh and Lysandre Debut and Julien Chaumond and Thomas Wolf},
journal={ArXiv},
year={2019},
volume={abs/1910.01108}
}
```
APA
- Sanh, V., Debut, L., Chaumond, J., & Wolf, T. (2019). DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108.
# How to Get Started With the Model
You can use the model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='distilbert-base-multilingual-cased')
>>> unmasker("Hello I'm a [MASK] model.")
[{'score': 0.040800247341394424,
'sequence': "Hello I'm a virtual model.",
'token': 37859,
'token_str': 'virtual'},
{'score': 0.020015988498926163,
'sequence': "Hello I'm a big model.",
'token': 22185,
'token_str': 'big'},
{'score': 0.018680453300476074,
'sequence': "Hello I'm a Hello model.",
'token': 31178,
'token_str': 'Hello'},
{'score': 0.017396586015820503,
'sequence': "Hello I'm a model model.",
'token': 13192,
'token_str': 'model'},
{'score': 0.014229810796678066,
'sequence': "Hello I'm a perfect model.",
'token': 43477,
'token_str': 'perfect'}]
```
| [
-0.38927263021469116,
-0.7309663891792297,
0.2625051438808441,
0.2817128300666809,
-0.19239817559719086,
0.04243817180395126,
-0.41277891397476196,
-0.360832542181015,
0.058010514825582504,
0.34979283809661865,
-0.5735239386558533,
-0.4491490423679352,
-0.7449554204940796,
0.033942852169275284,
-0.3233241140842438,
1.2073372602462769,
0.149904265999794,
0.14522884786128998,
0.0959811806678772,
0.08556754887104034,
-0.34167829155921936,
-0.8346816301345825,
-0.5815259218215942,
-0.30286261439323425,
0.4110974073410034,
0.1335628181695938,
0.47410333156585693,
0.30624842643737793,
0.291036993265152,
0.35251879692077637,
-0.29237398505210876,
-0.11158052831888199,
-0.3862946033477783,
-0.12654849886894226,
0.11863154917955399,
-0.3041127324104309,
-0.38985854387283325,
-0.023549476638436317,
0.571199357509613,
0.8351343274116516,
-0.045006558299064636,
0.30887264013290405,
0.10629112273454666,
0.6503450274467468,
-0.17683643102645874,
0.44603025913238525,
-0.7561065554618835,
-0.09645775705575943,
-0.20449510216712952,
0.42742955684661865,
-0.540648341178894,
0.008681179955601692,
0.17877429723739624,
-0.2422877848148346,
0.26159772276878357,
0.005616834387183189,
1.1590654850006104,
0.1578599214553833,
-0.3008219003677368,
-0.211847186088562,
-0.5551410913467407,
0.9696904420852661,
-0.9995595216751099,
0.45221662521362305,
0.2935408055782318,
0.1957847625017166,
-0.08541850000619888,
-0.7566239237785339,
-0.7431617379188538,
-0.23074612021446228,
-0.29918766021728516,
0.1714041829109192,
-0.2499673217535019,
-0.05230160430073738,
0.35352590680122375,
0.40563660860061646,
-0.5856371521949768,
0.030223269015550613,
-0.49936625361442566,
-0.19364824891090393,
0.7247008681297302,
-0.16379202902317047,
0.20160211622714996,
-0.4214591979980469,
-0.2713888883590698,
-0.3481045365333557,
-0.3171549141407013,
0.08832503855228424,
0.5389295220375061,
0.6381174921989441,
-0.2902868688106537,
0.5098205208778381,
-0.02885495312511921,
0.6376245617866516,
0.14997029304504395,
-0.20906519889831543,
0.5805821418762207,
-0.307065486907959,
-0.2049776017665863,
0.06960131227970123,
0.8963649272918701,
0.122234046459198,
0.24289865791797638,
0.04892626404762268,
-0.0809411033987999,
-0.06118621677160263,
-0.007871724665164948,
-0.8532990217208862,
-0.32046517729759216,
0.35506924986839294,
-0.40554937720298767,
-0.22347430884838104,
0.004701720084995031,
-0.6465055346488953,
0.06111343577504158,
-0.26017430424690247,
0.27154189348220825,
-0.5330759286880493,
-0.4822917580604553,
0.13102057576179504,
-0.14946569502353668,
0.09308473020792007,
0.007409268990159035,
-0.8784099221229553,
0.1517770141363144,
0.43663662672042847,
0.7755292057991028,
-0.021568194031715393,
-0.2710326611995697,
-0.09258519113063812,
-0.2869306802749634,
0.023176252841949463,
0.29316359758377075,
-0.20089709758758545,
-0.2566605806350708,
-0.054976753890514374,
0.2648339569568634,
0.07045501470565796,
-0.3051977753639221,
0.7131256461143494,
-0.3682975172996521,
0.39998963475227356,
-0.20649279654026031,
-0.45903506875038147,
-0.3965737819671631,
0.1404329538345337,
-0.793110728263855,
1.280285358428955,
0.14954033493995667,
-0.820965588092804,
0.3318495750427246,
-0.6330260634422302,
-0.6121541261672974,
-0.002678695833310485,
0.14235590398311615,
-0.589667022228241,
-0.04368645325303078,
0.23708029091358185,
0.5098527073860168,
-0.056392066180706024,
0.6351935267448425,
-0.10512099415063858,
-0.08040111511945724,
-0.0651746615767479,
-0.5367375612258911,
1.420737862586975,
0.3876790702342987,
-0.4802720546722412,
-0.1470445841550827,
-0.8954843282699585,
0.050665006041526794,
0.21981318295001984,
-0.4326549768447876,
-0.23616977035999298,
-0.007419062312692404,
0.3512580692768097,
0.37715157866477966,
0.2990248501300812,
-0.49587777256965637,
0.10202240198850632,
-0.33206653594970703,
0.5617827773094177,
0.6405501365661621,
-0.32115811109542847,
0.22488394379615784,
-0.18637336790561676,
0.2664300203323364,
0.18852613866329193,
0.13621577620506287,
-0.19916890561580658,
-0.7617621421813965,
-1.0009584426879883,
-0.3597540855407715,
0.5664961934089661,
0.6579370498657227,
-0.7247170805931091,
0.761856734752655,
-0.32611316442489624,
-0.6824784874916077,
-0.6379372477531433,
0.11379032582044601,
0.494567334651947,
0.5019755363464355,
0.3534802496433258,
-0.19331876933574677,
-0.7506510019302368,
-0.9411936402320862,
0.185247540473938,
-0.31179288029670715,
0.009803087450563908,
0.1337721049785614,
0.6441522836685181,
-0.2769021987915039,
0.8510069251060486,
-0.43401163816452026,
-0.23249907791614532,
-0.3851531445980072,
0.1528010219335556,
0.6510799527168274,
0.43286532163619995,
0.7637991905212402,
-0.7735117673873901,
-0.7958375811576843,
-0.04218171164393425,
-0.6216392517089844,
-0.054469212889671326,
-0.019897762686014175,
-0.09303513914346695,
0.45388564467430115,
0.32935649156570435,
-0.5642720460891724,
0.07173168659210205,
0.8037605881690979,
-0.14785468578338623,
0.4664623439311981,
-0.2908098101615906,
-0.06745795160531998,
-1.2964236736297607,
0.19583769142627716,
0.09339036047458649,
-0.1561930626630783,
-0.8298813700675964,
0.0384768545627594,
-0.009404506534337997,
-0.021899797022342682,
-0.6914102435112,
0.5480117201805115,
-0.5052134394645691,
0.2372957020998001,
-0.019409548491239548,
-0.09049800783395767,
0.13195833563804626,
0.8190318942070007,
0.2580699622631073,
0.550404965877533,
0.5530731678009033,
-0.5008599162101746,
0.23421922326087952,
0.2249525934457779,
-0.5714603066444397,
0.129324272274971,
-0.6773725748062134,
0.07693547755479813,
-0.1501854956150055,
0.1792503446340561,
-0.9219221472740173,
0.02284976653754711,
0.0001914025779115036,
-0.45641207695007324,
0.5898268818855286,
-0.22018897533416748,
-0.6374492049217224,
-0.5579058527946472,
-0.17011578381061554,
0.12490444630384445,
0.7334503531455994,
-0.5134862661361694,
0.5412003397941589,
0.36537304520606995,
-0.22234827280044556,
-0.7424366474151611,
-0.9812275767326355,
0.0024502472952008247,
-0.27955180406570435,
-0.7095485925674438,
0.4845755696296692,
-0.20909149944782257,
-0.21077007055282593,
-0.10879592597484589,
0.25605618953704834,
-0.22842727601528168,
0.05830978602170944,
0.08484648168087006,
0.34626656770706177,
0.01186161208897829,
-0.0017827851697802544,
0.09119849652051926,
0.02693774178624153,
-0.08248288184404373,
-0.1725284457206726,
0.7038804292678833,
-0.2552715837955475,
-0.019900556653738022,
-0.21394772827625275,
0.4024885296821594,
0.5152570605278015,
-0.0703546404838562,
0.8194708824157715,
0.6869243383407593,
-0.4975869953632355,
0.03905969858169556,
-0.5613922476768494,
-0.1874210387468338,
-0.46823495626449585,
0.6134350299835205,
-0.4599524736404419,
-0.7747631072998047,
0.7042633295059204,
0.2748424708843231,
0.17649361491203308,
0.7101950645446777,
0.7958003282546997,
-0.08244349807500839,
1.023023247718811,
0.6672707796096802,
-0.35585105419158936,
0.4375557601451874,
-0.3980230689048767,
0.40821072459220886,
-0.5897373557090759,
-0.20026524364948273,
-0.5270823240280151,
-0.16692271828651428,
-0.8140849471092224,
-0.28587788343429565,
0.2119830697774887,
0.24743051826953888,
-0.2517010271549225,
0.7064645290374756,
-0.6240247488021851,
0.17764559388160706,
0.8182080388069153,
-0.01686215028166771,
0.212498739361763,
0.10426429659128189,
-0.28926047682762146,
-0.17435671389102936,
-0.7573673129081726,
-0.5092222690582275,
1.0147860050201416,
0.5423406362533569,
0.519025444984436,
0.17754121124744415,
0.6447871327400208,
0.2459643930196762,
0.15416961908340454,
-0.5276731252670288,
0.39754873514175415,
-0.38854944705963135,
-1.0745773315429688,
-0.3133485019207001,
-0.32780855894088745,
-0.8348538279533386,
0.23014654219150543,
-0.0779629498720169,
-0.6967681050300598,
0.10798680037260056,
-0.009752861224114895,
-0.2276448905467987,
0.35357099771499634,
-1.028390884399414,
0.8686084151268005,
-0.5435956120491028,
-0.20824474096298218,
0.10485640913248062,
-0.8014978170394897,
0.39380234479904175,
-0.25737327337265015,
0.34919533133506775,
-0.15909601747989655,
0.4887006878852844,
0.5912683010101318,
-0.494571328163147,
1.0241470336914062,
-0.2601991295814514,
-0.1013195738196373,
0.2977468967437744,
-0.28071728348731995,
0.40693995356559753,
-0.06253807246685028,
-0.1916469782590866,
0.8064758777618408,
0.03830705210566521,
-0.2550899386405945,
-0.21774010360240936,
0.6586897373199463,
-0.7924388647079468,
-0.5400308966636658,
-0.5799471735954285,
-0.5095212459564209,
0.08105561137199402,
0.3282051384449005,
0.3410138785839081,
0.0679781436920166,
-0.09669321775436401,
0.11613471806049347,
0.5467444062232971,
-0.5152090191841125,
0.5544012784957886,
0.5334269404411316,
-0.25786757469177246,
-0.17653948068618774,
0.798416256904602,
0.19539158046245575,
0.25322526693344116,
0.4276953637599945,
0.19249142706394196,
-0.4733636975288391,
-0.3947700262069702,
-0.5432265400886536,
0.1941240429878235,
-0.655562162399292,
-0.15737028419971466,
-0.8240315914154053,
-0.5023341774940491,
-0.6367209553718567,
0.17056825757026672,
-0.3846930265426636,
-0.4456349313259125,
-0.28635820746421814,
-0.21707355976104736,
0.5160149335861206,
0.3218242824077606,
-0.11029371619224548,
0.20770657062530518,
-0.6407933235168457,
0.1870192289352417,
0.2729943096637726,
0.2841838598251343,
-0.10152152925729752,
-0.7317581176757812,
-0.2540929913520813,
0.38061749935150146,
-0.31624001264572144,
-0.6457721590995789,
0.5600706338882446,
0.35986804962158203,
0.615109920501709,
0.28080520033836365,
0.06619555503129959,
0.67078697681427,
-0.7744157910346985,
0.9758127331733704,
0.25021690130233765,
-1.0215259790420532,
0.5494384765625,
-0.11982879042625427,
0.16278304159641266,
0.46869999170303345,
0.5186069011688232,
-0.535735011100769,
-0.4267793595790863,
-0.6466227769851685,
-1.0012856721878052,
0.8163762092590332,
0.35618600249290466,
0.44145652651786804,
-0.18895676732063293,
0.16348451375961304,
0.13988402485847473,
0.19770456850528717,
-1.1692726612091064,
-0.6288020610809326,
-0.27614283561706543,
-0.1861349195241928,
-0.12824803590774536,
-0.3044751286506653,
0.13591636717319489,
-0.6207711696624756,
0.9866593480110168,
0.0632287785410881,
0.26759833097457886,
0.06348289549350739,
-0.17640967667102814,
0.2765173017978668,
0.1414373815059662,
0.5517945289611816,
0.24231041967868805,
-0.5080087184906006,
-0.028136495500802994,
0.2817085385322571,
-0.531048059463501,
0.06048014387488365,
0.3153562843799591,
-0.16565652191638947,
0.36055293679237366,
0.31231340765953064,
0.9964606761932373,
-0.08545423299074173,
-0.7176540493965149,
0.4395899176597595,
0.03149046748876572,
-0.39403149485588074,
-0.43381357192993164,
-0.18270865082740784,
0.215174600481987,
0.18556657433509827,
0.301448255777359,
-0.15519733726978302,
0.14276689291000366,
-0.6366868019104004,
0.20782189071178436,
0.344845712184906,
-0.36647161841392517,
-0.25297409296035767,
0.8466202020645142,
0.19421491026878357,
-0.14083218574523926,
0.7896100282669067,
-0.3574909567832947,
-0.6147428154945374,
0.6696877479553223,
0.41905370354652405,
0.7903189659118652,
-0.11200226098299026,
0.12202558666467667,
0.6691200733184814,
0.5183570384979248,
-0.026950456202030182,
0.19501091539859772,
0.1718919724225998,
-0.7920833230018616,
-0.5396666526794434,
-0.834783136844635,
-0.026415545493364334,
0.37879759073257446,
-0.5460128784179688,
0.4841318428516388,
-0.21058519184589386,
-0.3273877203464508,
0.23463264107704163,
0.1667913794517517,
-0.7112828493118286,
0.18119128048419952,
0.3085889518260956,
0.8313165903091431,
-0.999147355556488,
1.183902621269226,
0.5413520336151123,
-0.6698154807090759,
-0.7654129862785339,
-0.3511488139629364,
-0.2018834501504898,
-0.7255871891975403,
0.7964363694190979,
0.20041903853416443,
0.31279852986335754,
-0.10381828248500824,
-0.3377549350261688,
-0.8300683498382568,
0.9484336376190186,
0.4673173427581787,
-0.8683581948280334,
0.014017466455698013,
0.30062049627304077,
0.7653733491897583,
-0.20440945029258728,
0.472829669713974,
0.5592437982559204,
0.5512493252754211,
0.05214924365282059,
-1.0602399110794067,
-0.06649655103683472,
-0.5289366841316223,
0.14030751585960388,
0.02842470444738865,
-0.6812784075737,
1.0371184349060059,
-0.18724091351032257,
-0.2057098001241684,
-0.09368995577096939,
0.40833553671836853,
0.21266575157642365,
-0.0009552593110129237,
0.5079330801963806,
0.6602846384048462,
0.6163736581802368,
-0.3780335485935211,
1.0003687143325806,
-0.515156090259552,
0.6001911759376526,
1.143225073814392,
-0.2991247773170471,
0.7609707713127136,
0.5033218860626221,
-0.4085451364517212,
0.6483683586120605,
0.7117913365364075,
-0.21458695828914642,
0.7168917059898376,
0.22010883688926697,
-0.1409865766763687,
0.05489461123943329,
-0.015950871631503105,
-0.4083094596862793,
0.3518836200237274,
0.18652747571468353,
-0.5042438507080078,
-0.07627714425325394,
0.0009693680913187563,
0.28757381439208984,
-0.07381762564182281,
0.13491666316986084,
0.5572183728218079,
-0.022844024002552032,
-0.6873857378959656,
0.685408353805542,
0.2835192382335663,
0.9659087061882019,
-0.6049466133117676,
-0.005061205010861158,
-0.156693235039711,
0.18187493085861206,
-0.07467281818389893,
-0.7315969467163086,
0.2957879304885864,
0.11053389310836792,
-0.47664281725883484,
-0.402985543012619,
0.49740275740623474,
-0.6571943163871765,
-0.9694890379905701,
0.49532532691955566,
0.4788714349269867,
0.27518773078918457,
-0.06491271406412125,
-0.9804132580757141,
0.05777887627482414,
0.27256613969802856,
-0.26587164402008057,
0.14135374128818512,
0.24302315711975098,
-0.07648613303899765,
0.47100362181663513,
0.7321993112564087,
-0.08696410059928894,
0.19318801164627075,
0.29080235958099365,
0.7915872931480408,
-0.4086982309818268,
-0.20761917531490326,
-0.8604536056518555,
0.8201650381088257,
-0.14530709385871887,
-0.230854332447052,
0.737828254699707,
0.7539346814155579,
1.0861241817474365,
-0.20864775776863098,
1.0187546014785767,
-0.3955543637275696,
0.43147656321525574,
-0.3516285717487335,
0.768642783164978,
-0.5698335766792297,
0.1592179238796234,
-0.397497296333313,
-1.0001791715621948,
-0.2328280657529831,
0.6904396414756775,
-0.07704035937786102,
0.23448705673217773,
0.5605148673057556,
0.6958038210868835,
0.018039222806692123,
-0.3567000925540924,
0.24694830179214478,
0.31390732526779175,
0.34706228971481323,
0.5318500399589539,
0.3789106607437134,
-0.6980315446853638,
0.47945064306259155,
-0.655925452709198,
-0.24007323384284973,
-0.09441505372524261,
-1.0776634216308594,
-0.9728238582611084,
-0.7385697960853577,
-0.40789690613746643,
-0.33449792861938477,
-0.1295912116765976,
0.7060976624488831,
0.8525862097740173,
-1.0289926528930664,
-0.33490437269210815,
-0.07937248796224594,
-0.016216611489653587,
-0.3121391236782074,
-0.25986436009407043,
0.40131404995918274,
-0.25640806555747986,
-1.1651140451431274,
0.1706089824438095,
0.013884777203202248,
0.117619588971138,
-0.36913058161735535,
-0.1782599538564682,
-0.5260124802589417,
-0.056849971413612366,
0.7790372967720032,
0.051195695996284485,
-0.822496771812439,
-0.1652059555053711,
0.1426803022623062,
-0.08923961967229843,
0.016010792925953865,
0.2790434956550598,
-0.44273167848587036,
0.5444298982620239,
0.4157206118106842,
0.2902520000934601,
0.7575661540031433,
-0.37070733308792114,
0.3629121482372284,
-0.9941838383674622,
0.45235416293144226,
0.08104006946086884,
0.6281830668449402,
0.35965731739997864,
-0.4020248353481293,
0.5565953850746155,
0.1444627344608307,
-0.35479170083999634,
-0.7985168695449829,
-0.006122628226876259,
-1.0965200662612915,
-0.3838033378124237,
1.1902458667755127,
-0.2413852959871292,
-0.14078353345394135,
-0.0528559647500515,
-0.3075532913208008,
0.3354671597480774,
-0.3561285436153412,
0.7821604609489441,
1.027468204498291,
0.1653144359588623,
-0.1251278668642044,
-0.5783197283744812,
0.26945191621780396,
0.34414172172546387,
-0.5897728204727173,
-0.08921511471271515,
0.30369219183921814,
0.4113294780254364,
0.3773357570171356,
0.4644152522087097,
-0.12381467968225479,
-0.19833500683307648,
0.0068567064590752125,
0.4857007563114166,
0.019395997747778893,
-0.1511230170726776,
-0.2161530703306198,
-0.26804134249687195,
-0.0717218816280365,
-0.07736241817474365
] |
bert-base-cased | null | "2022-11-16T15:18:28Z" | 5,326,802 | 162 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"bert",
"fill-mask",
"exbert",
"en",
"dataset:bookcorpus",
"dataset:wikipedia",
"arxiv:1810.04805",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: apache-2.0
datasets:
- bookcorpus
- wikipedia
---
# BERT base model (cased)
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
[this paper](https://arxiv.org/abs/1810.04805) and first released in
[this repository](https://github.com/google-research/bert). This model is case-sensitive: it makes a difference between
english and English.
Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it
was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
was pretrained with two objectives:
- Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run
the entire masked sentence through the model and has to predict the masked words. This is different from traditional
recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like
GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the
sentence.
- Next sentence prediction (NSP): the models concatenates two masked sentences as inputs during pretraining. Sometimes
they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to
predict if the two sentences were following each other or not.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
classifier using the features produced by the BERT model as inputs.
## Intended uses & limitations
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=bert) to look for
fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='bert-base-cased')
>>> unmasker("Hello I'm a [MASK] model.")
[{'sequence': "[CLS] Hello I'm a fashion model. [SEP]",
'score': 0.09019174426794052,
'token': 4633,
'token_str': 'fashion'},
{'sequence': "[CLS] Hello I'm a new model. [SEP]",
'score': 0.06349995732307434,
'token': 1207,
'token_str': 'new'},
{'sequence': "[CLS] Hello I'm a male model. [SEP]",
'score': 0.06228214129805565,
'token': 2581,
'token_str': 'male'},
{'sequence': "[CLS] Hello I'm a professional model. [SEP]",
'score': 0.0441727414727211,
'token': 1848,
'token_str': 'professional'},
{'sequence': "[CLS] Hello I'm a super model. [SEP]",
'score': 0.03326151892542839,
'token': 7688,
'token_str': 'super'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-cased')
model = BertModel.from_pretrained("bert-base-cased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-cased')
model = TFBertModel.from_pretrained("bert-base-cased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
Even if the training data used for this model could be characterized as fairly neutral, this model can have biased
predictions:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='bert-base-cased')
>>> unmasker("The man worked as a [MASK].")
[{'sequence': '[CLS] The man worked as a lawyer. [SEP]',
'score': 0.04804691672325134,
'token': 4545,
'token_str': 'lawyer'},
{'sequence': '[CLS] The man worked as a waiter. [SEP]',
'score': 0.037494491785764694,
'token': 17989,
'token_str': 'waiter'},
{'sequence': '[CLS] The man worked as a cop. [SEP]',
'score': 0.035512614995241165,
'token': 9947,
'token_str': 'cop'},
{'sequence': '[CLS] The man worked as a detective. [SEP]',
'score': 0.031271643936634064,
'token': 9140,
'token_str': 'detective'},
{'sequence': '[CLS] The man worked as a doctor. [SEP]',
'score': 0.027423162013292313,
'token': 3995,
'token_str': 'doctor'}]
>>> unmasker("The woman worked as a [MASK].")
[{'sequence': '[CLS] The woman worked as a nurse. [SEP]',
'score': 0.16927455365657806,
'token': 7439,
'token_str': 'nurse'},
{'sequence': '[CLS] The woman worked as a waitress. [SEP]',
'score': 0.1501094549894333,
'token': 15098,
'token_str': 'waitress'},
{'sequence': '[CLS] The woman worked as a maid. [SEP]',
'score': 0.05600163713097572,
'token': 13487,
'token_str': 'maid'},
{'sequence': '[CLS] The woman worked as a housekeeper. [SEP]',
'score': 0.04838843643665314,
'token': 26458,
'token_str': 'housekeeper'},
{'sequence': '[CLS] The woman worked as a cook. [SEP]',
'score': 0.029980547726154327,
'token': 9834,
'token_str': 'cook'}]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
The BERT model was pretrained on [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038
unpublished books and [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and
headers).
## Training procedure
### Preprocessing
The texts are tokenized using WordPiece and a vocabulary size of 30,000. The inputs of the model are then of the form:
```
[CLS] Sentence A [SEP] Sentence B [SEP]
```
With probability 0.5, sentence A and sentence B correspond to two consecutive sentences in the original corpus and in
the other cases, it's another random sentence in the corpus. Note that what is considered a sentence here is a
consecutive span of text usually longer than a single sentence. The only constrain is that the result with the two
"sentences" has a combined length of less than 512 tokens.
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
### Pretraining
The model was trained on 4 cloud TPUs in Pod configuration (16 TPU chips total) for one million steps with a batch size
of 256. The sequence length was limited to 128 tokens for 90% of the steps and 512 for the remaining 10%. The optimizer
used is Adam with a learning rate of 1e-4, \\(\beta_{1} = 0.9\\) and \\(\beta_{2} = 0.999\\), a weight decay of 0.01,
learning rate warmup for 10,000 steps and linear decay of the learning rate after.
## Evaluation results
When fine-tuned on downstream tasks, this model achieves the following results:
Glue test results:
| Task | MNLI-(m/mm) | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE | Average |
|:----:|:-----------:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|:-------:|
| | 84.6/83.4 | 71.2 | 90.5 | 93.5 | 52.1 | 85.8 | 88.9 | 66.4 | 79.6 |
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1810-04805,
author = {Jacob Devlin and
Ming{-}Wei Chang and
Kenton Lee and
Kristina Toutanova},
title = {{BERT:} Pre-training of Deep Bidirectional Transformers for Language
Understanding},
journal = {CoRR},
volume = {abs/1810.04805},
year = {2018},
url = {http://arxiv.org/abs/1810.04805},
archivePrefix = {arXiv},
eprint = {1810.04805},
timestamp = {Tue, 30 Oct 2018 20:39:56 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1810-04805.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
<a href="https://huggingface.co/exbert/?model=bert-base-cased">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.10652753710746765,
-0.6248297691345215,
0.2197728008031845,
0.23527343571186066,
-0.5516867637634277,
0.038627006113529205,
-0.032347872853279114,
-0.13558587431907654,
0.4068670868873596,
0.49688300490379333,
-0.5742049217224121,
-0.4455358684062958,
-0.801167905330658,
0.1387893110513687,
-0.5559012293815613,
1.1443299055099487,
0.2828684449195862,
0.33080726861953735,
0.08051122725009918,
0.16883888840675354,
-0.447372168302536,
-0.7775906920433044,
-0.8183588981628418,
-0.2768586277961731,
0.45845624804496765,
0.3879752457141876,
0.6091887354850769,
0.6153676509857178,
0.47310003638267517,
0.37355101108551025,
-0.06342068314552307,
-0.08224037289619446,
-0.32080838084220886,
0.0944090262055397,
-0.03260476514697075,
-0.6080909967422485,
-0.37579017877578735,
0.16940799355506897,
0.45849427580833435,
0.7922123670578003,
-0.04053275287151337,
0.32988590002059937,
-0.14967793226242065,
0.6335020661354065,
-0.2232607901096344,
0.30567777156829834,
-0.5017192363739014,
0.13256029784679413,
-0.2621387541294098,
0.1319911777973175,
-0.3869399428367615,
-0.20286116003990173,
0.12671728432178497,
-0.6014005541801453,
0.2964058816432953,
0.17633382976055145,
1.1095935106277466,
0.17244094610214233,
-0.22453004121780396,
-0.13616284728050232,
-0.47515591979026794,
0.755405068397522,
-0.697803795337677,
0.15428175032138824,
0.5002956390380859,
0.23808984458446503,
-0.19327811896800995,
-1.0772068500518799,
-0.4112760126590729,
-0.028267396613955498,
-0.0972861498594284,
0.06256843358278275,
0.0008088084869086742,
-0.13222333788871765,
0.36313876509666443,
0.41599202156066895,
-0.34694257378578186,
0.0007994848419912159,
-0.7211878895759583,
-0.3423597812652588,
0.6681753396987915,
0.16731607913970947,
0.20923779904842377,
-0.3416009843349457,
-0.344902902841568,
-0.29638344049453735,
-0.27882763743400574,
0.12755469977855682,
0.5248287916183472,
0.45571598410606384,
-0.170593723654747,
0.7372640371322632,
-0.20131196081638336,
0.5891566276550293,
0.10147909075021744,
-0.016309568658471107,
0.4898105263710022,
-0.1366201937198639,
-0.3769865036010742,
0.003310420550405979,
0.9367426037788391,
0.2640286386013031,
0.43656712770462036,
-0.018706513568758965,
-0.3254721164703369,
0.049248505383729935,
0.3729723393917084,
-0.6258776783943176,
-0.3746030628681183,
0.1466001570224762,
-0.5349518060684204,
-0.4575969874858856,
0.4697606861591339,
-0.6358407139778137,
-0.06793103367090225,
-0.12459461390972137,
0.5802128911018372,
-0.40302738547325134,
-0.14968131482601166,
0.1329745501279831,
-0.5242149829864502,
0.2183133214712143,
0.04134323447942734,
-0.9261307716369629,
0.2821095585823059,
0.7124360799789429,
0.8649459481239319,
0.29703500866889954,
-0.1433810591697693,
-0.45884788036346436,
-0.2779959440231323,
-0.3927442133426666,
0.4949192702770233,
-0.30600205063819885,
-0.5006076097488403,
-0.018469244241714478,
0.28658097982406616,
-0.12145192176103592,
-0.2527613937854767,
0.7189342379570007,
-0.4860403835773468,
0.5523566603660583,
-0.09935656934976578,
-0.5955016016960144,
-0.26038217544555664,
0.017996788024902344,
-0.7090065479278564,
1.2188653945922852,
0.3514428436756134,
-0.728094220161438,
0.3900868892669678,
-0.91810142993927,
-0.6429875493049622,
0.21049386262893677,
0.11248410493135452,
-0.4960435926914215,
0.18551401793956757,
0.1199461966753006,
0.46982041001319885,
-0.02863919548690319,
0.3320653736591339,
-0.18766069412231445,
-0.4760863482952118,
0.3285435140132904,
-0.19790449738502502,
1.0369311571121216,
0.22032073140144348,
-0.33334261178970337,
0.1770753711462021,
-0.7945287823677063,
-0.03658652678132057,
0.2475138157606125,
-0.3906015157699585,
-0.16046471893787384,
-0.09661056846380234,
0.2926870286464691,
0.1853068321943283,
0.3655173182487488,
-0.6522576808929443,
0.30778300762176514,
-0.567672848701477,
0.6795042753219604,
0.8243142366409302,
-0.06629366427659988,
0.254337340593338,
-0.4388565421104431,
0.5076200366020203,
-0.021010154858231544,
-0.027115724980831146,
-0.19696930050849915,
-0.8004058599472046,
-0.7777818441390991,
-0.36160004138946533,
0.6409963965415955,
0.7706382274627686,
-0.5102174878120422,
0.7422284483909607,
-0.03442985191941261,
-0.5891508460044861,
-0.6276376247406006,
-0.12540210783481598,
0.33532458543777466,
0.5010918974876404,
0.35025665163993835,
-0.4725760519504547,
-0.8634685277938843,
-0.8289666771888733,
-0.27332594990730286,
-0.15224657952785492,
-0.2536058723926544,
0.10730092972517014,
0.7343130111694336,
-0.23747257888317108,
0.8359875082969666,
-0.7351307272911072,
-0.4141467809677124,
-0.18466846644878387,
0.2647709846496582,
0.6690483689308167,
0.7058634161949158,
0.35976821184158325,
-0.640718400478363,
-0.4389028549194336,
-0.4184824228286743,
-0.5599948167800903,
0.027161529287695885,
-0.009386523626744747,
-0.18335749208927155,
0.1759795844554901,
0.5705347061157227,
-0.7535751461982727,
0.5805104970932007,
0.23561765253543854,
-0.5829735994338989,
0.7384008765220642,
-0.37221693992614746,
-0.05338389053940773,
-1.3051291704177856,
0.17379087209701538,
-0.10595642775297165,
-0.34207141399383545,
-0.7850050926208496,
-0.010204589925706387,
-0.09372816979885101,
-0.08025676757097244,
-0.5810689330101013,
0.4883858859539032,
-0.4196051359176636,
-0.020756257697939873,
0.04227861389517784,
-0.21785712242126465,
0.0038122376427054405,
0.4593881070613861,
0.024873236194252968,
0.6007395386695862,
0.5740187764167786,
-0.5643410086631775,
0.5100587606430054,
0.4133893847465515,
-0.5579961538314819,
0.17252442240715027,
-0.812802255153656,
0.2685128450393677,
0.09414282441139221,
0.033695559948682785,
-1.136581540107727,
-0.346125066280365,
0.2397778183221817,
-0.6007608771324158,
0.2274038940668106,
-0.11649082601070404,
-0.756077229976654,
-0.5983243584632874,
-0.2393985390663147,
0.40915748476982117,
0.6162100434303284,
-0.23174072802066803,
0.4458205997943878,
0.2877567410469055,
-0.09170454740524292,
-0.6133936643600464,
-0.6875615119934082,
0.10916560888290405,
-0.20748114585876465,
-0.5099141001701355,
0.4195459485054016,
-0.028346575796604156,
-0.11644648015499115,
-0.2101946622133255,
0.052060872316360474,
-0.16048505902290344,
0.09500820934772491,
0.29107993841171265,
0.4420061707496643,
-0.1849624365568161,
-0.07370997965335846,
-0.1907290518283844,
-0.12767045199871063,
0.28379037976264954,
-0.17043884098529816,
0.8777840733528137,
-0.015255498699843884,
-0.0674830824136734,
-0.3229864537715912,
0.3477611839771271,
0.6660502552986145,
-0.05719343200325966,
0.7258079051971436,
0.8549434542655945,
-0.5928522944450378,
0.0847879946231842,
-0.3407531976699829,
-0.20718912780284882,
-0.5110514760017395,
0.4751978814601898,
-0.5054360032081604,
-0.805654764175415,
0.7639002203941345,
0.3084537386894226,
-0.14140477776527405,
0.7501248717308044,
0.5876258015632629,
-0.21293459832668304,
0.9934735298156738,
0.4817308187484741,
-0.1551327258348465,
0.49230143427848816,
-0.152267187833786,
0.3050924837589264,
-0.7328169941902161,
-0.4361502528190613,
-0.4135165810585022,
-0.28324171900749207,
-0.525180995464325,
-0.18967874348163605,
0.24496255815029144,
0.215846985578537,
-0.44410043954849243,
0.6002269387245178,
-0.6351103186607361,
0.3326556384563446,
1.0439908504486084,
0.389616996049881,
-0.21952398121356964,
-0.2377132773399353,
-0.29574042558670044,
0.07172945141792297,
-0.5093370676040649,
-0.3379461467266083,
1.1845203638076782,
0.5178951621055603,
0.6079532504081726,
0.03886371850967407,
0.6695717573165894,
0.39232346415519714,
-0.05593499168753624,
-0.7228481769561768,
0.6270802021026611,
-0.40971246361732483,
-0.8836607933044434,
-0.402510404586792,
-0.09417816251516342,
-1.0698509216308594,
0.14121733605861664,
-0.3272736072540283,
-0.8301524519920349,
-0.05288337916135788,
-0.1621374487876892,
-0.3692225515842438,
0.19292236864566803,
-0.7425242066383362,
1.0412554740905762,
-0.27738016843795776,
-0.14035363495349884,
0.0890507623553276,
-0.9854588508605957,
0.25468021631240845,
-0.003306332277134061,
0.09517019242048264,
-0.07590790838003159,
0.242658331990242,
1.0971975326538086,
-0.591408371925354,
0.9942731261253357,
-0.2455204427242279,
0.2718290388584137,
0.06716354191303253,
-0.027013549581170082,
0.32195210456848145,
0.02088942378759384,
0.07524807006120682,
0.300535649061203,
0.05167640000581741,
-0.49403372406959534,
-0.11083013564348221,
0.3008240759372711,
-0.7345086932182312,
-0.5229243040084839,
-0.6415303349494934,
-0.6410622596740723,
0.15014415979385376,
0.4399048984050751,
0.5946798324584961,
0.526844322681427,
-0.09519781172275543,
0.2511751055717468,
0.5075055360794067,
-0.21835598349571228,
0.7757589817047119,
0.32644176483154297,
-0.17928072810173035,
-0.4954841434955597,
0.593019425868988,
0.008486938662827015,
0.02839335799217224,
0.4952053725719452,
0.23837505280971527,
-0.592899739742279,
-0.18874181807041168,
-0.35685083270072937,
0.13192333281040192,
-0.5739870667457581,
-0.31411513686180115,
-0.575739860534668,
-0.46209144592285156,
-0.6543439030647278,
-0.05886658653616905,
-0.181532084941864,
-0.5327264070510864,
-0.6900167465209961,
-0.20838747918605804,
0.4676458537578583,
0.6374649405479431,
-0.1218915581703186,
0.4563065767288208,
-0.7382206916809082,
0.2766256034374237,
0.31141793727874756,
0.37378066778182983,
-0.3203814625740051,
-0.8066366910934448,
-0.31488236784935,
-0.0342317670583725,
-0.13110853731632233,
-0.8606711626052856,
0.6890634298324585,
0.24551869928836823,
0.4966166317462921,
0.5410624742507935,
-0.018009625375270844,
0.6314767003059387,
-0.6370828747749329,
1.0108405351638794,
0.2163466513156891,
-1.1034798622131348,
0.6083394885063171,
-0.36628782749176025,
0.24802882969379425,
0.3743196129798889,
0.2724601924419403,
-0.49272504448890686,
-0.3712446689605713,
-0.9249088764190674,
-0.9855073094367981,
0.8162480592727661,
0.18028677999973297,
0.24718980491161346,
-0.033034246414899826,
0.31780198216438293,
0.12209577113389969,
0.4003535807132721,
-0.8865741491317749,
-0.5172181725502014,
-0.4789268970489502,
-0.34600234031677246,
-0.1734529435634613,
-0.28282430768013,
-0.052785277366638184,
-0.557521641254425,
0.682121753692627,
0.12904225289821625,
0.5977597832679749,
0.12678475677967072,
-0.12536388635635376,
0.13626576960086823,
0.1640741378068924,
0.8354013562202454,
0.48253726959228516,
-0.5477099418640137,
-0.01786860264837742,
-0.012998249381780624,
-0.6415243744850159,
0.06613985449075699,
0.15235471725463867,
0.011269969865679741,
0.22234980762004852,
0.5759359002113342,
0.7947008013725281,
0.18447479605674744,
-0.469882607460022,
0.5842620730400085,
0.11354458332061768,
-0.37697309255599976,
-0.5641114115715027,
0.1445755511522293,
-0.04332319274544716,
0.13044427335262299,
0.5382179021835327,
0.22176778316497803,
0.10188674181699753,
-0.5555431246757507,
0.456306517124176,
0.3323504328727722,
-0.4957193434238434,
-0.2492232769727707,
0.9198431968688965,
0.05133232846856117,
-0.7867186069488525,
0.8534671068191528,
-0.22898419201374054,
-0.806213915348053,
0.7809157371520996,
0.6451563835144043,
0.9562793970108032,
-0.21929438412189484,
0.22379852831363678,
0.4764094948768616,
0.32641005516052246,
-0.3326191008090973,
0.4344680607318878,
0.2902515232563019,
-0.8485919833183289,
-0.33644962310791016,
-0.7206836938858032,
-0.18495765328407288,
0.2059699147939682,
-0.8804398775100708,
0.29322704672813416,
-0.488511323928833,
-0.29201221466064453,
0.16607274115085602,
0.00921414140611887,
-0.7206872701644897,
0.48432156443595886,
0.034429050981998444,
1.0863693952560425,
-1.0550733804702759,
1.0089913606643677,
0.7862583994865417,
-0.6106042861938477,
-0.8862323760986328,
-0.38738158345222473,
-0.3026912808418274,
-1.086984634399414,
0.7657967805862427,
0.3688175678253174,
0.3551270067691803,
-0.018220270052552223,
-0.5735409259796143,
-0.6948338150978088,
0.8870396614074707,
0.13160091638565063,
-0.5203102827072144,
-0.14035211503505707,
0.05186479911208153,
0.5722759962081909,
-0.555322527885437,
0.43412813544273376,
0.5717931389808655,
0.39475056529045105,
-0.10670219361782074,
-0.8196976184844971,
0.0834822729229927,
-0.44216254353523254,
-0.028061261400580406,
0.10497446358203888,
-0.45981261134147644,
1.1899100542068481,
-0.17386995255947113,
0.05509345233440399,
0.1701676994562149,
0.4987507164478302,
0.0419040210545063,
0.19179251790046692,
0.5512021780014038,
0.6586153507232666,
0.7282639145851135,
-0.37858688831329346,
0.8237928748130798,
-0.26952463388442993,
0.49861180782318115,
0.8688817024230957,
0.07419461756944656,
0.8155415654182434,
0.4288581311702728,
-0.29349979758262634,
0.9481006264686584,
0.9066933989524841,
-0.34977230429649353,
0.7888179421424866,
0.24786943197250366,
-0.03989919647574425,
-0.11102987825870514,
0.16735811531543732,
-0.2486124187707901,
0.5103084444999695,
0.29774513840675354,
-0.5602568984031677,
0.14975190162658691,
-0.08567891269922256,
0.16701190173625946,
-0.1787491887807846,
-0.4673391580581665,
0.7131831049919128,
0.1483154445886612,
-0.7147756814956665,
0.2880434989929199,
0.20529502630233765,
0.6463152766227722,
-0.5395341515541077,
0.0060859858058393,
-0.11075286567211151,
0.1738782823085785,
-0.11879868805408478,
-0.8474616408348083,
0.2118774950504303,
-0.1759977489709854,
-0.44015681743621826,
-0.2317727953195572,
0.745302677154541,
-0.39257457852363586,
-0.6742752194404602,
0.014516390860080719,
0.3031894862651825,
0.3172760009765625,
-0.15616200864315033,
-0.8068493604660034,
-0.2998475730419159,
0.017170488834381104,
-0.1391071379184723,
0.17143945395946503,
0.29905009269714355,
0.08075284957885742,
0.6040399074554443,
0.8277608156204224,
-0.11978746205568314,
0.10826972872018814,
0.07709478586912155,
0.7205467820167542,
-0.9832528233528137,
-0.8428809642791748,
-0.9819194078445435,
0.6021636724472046,
-0.09481926262378693,
-0.5789031386375427,
0.6134393215179443,
0.7534745931625366,
0.7067692875862122,
-0.41338884830474854,
0.517487108707428,
-0.1914968490600586,
0.5533044934272766,
-0.45596832036972046,
0.720647931098938,
-0.33908385038375854,
0.01508801244199276,
-0.34817102551460266,
-0.745752215385437,
-0.2854008376598358,
0.8387146592140198,
-0.05300921946763992,
-0.004883512854576111,
0.7500202059745789,
0.6192798614501953,
0.06377380341291428,
-0.12174363434314728,
0.18107683956623077,
0.12062660604715347,
0.09302786737680435,
0.4441123902797699,
0.5455083847045898,
-0.6645029187202454,
0.39527711272239685,
-0.21834823489189148,
-0.059571508318185806,
-0.3659607470035553,
-0.8785901069641113,
-1.0160778760910034,
-0.6023043394088745,
-0.28374603390693665,
-0.5949307084083557,
-0.139628604054451,
0.9215502738952637,
0.811419665813446,
-0.9418470859527588,
-0.2753557860851288,
-0.15608125925064087,
0.04876174405217171,
-0.3824244439601898,
-0.3021690845489502,
0.48763808608055115,
-0.2509503960609436,
-0.7365754842758179,
0.2715025842189789,
-0.06507796794176102,
0.046991799026727676,
-0.11397165060043335,
0.07517895102500916,
-0.41783300042152405,
0.05582745745778084,
0.52100670337677,
0.09890935570001602,
-0.7533287405967712,
-0.501886785030365,
0.09028930217027664,
-0.15478619933128357,
0.1602046638727188,
0.4937874674797058,
-0.5917853116989136,
0.3776150047779083,
0.41794249415397644,
0.3867308497428894,
0.7308550477027893,
0.16730140149593353,
0.6456189155578613,
-1.1128054857254028,
0.22731800377368927,
0.17559686303138733,
0.5113447308540344,
0.332843154668808,
-0.49416980147361755,
0.56772780418396,
0.5310183763504028,
-0.5141615867614746,
-0.8370038866996765,
-0.04874777793884277,
-1.0503133535385132,
-0.27232393622398376,
0.8996329307556152,
-0.1778845638036728,
-0.29059433937072754,
-0.10419029742479324,
-0.2976492941379547,
0.4528889060020447,
-0.46430879831314087,
0.7518585920333862,
0.862190306186676,
-0.01614277809858322,
-0.10164966434240341,
-0.3616933822631836,
0.4012267589569092,
0.4366573989391327,
-0.4372604191303253,
-0.49192875623703003,
0.09835635870695114,
0.5224674940109253,
0.23446258902549744,
0.5829901099205017,
-0.0013076362665742636,
0.1948482096195221,
0.21200166642665863,
0.16500048339366913,
-0.13905811309814453,
-0.1522504836320877,
-0.3189915120601654,
0.18606819212436676,
-0.17763924598693848,
-0.7610342502593994
] |
microsoft/deberta-base | microsoft | "2022-09-26T08:50:43Z" | 5,050,985 | 57 | transformers | [
"transformers",
"pytorch",
"tf",
"rust",
"deberta",
"deberta-v1",
"fill-mask",
"en",
"arxiv:2006.03654",
"license:mit",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:05Z" | ---
language: en
tags:
- deberta-v1
- fill-mask
thumbnail: https://huggingface.co/front/thumbnails/microsoft.png
license: mit
---
## DeBERTa: Decoding-enhanced BERT with Disentangled Attention
[DeBERTa](https://arxiv.org/abs/2006.03654) improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. It outperforms BERT and RoBERTa on majority of NLU tasks with 80GB training data.
Please check the [official repository](https://github.com/microsoft/DeBERTa) for more details and updates.
#### Fine-tuning on NLU tasks
We present the dev results on SQuAD 1.1/2.0 and MNLI tasks.
| Model | SQuAD 1.1 | SQuAD 2.0 | MNLI-m |
|-------------------|-----------|-----------|--------|
| RoBERTa-base | 91.5/84.6 | 83.7/80.5 | 87.6 |
| XLNet-Large | -/- | -/80.2 | 86.8 |
| **DeBERTa-base** | 93.1/87.2 | 86.2/83.1 | 88.8 |
### Citation
If you find DeBERTa useful for your work, please cite the following paper:
``` latex
@inproceedings{
he2021deberta,
title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
booktitle={International Conference on Learning Representations},
year={2021},
url={https://openreview.net/forum?id=XPZIaotutsD}
}
```
| [
-0.3490139842033386,
-0.6190047860145569,
0.24900153279304504,
0.5731582045555115,
-0.2694041430950165,
0.2976255416870117,
-0.11898764967918396,
-0.6899542808532715,
0.1617627888917923,
0.058031823486089706,
-0.6317624449729919,
-0.4253840744495392,
-1.0415276288986206,
0.06717120856046677,
-0.25053709745407104,
0.6869421005249023,
0.17220786213874817,
0.3138706386089325,
0.0305994413793087,
-0.17453329265117645,
-0.524662971496582,
-0.6528847217559814,
-0.7750762701034546,
-0.42513489723205566,
0.3465031087398529,
-0.12015706300735474,
0.40373510122299194,
-0.0013998914510011673,
0.707364559173584,
0.34079617261886597,
-0.5523278713226318,
0.3909180164337158,
-0.6803994178771973,
-0.02388439141213894,
0.0571492500603199,
-0.16674590110778809,
-0.791758120059967,
-0.12737184762954712,
0.6894177198410034,
0.37499547004699707,
0.11632576584815979,
0.21429839730262756,
0.30827710032463074,
1.1261836290359497,
-0.58759605884552,
0.18293362855911255,
-0.7427648901939392,
-0.04782886058092117,
0.21225638687610626,
-0.008275774307549,
-0.672025740146637,
-0.10613143444061279,
0.21572116017341614,
-0.37366795539855957,
0.10298516601324081,
-0.36517444252967834,
1.2623603343963623,
0.7381024360656738,
-0.2752006947994232,
-0.08298533409833908,
-0.591511607170105,
1.1507619619369507,
-0.9579318165779114,
0.505493700504303,
0.39411038160324097,
0.21717208623886108,
-0.3467339873313904,
-0.5187034606933594,
-0.4496071934700012,
-0.19572009146213531,
-0.07004237920045853,
0.42674383521080017,
-0.7408505082130432,
-0.05121105909347534,
0.3639048635959625,
0.14195309579372406,
-0.5544624328613281,
0.12448715418577194,
-0.42167696356773376,
0.12732170522212982,
0.8503586053848267,
-0.039401035755872726,
-0.052185799926519394,
0.09170102328062057,
-0.5240495800971985,
-0.31195247173309326,
-0.6795549988746643,
0.018436096608638763,
0.40985774993896484,
-0.12566021084785461,
-0.09864960610866547,
0.02281387336552143,
-0.1424901783466339,
1.0352363586425781,
0.09446406364440918,
0.3809370696544647,
0.5551289319992065,
-0.07545600086450577,
-0.3860395848751068,
0.09705246984958649,
0.5240020751953125,
0.21513989567756653,
-0.13504181802272797,
-0.3159955143928528,
-0.01459716446697712,
-0.05286731943488121,
0.22697187960147858,
-0.7490259408950806,
-0.5012918710708618,
0.419283002614975,
-0.6945584416389465,
-0.13391564786434174,
0.12875452637672424,
-0.7157155871391296,
-0.050131965428590775,
-0.49047091603279114,
0.3194853365421295,
-0.6066070199012756,
-0.3881572186946869,
0.2896818220615387,
-0.20258979499340057,
0.39240479469299316,
0.5586116909980774,
-1.0716458559036255,
0.024526452645659447,
0.519612193107605,
0.6679105758666992,
-0.13947385549545288,
-0.10428601503372192,
-0.47605136036872864,
-0.13631705939769745,
-0.00851594377309084,
0.36330077052116394,
-0.028737785294651985,
0.2523828446865082,
-0.21511726081371307,
0.03341138735413551,
-0.1779474914073944,
-0.32093921303749084,
0.4037269353866577,
-0.9113568067550659,
-0.16125082969665527,
-0.2732231914997101,
-0.48463931679725647,
-0.5458827614784241,
0.2758480906486511,
-0.8327414393424988,
0.8759415745735168,
0.20240525901317596,
-0.6587433815002441,
0.21310967206954956,
-0.7710888385772705,
-0.05133773386478424,
-0.10976696759462357,
0.11544232815504074,
-0.3946268856525421,
-0.014685535803437233,
0.404371976852417,
0.4532296359539032,
-0.007706328295171261,
0.3072722852230072,
-0.17203886806964874,
-0.5622555017471313,
0.4018252193927765,
-0.46885037422180176,
1.5565919876098633,
0.32696732878685,
-0.6076796650886536,
-0.01804548315703869,
-1.0491243600845337,
0.06989359855651855,
0.23504012823104858,
-0.46166443824768066,
-0.21595868468284607,
0.12868894636631012,
0.07309836894273758,
0.06075989082455635,
0.4816151559352875,
-0.6721471548080444,
0.22457563877105713,
-0.3496505320072174,
0.7448297142982483,
0.7494615912437439,
-0.3464275598526001,
0.2853432893753052,
-0.016600191593170166,
0.16565003991127014,
0.2351449579000473,
0.3732876181602478,
0.2685394585132599,
-0.7125956416130066,
-0.7732529640197754,
-0.6994584202766418,
0.7179950475692749,
0.5715609788894653,
-0.6219682693481445,
0.835764467716217,
0.029429709538817406,
-0.5180879831314087,
-0.8992444276809692,
0.08554244786500931,
0.3416760563850403,
0.2517063319683075,
0.7103251218795776,
0.04126090928912163,
-0.8577401041984558,
-0.8581616878509521,
0.14722244441509247,
-0.011991928331553936,
-0.0911770612001419,
-0.03818444907665253,
0.510840892791748,
-0.4352894723415375,
0.848057210445404,
-0.4287351667881012,
-0.5569512844085693,
-0.3125566244125366,
0.15260283648967743,
0.4685889184474945,
0.6968434453010559,
0.9853392839431763,
-0.8846151232719421,
-0.5200677514076233,
-0.432900071144104,
-0.754357099533081,
0.37132662534713745,
0.012585240416228771,
-0.27022597193717957,
0.5463927984237671,
0.21561798453330994,
-0.280734121799469,
0.5214059948921204,
0.7982774972915649,
-0.32786494493484497,
-0.010174990631639957,
-0.30794602632522583,
0.14414961636066437,
-1.1911439895629883,
0.09094510227441788,
-0.137111097574234,
-0.23044301569461823,
-0.5638799071311951,
0.1876765638589859,
0.1990741640329361,
0.34169504046440125,
-0.430513471364975,
0.10627149045467377,
-0.636934757232666,
0.05204549804329872,
-0.2508712410926819,
0.18789467215538025,
0.10457714647054672,
0.857070803642273,
0.14543676376342773,
0.6075220108032227,
0.6166655421257019,
-0.4575088620185852,
0.3575754165649414,
0.6872643232345581,
-0.39562907814979553,
-0.06449615955352783,
-1.0528419017791748,
0.3299652338027954,
-0.31701579689979553,
0.4712584912776947,
-1.1876580715179443,
0.19226562976837158,
0.26840895414352417,
-0.632804274559021,
0.46524515748023987,
-0.1309860646724701,
-0.7107047438621521,
-0.31445690989494324,
-0.4555870592594147,
0.1811620146036148,
0.8009713888168335,
-0.8606707453727722,
0.18328218162059784,
0.34682798385620117,
0.49410703778266907,
-0.8782445192337036,
-0.981154203414917,
-0.08509498089551926,
-0.0946936160326004,
-0.512532114982605,
0.6553491950035095,
-0.38907989859580994,
-0.11641333997249603,
0.10262267291545868,
0.1965561956167221,
-0.36565807461738586,
0.2810932695865631,
0.11367327719926834,
0.45077937841415405,
-0.14940591156482697,
0.14166927337646484,
0.10711423307657242,
-0.020797301083803177,
-0.09169310331344604,
0.030284103006124496,
0.4731810390949249,
-0.33376097679138184,
-0.08221283555030823,
-0.44784221053123474,
0.4443984627723694,
0.31592801213264465,
-0.408955842256546,
0.8169651031494141,
1.103032112121582,
-0.3959149420261383,
0.018088217824697495,
-0.4429048001766205,
-0.3899272382259369,
-0.46337631344795227,
0.2675895392894745,
-0.1545494794845581,
-0.7734823226928711,
0.6647647619247437,
0.3303301930427551,
0.14636458456516266,
0.6289946436882019,
0.4685775637626648,
-0.3258121907711029,
1.1002867221832275,
0.6163662075996399,
-0.2932003438472748,
0.655644416809082,
-0.8604694604873657,
0.19883917272090912,
-1.3587042093276978,
-0.1453421711921692,
-0.4563513398170471,
-0.7971852421760559,
-0.451838880777359,
-0.27789953351020813,
0.1659521460533142,
0.5801491141319275,
-0.07020294666290283,
0.7554537057876587,
-1.1732724905014038,
0.35947662591934204,
0.7489019632339478,
0.549403190612793,
0.28472810983657837,
0.09868963807821274,
0.5124484896659851,
-0.14175790548324585,
-0.8038835525512695,
-0.4107751250267029,
1.039210319519043,
0.5479851365089417,
0.8157787919044495,
0.5788718461990356,
0.9045964479446411,
0.3246987462043762,
-0.14172711968421936,
-0.4821271300315857,
0.5633965134620667,
-0.24949991703033447,
-0.7761337757110596,
-0.31348323822021484,
-0.2633803188800812,
-1.281309962272644,
0.24200047552585602,
-0.2125907987356186,
-1.1621019840240479,
0.5656362175941467,
0.15049707889556885,
-0.4263334572315216,
0.2571021616458893,
-0.5774736404418945,
0.6123815774917603,
-0.015973985195159912,
-0.07903729379177094,
-0.29334756731987,
-0.6915416717529297,
0.29006829857826233,
0.20952944457530975,
-0.5687418580055237,
-0.1367751508951187,
0.1601664274930954,
0.848959743976593,
0.026694290339946747,
0.9622699022293091,
-0.26313886046409607,
-0.29457956552505493,
0.40168216824531555,
-0.27201923727989197,
0.5892241597175598,
0.4240266978740692,
-0.14067570865154266,
0.6167274117469788,
0.0726081132888794,
-0.4530640244483948,
-0.49463146924972534,
0.8803325295448303,
-1.0314241647720337,
-0.387382447719574,
-0.5801264643669128,
-0.7212008237838745,
-0.06532011926174164,
-0.011313880793750286,
0.45446717739105225,
0.6198766827583313,
-0.024950606748461723,
0.4148622453212738,
1.194183111190796,
-0.01766476407647133,
0.7653207182884216,
0.7216127514839172,
0.31035852432250977,
-0.24017633497714996,
0.8244333863258362,
0.07554257661104202,
0.026054752990603447,
0.7330880761146545,
-0.35529735684394836,
-0.4702795743942261,
-0.8627188801765442,
-0.7115987539291382,
0.10379836708307266,
-0.8116332292556763,
-0.4991888999938965,
-0.9092528820037842,
-0.4121584892272949,
-0.47653767466545105,
0.18394073843955994,
-0.2749737799167633,
-0.5985724329948425,
-0.7657003998756409,
0.14901810884475708,
0.7396604418754578,
0.6334351301193237,
-0.1313629299402237,
0.1095583587884903,
-1.067239761352539,
0.22719496488571167,
0.17112107574939728,
0.06208343431353569,
0.22219236195087433,
-0.5397155284881592,
-0.33503544330596924,
0.1805780977010727,
-0.49718326330184937,
-0.9813812375068665,
0.43932032585144043,
0.08206728845834732,
0.8760708570480347,
0.0008862739196047187,
0.32233530282974243,
0.6073146462440491,
-0.3381403088569641,
0.8065892457962036,
0.08988571912050247,
-0.9976552128791809,
0.6340104341506958,
-0.22572562098503113,
0.431099534034729,
0.6979984641075134,
0.36073824763298035,
0.31886789202690125,
-0.39554736018180847,
-0.7079048752784729,
-0.9908350706100464,
0.9756106734275818,
0.4748097360134125,
0.0588560551404953,
0.01242519449442625,
-0.011018666438758373,
-0.10578291863203049,
0.14597539603710175,
-0.7573581337928772,
-0.4356362521648407,
-0.15621961653232574,
-0.31344500184059143,
-0.02181573025882244,
-0.42879360914230347,
-0.11150415986776352,
-0.5009638071060181,
0.9240099191665649,
0.06843821704387665,
0.8239797949790955,
0.6170967817306519,
-0.37827688455581665,
0.09941626340150833,
0.03201191499829292,
1.058211326599121,
0.8575403690338135,
-0.7243192195892334,
-0.1409396380186081,
0.3121635615825653,
-0.4668162763118744,
0.006959724240005016,
0.3467169404029846,
-0.021165648475289345,
0.37874409556388855,
0.5001140832901001,
0.9497236013412476,
0.01861320249736309,
-0.6118348240852356,
0.2999344766139984,
-0.184943288564682,
-0.40152376890182495,
-0.2682426869869232,
-0.10238773375749588,
-0.06475919485092163,
0.651025652885437,
0.5531473159790039,
0.1269894391298294,
0.39320895075798035,
-0.3173765242099762,
0.1098368763923645,
0.40810877084732056,
-0.4415382444858551,
-0.2626897096633911,
0.617121160030365,
0.2999328672885895,
0.05326805263757706,
0.6343938708305359,
-0.43612781167030334,
-0.5461751818656921,
0.8182714581489563,
0.6284182071685791,
0.924029529094696,
-0.11133962124586105,
0.0508275032043457,
0.6458602547645569,
0.4117419123649597,
0.13556185364723206,
0.6625174880027771,
-0.10206818580627441,
-0.5148534178733826,
-0.4242767095565796,
-0.5228995084762573,
-0.16473747789859772,
0.3534587025642395,
-0.8657189607620239,
-0.08096469193696976,
-0.09989326447248459,
-0.1816464066505432,
0.05862753093242645,
0.10919845104217529,
-0.6961638927459717,
-0.08563309907913208,
0.007793574593961239,
0.9821387529373169,
-0.39077723026275635,
1.129271388053894,
0.7425118088722229,
-0.42563074827194214,
-0.5701354742050171,
-0.09405623376369476,
-0.39502963423728943,
-0.6308090090751648,
1.1407945156097412,
0.016624566167593002,
-0.08354686945676804,
0.18027670681476593,
-0.2526381313800812,
-0.9318774342536926,
1.3196251392364502,
0.5209616422653198,
-1.015393853187561,
0.11104819923639297,
-0.25843119621276855,
0.5878385305404663,
-0.17774894833564758,
0.14639422297477722,
0.3858467638492584,
0.4164050817489624,
-0.09425811469554901,
-0.7577576637268066,
0.03224121406674385,
-0.1722646951675415,
0.1604844629764557,
0.07560708373785019,
-0.827537477016449,
0.9790791869163513,
-0.18033333122730255,
0.027259016409516335,
0.17534039914608002,
0.7640920877456665,
0.0556413009762764,
0.2504214644432068,
0.4397675693035126,
0.6955927610397339,
0.5715448260307312,
-0.28906723856925964,
0.7034711241722107,
-0.2054048627614975,
0.6933408379554749,
1.2433604001998901,
0.053569260984659195,
1.0490320920944214,
0.5125046372413635,
-0.379324346780777,
0.49412107467651367,
0.6049675345420837,
-0.24870026111602783,
0.9349325299263,
0.2290477454662323,
0.02050292305648327,
-0.09076518565416336,
0.38788583874702454,
-0.7009161114692688,
0.5133666396141052,
0.13213399052619934,
-0.535759449005127,
-0.30237501859664917,
0.22292213141918182,
-0.23156216740608215,
-0.045083045959472656,
-0.18045668303966522,
0.9740172624588013,
-0.09061911702156067,
-0.547602117061615,
1.259563684463501,
-0.23169058561325073,
0.7876389622688293,
-0.6204583644866943,
-0.31675848364830017,
-0.13559438288211823,
0.5354763269424438,
-0.13729634881019592,
-0.6636615991592407,
0.31005236506462097,
0.05240365490317345,
-0.4547158479690552,
-0.003969650715589523,
0.7320528626441956,
-0.5040964484214783,
-0.4754580855369568,
0.5506583452224731,
0.13783316314220428,
0.1666262149810791,
-0.009176659397780895,
-1.054330587387085,
0.5023959279060364,
0.1390562504529953,
-0.26532551646232605,
0.36984074115753174,
0.07249031960964203,
0.30368664860725403,
0.42366471886634827,
0.4376487135887146,
-0.4091089963912964,
0.18157155811786652,
0.002604448003694415,
0.9641307592391968,
-0.3759177625179291,
-0.3131791651248932,
-0.9069057106971741,
0.607292115688324,
-0.3311126232147217,
-0.3011854887008667,
0.9149577021598816,
0.3405592143535614,
0.7672460079193115,
-0.4467889070510864,
0.3735838234424591,
-0.18644386529922485,
0.1835235357284546,
-0.5993335247039795,
0.8337658047676086,
-0.5832502245903015,
0.08566837757825851,
-0.26557987928390503,
-0.9959335923194885,
-0.2708498537540436,
0.7820960283279419,
0.13664931058883667,
-0.0940801352262497,
0.42113208770751953,
0.6007980108261108,
-0.014650911092758179,
-0.15899419784545898,
0.3104231059551239,
0.06627807766199112,
0.386932373046875,
0.980970561504364,
0.7487702369689941,
-1.078060507774353,
0.45876359939575195,
-0.24339917302131653,
-0.36922869086265564,
-0.5275906920433044,
-0.9253897070884705,
-1.2442103624343872,
-0.8777974247932434,
-0.6496341824531555,
-0.40024301409721375,
0.19303327798843384,
0.7897565364837646,
0.9373262524604797,
-0.965038537979126,
0.278751939535141,
-0.25176969170570374,
0.14345362782478333,
-0.7828348278999329,
-0.18573279678821564,
0.6282151341438293,
-0.49620190262794495,
-1.2955043315887451,
0.6093989014625549,
-0.028245314955711365,
0.2602830231189728,
-0.33703967928886414,
-0.2746396064758301,
-0.5868906378746033,
0.01964159868657589,
0.7670984268188477,
0.05370518937706947,
-0.82440185546875,
0.07187361270189285,
0.03296709060668945,
-0.12178105860948563,
0.0020382751245051622,
0.2941834032535553,
-0.7898771166801453,
0.34316375851631165,
0.7778573632240295,
0.5348947644233704,
0.49809709191322327,
-0.2921402156352997,
0.26378098130226135,
-0.7484061121940613,
0.5018143057823181,
0.2978218197822571,
0.38524797558784485,
0.14241603016853333,
-0.6352565884590149,
0.7514489889144897,
-0.2949982285499573,
-0.6658621430397034,
-1.0543712377548218,
0.054777830839157104,
-1.6173006296157837,
-0.31413692235946655,
0.9552090764045715,
-0.5560261011123657,
-0.20785774290561676,
0.0422416515648365,
-0.33762645721435547,
0.24886004626750946,
-0.6068236231803894,
0.9798450469970703,
0.5779327750205994,
0.015530114993453026,
-0.056802671402692795,
-0.5177839994430542,
0.6811817288398743,
0.5628218650817871,
-0.6301369667053223,
-0.05887601152062416,
0.15423792600631714,
-0.06041251868009567,
0.47744259238243103,
0.38833582401275635,
-0.04308011382818222,
0.3950378894805908,
-0.18706530332565308,
-0.1471041738986969,
-0.4105398654937744,
-0.42437586188316345,
-0.4886007606983185,
-0.2705160975456238,
-0.061017852276563644,
-0.8827152252197266
] |
cardiffnlp/twitter-roberta-base-sentiment | cardiffnlp | "2023-01-20T09:52:13Z" | 4,806,206 | 225 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"roberta",
"text-classification",
"en",
"dataset:tweet_eval",
"arxiv:2010.12421",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:05Z" | ---
datasets:
- tweet_eval
language:
- en
---
# Twitter-roBERTa-base for Sentiment Analysis
This is a roBERTa-base model trained on ~58M tweets and finetuned for sentiment analysis with the TweetEval benchmark. This model is suitable for English (for a similar multilingual model, see [XLM-T](https://huggingface.co/cardiffnlp/twitter-xlm-roberta-base-sentiment)).
- Reference Paper: [_TweetEval_ (Findings of EMNLP 2020)](https://arxiv.org/pdf/2010.12421.pdf).
- Git Repo: [Tweeteval official repository](https://github.com/cardiffnlp/tweeteval).
<b>Labels</b>:
0 -> Negative;
1 -> Neutral;
2 -> Positive
<b>New!</b> We just released a new sentiment analysis model trained on more recent and a larger quantity of tweets.
See [twitter-roberta-base-sentiment-latest](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest) and [TweetNLP](https://tweetnlp.org) for more details.
## Example of classification
```python
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer
import numpy as np
from scipy.special import softmax
import csv
import urllib.request
# Preprocess text (username and link placeholders)
def preprocess(text):
new_text = []
for t in text.split(" "):
t = '@user' if t.startswith('@') and len(t) > 1 else t
t = 'http' if t.startswith('http') else t
new_text.append(t)
return " ".join(new_text)
# Tasks:
# emoji, emotion, hate, irony, offensive, sentiment
# stance/abortion, stance/atheism, stance/climate, stance/feminist, stance/hillary
task='sentiment'
MODEL = f"cardiffnlp/twitter-roberta-base-{task}"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
# download label mapping
labels=[]
mapping_link = f"https://raw.githubusercontent.com/cardiffnlp/tweeteval/main/datasets/{task}/mapping.txt"
with urllib.request.urlopen(mapping_link) as f:
html = f.read().decode('utf-8').split("\n")
csvreader = csv.reader(html, delimiter='\t')
labels = [row[1] for row in csvreader if len(row) > 1]
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
model.save_pretrained(MODEL)
text = "Good night 😊"
text = preprocess(text)
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = softmax(scores)
# # TF
# model = TFAutoModelForSequenceClassification.from_pretrained(MODEL)
# model.save_pretrained(MODEL)
# text = "Good night 😊"
# encoded_input = tokenizer(text, return_tensors='tf')
# output = model(encoded_input)
# scores = output[0][0].numpy()
# scores = softmax(scores)
ranking = np.argsort(scores)
ranking = ranking[::-1]
for i in range(scores.shape[0]):
l = labels[ranking[i]]
s = scores[ranking[i]]
print(f"{i+1}) {l} {np.round(float(s), 4)}")
```
Output:
```
1) positive 0.8466
2) neutral 0.1458
3) negative 0.0076
```
### BibTeX entry and citation info
Please cite the [reference paper](https://aclanthology.org/2020.findings-emnlp.148/) if you use this model.
```bibtex
@inproceedings{barbieri-etal-2020-tweeteval,
title = "{T}weet{E}val: Unified Benchmark and Comparative Evaluation for Tweet Classification",
author = "Barbieri, Francesco and
Camacho-Collados, Jose and
Espinosa Anke, Luis and
Neves, Leonardo",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.findings-emnlp.148",
doi = "10.18653/v1/2020.findings-emnlp.148",
pages = "1644--1650"
}
``` | [
-0.05480519309639931,
-0.6883974671363831,
0.11295696347951889,
0.3965694010257721,
-0.17153975367546082,
0.17101004719734192,
-0.4280341565608978,
-0.18449129164218903,
0.3555622100830078,
0.044263772666454315,
-0.3705562949180603,
-0.9291340112686157,
-0.6859224438667297,
0.08907335251569748,
-0.34920164942741394,
1.032893419265747,
0.06420815736055374,
0.11432979255914688,
0.20686355233192444,
-0.2724674642086029,
-0.05374393239617348,
-0.5318387150764465,
-0.7097337245941162,
-0.19540517032146454,
0.4403422474861145,
0.31341689825057983,
0.3656863868236542,
0.25133004784584045,
0.4129660725593567,
0.4425007700920105,
-0.07850529253482819,
0.013385585509240627,
-0.4192464351654053,
0.18490013480186462,
0.0012743815314024687,
-0.3304561972618103,
-0.6197863221168518,
0.2384570837020874,
0.5959641933441162,
0.5944935083389282,
0.03379936143755913,
0.36996564269065857,
0.09243565797805786,
0.4452835023403168,
-0.4026493728160858,
0.163446843624115,
-0.41593271493911743,
-0.03803947567939758,
-0.09621865302324295,
-0.19103410840034485,
-0.3679143488407135,
-0.6665295362472534,
0.12913160026073456,
-0.4130260646343231,
0.15528027713298798,
-0.09718457609415054,
1.25115168094635,
0.14583708345890045,
-0.2253536432981491,
-0.10477614402770996,
-0.2813095152378082,
1.1922965049743652,
-0.7619364261627197,
0.18425534665584564,
0.18010954558849335,
0.07948639988899231,
0.14187489449977875,
-0.5311813950538635,
-0.4280765950679779,
-0.1636420488357544,
0.06370382755994797,
0.251097172498703,
-0.3333742320537567,
-0.22384439408779144,
0.06446816027164459,
0.17788061499595642,
-0.49077197909355164,
-0.164700448513031,
-0.3483639359474182,
-0.0461038276553154,
0.6097279191017151,
0.06621772050857544,
0.2923385202884674,
-0.44191738963127136,
-0.23641245067119598,
-0.19683966040611267,
-0.19502070546150208,
0.04883227497339249,
0.07517965883016586,
0.4987432658672333,
-0.41201144456863403,
0.5024405121803284,
-0.07691529393196106,
0.48870784044265747,
0.09120526909828186,
-0.11042045056819916,
0.7651538848876953,
-0.22076451778411865,
-0.27865153551101685,
-0.20859096944332123,
1.1545315980911255,
0.39022478461265564,
0.43415001034736633,
-0.09833502769470215,
-0.1356801688671112,
-0.0008654841803945601,
-0.13433630764484406,
-0.786681592464447,
-0.21541909873485565,
0.3517937958240509,
-0.546366810798645,
-0.6518528461456299,
0.0673208087682724,
-0.828287661075592,
-0.16064836084842682,
-0.10114330053329468,
0.5910546779632568,
-0.5567458868026733,
-0.46627408266067505,
-0.09368325024843216,
-0.3138493597507477,
0.15125702321529388,
0.2613297700881958,
-0.6533753871917725,
0.05145622044801712,
0.46944135427474976,
0.9304404258728027,
0.008971868082880974,
-0.3850729465484619,
-0.2633124589920044,
-0.025234432891011238,
-0.247482568025589,
0.6555813550949097,
-0.43018653988838196,
-0.26229554414749146,
0.04182565584778786,
0.010050817392766476,
-0.20043566823005676,
-0.21744707226753235,
0.43572670221328735,
-0.2115604281425476,
0.28610295057296753,
-0.22226674854755402,
-0.48592227697372437,
-0.04222370311617851,
0.423307329416275,
-0.37782159447669983,
1.1507842540740967,
0.22278456389904022,
-0.7919827103614807,
0.24639691412448883,
-0.82439124584198,
-0.3832646906375885,
-0.20478826761245728,
0.12322395294904709,
-0.4835129678249359,
-0.04983541741967201,
0.25293347239494324,
0.6766046285629272,
-0.27791786193847656,
0.19718526303768158,
-0.528331995010376,
-0.13546591997146606,
0.3638133406639099,
-0.24815118312835693,
1.3297653198242188,
0.26941952109336853,
-0.3386937379837036,
0.06694004684686661,
-0.7847979068756104,
0.257442831993103,
0.1352284699678421,
-0.4518791437149048,
-0.21434155106544495,
-0.25786808133125305,
0.3296755254268646,
0.2216140776872635,
0.2725871205329895,
-0.6682847142219543,
0.19020794332027435,
-0.3564684987068176,
0.6295756697654724,
0.7447503805160522,
-0.05448238551616669,
0.3949316143989563,
-0.40346914529800415,
0.39892664551734924,
0.1088501363992691,
0.1899433434009552,
0.13361018896102905,
-0.496645987033844,
-0.8467831611633301,
-0.13183529675006866,
0.4584328830242157,
0.5400733947753906,
-0.4957311749458313,
0.5559883117675781,
-0.5155042409896851,
-0.6602519750595093,
-0.6061965823173523,
-0.05690011382102966,
0.24465009570121765,
0.4636310040950775,
0.6010777950286865,
0.08818970620632172,
-0.7589490413665771,
-0.5652167201042175,
-0.49819663166999817,
-0.25783097743988037,
0.15303708612918854,
0.24433934688568115,
0.6912692785263062,
-0.2522868812084198,
0.7149728536605835,
-0.42338985204696655,
-0.35566478967666626,
-0.3249214291572571,
0.3828849494457245,
0.4370153546333313,
0.7713930010795593,
0.7281113266944885,
-0.6469965577125549,
-0.7713010907173157,
-0.23715601861476898,
-0.832977831363678,
-0.2547440826892853,
0.13792923092842102,
-0.2251521497964859,
0.497890830039978,
0.22290265560150146,
-0.4840388298034668,
0.352984756231308,
0.3534461557865143,
-0.42589595913887024,
0.11443383246660233,
0.13276837766170502,
0.33224838972091675,
-1.4001017808914185,
0.05445869266986847,
0.27228519320487976,
-0.0010948157869279385,
-0.6205101013183594,
-0.20547185838222504,
-0.00524919293820858,
0.16525565087795258,
-0.38225701451301575,
0.5387192368507385,
-0.41019025444984436,
0.19815801084041595,
0.11939764767885208,
0.06314745545387268,
0.01837197132408619,
0.4113922417163849,
-0.13106244802474976,
0.38254526257514954,
0.5644311904907227,
-0.33577170968055725,
0.28804129362106323,
0.2888117730617523,
-0.025796648114919662,
0.4808220863342285,
-0.6827234029769897,
-0.08577524870634079,
0.08217278122901917,
0.2185467630624771,
-1.1648410558700562,
-0.1367739737033844,
0.21474693715572357,
-0.9923326373100281,
0.42395955324172974,
-0.37600603699684143,
-0.4901536703109741,
-0.3702968657016754,
-0.5200976729393005,
0.2844539284706116,
0.634563148021698,
-0.48367467522621155,
0.7072619199752808,
0.43765825033187866,
0.16920801997184753,
-0.7218555808067322,
-1.0354267358779907,
0.15239152312278748,
-0.24195769429206848,
-0.7893664836883545,
0.280535489320755,
-0.06899791955947876,
-0.2300632894039154,
0.12027742713689804,
0.14448733627796173,
-0.19392408430576324,
0.07069668918848038,
0.185693621635437,
0.25683215260505676,
-0.21952499449253082,
0.19388581812381744,
-0.20788851380348206,
-0.03404664620757103,
0.057310860604047775,
-0.31464406847953796,
0.6507978439331055,
-0.40344473719596863,
0.2135249227285385,
-0.4971853494644165,
0.2164979875087738,
0.373013436794281,
-0.08682312816381454,
0.9657440185546875,
0.9744278192520142,
-0.38426870107650757,
-0.16475257277488708,
-0.6232072114944458,
0.017818253487348557,
-0.4689328074455261,
0.33470138907432556,
-0.2979593873023987,
-0.6525517106056213,
0.5684248805046082,
0.21675264835357666,
0.01363410521298647,
0.8698739409446716,
0.6525983810424805,
-0.13746146857738495,
0.9505520462989807,
0.4307647943496704,
-0.14342783391475677,
0.5839511156082153,
-0.8297892212867737,
0.048981547355651855,
-0.6450141072273254,
-0.2980588972568512,
-0.6955151557922363,
-0.09685315191745758,
-0.8500574827194214,
-0.2621511220932007,
0.13477906584739685,
-0.064463771879673,
-0.5340369343757629,
0.2767104506492615,
-0.6384024024009705,
0.11503878980875015,
0.4691704511642456,
0.15811453759670258,
-0.12690535187721252,
0.04011249169707298,
-0.05097021907567978,
-0.11850467324256897,
-0.5791252851486206,
-0.43343454599380493,
1.2831066846847534,
0.3154510259628296,
0.6720536351203918,
0.15894551575183868,
0.963038980960846,
0.17464371025562286,
0.5041147470474243,
-0.6476094722747803,
0.585924506187439,
-0.3512117564678192,
-0.5615874528884888,
-0.1981964111328125,
-0.5715123414993286,
-0.8038938641548157,
0.1370927095413208,
-0.3275958001613617,
-0.6680364012718201,
0.11608806252479553,
-0.08347213268280029,
-0.1907440572977066,
0.3637838661670685,
-0.7151218056678772,
0.8346479535102844,
-0.08704196661710739,
-0.44979363679885864,
0.029654674232006073,
-0.4726935923099518,
0.20116569101810455,
0.08964450657367706,
0.2923443615436554,
-0.2691580653190613,
-0.13797402381896973,
1.0454657077789307,
-0.5733456015586853,
0.8622583746910095,
-0.2726980149745941,
0.2072078287601471,
0.22324785590171814,
-0.09223140776157379,
0.15674012899398804,
-0.03279053419828415,
-0.37666675448417664,
0.2697131037712097,
-0.07792972028255463,
-0.5634297728538513,
-0.228062242269516,
0.9170449376106262,
-1.037406086921692,
-0.37821587920188904,
-0.7746065258979797,
-0.3715801239013672,
-0.05763169005513191,
0.24837379157543182,
0.4416084289550781,
0.4208199381828308,
-0.13657869398593903,
0.41556045413017273,
0.3803389072418213,
-0.2733050584793091,
0.6563706398010254,
0.34196850657463074,
-0.015944764018058777,
-0.5330615043640137,
0.7928804755210876,
0.35362353920936584,
-0.01797311007976532,
0.4584634006023407,
0.3704497516155243,
-0.29528185725212097,
-0.43229052424430847,
-0.12286105006933212,
0.2496909201145172,
-0.7479933500289917,
-0.39777249097824097,
-0.8334488868713379,
-0.311463862657547,
-0.8001620769500732,
-0.11310828477144241,
-0.23487284779548645,
-0.688213586807251,
-0.5302450656890869,
-0.04478185251355171,
0.6369829773902893,
0.7724527716636658,
-0.3608735203742981,
0.20330777764320374,
-0.6632543206214905,
0.17109178006649017,
-0.0038633630611002445,
0.26507583260536194,
0.0321488119661808,
-0.8056355118751526,
-0.24026712775230408,
0.09787894040346146,
-0.3334183394908905,
-0.9110031723976135,
0.7549193501472473,
0.28006312251091003,
0.4007972776889801,
0.21710380911827087,
0.06397111713886261,
0.6799829006195068,
-0.15914446115493774,
0.8917946815490723,
0.2553479075431824,
-1.0132777690887451,
0.6769140958786011,
-0.49549415707588196,
0.17878836393356323,
0.487138032913208,
0.3770447075366974,
-0.4631560444831848,
-0.44137585163116455,
-0.6912787556648254,
-0.9481707215309143,
0.778373122215271,
0.24958518147468567,
0.15962101519107819,
-0.1630973368883133,
0.16238504648208618,
-0.17121022939682007,
0.08803091943264008,
-0.9126900434494019,
-0.5193730592727661,
-0.5123907923698425,
-0.5264123678207397,
-0.13259148597717285,
-0.17472197115421295,
-0.008858971297740936,
-0.611339807510376,
0.863614559173584,
0.11971587687730789,
0.45673221349716187,
0.12070992588996887,
-0.23872549831867218,
-0.0999772921204567,
0.15861287713050842,
0.32711169123649597,
0.5720452070236206,
-0.4877740442752838,
-0.10463737696409225,
0.3139856159687042,
-0.4677419364452362,
0.02254975028336048,
0.11822693794965744,
-0.10088802129030228,
0.1768469661474228,
0.4516639709472656,
0.4799697995185852,
0.26119405031204224,
-0.06041198596358299,
0.6987990140914917,
-0.1114984005689621,
-0.3454609513282776,
-0.5640686750411987,
-0.028242994099855423,
0.04653959348797798,
0.1397213488817215,
0.6365845799446106,
0.2316310852766037,
-0.007824210450053215,
-0.5425466895103455,
0.09781859815120697,
0.22241321206092834,
-0.36460426449775696,
-0.4494613707065582,
0.7025361657142639,
0.08556514978408813,
-0.304399311542511,
0.4333416521549225,
-0.11004068702459335,
-0.7865310311317444,
0.6527875065803528,
0.3390742838382721,
1.1341620683670044,
-0.18787473440170288,
0.3052656054496765,
0.7569197416305542,
0.19160376489162445,
-0.042602669447660446,
0.5800896286964417,
0.1831013709306717,
-0.7193263173103333,
-0.07328660786151886,
-0.7746174931526184,
-0.06536360830068588,
0.011060076765716076,
-0.5730654001235962,
0.2495039701461792,
-0.5303246378898621,
-0.45328807830810547,
0.25811973214149475,
0.2868557870388031,
-0.7590840458869934,
0.418131947517395,
-0.013006985187530518,
0.7248036861419678,
-0.9211283922195435,
0.8271777033805847,
0.709933876991272,
-0.8247422575950623,
-0.9621443152427673,
-0.0009290784946642816,
-0.07649669796228409,
-0.6563241481781006,
0.896794855594635,
0.21546155214309692,
0.06389672309160233,
0.051293645054101944,
-0.7856132984161377,
-0.96210116147995,
1.064384937286377,
0.13976728916168213,
-0.05148841440677643,
0.0007968063000589609,
0.10398062318563461,
0.7239984273910522,
-0.4483068883419037,
0.6131979823112488,
0.439272940158844,
0.5360074043273926,
-0.0692857876420021,
-0.6104941368103027,
0.17401613295078278,
-0.5412479639053345,
-0.07456504553556442,
0.005127432756125927,
-0.9620354175567627,
1.247369647026062,
-0.11575323343276978,
0.019507749006152153,
0.06282223016023636,
0.6439641714096069,
0.17621292173862457,
0.20690864324569702,
0.39218249917030334,
0.6099305152893066,
0.6527570486068726,
-0.4089580178260803,
0.871599018573761,
-0.35454776883125305,
0.7698048949241638,
0.7146532535552979,
0.27441737055778503,
0.9463462233543396,
0.41450098156929016,
-0.28947827219963074,
0.6696714162826538,
0.7076862454414368,
-0.2270481139421463,
0.3833630383014679,
0.13188736140727997,
0.05965585261583328,
-0.18400688469409943,
-0.09157004207372665,
-0.4464071989059448,
0.38614708185195923,
0.33062732219696045,
-0.48769575357437134,
-0.1625959575176239,
-0.12177107483148575,
0.285714715719223,
-0.06273027509450912,
-0.21114616096019745,
0.5120245218276978,
0.1475922018289566,
-0.5712540149688721,
0.8892964124679565,
-0.014085180126130581,
0.9177560210227966,
-0.27358829975128174,
0.11695637553930283,
-0.10231804102659225,
0.33817195892333984,
-0.41365164518356323,
-0.8048995137214661,
0.06966155767440796,
0.23597829043865204,
-0.03077378310263157,
-0.2964722514152527,
0.4408949315547943,
-0.46404555439949036,
-0.6832665801048279,
0.5325689911842346,
0.3888280689716339,
0.24468877911567688,
0.22752779722213745,
-1.1380398273468018,
0.0764261782169342,
0.05117149278521538,
-0.703239381313324,
0.03448386490345001,
0.49569937586784363,
0.24519386887550354,
0.5625983476638794,
0.6065950393676758,
0.06289104372262955,
0.23986490070819855,
0.33385080099105835,
0.8656949996948242,
-0.7895321846008301,
-0.36096838116645813,
-0.9488767981529236,
0.4207989573478699,
-0.25643089413642883,
-0.5543735027313232,
0.9036689400672913,
0.6172758340835571,
0.6665332913398743,
0.032461557537317276,
0.9519162774085999,
-0.34080103039741516,
0.652401328086853,
-0.26375043392181396,
0.8979939222335815,
-0.8350633978843689,
0.11240773648023605,
-0.41438254714012146,
-0.737774670124054,
-0.40032246708869934,
0.7486894130706787,
-0.45343074202537537,
0.4173552095890045,
0.6986613273620605,
0.7130334377288818,
0.041637569665908813,
-0.1626843512058258,
0.09885936975479126,
0.6491172313690186,
0.31313082575798035,
0.6501763463020325,
0.6100562214851379,
-0.791354238986969,
0.6880823969841003,
-0.48312702775001526,
-0.15934684872627258,
-0.3484840393066406,
-0.8197704553604126,
-1.188981056213379,
-0.6634872555732727,
-0.404008686542511,
-0.9658498167991638,
0.009871545247733593,
1.116807460784912,
0.4961692690849304,
-1.0760177373886108,
-0.28373247385025024,
0.03669875115156174,
0.010642113164067268,
0.11290153115987778,
-0.2889365553855896,
0.6742550730705261,
-0.4329195022583008,
-0.838163435459137,
-0.006576341576874256,
-0.12252639979124069,
0.1281866878271103,
-0.01798679493367672,
-0.04709308221936226,
-0.4795413911342621,
0.07430525124073029,
0.41933709383010864,
0.11988092213869095,
-0.6532580256462097,
-0.24056045711040497,
0.08360372483730316,
-0.41305676102638245,
0.18324939906597137,
0.18549665808677673,
-0.4771415591239929,
0.1652926206588745,
0.7352729439735413,
0.2727572023868561,
0.5487011075019836,
0.006761184427887201,
0.34967729449272156,
-0.5306299328804016,
0.04990457370877266,
0.23925712704658508,
0.49171674251556396,
0.5263488292694092,
-0.1242469996213913,
0.6365106105804443,
0.35809823870658875,
-0.5100900530815125,
-0.9535015821456909,
-0.3726824223995209,
-1.1188905239105225,
-0.2250659018754959,
1.3141242265701294,
-0.2113317847251892,
-0.5171471834182739,
0.04073195904493332,
0.01677291840314865,
0.5948641300201416,
-0.7321805357933044,
0.7458600997924805,
0.5346227884292603,
0.18359558284282684,
0.04829534888267517,
-0.38232186436653137,
0.4989960193634033,
0.3071382939815521,
-0.5786688327789307,
-0.24190790951251984,
0.03558835759758949,
0.5984016060829163,
0.1574450135231018,
0.6946219205856323,
0.013695224188268185,
0.27113938331604004,
-0.031424883753061295,
0.11929097026586533,
-0.08983051776885986,
-0.01538757048547268,
-0.3761807382106781,
0.18125078082084656,
-0.34451189637184143,
-0.22511355578899384
] |
jonatasgrosman/wav2vec2-large-xlsr-53-portuguese | jonatasgrosman | "2022-12-14T01:59:47Z" | 4,751,160 | 18 | transformers | [
"transformers",
"pytorch",
"jax",
"wav2vec2",
"automatic-speech-recognition",
"audio",
"hf-asr-leaderboard",
"mozilla-foundation/common_voice_6_0",
"pt",
"robust-speech-event",
"speech",
"xlsr-fine-tuning-week",
"dataset:common_voice",
"dataset:mozilla-foundation/common_voice_6_0",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | automatic-speech-recognition | "2022-03-02T23:29:05Z" | ---
language: pt
license: apache-2.0
datasets:
- common_voice
- mozilla-foundation/common_voice_6_0
metrics:
- wer
- cer
tags:
- audio
- automatic-speech-recognition
- hf-asr-leaderboard
- mozilla-foundation/common_voice_6_0
- pt
- robust-speech-event
- speech
- xlsr-fine-tuning-week
model-index:
- name: XLSR Wav2Vec2 Portuguese by Jonatas Grosman
results:
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Common Voice pt
type: common_voice
args: pt
metrics:
- name: Test WER
type: wer
value: 11.31
- name: Test CER
type: cer
value: 3.74
- name: Test WER (+LM)
type: wer
value: 9.01
- name: Test CER (+LM)
type: cer
value: 3.21
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Robust Speech Event - Dev Data
type: speech-recognition-community-v2/dev_data
args: pt
metrics:
- name: Dev WER
type: wer
value: 42.1
- name: Dev CER
type: cer
value: 17.93
- name: Dev WER (+LM)
type: wer
value: 36.92
- name: Dev CER (+LM)
type: cer
value: 16.88
---
# Fine-tuned XLSR-53 large model for speech recognition in Portuguese
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) on Portuguese using the train and validation splits of [Common Voice 6.1](https://huggingface.co/datasets/common_voice).
When using this model, make sure that your speech input is sampled at 16kHz.
This model has been fine-tuned thanks to the GPU credits generously given by the [OVHcloud](https://www.ovhcloud.com/en/public-cloud/ai-training/) :)
The script used for training can be found here: https://github.com/jonatasgrosman/wav2vec2-sprint
## Usage
The model can be used directly (without a language model) as follows...
Using the [HuggingSound](https://github.com/jonatasgrosman/huggingsound) library:
```python
from huggingsound import SpeechRecognitionModel
model = SpeechRecognitionModel("jonatasgrosman/wav2vec2-large-xlsr-53-portuguese")
audio_paths = ["/path/to/file.mp3", "/path/to/another_file.wav"]
transcriptions = model.transcribe(audio_paths)
```
Writing your own inference script:
```python
import torch
import librosa
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
LANG_ID = "pt"
MODEL_ID = "jonatasgrosman/wav2vec2-large-xlsr-53-portuguese"
SAMPLES = 10
test_dataset = load_dataset("common_voice", LANG_ID, split=f"test[:{SAMPLES}]")
processor = Wav2Vec2Processor.from_pretrained(MODEL_ID)
model = Wav2Vec2ForCTC.from_pretrained(MODEL_ID)
# Preprocessing the datasets.
# We need to read the audio files as arrays
def speech_file_to_array_fn(batch):
speech_array, sampling_rate = librosa.load(batch["path"], sr=16_000)
batch["speech"] = speech_array
batch["sentence"] = batch["sentence"].upper()
return batch
test_dataset = test_dataset.map(speech_file_to_array_fn)
inputs = processor(test_dataset["speech"], sampling_rate=16_000, return_tensors="pt", padding=True)
with torch.no_grad():
logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
predicted_ids = torch.argmax(logits, dim=-1)
predicted_sentences = processor.batch_decode(predicted_ids)
for i, predicted_sentence in enumerate(predicted_sentences):
print("-" * 100)
print("Reference:", test_dataset[i]["sentence"])
print("Prediction:", predicted_sentence)
```
| Reference | Prediction |
| ------------- | ------------- |
| NEM O RADAR NEM OS OUTROS INSTRUMENTOS DETECTARAM O BOMBARDEIRO STEALTH. | NEMHUM VADAN OS OLTWES INSTRUMENTOS DE TTÉÃN UM BOMBERDEIRO OSTER |
| PEDIR DINHEIRO EMPRESTADO ÀS PESSOAS DA ALDEIA | E DIR ENGINHEIRO EMPRESTAR AS PESSOAS DA ALDEIA |
| OITO | OITO |
| TRANCÁ-LOS | TRANCAUVOS |
| REALIZAR UMA INVESTIGAÇÃO PARA RESOLVER O PROBLEMA | REALIZAR UMA INVESTIGAÇÃO PARA RESOLVER O PROBLEMA |
| O YOUTUBE AINDA É A MELHOR PLATAFORMA DE VÍDEOS. | YOUTUBE AINDA É A MELHOR PLATAFOMA DE VÍDEOS |
| MENINA E MENINO BEIJANDO NAS SOMBRAS | MENINA E MENINO BEIJANDO NAS SOMBRAS |
| EU SOU O SENHOR | EU SOU O SENHOR |
| DUAS MULHERES QUE SENTAM-SE PARA BAIXO LENDO JORNAIS. | DUAS MIERES QUE SENTAM-SE PARA BAICLANE JODNÓI |
| EU ORIGINALMENTE ESPERAVA | EU ORIGINALMENTE ESPERAVA |
## Evaluation
1. To evaluate on `mozilla-foundation/common_voice_6_0` with split `test`
```bash
python eval.py --model_id jonatasgrosman/wav2vec2-large-xlsr-53-portuguese --dataset mozilla-foundation/common_voice_6_0 --config pt --split test
```
2. To evaluate on `speech-recognition-community-v2/dev_data`
```bash
python eval.py --model_id jonatasgrosman/wav2vec2-large-xlsr-53-portuguese --dataset speech-recognition-community-v2/dev_data --config pt --split validation --chunk_length_s 5.0 --stride_length_s 1.0
```
## Citation
If you want to cite this model you can use this:
```bibtex
@misc{grosman2021xlsr53-large-portuguese,
title={Fine-tuned {XLSR}-53 large model for speech recognition in {P}ortuguese},
author={Grosman, Jonatas},
howpublished={\url{https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-portuguese}},
year={2021}
}
``` | [
-0.4338238835334778,
-0.6374335885047913,
0.13567115366458893,
0.2450847178697586,
-0.247168630361557,
-0.19712358713150024,
-0.3501100242137909,
-0.5621572136878967,
0.23057128489017487,
0.2715253531932831,
-0.5745862126350403,
-0.5381931662559509,
-0.575222373008728,
-0.06999600678682327,
-0.35913965106010437,
0.9956145882606506,
0.17770196497440338,
0.2773490846157074,
0.05141615867614746,
-0.22535131871700287,
-0.24244022369384766,
-0.36914339661598206,
-0.7565551996231079,
-0.18759766221046448,
0.38031628727912903,
0.17861199378967285,
0.25018322467803955,
0.4460209906101227,
0.2786656320095062,
0.38744479417800903,
-0.32529234886169434,
0.06574857980012894,
-0.31715264916419983,
-0.04245704784989357,
-0.007222713436931372,
-0.3214823603630066,
-0.35148879885673523,
-0.024992607533931732,
0.7169071435928345,
0.35170137882232666,
-0.2279416024684906,
0.2796954810619354,
0.018405307084321976,
0.3260398209095001,
-0.32265570759773254,
0.28141486644744873,
-0.4724268913269043,
-0.20381902158260345,
-0.05427263677120209,
0.024403421208262444,
-0.21623139083385468,
-0.2813466191291809,
0.29549920558929443,
-0.45428845286369324,
0.13925296068191528,
-0.14241451025009155,
0.9637008905410767,
0.2854757010936737,
-0.13012170791625977,
-0.4310891330242157,
-0.6728516221046448,
0.8960811495780945,
-0.8456926345825195,
0.5081561803817749,
0.3984467387199402,
0.21773123741149902,
-0.059618402272462845,
-0.6820316910743713,
-0.5400986671447754,
-0.19511491060256958,
0.20890925824642181,
0.15681302547454834,
-0.4956725835800171,
-0.07014922797679901,
0.38706520199775696,
0.009818058460950851,
-0.660298228263855,
0.1529466062784195,
-0.78536456823349,
-0.4361651539802551,
0.6371641755104065,
-0.19764786958694458,
0.12731227278709412,
-0.14906397461891174,
-0.1584981083869934,
-0.5055893063545227,
-0.30860617756843567,
0.3408345580101013,
0.543887197971344,
0.38566502928733826,
-0.6011902093887329,
0.4498283565044403,
-0.08541776984930038,
0.6993245482444763,
-0.010793160647153854,
-0.4032209515571594,
0.8618540167808533,
-0.20148946344852448,
-0.37562620639801025,
0.286122590303421,
1.0570088624954224,
-0.004776255693286657,
0.26856300234794617,
0.16314052045345306,
-0.07809141278266907,
0.23028044402599335,
-0.13906830549240112,
-0.7289774417877197,
-0.16440348327159882,
0.40072962641716003,
-0.18554896116256714,
-0.11274459213018417,
0.02837238274514675,
-0.5450248718261719,
0.04839974269270897,
-0.2557404637336731,
0.6088185906410217,
-0.5925185680389404,
-0.17999590933322906,
0.26395586133003235,
-0.18020716309547424,
0.11620914936065674,
-0.004609947092831135,
-0.7262899875640869,
0.2007792890071869,
0.4082612097263336,
0.7494940161705017,
0.18190208077430725,
-0.31115901470184326,
-0.5477168560028076,
-0.15516115725040436,
-0.04831371083855629,
0.5420379042625427,
-0.20012587308883667,
-0.2702987492084503,
-0.2503044009208679,
0.07482396811246872,
-0.17271697521209717,
-0.5059103965759277,
0.8680305480957031,
-0.12768492102622986,
0.39651253819465637,
-0.07393858581781387,
-0.44370344281196594,
-0.2808537483215332,
-0.1343722939491272,
-0.5037182569503784,
1.0312716960906982,
-0.04471148923039436,
-0.7759762406349182,
0.07192306965589523,
-0.6344411373138428,
-0.4230111837387085,
-0.27200910449028015,
-0.10918643325567245,
-0.5356904864311218,
-0.21839332580566406,
0.28825730085372925,
0.4718371629714966,
-0.25537988543510437,
0.21126431226730347,
-0.28316327929496765,
-0.28668707609176636,
0.378165602684021,
-0.42244216799736023,
1.1189377307891846,
0.3466677665710449,
-0.3965204358100891,
0.062239326536655426,
-0.8470205664634705,
0.07554289698600769,
0.08587401360273361,
-0.420584499835968,
-0.10799083113670349,
-0.007650676183402538,
0.27227842807769775,
0.2439383566379547,
0.1597874015569687,
-0.6171548366546631,
-0.05710211023688316,
-0.645546019077301,
0.6514317989349365,
0.5396818518638611,
-0.1425088495016098,
0.19235597550868988,
-0.3084206283092499,
0.3425511419773102,
0.005542371887713671,
0.001073657302185893,
0.0012095342390239239,
-0.48512715101242065,
-0.6689115762710571,
-0.47541800141334534,
0.4249166250228882,
0.5685142874717712,
-0.35272446274757385,
0.7026271820068359,
-0.22867876291275024,
-0.8594045639038086,
-0.7893804311752319,
-0.1057567149400711,
0.4906301498413086,
0.5361669063568115,
0.5280611515045166,
-0.09320885688066483,
-0.9930452704429626,
-0.8215656280517578,
0.013763347640633583,
-0.1790391504764557,
-0.22910213470458984,
0.5073394179344177,
0.6309635639190674,
-0.3406315743923187,
0.7911560535430908,
-0.39843541383743286,
-0.36628827452659607,
-0.2056494653224945,
0.062116608023643494,
0.4366978704929352,
0.7404653429985046,
0.6034231781959534,
-0.7489791512489319,
-0.3137843906879425,
-0.2510371208190918,
-0.49145838618278503,
-0.19788594543933868,
0.04100145027041435,
0.051955386996269226,
0.30304762721061707,
0.29589521884918213,
-0.5344095826148987,
0.17611445486545563,
0.6193516254425049,
-0.26256152987480164,
0.46592462062835693,
-0.12370836734771729,
0.0008181742741726339,
-1.1080573797225952,
0.11560020595788956,
0.19151540100574493,
-0.12222892791032791,
-0.4362486004829407,
-0.28036367893218994,
-0.21096938848495483,
0.06686350703239441,
-0.6302089095115662,
0.4721449911594391,
-0.38525906205177307,
-0.1679924875497818,
0.01344946026802063,
0.2327164262533188,
-0.13236746191978455,
0.5349531173706055,
0.07872522622346878,
0.6025840640068054,
0.8333358764648438,
-0.5241634249687195,
0.5120353698730469,
0.38483449816703796,
-0.6006669998168945,
0.2182760089635849,
-0.9792884588241577,
0.23856854438781738,
0.10326752066612244,
0.26472988724708557,
-0.9878183007240295,
-0.14972692728042603,
0.35656216740608215,
-0.8451643586158752,
0.19587641954421997,
-0.08644614368677139,
-0.38992851972579956,
-0.4537960886955261,
-0.04305601492524147,
0.21794813871383667,
0.7152904272079468,
-0.4201523959636688,
0.569191038608551,
0.5871288180351257,
-0.15555191040039062,
-0.6792299747467041,
-0.8229041695594788,
-0.2839861810207367,
-0.24769912660121918,
-0.7253384590148926,
0.2516367733478546,
-0.1843099147081375,
-0.11646488308906555,
-0.14183309674263,
-0.10491389781236649,
-0.05624450370669365,
-0.07025761157274246,
0.4107392132282257,
0.3239865005016327,
-0.1975761353969574,
-0.06731551140546799,
-0.04692244902253151,
0.03341355547308922,
0.08725054562091827,
-0.22793951630592346,
0.7422162890434265,
-0.11129632592201233,
-0.09234807640314102,
-0.6007433533668518,
0.12554189562797546,
0.5338220596313477,
-0.29381421208381653,
0.5337459444999695,
0.8458647131919861,
-0.3186112642288208,
-0.03494526073336601,
-0.5279382467269897,
-0.08935734629631042,
-0.45058995485305786,
0.6600573062896729,
-0.2228260636329651,
-0.7241138219833374,
0.5328170657157898,
0.362366646528244,
-0.0819704532623291,
0.5552129149436951,
0.5996282696723938,
-0.06817901879549026,
0.9451788067817688,
0.2722143828868866,
-0.26449480652809143,
0.5648629665374756,
-0.6150022745132446,
-0.10814797133207321,
-0.758056640625,
-0.43207645416259766,
-0.8230466842651367,
-0.1931893229484558,
-0.4778864085674286,
-0.43977320194244385,
0.24817362427711487,
-0.0962674617767334,
-0.3329729735851288,
0.43021833896636963,
-0.6361111998558044,
0.25552722811698914,
0.651076078414917,
0.15328168869018555,
-0.15424293279647827,
0.1465042531490326,
-0.18516315519809723,
0.13369688391685486,
-0.5814220309257507,
-0.35631847381591797,
1.0317702293395996,
0.40395429730415344,
0.6371843814849854,
-0.02669559232890606,
0.5873936414718628,
0.045997921377420425,
-0.32875683903694153,
-0.8351975083351135,
0.5462356805801392,
-0.1615796685218811,
-0.5176788568496704,
-0.3828595280647278,
-0.4027376174926758,
-0.9571146368980408,
0.17843355238437653,
-0.22444532811641693,
-0.9149636626243591,
0.15667681396007538,
0.012168875895440578,
-0.47319573163986206,
0.055207785218954086,
-0.6792433261871338,
0.8271970152854919,
-0.07218611985445023,
-0.13497456908226013,
-0.16952595114707947,
-0.7068339586257935,
0.1322789490222931,
0.04613671451807022,
0.14760565757751465,
-0.09889967739582062,
0.2320413738489151,
1.3009796142578125,
-0.25142061710357666,
0.7137693166732788,
-0.2699122130870819,
-0.02178390510380268,
0.4737621545791626,
-0.33373844623565674,
0.3961074948310852,
-0.12850025296211243,
-0.19166339933872223,
0.43835049867630005,
0.22337260842323303,
-0.16709564626216888,
-0.2925766706466675,
0.7485382556915283,
-1.109297275543213,
-0.26457682251930237,
-0.46740588545799255,
-0.4650404751300812,
-0.09133699536323547,
0.17501944303512573,
0.5989077091217041,
0.572908341884613,
-0.22298799455165863,
0.44024723768234253,
0.5201349854469299,
-0.27223339676856995,
0.42345935106277466,
0.5772200226783752,
0.019434913992881775,
-0.6400811672210693,
0.7147386074066162,
0.3671434223651886,
0.18225418031215668,
0.1844542920589447,
0.2136070877313614,
-0.5278416872024536,
-0.5326524972915649,
-0.1838962882757187,
0.3656449019908905,
-0.5314592719078064,
-0.08902028203010559,
-0.7626538872718811,
-0.26719725131988525,
-0.7931592464447021,
0.18602561950683594,
-0.39891374111175537,
-0.3327696621417999,
-0.5508856177330017,
-0.14323104918003082,
0.43465331196784973,
0.3671819567680359,
-0.2533193826675415,
0.30303868651390076,
-0.6580200791358948,
0.3332706391811371,
0.1063331887125969,
-0.008511850610375404,
-0.17631322145462036,
-0.9655120372772217,
-0.4051794111728668,
0.34979233145713806,
-0.20134028792381287,
-0.7764655947685242,
0.6104210019111633,
0.14808286726474762,
0.5020806193351746,
0.34635111689567566,
-0.09120403975248337,
0.6988252401351929,
-0.33618518710136414,
0.7156158685684204,
0.21793638169765472,
-1.0389983654022217,
0.704721212387085,
-0.334825336933136,
0.3112294375896454,
0.26696541905403137,
0.3926135301589966,
-0.42446938157081604,
-0.23596015572547913,
-0.7742529511451721,
-0.8302452564239502,
0.9627408385276794,
0.32537439465522766,
-0.022330330684781075,
0.14766287803649902,
0.0917440876364708,
-0.13590312004089355,
0.0567450150847435,
-0.6542310118675232,
-0.4770369827747345,
-0.17372335493564606,
-0.20054076611995697,
-0.3372736871242523,
-0.15768146514892578,
-0.12445178627967834,
-0.46989041566848755,
0.9972940683364868,
0.15361851453781128,
0.3795502483844757,
0.3416416347026825,
0.10141415148973465,
0.05103747546672821,
0.24445399641990662,
0.675622820854187,
0.22788022458553314,
-0.3823481500148773,
-0.05761697515845299,
0.20113906264305115,
-0.6506804823875427,
0.09765078872442245,
0.2647310495376587,
-0.13351447880268097,
0.22209066152572632,
0.3349803686141968,
1.1822139024734497,
0.19550329446792603,
-0.6664307117462158,
0.3986164331436157,
0.02093384973704815,
-0.32551729679107666,
-0.6406008005142212,
0.19131158292293549,
0.24758626520633698,
0.3378475308418274,
0.4213190972805023,
0.22155609726905823,
0.015299982391297817,
-0.3710309863090515,
0.05583544820547104,
0.3379291296005249,
-0.2951339781284332,
-0.2858487665653229,
0.6499719619750977,
0.09189371764659882,
-0.36718514561653137,
0.4666385352611542,
-0.034954216331243515,
-0.44488877058029175,
0.8585442900657654,
0.5623964071273804,
0.8490421772003174,
-0.4010615646839142,
-0.01945444755256176,
0.6328825354576111,
0.1932595670223236,
-0.28304827213287354,
0.47048041224479675,
0.009509393945336342,
-0.8082828521728516,
-0.24535632133483887,
-0.599296510219574,
-0.22949963808059692,
0.2973901033401489,
-0.8299874663352966,
0.5004004836082458,
-0.27218252420425415,
-0.21540099382400513,
0.28093212842941284,
0.10985615849494934,
-0.6114633083343506,
0.3423853814601898,
0.30936434864997864,
0.9367513656616211,
-0.8892204165458679,
1.0692473649978638,
0.45405712723731995,
-0.4095822274684906,
-1.1462249755859375,
-0.27432873845100403,
-0.14235588908195496,
-0.6816961765289307,
0.5023519396781921,
0.12883740663528442,
-0.21411114931106567,
0.047074828296899796,
-0.610519528388977,
-0.9581517577171326,
1.0485950708389282,
0.5700165033340454,
-0.8421474695205688,
-0.08912422508001328,
-0.08639521151781082,
0.5259499549865723,
-0.3356499969959259,
0.4000428318977356,
0.6618472933769226,
0.4842280447483063,
0.20757289230823517,
-1.1540896892547607,
-0.13263587653636932,
-0.2504322826862335,
-0.2955428957939148,
-0.12655773758888245,
-0.6019039154052734,
0.9777639508247375,
-0.3560161590576172,
-0.03822699934244156,
0.11211395263671875,
0.6734485030174255,
0.4644468426704407,
0.33331191539764404,
0.49996498227119446,
0.6180527210235596,
0.8410308361053467,
-0.14399553835391998,
0.7070261240005493,
-0.12272410839796066,
0.4830073416233063,
1.2087314128875732,
-0.056445613503456116,
1.0394264459609985,
0.3842817544937134,
-0.35602685809135437,
0.4922955632209778,
0.5189917683601379,
-0.3288395404815674,
0.61545330286026,
0.05841062217950821,
-0.1333661526441574,
-0.07960595190525055,
-0.002373047173023224,
-0.6174306273460388,
0.848594605922699,
0.2518552541732788,
-0.522784948348999,
0.22643570601940155,
0.20881696045398712,
0.18204988539218903,
-0.20857210457324982,
-0.2024349719285965,
0.5432325601577759,
0.04716935008764267,
-0.5629479885101318,
0.9350572228431702,
-0.03988170996308327,
0.8596215844154358,
-0.7922366857528687,
0.19508925080299377,
0.21508055925369263,
0.21858921647071838,
-0.29894664883613586,
-0.6170721650123596,
0.17767685651779175,
0.16742390394210815,
-0.18844231963157654,
0.033283405005931854,
0.34906670451164246,
-0.5319907069206238,
-0.5693686008453369,
0.5402967929840088,
0.18087956309318542,
0.45567217469215393,
-0.0904373973608017,
-0.8487161993980408,
0.365261435508728,
0.33556967973709106,
-0.3631409704685211,
0.20982445776462555,
0.25374269485473633,
0.3290289044380188,
0.557979941368103,
0.7252975702285767,
0.3204552233219147,
-0.024053549394011497,
-0.011599353514611721,
0.7115620374679565,
-0.5534183382987976,
-0.654258668422699,
-0.7516245245933533,
0.4272955060005188,
0.02367137186229229,
-0.36636143922805786,
0.7230859398841858,
0.7933225631713867,
0.9319208264350891,
-0.06617572158575058,
0.9171302318572998,
-0.1733032912015915,
0.7570927143096924,
-0.46866294741630554,
0.7051039338111877,
-0.4427139461040497,
0.19613662362098694,
-0.4043639004230499,
-0.6705431342124939,
-0.06227611377835274,
0.8447231650352478,
-0.36191433668136597,
0.08748891949653625,
0.42215946316719055,
1.0099297761917114,
-0.04608646407723427,
-0.10402501374483109,
0.25653472542762756,
0.5754079222679138,
0.16967624425888062,
0.6900424361228943,
0.4407182037830353,
-0.6703886985778809,
0.8087724447250366,
-0.42280083894729614,
-0.08316564559936523,
-0.14296413958072662,
-0.5503281950950623,
-0.7662675380706787,
-0.7247553467750549,
-0.46799689531326294,
-0.6150413155555725,
-0.03967994451522827,
1.1410959959030151,
0.7145281434059143,
-0.8984563946723938,
-0.3909522294998169,
0.1602621078491211,
-0.07484093308448792,
-0.27594372630119324,
-0.2097521275281906,
0.5327100157737732,
0.27879342436790466,
-1.0071358680725098,
0.48114827275276184,
-0.12698520720005035,
0.24771732091903687,
-0.13273845613002777,
-0.25836947560310364,
-0.25588133931159973,
0.09519389271736145,
0.2681530714035034,
0.4346052408218384,
-0.767525851726532,
-0.1561623066663742,
-0.04313993453979492,
-0.19340276718139648,
0.12300827354192734,
0.23539066314697266,
-0.863321840763092,
0.2509734630584717,
0.5883062481880188,
0.11765341460704803,
0.6396191120147705,
-0.2384340614080429,
0.1751076877117157,
-0.48271724581718445,
0.5123512744903564,
0.30733025074005127,
0.6197298169136047,
0.32430729269981384,
-0.13926562666893005,
0.3959377110004425,
0.2461734265089035,
-0.5517705082893372,
-0.9865404367446899,
-0.15451563894748688,
-1.410292625427246,
-0.12312860786914825,
1.2841975688934326,
-0.18476423621177673,
-0.22988519072532654,
0.13860879838466644,
-0.5135078430175781,
0.6544261574745178,
-0.6767591238021851,
0.4780845642089844,
0.45545876026153564,
-0.05754952132701874,
0.03617656230926514,
-0.45591679215431213,
0.3442225754261017,
0.29432380199432373,
-0.4930817782878876,
-0.16376839578151703,
0.43456509709358215,
0.5625602602958679,
0.23041129112243652,
0.593086302280426,
0.02906894125044346,
0.2910032570362091,
0.06029416248202324,
0.23438020050525665,
-0.14185215532779694,
-0.14424347877502441,
-0.5821216702461243,
0.09503506869077682,
-0.3292296826839447,
-0.5532999038696289
] |
pyannote/segmentation | pyannote | "2023-10-04T18:52:36Z" | 4,256,827 | 328 | pyannote-audio | [
"pyannote-audio",
"pytorch",
"pyannote",
"pyannote-audio-model",
"audio",
"voice",
"speech",
"speaker",
"speaker-segmentation",
"voice-activity-detection",
"overlapped-speech-detection",
"resegmentation",
"arxiv:2104.04045",
"license:mit",
"has_space",
"region:us"
] | voice-activity-detection | "2022-03-02T23:29:05Z" | ---
tags:
- pyannote
- pyannote-audio
- pyannote-audio-model
- audio
- voice
- speech
- speaker
- speaker-segmentation
- voice-activity-detection
- overlapped-speech-detection
- resegmentation
license: mit
inference: false
extra_gated_prompt: "The collected information will help acquire a better knowledge of pyannote.audio userbase and help its maintainers apply for grants to improve it further. If you are an academic researcher, please cite the relevant papers in your own publications using the model. If you work for a company, please consider contributing back to pyannote.audio development (e.g. through unrestricted gifts). We also provide scientific consulting services around speaker diarization and machine listening."
extra_gated_fields:
Company/university: text
Website: text
I plan to use this model for (task, type of audio data, etc): text
---
Using this open-source model in production?
Make the most of it thanks to our [consulting services](https://herve.niderb.fr/consulting.html).
# 🎹 Speaker segmentation
[Paper](http://arxiv.org/abs/2104.04045) | [Demo](https://huggingface.co/spaces/pyannote/pretrained-pipelines) | [Blog post](https://herve.niderb.fr/fastpages/2022/10/23/One-speaker-segmentation-model-to-rule-them-all)
![Example](example.png)
## Usage
Relies on pyannote.audio 2.1.1: see [installation instructions](https://github.com/pyannote/pyannote-audio).
```python
# 1. visit hf.co/pyannote/segmentation and accept user conditions
# 2. visit hf.co/settings/tokens to create an access token
# 3. instantiate pretrained model
from pyannote.audio import Model
model = Model.from_pretrained("pyannote/segmentation",
use_auth_token="ACCESS_TOKEN_GOES_HERE")
```
### Voice activity detection
```python
from pyannote.audio.pipelines import VoiceActivityDetection
pipeline = VoiceActivityDetection(segmentation=model)
HYPER_PARAMETERS = {
# onset/offset activation thresholds
"onset": 0.5, "offset": 0.5,
# remove speech regions shorter than that many seconds.
"min_duration_on": 0.0,
# fill non-speech regions shorter than that many seconds.
"min_duration_off": 0.0
}
pipeline.instantiate(HYPER_PARAMETERS)
vad = pipeline("audio.wav")
# `vad` is a pyannote.core.Annotation instance containing speech regions
```
### Overlapped speech detection
```python
from pyannote.audio.pipelines import OverlappedSpeechDetection
pipeline = OverlappedSpeechDetection(segmentation=model)
pipeline.instantiate(HYPER_PARAMETERS)
osd = pipeline("audio.wav")
# `osd` is a pyannote.core.Annotation instance containing overlapped speech regions
```
### Resegmentation
```python
from pyannote.audio.pipelines import Resegmentation
pipeline = Resegmentation(segmentation=model,
diarization="baseline")
pipeline.instantiate(HYPER_PARAMETERS)
resegmented_baseline = pipeline({"audio": "audio.wav", "baseline": baseline})
# where `baseline` should be provided as a pyannote.core.Annotation instance
```
### Raw scores
```python
from pyannote.audio import Inference
inference = Inference(model)
segmentation = inference("audio.wav")
# `segmentation` is a pyannote.core.SlidingWindowFeature
# instance containing raw segmentation scores like the
# one pictured above (output)
```
## Citation
```bibtex
@inproceedings{Bredin2021,
Title = {{End-to-end speaker segmentation for overlap-aware resegmentation}},
Author = {{Bredin}, Herv{\'e} and {Laurent}, Antoine},
Booktitle = {Proc. Interspeech 2021},
Address = {Brno, Czech Republic},
Month = {August},
Year = {2021},
```
```bibtex
@inproceedings{Bredin2020,
Title = {{pyannote.audio: neural building blocks for speaker diarization}},
Author = {{Bredin}, Herv{\'e} and {Yin}, Ruiqing and {Coria}, Juan Manuel and {Gelly}, Gregory and {Korshunov}, Pavel and {Lavechin}, Marvin and {Fustes}, Diego and {Titeux}, Hadrien and {Bouaziz}, Wassim and {Gill}, Marie-Philippe},
Booktitle = {ICASSP 2020, IEEE International Conference on Acoustics, Speech, and Signal Processing},
Address = {Barcelona, Spain},
Month = {May},
Year = {2020},
}
```
## Reproducible research
In order to reproduce the results of the paper ["End-to-end speaker segmentation for overlap-aware resegmentation
"](https://arxiv.org/abs/2104.04045), use `pyannote/segmentation@Interspeech2021` with the following hyper-parameters:
| Voice activity detection | `onset` | `offset` | `min_duration_on` | `min_duration_off` |
| ------------------------ | ------- | -------- | ----------------- | ------------------ |
| AMI Mix-Headset | 0.684 | 0.577 | 0.181 | 0.037 |
| DIHARD3 | 0.767 | 0.377 | 0.136 | 0.067 |
| VoxConverse | 0.767 | 0.713 | 0.182 | 0.501 |
| Overlapped speech detection | `onset` | `offset` | `min_duration_on` | `min_duration_off` |
| --------------------------- | ------- | -------- | ----------------- | ------------------ |
| AMI Mix-Headset | 0.448 | 0.362 | 0.116 | 0.187 |
| DIHARD3 | 0.430 | 0.320 | 0.091 | 0.144 |
| VoxConverse | 0.587 | 0.426 | 0.337 | 0.112 |
| Resegmentation of VBx | `onset` | `offset` | `min_duration_on` | `min_duration_off` |
| --------------------- | ------- | -------- | ----------------- | ------------------ |
| AMI Mix-Headset | 0.542 | 0.527 | 0.044 | 0.705 |
| DIHARD3 | 0.592 | 0.489 | 0.163 | 0.182 |
| VoxConverse | 0.537 | 0.724 | 0.410 | 0.563 |
Expected outputs (and VBx baseline) are also provided in the `/reproducible_research` sub-directories.
| [
-0.6616150736808777,
-0.6818209290504456,
0.34610089659690857,
0.3079899847507477,
-0.40718820691108704,
-0.30719733238220215,
-0.35858261585235596,
-0.35218945145606995,
0.43828141689300537,
0.4550400972366333,
-0.691686749458313,
-0.6610769629478455,
-0.2644743323326111,
-0.27787408232688904,
-0.1596558392047882,
0.5884903073310852,
0.3553926348686218,
-0.15208542346954346,
-0.12629108130931854,
-0.08197928965091705,
-0.3831615149974823,
-0.2854306101799011,
-0.39768847823143005,
-0.28118184208869934,
0.18093183636665344,
0.5418307781219482,
0.32126033306121826,
0.794513463973999,
0.2675091624259949,
0.35648488998413086,
-0.4816250801086426,
0.12872450053691864,
-0.09710191190242767,
-0.004759674891829491,
0.18234305083751678,
-0.008009891025722027,
-0.36205995082855225,
0.03881208598613739,
0.9076536297798157,
0.6914358735084534,
-0.27878087759017944,
0.25885075330734253,
-0.1268911510705948,
0.3539236783981323,
-0.4087011218070984,
-0.03342362865805626,
-0.4583662748336792,
-0.01345230732113123,
-0.3350089192390442,
-0.18893203139305115,
-0.26040154695510864,
-0.047634292393922806,
0.2256290763616562,
-0.5985885858535767,
-0.010448316112160683,
-0.07083192467689514,
1.2863208055496216,
0.1670796424150467,
0.14041046798229218,
0.029376041144132614,
-0.6351029276847839,
0.764655590057373,
-1.021837830543518,
0.47994697093963623,
0.3458822965621948,
0.32956331968307495,
-0.14007002115249634,
-0.8781976103782654,
-0.6029729843139648,
-0.015127052552998066,
-0.0607793889939785,
0.2830183506011963,
-0.31181493401527405,
0.11756117641925812,
0.39429834485054016,
0.4695299565792084,
-0.48233360052108765,
0.16634522378444672,
-0.5653343796730042,
-0.30888235569000244,
0.7117945551872253,
-0.07291770726442337,
0.24998320639133453,
-0.2681012451648712,
-0.3685365319252014,
-0.22238381206989288,
-0.26989656686782837,
0.2545182406902313,
0.4390239417552948,
0.3599103093147278,
-0.3770869970321655,
0.45684564113616943,
-0.0248964112251997,
0.9083727598190308,
0.17540934681892395,
-0.10379177331924438,
0.709987223148346,
-0.4903787076473236,
-0.2689683437347412,
0.4135899543762207,
1.1173418760299683,
0.2521519660949707,
0.08497561514377594,
0.36465704441070557,
-0.027510032057762146,
-0.364147424697876,
0.004917837213724852,
-0.7725794315338135,
-0.47202980518341064,
0.5291505455970764,
-0.49120932817459106,
0.233998641371727,
-0.06093394011259079,
-0.8249372839927673,
-0.0023628680501133204,
-0.32661205530166626,
0.4924253523349762,
-0.5729029774665833,
-0.6004951596260071,
0.06863635033369064,
-0.27581265568733215,
0.20742939412593842,
0.026003912091255188,
-0.9836394190788269,
0.221506729722023,
0.5334762930870056,
1.1498103141784668,
0.11161554604768753,
-0.2542049288749695,
-0.5647322535514832,
-0.05619385465979576,
-0.23730148375034332,
0.7421380877494812,
-0.34701621532440186,
-0.45867079496383667,
-0.38692235946655273,
-0.011177578940987587,
-0.23272722959518433,
-0.6339435577392578,
0.681132435798645,
0.056435875594615936,
0.2774052023887634,
-0.1740996092557907,
-0.5457058548927307,
-0.06312153488397598,
-0.1729680448770523,
-0.40524396300315857,
1.0054141283035278,
0.18701182305812836,
-0.7460303902626038,
0.3720160126686096,
-0.6743173599243164,
-0.11789994686841965,
-0.12116343528032303,
-0.15248054265975952,
-0.8224010467529297,
-0.18754097819328308,
0.3195429742336273,
0.19583749771118164,
-0.11597727239131927,
-0.05863114818930626,
-0.19318020343780518,
-0.3305476903915405,
0.10048755258321762,
-0.3026407063007355,
1.1205451488494873,
0.18142643570899963,
-0.5714249014854431,
0.3225296437740326,
-1.1038156747817993,
0.08135991543531418,
-0.002094331895932555,
-0.47330865263938904,
-0.23433341085910797,
-0.03981713950634003,
0.18707719445228577,
0.14168258011341095,
0.08384179323911667,
-0.7442692518234253,
-0.2433868646621704,
-0.5488697290420532,
0.40676504373550415,
0.6897711157798767,
0.26569750905036926,
0.1438816785812378,
-0.28842616081237793,
0.22112827003002167,
0.12720826268196106,
0.13961829245090485,
-0.3846803605556488,
-0.5983346700668335,
-0.551886260509491,
-0.7351874709129333,
0.316913902759552,
0.5334988832473755,
-0.05604257434606552,
0.83249431848526,
-0.09531951695680618,
-0.7961832880973816,
-0.6996641159057617,
-0.06494380533695221,
0.5200853943824768,
0.6373761296272278,
0.5942723751068115,
-0.361939013004303,
-0.8319590091705322,
-1.0488272905349731,
-0.12875643372535706,
-0.2605910003185272,
-0.03310099244117737,
0.5861775875091553,
0.2701290249824524,
-0.07283937931060791,
1.1200511455535889,
-0.4474826157093048,
-0.1944248378276825,
-0.007179242558777332,
-0.022125128656625748,
0.5488280057907104,
0.8256497979164124,
0.49967414140701294,
-0.8073288202285767,
-0.5568586587905884,
0.013751689344644547,
-0.3786507844924927,
-0.43860381841659546,
-0.2878495454788208,
-0.2905622124671936,
-0.08293861895799637,
0.47725412249565125,
-0.6319381594657898,
0.3999318778514862,
0.218596950173378,
-0.33011096715927124,
0.9101869463920593,
0.06250598281621933,
0.02951507270336151,
-0.9765855669975281,
0.13258486986160278,
0.2713123559951782,
-0.022238848730921745,
-0.7261860966682434,
-0.745970606803894,
-0.16318783164024353,
-0.0645698606967926,
-0.41062188148498535,
0.46707063913345337,
-0.6110178828239441,
-0.3404964208602905,
-0.018426591530442238,
0.3229496479034424,
-0.16832253336906433,
0.7142687439918518,
0.23046904802322388,
0.8038933277130127,
0.6530199646949768,
-0.5738641619682312,
0.2617357671260834,
0.36544039845466614,
-0.8235834240913391,
0.45684656500816345,
-0.9189777970314026,
0.09571576863527298,
0.32257604598999023,
0.08636987209320068,
-1.3331600427627563,
-0.17170412838459015,
0.5208119750022888,
-0.8608238101005554,
0.24446332454681396,
-0.41733747720718384,
-0.11530297994613647,
-0.29709571599960327,
-0.059610720723867416,
0.3854479491710663,
0.5438449382781982,
-0.5271022915840149,
0.3186776041984558,
0.6103492975234985,
-0.329369455575943,
-0.414805144071579,
-0.7150787115097046,
-0.21110883355140686,
-0.29548320174217224,
-0.8848877549171448,
0.6531431674957275,
-0.02349456213414669,
-0.3768801987171173,
-0.04347536340355873,
-0.21433132886886597,
-0.10054399818181992,
-0.3193109929561615,
0.261292427778244,
0.10832561552524567,
-0.32750001549720764,
-0.1469661295413971,
-0.1335284411907196,
-0.032788705080747604,
-0.03979576751589775,
-0.3645704984664917,
0.6118696331977844,
0.11570050567388535,
-0.44746020436286926,
-0.8153050541877747,
0.24228771030902863,
0.6559626460075378,
-0.5399346947669983,
0.39859044551849365,
0.9147850871086121,
-0.31780481338500977,
0.022062884643673897,
-0.5272193551063538,
0.0015398175455629826,
-0.48071208596229553,
0.6653013825416565,
-0.1905323565006256,
-0.8000550866127014,
0.7272921204566956,
0.11911818385124207,
0.32634326815605164,
0.534651517868042,
0.5960965752601624,
-0.015256240032613277,
0.8495990633964539,
0.18293485045433044,
0.19833387434482574,
0.9423664212226868,
-0.3947599530220032,
0.22513821721076965,
-1.2545833587646484,
-0.40944918990135193,
-0.6796177625656128,
-0.180300772190094,
-0.47398778796195984,
-0.5384088754653931,
0.32549959421157837,
0.10169806331396103,
-0.1759539544582367,
0.3724018633365631,
-0.7740364670753479,
0.335859477519989,
0.6500165462493896,
-0.09585560113191605,
-0.4056071639060974,
0.20535844564437866,
-0.2808281481266022,
-0.11730826646089554,
-0.6170828342437744,
-0.2463534027338028,
0.8060157895088196,
0.33632078766822815,
0.3285122811794281,
-0.009630510583519936,
0.7897703647613525,
0.11740873754024506,
-0.26856347918510437,
-0.7787368893623352,
0.4981550872325897,
0.0010637968080118299,
-0.5595034956932068,
-0.6252676844596863,
-0.4729762375354767,
-0.9518188834190369,
0.615291953086853,
0.12459606677293777,
-1.208348274230957,
0.6928321719169617,
0.05781767517328262,
-0.6043625473976135,
0.3778925836086273,
-0.8957571983337402,
1.0331103801727295,
-0.1680690348148346,
-0.4091610908508301,
-0.04543902352452278,
-0.6232380867004395,
0.23273682594299316,
0.277770072221756,
0.28361204266548157,
-0.274537593126297,
0.32934629917144775,
1.221422553062439,
-0.5277934670448303,
0.6704294085502625,
-0.5440595746040344,
0.074710913002491,
0.7273244857788086,
-0.283279687166214,
0.3023298978805542,
0.06533437967300415,
0.008397981524467468,
0.13104526698589325,
0.02913791686296463,
-0.30406999588012695,
-0.2623174488544464,
0.6714435815811157,
-0.8306042551994324,
-0.6185005307197571,
-0.21151801943778992,
-0.3900947868824005,
-0.08791597932577133,
0.3028835952281952,
0.22164414823055267,
0.6115933060646057,
-0.02935566008090973,
0.37017929553985596,
0.6656074523925781,
-0.3593341112136841,
0.6429795622825623,
0.32224565744400024,
0.05789915844798088,
-0.9801185131072998,
0.8711065649986267,
0.2398705929517746,
0.330336332321167,
0.23003612458705902,
0.30803871154785156,
-0.4971868395805359,
-0.634177565574646,
-0.2932869791984558,
0.27823343873023987,
-0.5262535810470581,
0.13815829157829285,
-0.6177442669868469,
-0.2619154155254364,
-0.7096783518791199,
0.10727918893098831,
-0.7294851541519165,
-0.46313080191612244,
-0.3534386456012726,
0.005360056180506945,
0.20177629590034485,
0.1270916759967804,
-0.4507835805416107,
0.447091668844223,
-0.7084113359451294,
0.1496880203485489,
0.2660118043422699,
0.23180685937404633,
-0.22000296413898468,
-0.8460766673088074,
-0.5420026183128357,
0.05152915045619011,
-0.20752577483654022,
-0.8447394967079163,
0.3141898810863495,
0.12038475275039673,
0.9657352566719055,
0.3913528025150299,
-0.1459830403327942,
0.9011880159378052,
-0.1915738433599472,
1.0307499170303345,
0.4210520386695862,
-0.9839675426483154,
0.6219765543937683,
-0.4161592721939087,
0.49280744791030884,
0.5430368781089783,
0.09142452478408813,
-0.7884742617607117,
0.04423952475190163,
-0.7021878957748413,
-1.3375766277313232,
1.208203673362732,
0.44453179836273193,
-0.33949631452560425,
0.023324165493249893,
0.06108687445521355,
-0.2562102973461151,
-0.04710078611969948,
-0.5872080326080322,
-0.3845217525959015,
-0.3608262240886688,
0.019001588225364685,
-0.04099975898861885,
-0.34415164589881897,
-0.05049315094947815,
-0.542143702507019,
0.8395116925239563,
0.2512795031070709,
0.5169950127601624,
0.7104223966598511,
0.06636182218790054,
-0.12693259119987488,
0.11827018857002258,
0.870930552482605,
0.7191628813743591,
-0.5349980592727661,
-0.16792476177215576,
-0.07266297936439514,
-0.47338050603866577,
0.042257118970155716,
0.14328785240650177,
0.03712518513202667,
0.41363972425460815,
0.48522868752479553,
1.1190518140792847,
0.0680197924375534,
-0.5101284384727478,
0.3779192864894867,
0.03266313672065735,
-0.4145905673503876,
-0.6102208495140076,
-0.02112756483256817,
0.23496785759925842,
0.302605003118515,
0.3538690507411957,
-0.046286944299936295,
-0.03810492902994156,
-0.2688869535923004,
0.4318637549877167,
0.10784520953893661,
-0.5097226500511169,
-0.12359251827001572,
0.5015970468521118,
0.21895626187324524,
-0.6885508894920349,
0.6372966766357422,
-0.06323150545358658,
-0.5370673537254333,
0.9004104137420654,
0.4971819221973419,
1.142208218574524,
-0.5132337808609009,
-0.051246270537376404,
0.7231372594833374,
0.3100346326828003,
0.14049088954925537,
0.2254982590675354,
-0.4591487646102905,
-0.5173491835594177,
-0.3125666677951813,
-0.7642714381217957,
-0.2595854103565216,
0.3436691462993622,
-0.5942636728286743,
0.23438569903373718,
-0.5326968431472778,
-0.3091363310813904,
0.429267942905426,
-0.04947643354535103,
-0.20518285036087036,
0.28481781482696533,
0.20761792361736298,
0.9277582764625549,
-0.6201090812683105,
0.703813374042511,
0.7057879567146301,
-0.3297465145587921,
-0.8218364119529724,
0.004226345103234053,
-0.04126393049955368,
-0.3904917538166046,
0.22061362862586975,
0.098761186003685,
-0.04631172865629196,
-0.12026990205049515,
-0.30523401498794556,
-0.9328650236129761,
1.1024682521820068,
0.18378853797912598,
-0.9165025353431702,
0.2487318515777588,
-0.09667474776506424,
0.3272770941257477,
-0.41869738698005676,
0.3320089876651764,
0.7329383492469788,
0.6729117035865784,
0.09518729150295258,
-1.158237338066101,
-0.05135408416390419,
-0.516325056552887,
-0.2706056237220764,
0.265686571598053,
-0.9408065676689148,
1.116094946861267,
-0.06599142402410507,
-0.07152054458856583,
-0.14113688468933105,
0.6474205255508423,
0.5638667941093445,
0.33364176750183105,
0.866714596748352,
0.6637820601463318,
0.605739414691925,
-0.19703590869903564,
0.5310779809951782,
-0.2851891815662384,
0.23127339780330658,
1.2224891185760498,
0.14101703464984894,
0.6758326888084412,
0.463765412569046,
-0.4675299823284149,
0.4333963394165039,
0.9443424344062805,
-0.17112325131893158,
0.6274181008338928,
0.32460373640060425,
-0.10278647392988205,
-0.446929007768631,
-0.03480009362101555,
-0.6495989561080933,
0.6311585903167725,
0.45678210258483887,
-0.37217915058135986,
0.17978084087371826,
-0.35828304290771484,
-0.016571160405874252,
-0.13691696524620056,
-0.08273071050643921,
0.6143879890441895,
0.0695805475115776,
-0.6403703689575195,
0.8206385374069214,
-0.06356893479824066,
0.6092992424964905,
-0.6986303925514221,
-0.011092889122664928,
-0.1390649527311325,
0.1586824208498001,
-0.4229283630847931,
-0.6595803499221802,
0.2210376262664795,
-0.15611371397972107,
-0.18238620460033417,
-0.016412964090704918,
0.5030035972595215,
-0.6166256070137024,
-0.20733805000782013,
0.3508249819278717,
0.06932699680328369,
0.3187052607536316,
0.012649026699364185,
-0.7419707775115967,
0.1862485259771347,
0.29959672689437866,
-0.4334154725074768,
0.12903596460819244,
0.48998281359672546,
0.22626148164272308,
0.252088338136673,
0.7559725642204285,
0.24347564578056335,
0.2618049085140228,
0.19641634821891785,
0.7922903895378113,
-0.6221179366111755,
-0.9755585789680481,
-0.8294183015823364,
0.6346683502197266,
-0.484971821308136,
-0.5413777232170105,
0.836527943611145,
0.9097961187362671,
0.9653027653694153,
0.26578834652900696,
0.7012415528297424,
-0.12325296550989151,
0.5476257801055908,
-0.4045906960964203,
0.7293466925621033,
-0.6554402709007263,
0.35314542055130005,
-0.5733644962310791,
-0.8746224045753479,
-0.08551392704248428,
0.71152663230896,
-0.3558577001094818,
0.2028651386499405,
0.4761100709438324,
0.8847002387046814,
-0.19597293436527252,
-0.1169760599732399,
0.23834510147571564,
0.1738704890012741,
0.48051416873931885,
0.4208946228027344,
0.7064836025238037,
-0.26350656151771545,
0.7210288643836975,
-0.5595703721046448,
-0.199784517288208,
-0.2183605581521988,
-0.4131300449371338,
-0.7247844338417053,
-0.7666879892349243,
-0.5579122304916382,
-0.2264660745859146,
0.0217913705855608,
1.0777045488357544,
1.0685620307922363,
-0.7230260372161865,
-0.6079629063606262,
0.0007154829800128937,
0.14865918457508087,
-0.4576876163482666,
-0.24047064781188965,
0.6379086375236511,
-0.03416428342461586,
-0.7046226263046265,
0.6471391916275024,
0.3638327717781067,
0.070860356092453,
-0.0027174735441803932,
-0.2971545457839966,
-0.7151033878326416,
0.07943204790353775,
0.13812321424484253,
0.4664683938026428,
-0.6013487577438354,
-0.1553444117307663,
-0.3925836980342865,
0.22283057868480682,
0.35692331194877625,
0.6311773657798767,
-0.3366529047489166,
0.6279131770133972,
0.6706743836402893,
0.23429390788078308,
0.7525398135185242,
0.06612805277109146,
0.26090115308761597,
-0.7510535717010498,
0.2342604696750641,
0.2991654574871063,
0.4188603162765503,
0.4054637849330902,
-0.13321807980537415,
0.2864486575126648,
0.533893346786499,
-0.6423829197883606,
-1.1102561950683594,
-0.09691242128610611,
-1.0001089572906494,
-0.2639681100845337,
1.1432437896728516,
-0.24988886713981628,
-0.5097543001174927,
-0.09995777159929276,
-0.3577106297016144,
0.5259355902671814,
-0.6121825575828552,
0.5653157234191895,
0.619522213935852,
-0.317909836769104,
-0.12990206480026245,
-0.3609096109867096,
0.6125140190124512,
0.39848965406417847,
-0.5651471018791199,
0.22992432117462158,
0.5461182594299316,
0.2428782880306244,
0.5138775110244751,
0.8989775776863098,
-0.18240343034267426,
0.43342626094818115,
0.49004584550857544,
0.24777592718601227,
-0.41985368728637695,
-0.25936374068260193,
-0.2700074017047882,
0.09735603630542755,
-0.11033420264720917,
-0.7808272838592529
] |
bert-base-multilingual-cased | null | "2022-11-16T23:22:54Z" | 4,090,354 | 251 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"bert",
"fill-mask",
"multilingual",
"af",
"sq",
"ar",
"an",
"hy",
"ast",
"az",
"ba",
"eu",
"bar",
"be",
"bn",
"inc",
"bs",
"br",
"bg",
"my",
"ca",
"ceb",
"ce",
"zh",
"cv",
"hr",
"cs",
"da",
"nl",
"en",
"et",
"fi",
"fr",
"gl",
"ka",
"de",
"el",
"gu",
"ht",
"he",
"hi",
"hu",
"is",
"io",
"id",
"ga",
"it",
"ja",
"jv",
"kn",
"kk",
"ky",
"ko",
"la",
"lv",
"lt",
"roa",
"nds",
"lm",
"mk",
"mg",
"ms",
"ml",
"mr",
"mn",
"min",
"ne",
"new",
"nb",
"nn",
"oc",
"fa",
"pms",
"pl",
"pt",
"pa",
"ro",
"ru",
"sco",
"sr",
"scn",
"sk",
"sl",
"aze",
"es",
"su",
"sw",
"sv",
"tl",
"tg",
"th",
"ta",
"tt",
"te",
"tr",
"uk",
"ud",
"uz",
"vi",
"vo",
"war",
"cy",
"fry",
"pnb",
"yo",
"dataset:wikipedia",
"arxiv:1810.04805",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language:
- multilingual
- af
- sq
- ar
- an
- hy
- ast
- az
- ba
- eu
- bar
- be
- bn
- inc
- bs
- br
- bg
- my
- ca
- ceb
- ce
- zh
- cv
- hr
- cs
- da
- nl
- en
- et
- fi
- fr
- gl
- ka
- de
- el
- gu
- ht
- he
- hi
- hu
- is
- io
- id
- ga
- it
- ja
- jv
- kn
- kk
- ky
- ko
- la
- lv
- lt
- roa
- nds
- lm
- mk
- mg
- ms
- ml
- mr
- mn
- min
- ne
- new
- nb
- nn
- oc
- fa
- pms
- pl
- pt
- pa
- ro
- ru
- sco
- sr
- hr
- scn
- sk
- sl
- aze
- es
- su
- sw
- sv
- tl
- tg
- th
- ta
- tt
- te
- tr
- uk
- ud
- uz
- vi
- vo
- war
- cy
- fry
- pnb
- yo
license: apache-2.0
datasets:
- wikipedia
---
# BERT multilingual base model (cased)
Pretrained model on the top 104 languages with the largest Wikipedia using a masked language modeling (MLM) objective.
It was introduced in [this paper](https://arxiv.org/abs/1810.04805) and first released in
[this repository](https://github.com/google-research/bert). This model is case sensitive: it makes a difference
between english and English.
Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
BERT is a transformers model pretrained on a large corpus of multilingual data in a self-supervised fashion. This means
it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
was pretrained with two objectives:
- Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run
the entire masked sentence through the model and has to predict the masked words. This is different from traditional
recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like
GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the
sentence.
- Next sentence prediction (NSP): the models concatenates two masked sentences as inputs during pretraining. Sometimes
they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to
predict if the two sentences were following each other or not.
This way, the model learns an inner representation of the languages in the training set that can then be used to
extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a
standard classifier using the features produced by the BERT model as inputs.
## Intended uses & limitations
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=bert) to look for
fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='bert-base-multilingual-cased')
>>> unmasker("Hello I'm a [MASK] model.")
[{'sequence': "[CLS] Hello I'm a model model. [SEP]",
'score': 0.10182085633277893,
'token': 13192,
'token_str': 'model'},
{'sequence': "[CLS] Hello I'm a world model. [SEP]",
'score': 0.052126359194517136,
'token': 11356,
'token_str': 'world'},
{'sequence': "[CLS] Hello I'm a data model. [SEP]",
'score': 0.048930276185274124,
'token': 11165,
'token_str': 'data'},
{'sequence': "[CLS] Hello I'm a flight model. [SEP]",
'score': 0.02036019042134285,
'token': 23578,
'token_str': 'flight'},
{'sequence': "[CLS] Hello I'm a business model. [SEP]",
'score': 0.020079681649804115,
'token': 14155,
'token_str': 'business'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased')
model = BertModel.from_pretrained("bert-base-multilingual-cased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased')
model = TFBertModel.from_pretrained("bert-base-multilingual-cased")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
## Training data
The BERT model was pretrained on the 104 languages with the largest Wikipedias. You can find the complete list
[here](https://github.com/google-research/bert/blob/master/multilingual.md#list-of-languages).
## Training procedure
### Preprocessing
The texts are lowercased and tokenized using WordPiece and a shared vocabulary size of 110,000. The languages with a
larger Wikipedia are under-sampled and the ones with lower resources are oversampled. For languages like Chinese,
Japanese Kanji and Korean Hanja that don't have space, a CJK Unicode block is added around every character.
The inputs of the model are then of the form:
```
[CLS] Sentence A [SEP] Sentence B [SEP]
```
With probability 0.5, sentence A and sentence B correspond to two consecutive sentences in the original corpus and in
the other cases, it's another random sentence in the corpus. Note that what is considered a sentence here is a
consecutive span of text usually longer than a single sentence. The only constrain is that the result with the two
"sentences" has a combined length of less than 512 tokens.
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1810-04805,
author = {Jacob Devlin and
Ming{-}Wei Chang and
Kenton Lee and
Kristina Toutanova},
title = {{BERT:} Pre-training of Deep Bidirectional Transformers for Language
Understanding},
journal = {CoRR},
volume = {abs/1810.04805},
year = {2018},
url = {http://arxiv.org/abs/1810.04805},
archivePrefix = {arXiv},
eprint = {1810.04805},
timestamp = {Tue, 30 Oct 2018 20:39:56 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1810-04805.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
| [
-0.3475418984889984,
-0.7952669262886047,
0.16184143722057343,
0.343375027179718,
-0.41012120246887207,
0.07138051837682724,
-0.2665919065475464,
-0.30819544196128845,
0.3789016306400299,
0.5304887890815735,
-0.6878768801689148,
-0.40776360034942627,
-0.6420354843139648,
0.05182227864861488,
-0.40816593170166016,
1.2605631351470947,
0.09078648686408997,
0.2323085218667984,
0.03986406698822975,
0.08334987610578537,
-0.38395223021507263,
-0.9255403280258179,
-0.5611084699630737,
-0.2627730071544647,
0.44044485688209534,
0.2662082314491272,
0.5558180212974548,
0.41280633211135864,
0.4964340329170227,
0.3514321446418762,
-0.08958975970745087,
-0.12922538816928864,
-0.3389650881290436,
0.006862481590360403,
0.034285999834537506,
-0.40542274713516235,
-0.28487277030944824,
0.09942664206027985,
0.685721218585968,
0.8814366459846497,
0.03194648027420044,
0.1833055168390274,
-0.08676887303590775,
0.49483662843704224,
-0.24339911341667175,
0.2956909239292145,
-0.5261211395263672,
0.07666654884815216,
-0.28470954298973083,
0.2256450206041336,
-0.359592467546463,
-0.22489812970161438,
0.2732938826084137,
-0.5650635957717896,
0.28902146220207214,
0.14197689294815063,
1.2025997638702393,
0.00866506528109312,
-0.2394215613603592,
-0.180974081158638,
-0.47285929322242737,
0.7597755193710327,
-0.693366527557373,
0.35792458057403564,
0.4222744405269623,
0.16716068983078003,
-0.1424965113401413,
-1.0671794414520264,
-0.6341690421104431,
-0.16380952298641205,
-0.2164362668991089,
0.07665891945362091,
-0.06437712907791138,
0.0581965409219265,
0.3437669277191162,
0.3524285554885864,
-0.6336778998374939,
-0.014361563138663769,
-0.6284007430076599,
-0.4390711784362793,
0.6222304701805115,
-0.12663820385932922,
0.33269068598747253,
-0.42243263125419617,
-0.3961279094219208,
-0.34056663513183594,
-0.3916187584400177,
0.07736732810735703,
0.5134925246238708,
0.4286099374294281,
-0.22815090417861938,
0.6923665404319763,
-0.13396628201007843,
0.6433466672897339,
0.06397172063589096,
0.08577367663383484,
0.5335955023765564,
-0.2858215570449829,
-0.32437264919281006,
0.037262044847011566,
0.9062480330467224,
0.14270317554473877,
0.5005889534950256,
-0.153179332613945,
-0.12939299643039703,
-0.10652807354927063,
0.2115454524755478,
-0.7540029287338257,
-0.2625108063220978,
0.17945724725723267,
-0.5792002081871033,
-0.2254435122013092,
0.28517115116119385,
-0.5983150601387024,
0.04807865247130394,
-0.1155485138297081,
0.6095442175865173,
-0.44266071915626526,
-0.1992606818675995,
0.09689056128263474,
-0.28622791171073914,
0.1950584203004837,
-0.07327701896429062,
-0.9157432913780212,
0.20731064677238464,
0.611587643623352,
0.8346092700958252,
0.09888682514429092,
-0.38214802742004395,
-0.26325127482414246,
-0.22984683513641357,
-0.2897202670574188,
0.5422961711883545,
-0.2671535313129425,
-0.36629945039749146,
0.06330637633800507,
0.23762434720993042,
-0.1467975229024887,
-0.24863122403621674,
0.6126996874809265,
-0.5765612721443176,
0.5090647339820862,
-0.13750971853733063,
-0.5527198314666748,
-0.3794154226779938,
0.09218821674585342,
-0.6803433299064636,
1.1385257244110107,
0.1810665875673294,
-0.6742411851882935,
0.3850628733634949,
-0.7544570565223694,
-0.6304265260696411,
0.17511919140815735,
0.14326731860637665,
-0.496727854013443,
0.07570268213748932,
0.21227779984474182,
0.43537724018096924,
0.07520303875207901,
0.48186784982681274,
-0.2968364357948303,
-0.3736554980278015,
0.3413844406604767,
-0.31509140133857727,
1.0811545848846436,
0.26186758279800415,
-0.24304094910621643,
0.11370242387056351,
-0.7725946307182312,
0.0898616835474968,
0.13321149349212646,
-0.37617823481559753,
-0.20777451992034912,
-0.06530459970235825,
0.40874016284942627,
0.24353061616420746,
0.3761737048625946,
-0.6272813677787781,
0.23902162909507751,
-0.5923618674278259,
0.612335741519928,
0.7090105414390564,
-0.0551624558866024,
0.3002607226371765,
-0.272902250289917,
0.3713720142841339,
0.09681879729032516,
0.027197085320949554,
-0.2491074502468109,
-0.6767945289611816,
-0.93597012758255,
-0.29935047030448914,
0.6347411274909973,
0.6478854417800903,
-0.6354826092720032,
0.7200836539268494,
-0.2550114393234253,
-0.42471763491630554,
-0.698337197303772,
0.02721058577299118,
0.33572226762771606,
0.37694504857063293,
0.3512922525405884,
-0.4412436783313751,
-0.8685529232025146,
-0.9263791441917419,
-0.13614621758460999,
-0.28389883041381836,
-0.05294299125671387,
0.10959581285715103,
0.6714974641799927,
-0.2639620304107666,
0.8873759508132935,
-0.49527591466903687,
-0.2811388075351715,
-0.35340365767478943,
0.2674388885498047,
0.4688189625740051,
0.6542097330093384,
0.4440653920173645,
-0.7706225514411926,
-0.5576115846633911,
-0.2693154513835907,
-0.5925856828689575,
-0.031190279871225357,
-0.1484154313802719,
-0.21664628386497498,
0.3414192199707031,
0.5675612092018127,
-0.6971408128738403,
0.41663268208503723,
0.43924006819725037,
-0.39427539706230164,
0.4589119255542755,
-0.2746589779853821,
-0.08719146251678467,
-1.2427202463150024,
0.1796703040599823,
-0.16449938714504242,
-0.1896282583475113,
-0.7483524084091187,
0.05729450657963753,
-0.007840672507882118,
-0.1037161648273468,
-0.4920722544193268,
0.5657325387001038,
-0.41274702548980713,
-0.009596112184226513,
-0.03070833347737789,
-0.02503851056098938,
0.025724198669195175,
0.6660247445106506,
0.19005747139453888,
0.6459163427352905,
0.5618789792060852,
-0.5561909079551697,
0.4246276617050171,
0.4523313641548157,
-0.6604050397872925,
0.15485060214996338,
-0.7452452182769775,
0.14008890092372894,
-0.046071864664554596,
0.16627582907676697,
-1.0610090494155884,
-0.2788504660129547,
0.22548983991146088,
-0.6077292561531067,
0.2845880091190338,
-0.09628647565841675,
-0.6962854266166687,
-0.6182212829589844,
-0.14790305495262146,
0.38753190636634827,
0.5974891781806946,
-0.39749985933303833,
0.40949907898902893,
0.30074483156204224,
-0.27526625990867615,
-0.6621306538581848,
-0.885066568851471,
0.16816094517707825,
-0.1067364513874054,
-0.6132417917251587,
0.46088171005249023,
-0.2137245386838913,
-0.03175664693117142,
-0.09058178961277008,
0.20719437301158905,
-0.1527864784002304,
0.06460096687078476,
0.18203702569007874,
0.35328149795532227,
-0.24005132913589478,
0.13144183158874512,
-0.04189874604344368,
-0.019984936341643333,
0.12194095551967621,
-0.27096837759017944,
0.8136284947395325,
-0.08452577888965607,
-0.16913409531116486,
-0.29825690388679504,
0.44494733214378357,
0.4447813928127289,
-0.13771404325962067,
0.7402468919754028,
0.8196366429328918,
-0.4717974364757538,
0.10032685846090317,
-0.48883727192878723,
-0.1775517612695694,
-0.47739630937576294,
0.6116209626197815,
-0.497490793466568,
-0.8023822903633118,
0.7178690433502197,
0.3499321937561035,
-0.044030264019966125,
0.6693257093429565,
0.6585983633995056,
-0.180523082613945,
0.958122193813324,
0.6717755794525146,
-0.18173010647296906,
0.5279222130775452,
-0.21912282705307007,
0.37145864963531494,
-0.6788635849952698,
-0.41236987709999084,
-0.4153185784816742,
-0.23422890901565552,
-0.7176560759544373,
-0.20634081959724426,
0.18125209212303162,
0.2838137745857239,
-0.3553856611251831,
0.5466080904006958,
-0.44132936000823975,
0.27632734179496765,
1.0082345008850098,
0.1825430542230606,
-0.11781109869480133,
0.007894789800047874,
-0.28015172481536865,
-0.052880287170410156,
-0.569800078868866,
-0.3096601366996765,
1.153486728668213,
0.4442863166332245,
0.5980949401855469,
0.04150478541851044,
0.6655612587928772,
0.24240171909332275,
0.051073309034109116,
-0.7643953561782837,
0.5108485221862793,
-0.29579615592956543,
-0.9746264815330505,
-0.2820163667201996,
-0.20160534977912903,
-0.9901872873306274,
0.18954093754291534,
-0.25773486495018005,
-0.7863073348999023,
0.07753168791532516,
-0.19946689903736115,
-0.25639599561691284,
0.15747900307178497,
-0.8033800721168518,
0.9672203660011292,
-0.31508350372314453,
-0.03529539704322815,
0.03755437955260277,
-0.9299042820930481,
0.26609697937965393,
-0.13449501991271973,
0.10231240093708038,
0.005753540899604559,
0.3346128761768341,
0.942130446434021,
-0.47962307929992676,
0.9784131050109863,
-0.1365060657262802,
0.20231033861637115,
0.22224734723567963,
-0.1802530139684677,
0.23448482155799866,
-0.0036508317571133375,
0.12640461325645447,
0.4635472893714905,
-0.04309102147817612,
-0.41116803884506226,
-0.27900072932243347,
0.44318556785583496,
-0.8716108202934265,
-0.5696864724159241,
-0.5445805788040161,
-0.5879703760147095,
0.03910382091999054,
0.44663184881210327,
0.521237313747406,
0.3156411051750183,
-0.25157853960990906,
0.2476208508014679,
0.4988071918487549,
-0.37475505471229553,
0.7593984603881836,
0.37676817178726196,
-0.26876816153526306,
-0.4612513482570648,
0.7241557836532593,
0.08198951184749603,
0.11323395371437073,
0.5276806354522705,
0.11710574477910995,
-0.5221737623214722,
-0.2778043746948242,
-0.39812666177749634,
0.20059934258460999,
-0.6107081174850464,
-0.1541721522808075,
-0.7398027181625366,
-0.6233035326004028,
-0.7149664759635925,
0.01018705777823925,
-0.10446782410144806,
-0.6000515818595886,
-0.39484235644340515,
-0.15265505015850067,
0.3653007745742798,
0.5440965890884399,
-0.23397839069366455,
0.5058391094207764,
-0.727578341960907,
0.2953903079032898,
0.3218218982219696,
0.36477652192115784,
-0.23604990541934967,
-0.7150266170501709,
-0.3701205253601074,
0.12810096144676208,
-0.23234812915325165,
-0.7265552282333374,
0.572506844997406,
0.303069144487381,
0.6676813364028931,
0.43501392006874084,
-0.08825603872537613,
0.6972253322601318,
-0.6460147500038147,
0.9418131113052368,
0.1788778156042099,
-1.0975550413131714,
0.5541877746582031,
-0.13737620413303375,
0.17933650314807892,
0.342983603477478,
0.2812918722629547,
-0.6886712908744812,
-0.39794689416885376,
-0.8025835156440735,
-0.9248563647270203,
0.8165410757064819,
0.2534913420677185,
0.44122910499572754,
-0.06526870280504227,
0.2606760263442993,
0.06884172558784485,
0.35064730048179626,
-1.134942889213562,
-0.5163722634315491,
-0.5290321707725525,
-0.33900630474090576,
-0.2681054472923279,
-0.36626729369163513,
0.025730198249220848,
-0.3978481888771057,
0.6912097334861755,
0.1345699280500412,
0.5375550985336304,
0.10260150581598282,
-0.3155011236667633,
0.1309957355260849,
0.12092766165733337,
0.7705809473991394,
0.3790988028049469,
-0.4434051215648651,
-0.05117267742753029,
-0.00012319562665652484,
-0.6893408894538879,
-0.09784678369760513,
0.333950400352478,
-0.12042157351970673,
0.26625561714172363,
0.5391141772270203,
0.9614725708961487,
0.14287540316581726,
-0.5169350504875183,
0.5866100192070007,
0.1384088099002838,
-0.28627869486808777,
-0.416316956281662,
-0.09800811856985092,
-0.05601705610752106,
0.17394524812698364,
0.5022135376930237,
0.011960078962147236,
0.09997594356536865,
-0.5450925230979919,
0.38788312673568726,
0.3874308466911316,
-0.4044494330883026,
-0.2640247046947479,
0.7310298085212708,
0.12451858073472977,
-0.4599292576313019,
0.8415789008140564,
-0.15408097207546234,
-0.8475608229637146,
0.745310366153717,
0.6663697957992554,
0.9406945705413818,
-0.0926399976015091,
0.2875065803527832,
0.4667772948741913,
0.43494439125061035,
-0.0663912296295166,
0.3040866553783417,
0.17105327546596527,
-0.8922870755195618,
-0.4412328600883484,
-0.7490453720092773,
-0.17987670004367828,
0.2895815968513489,
-0.7104636430740356,
0.31428882479667664,
-0.36756324768066406,
-0.17320790886878967,
0.13911260664463043,
0.140864759683609,
-0.654037356376648,
0.36277711391448975,
0.1707470566034317,
0.9095851182937622,
-0.8938288688659668,
1.0444402694702148,
0.6885083317756653,
-0.6584075689315796,
-0.722685694694519,
-0.22757291793823242,
-0.3645060658454895,
-1.0675766468048096,
0.8710143566131592,
0.2727871835231781,
0.48628780245780945,
0.007086924742907286,
-0.5888292789459229,
-0.8587489724159241,
0.7131157517433167,
0.1477586328983307,
-0.43617454171180725,
-0.14276912808418274,
0.1845501810312271,
0.5683006048202515,
-0.4217282235622406,
0.294220507144928,
0.392924427986145,
0.459602028131485,
0.012824255041778088,
-0.8482683897018433,
-0.046647973358631134,
-0.37056341767311096,
0.09994487464427948,
0.05838463455438614,
-0.5323374271392822,
1.1354730129241943,
-0.1655551940202713,
-0.052477605640888214,
0.14181853830814362,
0.5964734554290771,
0.12408256530761719,
0.042144209146499634,
0.39417144656181335,
0.5390657782554626,
0.6703711748123169,
-0.30045512318611145,
0.8591828346252441,
-0.32317325472831726,
0.5586167573928833,
0.8932262659072876,
0.03908845782279968,
0.8521180748939514,
0.4781896770000458,
-0.20007839798927307,
0.8366379737854004,
0.8790639638900757,
-0.36733478307724,
0.8275549411773682,
0.20462121069431305,
0.0004599680542014539,
-0.1281745284795761,
0.14794357120990753,
-0.4232219457626343,
0.4838826656341553,
0.31664785742759705,
-0.4608893096446991,
0.008067459799349308,
0.09633807837963104,
0.15723709762096405,
-0.20790322124958038,
-0.27740880846977234,
0.6987866163253784,
0.08456725627183914,
-0.7478992342948914,
0.3987288177013397,
0.23448602855205536,
0.7188184261322021,
-0.6241214871406555,
0.0917462706565857,
-0.26088109612464905,
0.13479264080524445,
0.0016483379295095801,
-0.7681456804275513,
0.2318526655435562,
-0.1308748722076416,
-0.3935743570327759,
-0.3476831912994385,
0.6423452496528625,
-0.604012668132782,
-0.7523242235183716,
0.14672395586967468,
0.36304304003715515,
0.3336217999458313,
-0.07113106548786163,
-0.8285208344459534,
-0.16189396381378174,
0.039817553013563156,
-0.26537689566612244,
0.17528828978538513,
0.3464106321334839,
-0.06047135591506958,
0.5985178351402283,
0.7771521210670471,
0.010503493249416351,
0.20430928468704224,
0.17346832156181335,
0.7067681550979614,
-0.8083493113517761,
-0.6986900568008423,
-0.8678010702133179,
0.5690791010856628,
-0.11772362142801285,
-0.44023850560188293,
0.6450955867767334,
0.6690309643745422,
0.9207101464271545,
-0.3076080083847046,
0.7621756196022034,
-0.21905949711799622,
0.49943262338638306,
-0.5213510394096375,
0.8526010513305664,
-0.43156346678733826,
-0.011108798906207085,
-0.27587997913360596,
-0.8471035361289978,
-0.3360404670238495,
0.8664646148681641,
-0.017446741461753845,
0.13311469554901123,
0.7476553320884705,
0.6094934940338135,
0.023968398571014404,
-0.1866448074579239,
0.26906198263168335,
0.2634080946445465,
0.12066341936588287,
0.4703744053840637,
0.5758297443389893,
-0.6511999368667603,
0.5475677847862244,
-0.3250845968723297,
-0.03342144563794136,
-0.3178345561027527,
-0.8570328950881958,
-1.1037694215774536,
-0.7411666512489319,
-0.308064728975296,
-0.5124823451042175,
-0.09326276928186417,
0.8133309483528137,
0.798134982585907,
-1.0312703847885132,
-0.31380942463874817,
-0.09501998871564865,
0.16006916761398315,
-0.20671959221363068,
-0.2739590108394623,
0.4597046673297882,
-0.4090520739555359,
-0.8549275994300842,
0.18029125034809113,
-0.060435082763433456,
0.24185551702976227,
-0.24841029942035675,
0.059301599860191345,
-0.43558740615844727,
0.04180355742573738,
0.5615731477737427,
0.18169201910495758,
-0.7791985273361206,
-0.4187515079975128,
0.11810898780822754,
-0.2215009331703186,
0.03375021368265152,
0.5551286935806274,
-0.6609391570091248,
0.45586177706718445,
0.40247055888175964,
0.42732465267181396,
0.7459125518798828,
-0.09595488756895065,
0.6058559417724609,
-1.0965800285339355,
0.4079567492008209,
0.06613986939191818,
0.4369070529937744,
0.3341060280799866,
-0.34272029995918274,
0.42643365263938904,
0.4314866364002228,
-0.4452577531337738,
-0.8376607298851013,
0.014157626777887344,
-1.0312962532043457,
-0.33362895250320435,
1.0182493925094604,
-0.27214571833610535,
-0.14443768560886383,
-0.09954711049795151,
-0.225042924284935,
0.43866339325904846,
-0.2505674660205841,
0.7547085285186768,
1.0351332426071167,
0.19245263934135437,
-0.12998391687870026,
-0.3589016795158386,
0.4359149932861328,
0.347872793674469,
-0.5342350006103516,
-0.3388129472732544,
0.20369596779346466,
0.3755183219909668,
0.3057102859020233,
0.5395206809043884,
0.020296739414334297,
0.09522436559200287,
0.013405324891209602,
0.33715584874153137,
0.014244546182453632,
-0.22151312232017517,
-0.31680309772491455,
0.03831614553928375,
-0.233714297413826,
-0.5461620092391968
] |
trpakov/vit-face-expression | trpakov | "2022-11-09T12:56:19Z" | 4,056,771 | 4 | transformers | [
"transformers",
"pytorch",
"vit",
"image-classification",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | image-classification | "2022-11-09T12:50:30Z" | Entry not found | [
-0.3227650225162506,
-0.22568431496620178,
0.862226128578186,
0.43461495637893677,
-0.5282987952232361,
0.7012965679168701,
0.7915717363357544,
0.07618638128042221,
0.7746025919914246,
0.2563219666481018,
-0.7852817177772522,
-0.22573819756507874,
-0.9104480743408203,
0.5715669393539429,
-0.3992334008216858,
0.5791245698928833,
-0.14494505524635315,
-0.10751161724328995,
0.28233757615089417,
-0.2768954336643219,
-0.5409224033355713,
-0.36855220794677734,
-1.1902776956558228,
0.061491113156080246,
0.5316578149795532,
0.7435142397880554,
0.7584060430526733,
0.3652167320251465,
0.6432578563690186,
0.3932291269302368,
-0.23138920962810516,
0.4827055037021637,
-0.04171813279390335,
0.00260411505587399,
-0.3524433970451355,
-0.5516898036003113,
-0.28596609830856323,
0.07584730535745621,
1.0961304903030396,
0.966687798500061,
-0.284663587808609,
0.05330817773938179,
-0.3063621520996094,
0.33088892698287964,
-0.49734312295913696,
0.3054099678993225,
-0.022506045177578926,
0.16318801045417786,
-0.7041513919830322,
-0.5535354018211365,
0.012794834561645985,
-0.7361212968826294,
0.17926570773124695,
-0.690081000328064,
0.8269098401069641,
0.18583157658576965,
1.1533750295639038,
0.14819414913654327,
-0.462487131357193,
-0.8161764144897461,
-0.6538989543914795,
0.5711171627044678,
-0.32703715562820435,
0.39680248498916626,
0.7028235197067261,
-0.048573412001132965,
-0.9820332527160645,
-0.6745741367340088,
-0.46466192603111267,
0.2923962473869324,
0.35402774810791016,
-0.3411678075790405,
-0.17522086203098297,
-0.3058989644050598,
0.15792037546634674,
0.12811517715454102,
-0.4841994643211365,
-0.5543919205665588,
-0.5475160479545593,
-0.3960252106189728,
0.6206658482551575,
0.3482950031757355,
0.2429177463054657,
-0.1888415813446045,
-0.3228583335876465,
0.0880163162946701,
-0.4160851538181305,
0.3402571678161621,
0.6335517168045044,
0.7114017009735107,
-0.5811444520950317,
0.560215950012207,
-0.04927587881684303,
0.7439703941345215,
0.11445561796426773,
-0.27478092908859253,
0.41460567712783813,
-0.14724725484848022,
0.055171746760606766,
0.4226345121860504,
0.31524422764778137,
0.2841312289237976,
-0.3273695111274719,
0.2032228708267212,
-0.3215144872665405,
-0.30496224761009216,
-0.22332167625427246,
-0.29490774869918823,
-0.3592180609703064,
0.5492289066314697,
-0.3314017057418823,
-0.42855486273765564,
1.143175721168518,
-0.4200771450996399,
-0.7302224040031433,
0.33156412839889526,
0.4065209925174713,
-0.0994480773806572,
-0.37146568298339844,
-0.052260834723711014,
-0.8458789587020874,
-0.007907390594482422,
0.7491172552108765,
-0.7198970913887024,
0.3371737599372864,
0.4728063642978668,
0.7417217493057251,
0.19650575518608093,
-0.14034469425678253,
-0.42949390411376953,
0.2971969544887543,
-0.8659994006156921,
0.6320174336433411,
-0.20135220885276794,
-1.0051977634429932,
0.11150479316711426,
0.8971705436706543,
-0.37896400690078735,
-1.2094876766204834,
1.0605159997940063,
-0.6887932419776917,
0.16017857193946838,
-0.676761269569397,
-0.14661237597465515,
-0.07118501514196396,
-0.005096632521599531,
-0.6088156700134277,
0.7567102313041687,
0.587267279624939,
-0.4995276927947998,
0.21429483592510223,
-0.26029831171035767,
-0.39151400327682495,
0.38824859261512756,
-0.07935450226068497,
-0.21858926117420197,
0.713833212852478,
-0.6647079586982727,
-0.26932814717292786,
0.2942774295806885,
0.2368936538696289,
-0.35706108808517456,
-0.7931919097900391,
0.08478113263845444,
-0.05786270648241043,
1.550750494003296,
-0.03868847340345383,
-0.3586106300354004,
-0.679383397102356,
-1.1506240367889404,
-0.07070787996053696,
0.6886883974075317,
-0.9194989204406738,
-0.27839475870132446,
-0.046410128474235535,
-0.26169314980506897,
0.08994917571544647,
0.7390589714050293,
-1.1194051504135132,
0.2832726836204529,
-0.05092663690447807,
-0.22794683277606964,
0.8271058797836304,
0.15387225151062012,
0.24758946895599365,
0.14913396537303925,
0.42958706617355347,
0.527725338935852,
0.11115207523107529,
0.683587908744812,
-0.34720373153686523,
-0.9694353938102722,
0.6154631972312927,
0.25266361236572266,
0.8121447563171387,
-0.49945297837257385,
0.2685093879699707,
0.27025535702705383,
-0.3409680724143982,
-0.5682371854782104,
-0.3102838397026062,
0.09025752544403076,
0.14930562674999237,
0.11142510175704956,
-0.5721710324287415,
-0.6576125025749207,
-0.9689140319824219,
-0.13590654730796814,
-0.4314374029636383,
-0.3571570813655853,
0.21006910502910614,
0.5792906284332275,
-1.1975523233413696,
0.4128875136375427,
-0.7705625891685486,
-0.7038741111755371,
-0.01065548975020647,
-0.19338123500347137,
0.7540656328201294,
0.43240174651145935,
0.5033966898918152,
-0.6397148370742798,
-0.5661987066268921,
-0.22470176219940186,
-1.0333747863769531,
-0.13280506432056427,
0.24819621443748474,
0.3065737783908844,
-0.13423344492912292,
-0.2744963765144348,
-0.48740333318710327,
0.8100387454032898,
0.14789170026779175,
-0.5391897559165955,
0.5220767259597778,
-0.3020317256450653,
0.17224803566932678,
-0.6369150280952454,
-0.06916818022727966,
-0.661676287651062,
-0.0009071884560398757,
-0.3608308732509613,
-0.5737438797950745,
0.14772287011146545,
0.07017494738101959,
-0.16065457463264465,
0.28808408975601196,
-0.909277081489563,
-0.0010852962732315063,
-0.7442210912704468,
0.379071980714798,
0.06394772231578827,
-0.3145078718662262,
-0.017517540603876114,
1.0000386238098145,
0.7784460783004761,
-0.3848048746585846,
0.721744179725647,
0.4440041184425354,
0.19036155939102173,
0.7630521059036255,
-0.18725109100341797,
0.16478213667869568,
-0.5245416760444641,
-0.12161104381084442,
-0.8887597918510437,
-1.0982946157455444,
0.7320570349693298,
-0.6114250421524048,
0.36542922258377075,
-0.4277869760990143,
0.2589159905910492,
-0.6919258832931519,
-0.03885362669825554,
0.4808599352836609,
-0.05936325341463089,
-0.6863942742347717,
0.5232570171356201,
0.45317530632019043,
-0.2019241601228714,
-0.6609031558036804,
-0.530157208442688,
0.39365822076797485,
0.6154114007949829,
-0.16390392184257507,
0.06878514587879181,
0.14941060543060303,
-0.5441926121711731,
-0.040802597999572754,
-0.38691970705986023,
-0.45766758918762207,
0.054224006831645966,
0.13053473830223083,
-0.005750799085944891,
-0.404820054769516,
-0.0868026465177536,
-0.35842007398605347,
-0.4656120240688324,
0.21876516938209534,
0.3011947274208069,
-0.04096309468150139,
-0.42599788308143616,
-0.3619818687438965,
-0.888181209564209,
0.6719610095024109,
0.5370282530784607,
0.05281545966863632,
0.7555549740791321,
0.16819314658641815,
-0.8014987707138062,
-0.13532210886478424,
-0.1760706603527069,
0.2696830928325653,
-0.5588056445121765,
0.13849826157093048,
-0.013484534807503223,
-0.0637492910027504,
0.26297882199287415,
0.25386232137680054,
-0.4300556778907776,
0.9276250004768372,
-0.2615274488925934,
-0.3592521846294403,
0.7960181832313538,
0.5974742770195007,
0.49583131074905396,
0.16503219306468964,
-0.044541798532009125,
0.900709331035614,
-1.1966516971588135,
-0.6563175916671753,
-0.7409549355506897,
-0.15945707261562347,
-0.43510833382606506,
-0.032105933874845505,
0.6254412531852722,
0.2900990843772888,
-0.1333388388156891,
0.4756395220756531,
-0.5243489742279053,
0.3556033670902252,
1.01198410987854,
0.35748639702796936,
0.3435698449611664,
-0.7570229172706604,
-0.2515777349472046,
-0.1402427852153778,
-0.9998157620429993,
-0.2631377875804901,
0.8871029019355774,
0.22752606868743896,
0.844460666179657,
0.5992541313171387,
0.6784542798995972,
0.1367226243019104,
0.2523828148841858,
-0.30590319633483887,
0.3920294940471649,
0.4376082420349121,
-1.0401138067245483,
-0.42758408188819885,
0.021418681368231773,
-0.9703338742256165,
-0.14227519929409027,
-0.03495011106133461,
-0.42617112398147583,
0.7681737542152405,
0.00016589462757110596,
-0.4076709747314453,
0.7732734084129333,
-0.455583393573761,
0.7562873363494873,
-0.4473648965358734,
-0.02663906291127205,
0.4699096083641052,
-0.7070636749267578,
0.4677430987358093,
0.12878790497779846,
0.6205843091011047,
-0.015572631731629372,
-0.04078587517142296,
0.7104941606521606,
-0.9129160046577454,
0.25438642501831055,
-0.6348397135734558,
0.22421300411224365,
0.24246945977210999,
0.51606285572052,
0.5969953536987305,
0.4371243417263031,
0.10119888931512833,
-0.23920902609825134,
0.04115807265043259,
-0.8241125345230103,
-0.210506409406662,
0.697515606880188,
-0.7186890840530396,
-0.6864197850227356,
-1.2355337142944336,
0.14438660442829132,
0.27347055077552795,
0.389305055141449,
0.7959296107292175,
0.571408748626709,
0.1289544403553009,
0.680525004863739,
0.9888588190078735,
-0.0688566341996193,
0.9166924357414246,
0.3224477171897888,
0.09175168722867966,
-0.21944808959960938,
0.7036820650100708,
0.26627904176712036,
-0.24707956612110138,
-0.11939732730388641,
0.20913465321063995,
-0.11069409549236298,
-0.591761589050293,
-0.49990686774253845,
0.3701757788658142,
-0.6731787919998169,
-0.18303893506526947,
-0.6243735551834106,
-0.6043769717216492,
-0.511759340763092,
0.06927360594272614,
-0.7147687673568726,
0.23979046940803528,
-0.7753565907478333,
-0.10574902594089508,
0.04323432594537735,
0.9792009592056274,
-0.589311957359314,
0.5805224180221558,
-1.1218582391738892,
0.19345788657665253,
-0.07949887961149216,
0.7921058535575867,
0.21395787596702576,
-0.7344395518302917,
-0.3975418508052826,
-0.11592631042003632,
-0.3729911744594574,
-1.3576762676239014,
0.21404948830604553,
-0.2454141080379486,
0.23094046115875244,
0.6145404577255249,
0.1397707313299179,
0.5258248448371887,
-0.34326282143592834,
0.7029101848602295,
-0.057017259299755096,
-0.7069286704063416,
0.7934495210647583,
-0.5026894807815552,
0.4963534474372864,
0.9765996932983398,
0.5333835482597351,
-0.7984007596969604,
0.035741209983825684,
-1.041123390197754,
-0.6008695363998413,
0.38426393270492554,
0.11928944289684296,
-0.03601083159446716,
-0.6659559011459351,
-0.054019637405872345,
-0.16143807768821716,
0.6043745279312134,
-1.039069414138794,
-0.7858356237411499,
0.2576698362827301,
0.5277302861213684,
0.0816856250166893,
-0.5653398633003235,
0.20880667865276337,
-0.544416069984436,
1.0657774209976196,
0.45109400153160095,
0.3274499475955963,
0.8406060934066772,
0.46492424607276917,
-0.3823164403438568,
0.09252490103244781,
0.7662695050239563,
0.6666232347488403,
-0.5239797830581665,
-0.2908027470111847,
-0.08827541768550873,
-0.9143403768539429,
0.05927472561597824,
0.11168918758630753,
-0.013455932028591633,
0.9082110524177551,
0.5793083310127258,
0.2539709210395813,
0.4514279365539551,
-0.726460337638855,
0.8859451413154602,
-0.14954176545143127,
-0.12472866475582123,
-1.0677239894866943,
0.1948619782924652,
-0.23984959721565247,
0.5006402134895325,
1.0061326026916504,
0.5250048041343689,
-0.047630298882722855,
-0.8143380880355835,
-0.01473585981875658,
0.6939172148704529,
-0.7091123461723328,
-0.17449834942817688,
0.944853663444519,
0.3847099542617798,
-1.2953051328659058,
1.106776475906372,
-0.5381771326065063,
-0.560332179069519,
0.9121301770210266,
0.522956907749176,
1.1221847534179688,
-0.44204121828079224,
0.0008676342549733818,
0.2662237286567688,
0.41378432512283325,
0.5423170328140259,
1.0869629383087158,
0.431413471698761,
-0.7931063771247864,
0.8826584815979004,
-0.24776044487953186,
-0.40361151099205017,
-0.05347571521997452,
-0.42859897017478943,
0.16892178356647491,
-0.4406192898750305,
-0.10713007301092148,
-0.3444187641143799,
0.28543180227279663,
-0.7072042226791382,
0.42807620763778687,
-0.0838567465543747,
0.8653068542480469,
-0.8553727269172668,
0.47207626700401306,
0.635470449924469,
-0.3337355852127075,
-0.8508191108703613,
-0.26198428869247437,
-0.11448462307453156,
-0.6389466524124146,
0.30214807391166687,
-0.4554102420806885,
0.044398851692676544,
0.09623463451862335,
-0.649151623249054,
-1.1778275966644287,
0.9093633890151978,
-0.639612078666687,
-0.2784462869167328,
0.20464053750038147,
-0.11514760553836823,
0.28811705112457275,
-0.2524643540382385,
0.010661216452717781,
0.41876548528671265,
0.748940110206604,
0.2844654619693756,
-0.7727053761482239,
-0.3694884479045868,
0.0015032943338155746,
-0.44474777579307556,
0.7582978010177612,
-0.6002101898193359,
1.1840779781341553,
-0.5563543438911438,
-0.059654366225004196,
0.44384512305259705,
0.24690914154052734,
0.21076197922229767,
0.6629220843315125,
0.1442081481218338,
0.7282265424728394,
1.07012140750885,
-0.40835219621658325,
0.8811809420585632,
0.26432839035987854,
0.47430819272994995,
0.7238501906394958,
-0.6487724781036377,
0.7513749003410339,
0.31810489296913147,
-0.5682924389839172,
0.9228013753890991,
1.2906063795089722,
-0.15699204802513123,
0.8079374432563782,
0.05136508867144585,
-1.081600546836853,
0.325833261013031,
-0.20724765956401825,
-0.7530064582824707,
0.3150254189968109,
0.19055864214897156,
-0.6920982599258423,
-0.5770308971405029,
-0.24046507477760315,
-0.35662803053855896,
-0.11552901566028595,
-0.7631728649139404,
0.6720563769340515,
-0.016969164833426476,
-0.5103683471679688,
0.18857547640800476,
0.2877499461174011,
0.17368432879447937,
-0.5235732793807983,
-0.02939440682530403,
-0.22823619842529297,
0.2660655975341797,
-0.5670853853225708,
-0.5234526991844177,
0.5724433064460754,
-0.32430219650268555,
-0.5343255400657654,
0.18147465586662292,
0.763587236404419,
-0.16923809051513672,
-0.4515409469604492,
0.32472723722457886,
0.6959525346755981,
0.1665852814912796,
0.4250282347202301,
-0.23511263728141785,
0.24480605125427246,
-0.08044824004173279,
-0.06651552021503448,
0.27714768052101135,
0.3449169099330902,
0.22435641288757324,
0.4450142979621887,
0.43285664916038513,
-0.01808755099773407,
-0.10736498981714249,
-0.382819801568985,
0.4124940037727356,
-0.9542785882949829,
-0.5713282823562622,
-0.6307113766670227,
0.2740660607814789,
-0.02315417304635048,
-1.0836423635482788,
0.4145168364048004,
1.4406683444976807,
1.0359982252120972,
-0.4756383001804352,
1.067226529121399,
-0.21818485856056213,
0.9594791531562805,
0.41483086347579956,
0.5420440435409546,
-0.6030411720275879,
0.03835370019078255,
-0.4364396035671234,
-1.076962947845459,
-0.35716333985328674,
0.4539391100406647,
-0.022899555042386055,
-0.3429867625236511,
0.872571587562561,
0.5887166261672974,
-0.33473607897758484,
-0.11728022992610931,
0.048487238585948944,
-0.029941488057374954,
-0.12433847039937973,
0.5145376324653625,
0.7648399472236633,
-0.9344304800033569,
-0.10680416971445084,
-0.21577754616737366,
-0.6382725834846497,
-0.5047279000282288,
-0.9632009267807007,
-0.12959396839141846,
-0.16037796437740326,
0.035343267023563385,
-0.5662806630134583,
0.00255737011320889,
1.208324909210205,
0.5684957504272461,
-1.1113994121551514,
-0.5303789377212524,
0.3371853232383728,
0.3920421898365021,
-0.1874791383743286,
-0.24202413856983185,
0.2984568774700165,
0.15382249653339386,
-0.5908876657485962,
0.6875665783882141,
0.8089625239372253,
0.208888977766037,
0.19554761052131653,
0.15893013775348663,
-0.8229473829269409,
-0.14913435280323029,
0.17440445721149445,
0.9450570344924927,
-0.939853310585022,
-0.7114843130111694,
-0.03168516233563423,
-0.27094873785972595,
-0.05765746906399727,
0.17102102935314178,
-0.4046344757080078,
0.5180677175521851,
0.34591493010520935,
0.49933457374572754,
0.0561608150601387,
-0.054746925830841064,
0.5409556031227112,
-0.9069057703018188,
0.09425963461399078,
0.4134361147880554,
0.4154115319252014,
-0.4000864028930664,
-0.5910194516181946,
0.6713420748710632,
1.0073972940444946,
-0.6594868898391724,
-0.8743268847465515,
-0.19846712052822113,
-1.0016002655029297,
0.04189709946513176,
0.6762762069702148,
0.5009527802467346,
-0.4806513786315918,
-0.4174500107765198,
-0.5617399215698242,
-0.1254672110080719,
-0.1369970738887787,
0.7621601819992065,
1.179680585861206,
-0.7432094812393188,
0.07975747436285019,
-1.038639783859253,
0.6594986915588379,
-0.2419457733631134,
-0.3457581698894501,
-0.48644304275512695,
0.3832802176475525,
0.35236993432044983,
0.440481036901474,
0.614812433719635,
0.1408471167087555,
0.8338426351547241,
0.3126053214073181,
-0.1702686995267868,
0.2698982357978821,
-0.4559200704097748,
-0.028932858258485794,
-0.057962555438280106,
0.31015971302986145,
-1.0262157917022705
] |
pyannote/speaker-diarization | pyannote | "2023-10-04T18:53:17Z" | 3,790,498 | 553 | pyannote-audio | [
"pyannote-audio",
"pyannote",
"pyannote-audio-pipeline",
"audio",
"voice",
"speech",
"speaker",
"speaker-diarization",
"speaker-change-detection",
"voice-activity-detection",
"overlapped-speech-detection",
"automatic-speech-recognition",
"dataset:ami",
"dataset:dihard",
"dataset:voxconverse",
"dataset:aishell",
"dataset:repere",
"dataset:voxceleb",
"arxiv:2012.01477",
"arxiv:2110.07058",
"arxiv:2005.08072",
"license:mit",
"has_space",
"region:us"
] | automatic-speech-recognition | "2022-03-02T23:29:05Z" | ---
tags:
- pyannote
- pyannote-audio
- pyannote-audio-pipeline
- audio
- voice
- speech
- speaker
- speaker-diarization
- speaker-change-detection
- voice-activity-detection
- overlapped-speech-detection
- automatic-speech-recognition
datasets:
- ami
- dihard
- voxconverse
- aishell
- repere
- voxceleb
license: mit
extra_gated_prompt: "The collected information will help acquire a better knowledge of pyannote.audio userbase and help its maintainers apply for grants to improve it further. If you are an academic researcher, please cite the relevant papers in your own publications using the model. If you work for a company, please consider contributing back to pyannote.audio development (e.g. through unrestricted gifts). We also provide scientific consulting services around speaker diarization and machine listening."
extra_gated_fields:
Company/university: text
Website: text
I plan to use this model for (task, type of audio data, etc): text
---
Using this open-source pipeline in production?
Make the most of it thanks to our [consulting services](https://herve.niderb.fr/consulting.html).
# 🎹 Speaker diarization
Relies on pyannote.audio 2.1.1: see [installation instructions](https://github.com/pyannote/pyannote-audio#installation).
## TL;DR
```python
# 1. visit hf.co/pyannote/speaker-diarization and accept user conditions
# 2. visit hf.co/pyannote/segmentation and accept user conditions
# 3. visit hf.co/settings/tokens to create an access token
# 4. instantiate pretrained speaker diarization pipeline
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained("pyannote/[email protected]",
use_auth_token="ACCESS_TOKEN_GOES_HERE")
# apply the pipeline to an audio file
diarization = pipeline("audio.wav")
# dump the diarization output to disk using RTTM format
with open("audio.rttm", "w") as rttm:
diarization.write_rttm(rttm)
```
## Advanced usage
In case the number of speakers is known in advance, one can use the `num_speakers` option:
```python
diarization = pipeline("audio.wav", num_speakers=2)
```
One can also provide lower and/or upper bounds on the number of speakers using `min_speakers` and `max_speakers` options:
```python
diarization = pipeline("audio.wav", min_speakers=2, max_speakers=5)
```
## Benchmark
### Real-time factor
Real-time factor is around 2.5% using one Nvidia Tesla V100 SXM2 GPU (for the neural inference part) and one Intel Cascade Lake 6248 CPU (for the clustering part).
In other words, it takes approximately 1.5 minutes to process a one hour conversation.
### Accuracy
This pipeline is benchmarked on a growing collection of datasets.
Processing is fully automatic:
* no manual voice activity detection (as is sometimes the case in the literature)
* no manual number of speakers (though it is possible to provide it to the pipeline)
* no fine-tuning of the internal models nor tuning of the pipeline hyper-parameters to each dataset
... with the least forgiving diarization error rate (DER) setup (named *"Full"* in [this paper](https://doi.org/10.1016/j.csl.2021.101254)):
* no forgiveness collar
* evaluation of overlapped speech
| Benchmark | [DER%](. "Diarization error rate") | [FA%](. "False alarm rate") | [Miss%](. "Missed detection rate") | [Conf%](. "Speaker confusion rate") | Expected output | File-level evaluation |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | --------------------------- | ---------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [AISHELL-4](http://www.openslr.org/111/) | 14.09 | 5.17 | 3.27 | 5.65 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AISHELL.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AISHELL.test.eval) |
| [Albayzin (*RTVE 2022*)](http://catedrartve.unizar.es/albayzindatabases.html) | 25.60 | 5.58 | 6.84 | 13.18 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/Albayzin2022.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/Albayzin2022.test.eval) |
| [AliMeeting (*channel 1*)](https://www.openslr.org/119/) | 27.42 | 4.84 | 14.00 | 8.58 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AliMeeting.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AliMeeting.test.eval) |
| [AMI (*headset mix,*](https://groups.inf.ed.ac.uk/ami/corpus/) [*only_words*)](https://github.com/BUTSpeechFIT/AMI-diarization-setup) | 18.91 | 4.48 | 9.51 | 4.91 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AMI.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AMI.test.eval) |
| [AMI (*array1, channel 1,*](https://groups.inf.ed.ac.uk/ami/corpus/) [*only_words)*](https://github.com/BUTSpeechFIT/AMI-diarization-setup) | 27.12 | 4.11 | 17.78 | 5.23 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AMI-SDM.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/AMI-SDM.test.eval) |
| [CALLHOME](https://catalog.ldc.upenn.edu/LDC2001S97) [(*part2*)](https://github.com/BUTSpeechFIT/CALLHOME_sublists/issues/1) | 32.37 | 6.30 | 13.72 | 12.35 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/CALLHOME.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/CALLHOME.test.eval) |
| [DIHARD 3 (*Full*)](https://arxiv.org/abs/2012.01477) | 26.94 | 10.50 | 8.41 | 8.03 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/DIHARD.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/DIHARD.test.eval) |
| [Ego4D *v1 (validation)*](https://arxiv.org/abs/2110.07058) | 63.99 | 3.91 | 44.42 | 15.67 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/Ego4D.development.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/Ego4D.development.eval) |
| [REPERE (*phase 2*)](https://islrn.org/resources/360-758-359-485-0/) | 8.17 | 2.23 | 2.49 | 3.45 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/REPERE.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/REPERE.test.eval) |
| [This American Life](https://arxiv.org/abs/2005.08072) | 20.82 | 2.03 | 11.89 | 6.90 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/ThisAmericanLife.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/2.1.1/reproducible_research/2.1.1/ThisAmericanLife.test.eval) |
| [VoxConverse (*v0.3*)](https://github.com/joonson/voxconverse) | 11.24 | 4.42 | 2.88 | 3.94 | [RTTM](https://huggingface.co/pyannote/speaker-diarization/blob/main/reproducible_research/2.1.1/VoxConverse.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization/blob/main/reproducible_research/2.1.1/VoxConverse.test.eval) |
## Technical report
This [report](technical_report_2.1.pdf) describes the main principles behind version `2.1` of pyannote.audio speaker diarization pipeline.
It also provides recipes explaining how to adapt the pipeline to your own set of annotated data. In particular, those are applied to the above benchmark and consistently leads to significant performance improvement over the above out-of-the-box performance.
## Citations
```bibtex
@inproceedings{Bredin2021,
Title = {{End-to-end speaker segmentation for overlap-aware resegmentation}},
Author = {{Bredin}, Herv{\'e} and {Laurent}, Antoine},
Booktitle = {Proc. Interspeech 2021},
Address = {Brno, Czech Republic},
Month = {August},
Year = {2021},
}
```
```bibtex
@inproceedings{Bredin2020,
Title = {{pyannote.audio: neural building blocks for speaker diarization}},
Author = {{Bredin}, Herv{\'e} and {Yin}, Ruiqing and {Coria}, Juan Manuel and {Gelly}, Gregory and {Korshunov}, Pavel and {Lavechin}, Marvin and {Fustes}, Diego and {Titeux}, Hadrien and {Bouaziz}, Wassim and {Gill}, Marie-Philippe},
Booktitle = {ICASSP 2020, IEEE International Conference on Acoustics, Speech, and Signal Processing},
Address = {Barcelona, Spain},
Month = {May},
Year = {2020},
}
```
| [
-0.6493508815765381,
-0.7479451298713684,
0.10091114044189453,
0.53783118724823,
-0.17286746203899384,
0.033714570105075836,
-0.5556049942970276,
-0.3532935380935669,
0.5969036817550659,
0.38563060760498047,
-0.3841119706630707,
-0.7813142538070679,
-0.4215218424797058,
0.09837833046913147,
-0.19747917354106903,
0.7713229060173035,
0.38714295625686646,
-0.032664719969034195,
0.13546621799468994,
0.01357599999755621,
-0.27754828333854675,
-0.2607242465019226,
-0.5019920468330383,
-0.16300788521766663,
0.13774360716342926,
0.6150992512702942,
0.3418635427951813,
0.8306995034217834,
0.3151446580886841,
0.33330971002578735,
-0.4734201729297638,
0.11315125972032547,
-0.01707310974597931,
-0.08051120489835739,
0.06542737782001495,
-0.00842057354748249,
-0.5949248671531677,
0.13679510354995728,
0.865541398525238,
0.6700475215911865,
-0.23585273325443268,
0.26570969820022583,
0.04985218495130539,
0.6023703813552856,
-0.21254995465278625,
0.25778889656066895,
-0.7095785140991211,
-0.16756165027618408,
-0.558272659778595,
-0.2381466180086136,
-0.20918896794319153,
-0.3160792291164398,
0.14776849746704102,
-0.587175726890564,
0.11447466164827347,
0.08604077249765396,
1.1550425291061401,
0.0696709007024765,
-0.05723327025771141,
-0.12264023721218109,
-0.7262941598892212,
0.7669056057929993,
-1.0159146785736084,
0.4325703978538513,
0.6526621580123901,
-0.025777513161301613,
-0.26186230778694153,
-0.635247528553009,
-0.8179705142974854,
-0.06958413124084473,
-0.26964637637138367,
0.2683248221874237,
-0.10528244078159332,
0.11574629694223404,
0.371751993894577,
0.5547803044319153,
-0.6333694458007812,
-0.03231516480445862,
-0.5407596230506897,
-0.46688997745513916,
0.8044727444648743,
-0.17626814544200897,
0.45941242575645447,
-0.6875366568565369,
-0.27614790201187134,
-0.25980713963508606,
-0.4166930317878723,
0.27046823501586914,
0.539910078048706,
0.5531208515167236,
-0.5349417924880981,
0.6457112431526184,
-0.10691377520561218,
0.6105284690856934,
0.16346880793571472,
-0.2830306589603424,
0.7169115543365479,
-0.6565679907798767,
-0.09177839010953903,
0.18622654676437378,
1.2414511442184448,
0.38175588846206665,
-0.02892347238957882,
0.11290258169174194,
0.13002647459506989,
-0.0515468493103981,
-0.17024481296539307,
-0.6147890090942383,
-0.44766944646835327,
0.6144461035728455,
-0.6315875053405762,
-0.02654460072517395,
-0.12725621461868286,
-1.1698185205459595,
-0.01301770843565464,
-0.1818370223045349,
0.28678885102272034,
-0.717490017414093,
-0.670987069606781,
-0.05858404189348221,
-0.1678025722503662,
0.10285431146621704,
0.10017281025648117,
-1.1220706701278687,
0.24276700615882874,
0.5751512050628662,
1.0740467309951782,
0.03028702549636364,
-0.3230687975883484,
-0.4711500406265259,
0.05937143787741661,
-0.41103363037109375,
0.5992075204849243,
-0.15730752050876617,
-0.44704464077949524,
-0.13972952961921692,
0.038319990038871765,
-0.46160081028938293,
-0.5418834686279297,
0.9765245318412781,
-0.019729377701878548,
0.3037464916706085,
-0.17735770344734192,
-0.6616542935371399,
0.0831022784113884,
-0.052439332008361816,
-0.5820145606994629,
1.0516717433929443,
0.13192199170589447,
-1.0863604545593262,
0.2388412356376648,
-0.7290760278701782,
-0.17304283380508423,
-0.008388220332562923,
-0.20664939284324646,
-0.6534541249275208,
-0.338632196187973,
0.18617317080497742,
0.3938831686973572,
-0.12722446024417877,
0.0510677844285965,
0.06633534282445908,
-0.28385376930236816,
0.05772143974900246,
-0.050673212856054306,
1.161063313484192,
0.2964938282966614,
-0.6683720946311951,
0.009074922651052475,
-1.1063017845153809,
-0.020389607176184654,
0.06510300934314728,
-0.6554630398750305,
-0.20914816856384277,
0.06281975656747818,
0.2480831891298294,
0.05336441844701767,
0.2270234078168869,
-0.810326099395752,
0.000764198659453541,
-0.7981891632080078,
0.440650075674057,
0.6285390853881836,
0.03139955922961235,
0.3390553891658783,
-0.4993838369846344,
0.3012939691543579,
0.020311156287789345,
-0.08882197737693787,
-0.21769507229328156,
-0.6140190958976746,
-0.9287471771240234,
-0.6260539889335632,
0.4190111756324768,
0.7981089949607849,
-0.4928298890590668,
0.696736216545105,
-0.33507418632507324,
-0.708145260810852,
-0.9429245591163635,
0.0570216029882431,
0.7531750202178955,
0.3922637403011322,
0.4839313328266144,
-0.2505885362625122,
-0.8497057557106018,
-0.9750115871429443,
-0.19951000809669495,
-0.6342707276344299,
0.06584710627794266,
0.5644879341125488,
0.4656082093715668,
-0.13026289641857147,
0.9675092697143555,
-0.29017069935798645,
-0.34796059131622314,
0.004542417824268341,
0.07664012908935547,
0.6201539635658264,
0.6996526718139648,
0.5580024719238281,
-0.9454375505447388,
-0.7360103130340576,
0.1434408277273178,
-0.5044305324554443,
-0.3062286376953125,
-0.042155902832746506,
-0.005210805684328079,
0.1994308978319168,
0.37824320793151855,
-0.786980926990509,
0.35700416564941406,
0.3103128969669342,
-0.31153276562690735,
0.8962388634681702,
0.08382277935743332,
0.24792924523353577,
-1.1694756746292114,
0.3702905774116516,
0.06417519599199295,
-0.0015924571780487895,
-0.7989118099212646,
-0.4260445237159729,
-0.1343928724527359,
0.2515999674797058,
-0.29561272263526917,
0.6502429246902466,
-0.42034846544265747,
-0.0537702850997448,
0.20111870765686035,
0.44924572110176086,
-0.24486586451530457,
0.5559003949165344,
-0.019435841590166092,
0.8348951935768127,
0.579912006855011,
-0.6578468084335327,
0.3252183794975281,
0.7712804079055786,
-0.6547611951828003,
0.4321359694004059,
-0.6938199996948242,
0.13873086869716644,
0.19064633548259735,
0.17302396893501282,
-1.095577359199524,
-0.20527933537960052,
0.705910325050354,
-0.8279700875282288,
0.40036484599113464,
-0.3488023579120636,
-0.27957141399383545,
-0.5489020943641663,
-0.41379207372665405,
0.1294568032026291,
0.3062313199043274,
-0.4693940281867981,
0.3935545086860657,
0.48166850209236145,
-0.43459731340408325,
-0.6239517331123352,
-0.5689879655838013,
0.12602439522743225,
-0.3488667607307434,
-0.6865987777709961,
0.7687178254127502,
-0.21975548565387726,
-0.4977954626083374,
-0.1090928465127945,
0.021846583113074303,
0.19097161293029785,
-0.25114405155181885,
0.2677030861377716,
0.1372465044260025,
-0.22748148441314697,
0.03990324214100838,
-0.1992899626493454,
-0.0555972158908844,
-0.23655855655670166,
-0.18999573588371277,
0.6320945620536804,
-0.16042187809944153,
-0.1944575309753418,
-0.8033264875411987,
0.36787474155426025,
0.7386647462844849,
-0.5124987959861755,
0.6251916885375977,
0.9360865950584412,
-0.22291141748428345,
-0.030798189342021942,
-0.7124664783477783,
0.015729686245322227,
-0.4477587938308716,
0.31401675939559937,
-0.41133227944374084,
-0.7776843905448914,
0.59482741355896,
0.042394574731588364,
0.29680222272872925,
0.5400481224060059,
0.6963075399398804,
-0.09227782487869263,
0.6387869715690613,
0.1693984419107437,
-0.21894772350788116,
0.6014975905418396,
-0.45645207166671753,
0.31098219752311707,
-1.1598678827285767,
-0.26970458030700684,
-0.8783824443817139,
0.012114666402339935,
-0.9159301519393921,
-0.4855113625526428,
0.34722861647605896,
0.16941510140895844,
0.018626512959599495,
0.5920531749725342,
-0.7464393377304077,
0.10451115667819977,
0.568108320236206,
-0.052230916917324066,
0.04670250043272972,
0.10317566245794296,
-0.33075472712516785,
-0.07302270829677582,
-0.3626556098461151,
-0.6873931288719177,
1.0539246797561646,
0.4429432153701782,
0.21458427608013153,
0.2640323042869568,
0.7271884083747864,
0.28328824043273926,
-0.24630285799503326,
-0.6963921189308167,
0.6283153891563416,
-0.10566806048154831,
-0.6277592778205872,
-0.5258095860481262,
-0.468008428812027,
-1.0810638666152954,
0.43005356192588806,
-0.03335073962807655,
-1.106131672859192,
0.35826268792152405,
0.08126197010278702,
-0.35352346301078796,
0.2761143147945404,
-0.8325361013412476,
0.9568137526512146,
0.07977959513664246,
-0.17563942074775696,
-0.2806878089904785,
-0.8152098059654236,
0.23504924774169922,
0.12894244492053986,
0.5436622500419617,
-0.3799949586391449,
0.2807944118976593,
1.2571604251861572,
-0.3922814428806305,
0.6500393152236938,
-0.3722384572029114,
-0.01077708788216114,
0.5477181673049927,
-0.17416392266750336,
0.38350433111190796,
0.09624556452035904,
-0.3331378102302551,
0.2408425360918045,
0.22161707282066345,
-0.34432607889175415,
-0.2161131054162979,
0.9124026894569397,
-0.9778944253921509,
-0.6785706877708435,
-0.3340156674385071,
-0.2887771725654602,
-0.03124910779297352,
0.1435629278421402,
0.3048907220363617,
0.4623677730560303,
-0.09554688632488251,
0.27169400453567505,
0.71769118309021,
-0.4001013934612274,
0.7054567933082581,
0.4682939052581787,
-0.08868822455406189,
-0.8913248181343079,
0.8346851468086243,
0.11900697648525238,
0.16875697672367096,
0.46347174048423767,
0.22919316589832306,
-0.2343209832906723,
-0.7467998266220093,
-0.47923439741134644,
0.3679076135158539,
-0.36622223258018494,
-0.006554470397531986,
-0.9013981223106384,
-0.3000100255012512,
-0.8224377036094666,
0.33141809701919556,
-0.5057187676429749,
-0.6906810402870178,
-0.36305806040763855,
-0.10819698125123978,
0.4045335054397583,
0.26866409182548523,
-0.29727810621261597,
0.2656804919242859,
-0.6687905192375183,
0.30099251866340637,
0.1728990077972412,
0.21782231330871582,
-0.25309011340141296,
-0.600004255771637,
-0.45794621109962463,
0.18016940355300903,
-0.4091419279575348,
-0.8847588300704956,
0.5919098258018494,
0.5216031074523926,
0.7020223140716553,
0.20806601643562317,
-0.06445841491222382,
0.7049401998519897,
-0.3605172634124756,
1.1601457595825195,
0.1749524176120758,
-1.11279296875,
0.8211185932159424,
-0.6151542663574219,
0.18041279911994934,
0.5980280041694641,
0.26593706011772156,
-0.6923280954360962,
-0.2368086278438568,
-0.6745246648788452,
-1.169246792793274,
1.0413767099380493,
0.466059148311615,
-0.028494596481323242,
-0.12913252413272858,
0.09191878139972687,
-0.08653449267148972,
0.14327700436115265,
-0.6346279978752136,
-0.7668309807777405,
-0.3049066960811615,
-0.0533871091902256,
-0.17186565697193146,
-0.2681356966495514,
-0.06431490927934647,
-0.6203280091285706,
1.0595253705978394,
0.14874228835105896,
0.5992041230201721,
0.5875560641288757,
0.05280669406056404,
-0.23842130601406097,
0.4608970880508423,
0.7576117515563965,
0.3194282650947571,
-0.5586052536964417,
0.03480178117752075,
0.050476908683776855,
-0.6481545567512512,
0.02511989139020443,
0.11701172590255737,
-0.06780918687582016,
0.3404621183872223,
0.4604073762893677,
0.8783546090126038,
0.09026440232992172,
-0.4283877909183502,
0.5303120017051697,
-0.10650833696126938,
-0.43550586700439453,
-0.6331164836883545,
-0.1693878024816513,
0.34532561898231506,
0.1917611062526703,
0.42978110909461975,
-0.03250421956181526,
-0.011909144930541515,
-0.5079329013824463,
0.30368325114250183,
0.1744183599948883,
-0.16682472825050354,
-0.377651572227478,
0.5825763940811157,
0.21392114460468292,
-0.5677149295806885,
0.526086151599884,
-0.2776679992675781,
-0.6283466815948486,
0.6036708950996399,
0.3719158470630646,
0.9574223160743713,
-0.6384437084197998,
0.18246743083000183,
0.8527608513832092,
0.29771819710731506,
0.19610810279846191,
0.45522215962409973,
-0.32716789841651917,
-0.6759105920791626,
-0.2133588343858719,
-1.0041375160217285,
-0.24845507740974426,
0.2425442337989807,
-0.4747888743877411,
0.2751569151878357,
-0.42822563648223877,
-0.3627373278141022,
0.38754770159721375,
0.3459644317626953,
-0.32405972480773926,
0.07509250193834305,
0.09424998611211777,
0.8603929281234741,
-0.8244485259056091,
0.814232349395752,
0.6328282356262207,
-0.3439616858959198,
-1.0683789253234863,
-0.01588526926934719,
0.06551410257816315,
-0.29472479224205017,
0.34519025683403015,
-0.0569487065076828,
0.11450611799955368,
-0.026847410947084427,
-0.27506616711616516,
-0.8672264814376831,
1.1015645265579224,
0.2658616900444031,
-0.8919210433959961,
0.27460014820098877,
-0.10730054974555969,
0.5472710132598877,
-0.2135322391986847,
0.34012138843536377,
0.6722157001495361,
0.8237770795822144,
0.05805422365665436,
-1.5288282632827759,
0.06564582139253616,
-0.8205634951591492,
-0.13230948150157928,
0.1136537566781044,
-0.914348304271698,
0.9199647307395935,
-0.03574605658650398,
-0.26469501852989197,
0.12842071056365967,
0.6854395866394043,
0.34703752398490906,
0.46799346804618835,
0.589786946773529,
0.7728108167648315,
0.7245171666145325,
-0.11864648759365082,
0.6114885210990906,
-0.46912088990211487,
0.34202519059181213,
1.043389081954956,
0.037731148302555084,
0.9239750504493713,
0.5703977346420288,
-0.5955013036727905,
0.5336295366287231,
0.894840657711029,
-0.1113550141453743,
0.5775575637817383,
0.2649241089820862,
-0.43407177925109863,
-0.038981691002845764,
-0.2580845057964325,
-0.6144556403160095,
0.663498044013977,
0.4178658723831177,
-0.3217722773551941,
0.36259254813194275,
-0.2599552869796753,
0.28979507088661194,
0.12649188935756683,
-0.04590744897723198,
0.6749172806739807,
0.18537402153015137,
-0.6276501417160034,
0.8218803405761719,
-0.013722660019993782,
0.8433944582939148,
-0.465893030166626,
0.0821646973490715,
0.024806488305330276,
0.1192360669374466,
-0.6011334657669067,
-0.46503734588623047,
0.42817071080207825,
-0.07935734838247299,
-0.23243963718414307,
-0.1974593549966812,
0.47371140122413635,
-0.677647054195404,
-0.3043621778488159,
0.4301750361919403,
0.4078597128391266,
0.4774608910083771,
0.31434234976768494,
-0.5790371894836426,
0.06930737942457199,
0.24126586318016052,
-0.4059480130672455,
0.21802128851413727,
0.3286212682723999,
0.0932939201593399,
0.3793598711490631,
0.7575120329856873,
0.450343519449234,
0.2416045218706131,
0.18480679392814636,
0.7786173820495605,
-0.5808309316635132,
-0.4627171456813812,
-0.8973338603973389,
0.45676806569099426,
-0.24411427974700928,
-0.4128638505935669,
1.0599372386932373,
0.800650417804718,
0.8648576140403748,
0.09265443682670593,
0.7018594145774841,
-0.46379294991493225,
0.9143689870834351,
-0.27757877111434937,
0.8472387194633484,
-0.4378657639026642,
0.35012584924697876,
-0.7271051406860352,
-0.8081515431404114,
-0.15012229979038239,
0.6609248518943787,
-0.30762770771980286,
0.015332704409956932,
0.6637226343154907,
1.0286903381347656,
0.14236190915107727,
0.08498752117156982,
0.15133817493915558,
0.44910797476768494,
0.36627572774887085,
0.48424986004829407,
0.6092230081558228,
-0.5696423053741455,
0.5622190833091736,
-0.5738166570663452,
-0.18835382163524628,
-0.17085586488246918,
-0.6457730531692505,
-0.8065283298492432,
-0.953187882900238,
-0.7275903820991516,
-0.3906516432762146,
0.004726259037852287,
1.282583475112915,
0.7858550548553467,
-0.8637256622314453,
-0.48327013850212097,
0.10377206653356552,
0.22633415460586548,
-0.40997615456581116,
-0.21797452867031097,
0.7223084568977356,
0.1846378594636917,
-0.7951396703720093,
0.6501133441925049,
0.14888586103916168,
-0.06402475386857986,
0.06228415668010712,
-0.2614116072654724,
-0.6556328535079956,
0.06465376913547516,
0.2549738585948944,
0.4321171045303345,
-0.7398934960365295,
-0.20565229654312134,
-0.339409202337265,
-0.08575457334518433,
0.25207075476646423,
0.4043254256248474,
-0.38286203145980835,
0.5343614220619202,
0.6971282958984375,
0.042813073843717575,
0.6148021817207336,
-0.012265926226973534,
0.2365657240152359,
-0.6561996340751648,
0.019157417118549347,
0.2295840084552765,
0.28873854875564575,
0.49583175778388977,
-0.23385104537010193,
0.5446577668190002,
0.4599975645542145,
-0.726576030254364,
-0.9816020131111145,
-0.24317170679569244,
-1.194563865661621,
0.042731381952762604,
1.2384898662567139,
-0.32419353723526,
-0.309132844209671,
-0.20776017010211945,
-0.40227362513542175,
0.5998860001564026,
-0.6691316962242126,
0.8057436943054199,
0.7407499551773071,
-0.10928398370742798,
-0.050873249769210815,
-0.59809809923172,
0.6687551736831665,
0.4256238043308258,
-0.6788396239280701,
0.05531661584973335,
0.24009504914283752,
0.29697898030281067,
0.5390186905860901,
1.052832841873169,
-0.2703070044517517,
0.07410300523042679,
0.09530887752771378,
0.3147047162055969,
-0.036573659628629684,
-0.025386929512023926,
-0.2245788425207138,
-0.0798378437757492,
-0.10518446564674377,
-0.4608207941055298
] |
pyannote/segmentation-3.0 | pyannote | "2023-10-04T18:53:59Z" | 3,600,431 | 34 | pyannote-audio | [
"pyannote-audio",
"pytorch",
"pyannote",
"pyannote-audio-model",
"audio",
"voice",
"speech",
"speaker",
"speaker-diarization",
"speaker-change-detection",
"speaker-segmentation",
"voice-activity-detection",
"overlapped-speech-detection",
"resegmentation",
"license:mit",
"has_space",
"region:us"
] | voice-activity-detection | "2023-09-22T12:03:10Z" | ---
tags:
- pyannote
- pyannote-audio
- pyannote-audio-model
- audio
- voice
- speech
- speaker
- speaker-diarization
- speaker-change-detection
- speaker-segmentation
- voice-activity-detection
- overlapped-speech-detection
- resegmentation
license: mit
inference: false
extra_gated_prompt: "The collected information will help acquire a better knowledge of pyannote.audio userbase and help its maintainers improve it further. Though this model uses MIT license and will always remain open-source, we will occasionnally email you about premium models and paid services around pyannote."
extra_gated_fields:
Company/university: text
Website: text
---
Using this open-source model in production?
Make the most of it thanks to our [consulting services](https://herve.niderb.fr/consulting.html).
# 🎹 "Powerset" speaker segmentation
This model ingests 10 seconds of mono audio sampled at 16kHz and outputs speaker diarization as a (num_frames, num_classes) matrix where the 7 classes are _non-speech_, _speaker #1_, _speaker #2_, _speaker #3_, _speakers #1 and #2_, _speakers #1 and #3_, and _speakers #2 and #3_.
![Example output](example.png)
```python
# waveform (first row)
duration, sample_rate, num_channels = 10, 16000, 1
waveform = torch.randn(batch_size, num_channels, duration * sample_rate
# powerset multi-class encoding (second row)
powerset_encoding = model(waveform)
# multi-label encoding (third row)
from pyannote.audio.utils.powerset import Powerset
max_speakers_per_chunk, max_speakers_per_frame = 3, 2
to_multilabel = Powerset(
max_speakers_per_chunk,
max_speakers_per_frame).to_multilabel
multilabel_encoding = to_multilabel(powerset_encoding)
```
The various concepts behind this model are described in details in this [paper](https://www.isca-speech.org/archive/interspeech_2023/plaquet23_interspeech.html).
It has been trained by Séverin Baroudi with [pyannote.audio](https://github.com/pyannote/pyannote-audio) `3.0.0` using the combination of the training sets of AISHELL, AliMeeting, AMI, AVA-AVD, DIHARD, Ego4D, MSDWild, REPERE, and VoxConverse.
This [companion repository](https://github.com/FrenchKrab/IS2023-powerset-diarization/) by [Alexis Plaquet](https://frenchkrab.github.io/) also provides instructions on how to train or finetune such a model on your own data.
## Requirements
1. Install [`pyannote.audio`](https://github.com/pyannote/pyannote-audio) `3.0` with `pip install pyannote.audio`
2. Accept [`pyannote/segmentation-3.0`](https://hf.co/pyannote/segmentation-3.0) user conditions
3. Create access token at [`hf.co/settings/tokens`](https://hf.co/settings/tokens).
## Usage
```python
# instantiate the model
from pyannote.audio import Model
model = Model.from_pretrained(
"pyannote/segmentation-3.0",
use_auth_token="HUGGINGFACE_ACCESS_TOKEN_GOES_HERE")
```
### Speaker diarization
This model cannot be used to perform speaker diarization of full recordings on its own (it only processes 10s chunks).
See [pyannote/speaker-diarization-3.0](https://hf.co/pyannote/speaker-diarization-3.0) pipeline that uses an additional speaker embedding model to perform full recording speaker diarization.
### Voice activity detection
```python
from pyannote.audio.pipelines import VoiceActivityDetection
pipeline = VoiceActivityDetection(segmentation=model)
HYPER_PARAMETERS = {
# remove speech regions shorter than that many seconds.
"min_duration_on": 0.0,
# fill non-speech regions shorter than that many seconds.
"min_duration_off": 0.0
}
pipeline.instantiate(HYPER_PARAMETERS)
vad = pipeline("audio.wav")
# `vad` is a pyannote.core.Annotation instance containing speech regions
```
### Overlapped speech detection
```python
from pyannote.audio.pipelines import OverlappedSpeechDetection
pipeline = OverlappedSpeechDetection(segmentation=model)
HYPER_PARAMETERS = {
# remove overlapped speech regions shorter than that many seconds.
"min_duration_on": 0.0,
# fill non-overlapped speech regions shorter than that many seconds.
"min_duration_off": 0.0
}
pipeline.instantiate(HYPER_PARAMETERS)
osd = pipeline("audio.wav")
# `osd` is a pyannote.core.Annotation instance containing overlapped speech regions
```
## Citations
```bibtex
@inproceedings{Plaquet23,
author={Alexis Plaquet and Hervé Bredin},
title={{Powerset multi-class cross entropy loss for neural speaker diarization}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}
```
```bibtex
@inproceedings{Bredin23,
author={Hervé Bredin},
title={{pyannote.audio 2.1 speaker diarization pipeline: principle, benchmark, and recipe}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}
```
| [
-0.3095853328704834,
-0.6219159364700317,
0.20473948121070862,
0.3008125126361847,
-0.5283315777778625,
-0.22801320254802704,
-0.5428075790405273,
-0.38922184705734253,
0.42560186982154846,
0.5076965093612671,
-0.4289165437221527,
-0.5818568468093872,
-0.23382873833179474,
-0.32488465309143066,
-0.22457268834114075,
0.9096830487251282,
0.3253185451030731,
0.05930173024535179,
-0.04688316211104393,
0.03043532930314541,
-0.21620549261569977,
-0.4630845785140991,
-0.36197248101234436,
-0.36279091238975525,
0.12972290813922882,
0.5915411710739136,
0.18155117332935333,
0.651449978351593,
0.3371034562587738,
0.3670039772987366,
-0.45224130153656006,
0.10961826145648956,
-0.02906842716038227,
-0.02857680805027485,
0.13600629568099976,
-0.11371514946222305,
-0.566102147102356,
0.17502886056900024,
0.8003777861595154,
0.5422465205192566,
-0.2249496728181839,
0.2614513039588928,
-0.09066160768270493,
0.12557059526443481,
-0.3502133786678314,
0.177419975399971,
-0.6652665734291077,
-0.07604671269655228,
-0.39475518465042114,
-0.10083349794149399,
-0.41323381662368774,
-0.062430620193481445,
0.3694535195827484,
-0.6794694066047668,
0.17732885479927063,
-0.21826866269111633,
1.1241967678070068,
0.04801164194941521,
0.13110901415348053,
-0.20049549639225006,
-0.6946862936019897,
0.7112524509429932,
-0.9586907625198364,
0.3839324116706848,
0.4675345718860626,
0.2579498887062073,
0.1460183709859848,
-0.9444572329521179,
-0.5380338430404663,
-0.20411647856235504,
0.07832032442092896,
0.22452521324157715,
-0.04573209583759308,
0.1770101934671402,
0.3770487308502197,
0.5523184537887573,
-0.4281823933124542,
-0.09520342200994492,
-0.554278552532196,
-0.43991056084632874,
0.8400735259056091,
-0.28106820583343506,
0.3750857710838318,
-0.4097062647342682,
-0.46920281648635864,
-0.37817153334617615,
-0.2139686644077301,
0.07079463452100754,
0.6237369775772095,
0.6033043265342712,
-0.31704214215278625,
0.4561395049095154,
0.05657103285193443,
0.7569303512573242,
0.16788721084594727,
-0.38032621145248413,
0.6747320294380188,
-0.4746990203857422,
-0.2740323543548584,
0.6164860725402832,
0.9833096265792847,
0.12132363766431808,
0.270136296749115,
0.24140751361846924,
-0.044118743389844894,
-0.3968614935874939,
-0.06164279207587242,
-0.7941895723342896,
-0.7955822944641113,
0.3444597125053406,
-0.4582488238811493,
0.10704023391008377,
-0.07779309153556824,
-0.7307291030883789,
-0.35294100642204285,
-0.23439601063728333,
0.7187471985816956,
-0.6748006939888,
-0.6669392585754395,
0.1277466118335724,
-0.3124827444553375,
-0.0576903410255909,
-0.06019715592265129,
-1.2133013010025024,
0.13838934898376465,
0.4608442485332489,
1.119112491607666,
0.3089042007923126,
-0.3743293285369873,
-0.4667317867279053,
-0.05325314402580261,
-0.06299526244401932,
0.5860307812690735,
-0.16692519187927246,
-0.3947102427482605,
-0.41369950771331787,
0.017671113833785057,
-0.42173120379447937,
-0.6458035707473755,
0.7043008804321289,
0.11752084642648697,
-0.00499711511656642,
-0.005366797558963299,
-0.6753786206245422,
-0.010193850845098495,
-0.26415321230888367,
-0.4494970738887787,
0.772332489490509,
0.11000709235668182,
-0.9116367697715759,
0.30060243606567383,
-0.5448601841926575,
-0.20952259004116058,
0.04063716158270836,
0.01904294081032276,
-0.9659008979797363,
-0.2592654228210449,
0.2263619303703308,
0.3934609889984131,
0.01144716702401638,
0.14530430734157562,
-0.11452097445726395,
-0.33761903643608093,
0.16576850414276123,
-0.24532450735569,
1.1235448122024536,
0.0981704518198967,
-0.47743019461631775,
0.18408554792404175,
-1.139668345451355,
-0.07203467935323715,
0.09153211116790771,
-0.5478628277778625,
-0.3993660807609558,
-0.0704457238316536,
0.3812730610370636,
0.009490091353654861,
0.11078161001205444,
-0.882998526096344,
-0.12524662911891937,
-0.7206326127052307,
0.5848860740661621,
0.6107823252677917,
0.25445711612701416,
0.2625100016593933,
-0.22830645740032196,
0.07508207857608795,
0.0909862145781517,
0.15070629119873047,
-0.3716278672218323,
-0.6478387713432312,
-0.6596509218215942,
-0.6091638207435608,
0.46209776401519775,
0.5808868408203125,
-0.2669270932674408,
0.6143589019775391,
-0.08087077736854553,
-0.8450208902359009,
-0.6121244430541992,
0.0947478637099266,
0.40171411633491516,
0.46988508105278015,
0.5604502558708191,
-0.3869211673736572,
-0.8185586929321289,
-0.9440737962722778,
-0.27537885308265686,
-0.33562976121902466,
-0.08779186755418777,
0.376252144575119,
0.43339529633522034,
0.1474541574716568,
0.9184375405311584,
-0.22833579778671265,
-0.2241174429655075,
-0.059582073241472244,
0.04037996008992195,
0.5126850605010986,
0.8603982925415039,
0.3761747181415558,
-0.8211984634399414,
-0.48293188214302063,
-0.11907695978879929,
-0.3115179240703583,
-0.1392228603363037,
-0.30622610449790955,
-0.0669519379734993,
-0.17482149600982666,
0.4245615303516388,
-0.7063531875610352,
0.35010212659835815,
0.19909381866455078,
-0.18348240852355957,
0.6192293167114258,
0.10228051245212555,
-0.10493278503417969,
-1.0076208114624023,
0.11078494787216187,
0.20063689351081848,
0.04657389968633652,
-0.7870640158653259,
-0.6431850790977478,
0.05637460574507713,
-0.23074164986610413,
-0.4770868122577667,
0.40288645029067993,
-0.5002312064170837,
-0.16473481059074402,
-0.000742764794267714,
0.36083459854125977,
-0.11934354901313782,
0.6058998107910156,
0.20401999354362488,
0.6485440135002136,
0.6130154728889465,
-0.6632220149040222,
0.5031893849372864,
0.5400492548942566,
-0.8492674231529236,
0.5110070109367371,
-0.7938244342803955,
0.15869002044200897,
0.3431229293346405,
0.11248546838760376,
-1.0797451734542847,
-0.16558445990085602,
0.5441818237304688,
-0.7378504276275635,
0.3121330142021179,
-0.4419330656528473,
-0.1719122976064682,
-0.2684943675994873,
-0.11342036724090576,
0.3768519461154938,
0.28733938932418823,
-0.6913623213768005,
0.4367111325263977,
0.5391414761543274,
-0.353294312953949,
-0.38684913516044617,
-0.8611468076705933,
-0.07183060050010681,
-0.347606360912323,
-0.7976097464561462,
0.6450648307800293,
-0.07105132937431335,
-0.419659823179245,
-0.11170641332864761,
-0.09444978088140488,
0.01729278638958931,
-0.2554323077201843,
0.3455069065093994,
0.06856584548950195,
-0.2487274557352066,
0.17713141441345215,
-0.23636643588542938,
0.005635187495499849,
-0.1905178427696228,
-0.6401976346969604,
0.5193507671356201,
0.1300109177827835,
-0.23664039373397827,
-0.7473141551017761,
0.08121778070926666,
0.48179563879966736,
-0.6851840615272522,
0.48265716433525085,
0.8732646107673645,
-0.2731208801269531,
-0.1275276243686676,
-0.4232569932937622,
-0.09281913191080093,
-0.44512391090393066,
0.6557472348213196,
-0.23942099511623383,
-0.42379212379455566,
0.4618845283985138,
0.18255218863487244,
0.24138736724853516,
0.39439699053764343,
0.5483947396278381,
0.15584979951381683,
0.702073872089386,
0.3388932943344116,
0.07075338065624237,
0.8835792541503906,
-0.551934003829956,
0.34826555848121643,
-1.0383167266845703,
-0.4144260287284851,
-0.5148264765739441,
0.07596860826015472,
-0.5362627506256104,
-0.4346020519733429,
0.40323346853256226,
0.15770606696605682,
-0.054710112512111664,
0.3777719736099243,
-0.788436770439148,
0.3623940348625183,
0.6879156827926636,
0.16266699135303497,
-0.2356639802455902,
0.3244515061378479,
-0.09700402617454529,
0.027683595195412636,
-0.5784834027290344,
-0.3296479880809784,
1.017243504524231,
0.5692731142044067,
0.416066974401474,
-0.18667839467525482,
0.8208673000335693,
0.07867501676082611,
-0.23422382771968842,
-0.9453446865081787,
0.45140859484672546,
-0.15510503947734833,
-0.5977348685264587,
-0.587784469127655,
-0.42257410287857056,
-0.7778383493423462,
0.44193708896636963,
0.04386341571807861,
-1.0408414602279663,
0.4897758662700653,
0.028789568692445755,
-0.5313195586204529,
0.603399395942688,
-0.8096146583557129,
0.8947498798370361,
-0.11805442720651627,
-0.3391376733779907,
-0.016389083117246628,
-0.60613614320755,
0.25378477573394775,
0.27898210287094116,
0.13820086419582367,
-0.20057110488414764,
0.5244801640510559,
1.3565701246261597,
-0.4833838641643524,
0.706902027130127,
-0.6368972063064575,
0.012755835428833961,
0.7243205904960632,
-0.43264040350914,
0.19642284512519836,
0.012817003764212132,
-0.05597882345318794,
0.13375061750411987,
-0.005714676342904568,
-0.3109970688819885,
-0.10750133544206619,
0.6746132373809814,
-0.9206361174583435,
-0.2913745939731598,
-0.21408051252365112,
-0.5093603134155273,
-0.12253915518522263,
0.10574991255998611,
0.3456572890281677,
0.7839361429214478,
-0.08879007399082184,
0.13137629628181458,
0.7343205809593201,
-0.38376954197883606,
0.7054482698440552,
0.25815054774284363,
0.03469502925872803,
-0.9231932163238525,
1.0214126110076904,
0.31248506903648376,
0.3221135139465332,
0.17303946614265442,
0.30709853768348694,
-0.33905884623527527,
-0.5769661664962769,
-0.4600354731082916,
0.3966614902019501,
-0.7158615589141846,
0.10261234641075134,
-0.742854118347168,
-0.31731897592544556,
-0.726387619972229,
0.42489227652549744,
-0.6840867400169373,
-0.5894808769226074,
-0.2677134871482849,
-0.046320173889398575,
0.39727941155433655,
0.2581540048122406,
-0.4979083836078644,
0.5299155712127686,
-0.5383754968643188,
0.17716670036315918,
0.4955996572971344,
0.13836278021335602,
-0.08820311725139618,
-0.805305004119873,
-0.6004036068916321,
0.05732709914445877,
-0.2471325695514679,
-0.9362821578979492,
0.3138996660709381,
0.30243486166000366,
0.7745169997215271,
0.2820241451263428,
-0.2085169106721878,
0.5483895540237427,
-0.2170030176639557,
1.016051173210144,
0.25212982296943665,
-1.0841810703277588,
0.6270257830619812,
-0.40053948760032654,
0.2679893374443054,
0.4623481035232544,
0.10482177883386612,
-0.6958416700363159,
-0.008003324270248413,
-0.6938285827636719,
-1.2649701833724976,
1.096623182296753,
0.32707861065864563,
-0.1287548542022705,
0.19401401281356812,
0.16127105057239532,
-0.1726149320602417,
0.06993988901376724,
-0.6194173097610474,
-0.3548728823661804,
-0.5976069569587708,
-0.015675539150834084,
-0.29146894812583923,
-0.24042373895645142,
-0.018704380840063095,
-0.5910925269126892,
1.1639463901519775,
0.21219883859157562,
0.46431878209114075,
0.6399168968200684,
-0.06000048667192459,
-0.11438171565532684,
0.0981699600815773,
0.7214853763580322,
0.5274779200553894,
-0.5756248831748962,
0.005607880651950836,
-0.14085285365581512,
-0.7371394038200378,
0.19032932817935944,
0.3759722113609314,
-0.000006713928542012582,
0.48223191499710083,
0.4273007810115814,
1.166976809501648,
0.07734184712171555,
-0.2996130883693695,
0.47013330459594727,
-0.04738502576947212,
-0.3336741030216217,
-0.4950624704360962,
-0.13860327005386353,
0.28304022550582886,
0.21273407340049744,
0.3262132406234741,
-0.05926074832677841,
-0.09162212908267975,
-0.33855581283569336,
0.3607253432273865,
0.0030548651702702045,
-0.3545956015586853,
-0.2147751897573471,
0.5780519247055054,
0.2482055276632309,
-0.6562821865081787,
0.7623540163040161,
-0.10346706211566925,
-0.503727376461029,
0.8185469508171082,
0.502140998840332,
0.9751186966896057,
-0.655907928943634,
0.1941038966178894,
0.7221099734306335,
0.32008621096611023,
0.08540323376655579,
0.17731145024299622,
-0.39270177483558655,
-0.5645249485969543,
-0.20130309462547302,
-0.8361822366714478,
-0.3291565477848053,
0.47220900654792786,
-0.5723233222961426,
0.13893748819828033,
-0.5760788321495056,
-0.30421286821365356,
0.47582536935806274,
0.14341916143894196,
-0.17116272449493408,
0.24329857528209686,
0.3014090955257416,
0.8215709328651428,
-0.9500245451927185,
0.7809538245201111,
0.5631446838378906,
-0.49779245257377625,
-0.9291235208511353,
0.006503432057797909,
-0.07382846623659134,
-0.2558627724647522,
0.24022254347801208,
0.17069721221923828,
0.044521309435367584,
-0.14637356996536255,
-0.48870569467544556,
-0.7499203085899353,
0.9804374575614929,
0.27991822361946106,
-0.9048707485198975,
0.2514609098434448,
-0.1533157378435135,
0.23114493489265442,
-0.3233298659324646,
0.20558807253837585,
0.73154616355896,
0.622098982334137,
-0.09254459291696548,
-1.3467671871185303,
-0.24895556271076202,
-0.45064017176628113,
-0.36005985736846924,
0.14708463847637177,
-0.9003358483314514,
1.3082208633422852,
-0.04844822734594345,
-0.09027573466300964,
0.14670981466770172,
0.6081615090370178,
0.35772424936294556,
0.47434118390083313,
0.7260384559631348,
0.5270611643791199,
0.9382342100143433,
0.03268847241997719,
0.5912795066833496,
-0.3200904130935669,
0.392515629529953,
1.1054506301879883,
0.08222917467355728,
0.6168860793113708,
0.47762787342071533,
-0.2033272087574005,
0.44391000270843506,
0.7929331660270691,
-0.17689064145088196,
0.725562572479248,
0.35694220662117004,
-0.30929312109947205,
-0.347269207239151,
-0.11264385282993317,
-0.5851839780807495,
0.7361180782318115,
0.3473721146583557,
-0.4777505397796631,
0.18416206538677216,
-0.013940374366939068,
0.016516342759132385,
-0.07865013927221298,
-0.24774333834648132,
0.5123937129974365,
0.11435794830322266,
-0.44934511184692383,
0.729720413684845,
0.0359228178858757,
0.6783934235572815,
-0.6129053831100464,
0.06551939994096756,
-0.05046699196100235,
0.30978628993034363,
-0.33382275700569153,
-0.26170507073402405,
0.05422927066683769,
-0.23078717291355133,
-0.12790854275226593,
-0.0845775231719017,
0.6040111184120178,
-0.804101288318634,
-0.3465343415737152,
0.2524033784866333,
0.10628294199705124,
0.47668221592903137,
-0.09843433648347855,
-0.7771428227424622,
0.08838304877281189,
0.14838488399982452,
-0.2537740170955658,
0.07814167439937592,
0.2823416292667389,
0.22218936681747437,
0.09420180320739746,
0.5396000742912292,
0.29481345415115356,
0.21043723821640015,
0.2881610691547394,
0.6302293539047241,
-0.38186508417129517,
-0.8495878577232361,
-0.8511880040168762,
0.42058372497558594,
-0.36346346139907837,
-0.4574121832847595,
0.9184687733650208,
0.809501051902771,
0.9163382053375244,
0.12091714888811111,
0.7812884449958801,
0.03169365972280502,
0.5601558685302734,
-0.5240331888198853,
0.8319921493530273,
-0.46019667387008667,
0.2086787074804306,
-0.6389595866203308,
-0.8207097053527832,
-0.00037032520049251616,
0.8018882274627686,
-0.434245765209198,
0.11457071453332901,
0.4557858109474182,
0.9134640693664551,
-0.33452537655830383,
0.16550709307193756,
0.1756792515516281,
0.2536605894565582,
0.374380499124527,
0.5268822908401489,
0.8522062301635742,
-0.5294618606567383,
0.6145443320274353,
-0.6584171652793884,
-0.16884708404541016,
-0.08786479383707047,
-0.4130869209766388,
-0.9595412015914917,
-0.81952303647995,
-0.5449854731559753,
-0.3600008189678192,
0.01754343882203102,
1.0720257759094238,
1.0946162939071655,
-0.7996277213096619,
-0.6042871475219727,
0.1388489156961441,
0.04738380014896393,
-0.351238876581192,
-0.19699576497077942,
0.7014915943145752,
0.12818719446659088,
-0.6977120637893677,
0.7427459359169006,
0.24455372989177704,
0.11614574491977692,
-0.11072009801864624,
-0.06270953267812729,
-0.7261481285095215,
0.09939301013946533,
0.08062084764242172,
0.29864686727523804,
-0.42090490460395813,
-0.024330269545316696,
-0.48309922218322754,
0.17387156188488007,
0.30274009704589844,
0.8112487196922302,
-0.337405264377594,
0.632143497467041,
0.5399078130722046,
0.12199161946773529,
0.9235377907752991,
-0.017570778727531433,
0.12424647808074951,
-0.873621940612793,
0.44360244274139404,
0.2489435225725174,
0.2710215151309967,
0.7438586354255676,
-0.17449365556240082,
0.22037598490715027,
0.5612814426422119,
-0.648198127746582,
-0.9922477602958679,
-0.12744048237800598,
-0.7797979712486267,
-0.23628059029579163,
1.054551601409912,
-0.2852841019630432,
-0.4502512514591217,
-0.0874367207288742,
-0.30383893847465515,
0.6392035484313965,
-0.44236618280410767,
0.48778975009918213,
0.5115107893943787,
-0.18468517065048218,
0.0003174042794853449,
-0.43331360816955566,
0.640413224697113,
0.36827465891838074,
-0.42323532700538635,
0.195293590426445,
0.3370306193828583,
0.4115075469017029,
0.5554097890853882,
0.9487669467926025,
0.0037928889505565166,
0.2970987558364868,
0.5423622131347656,
0.3698209226131439,
-0.3618345558643341,
-0.4329870641231537,
-0.3930979371070862,
0.12845219671726227,
-0.07224974781274796,
-0.7335682511329651
] |
pyannote/speaker-diarization-3.0 | pyannote | "2023-10-04T18:54:33Z" | 3,399,557 | 118 | pyannote-audio | [
"pyannote-audio",
"pyannote",
"pyannote-audio-pipeline",
"audio",
"voice",
"speech",
"speaker",
"speaker-diarization",
"speaker-change-detection",
"voice-activity-detection",
"overlapped-speech-detection",
"automatic-speech-recognition",
"arxiv:2111.14448",
"arxiv:2012.01477",
"license:mit",
"has_space",
"region:us"
] | automatic-speech-recognition | "2023-09-22T13:40:36Z" | ---
tags:
- pyannote
- pyannote-audio
- pyannote-audio-pipeline
- audio
- voice
- speech
- speaker
- speaker-diarization
- speaker-change-detection
- voice-activity-detection
- overlapped-speech-detection
- automatic-speech-recognition
license: mit
extra_gated_prompt: "The collected information will help acquire a better knowledge of pyannote.audio userbase and help its maintainers improve it further. Though this pipeline uses MIT license and will always remain open-source, we will occasionnally email you about premium pipelines and paid services around pyannote."
extra_gated_fields:
Company/university: text
Website: text
---
Using this open-source pipeline in production?
Make the most of it thanks to our [consulting services](https://herve.niderb.fr/consulting.html).
# 🎹 Speaker diarization 3.0
This pipeline has been trained by Séverin Baroudi with [pyannote.audio](https://github.com/pyannote/pyannote-audio) `3.0.0` using a combination of the training sets of AISHELL, AliMeeting, AMI, AVA-AVD, DIHARD, Ego4D, MSDWild, REPERE, and VoxConverse.
It ingests mono audio sampled at 16kHz and outputs speaker diarization as an [`Annotation`](http://pyannote.github.io/pyannote-core/structure.html#annotation) instance:
* stereo or multi-channel audio files are automatically downmixed to mono by averaging the channels.
* audio files sampled at a different rate are resampled to 16kHz automatically upon loading.
## Requirements
1. Install [`pyannote.audio`](https://github.com/pyannote/pyannote-audio) `3.0` with `pip install pyannote.audio`
2. Accept [`pyannote/segmentation-3.0`](https://hf.co/pyannote/segmentation-3.0) user conditions
3. Accept [`pyannote/speaker-diarization-3.0`](https://hf.co/pyannote-speaker-diarization-3.0) user conditions
4. Create access token at [`hf.co/settings/tokens`](https://hf.co/settings/tokens).
## Usage
```python
# instantiate the pipeline
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained(
"pyannote/speaker-diarization-3.0",
use_auth_token="HUGGINGFACE_ACCESS_TOKEN_GOES_HERE")
# run the pipeline on an audio file
diarization = pipeline("audio.wav")
# dump the diarization output to disk using RTTM format
with open("audio.rttm", "w") as rttm:
diarization.write_rttm(rttm)
```
### Processing on GPU
`pyannote.audio` pipelines run on CPU by default.
You can send them to GPU with the following lines:
```python
import torch
pipeline.to(torch.device("cuda"))
```
Real-time factor is around 2.5% using one Nvidia Tesla V100 SXM2 GPU (for the neural inference part) and one Intel Cascade Lake 6248 CPU (for the clustering part).
In other words, it takes approximately 1.5 minutes to process a one hour conversation.
### Processing from memory
Pre-loading audio files in memory may result in faster processing:
```python
waveform, sample_rate = torchaudio.load("audio.wav")
diarization = pipeline({"waveform": waveform, "sample_rate": sample_rate})
```
### Monitoring progress
Hooks are available to monitor the progress of the pipeline:
```python
from pyannote.audio.pipelines.utils.hook import ProgressHook
with ProgressHook() as hook:
diarization = pipeline("audio.wav", hook=hook)
```
### Controlling the number of speakers
In case the number of speakers is known in advance, one can use the `num_speakers` option:
```python
diarization = pipeline("audio.wav", num_speakers=2)
```
One can also provide lower and/or upper bounds on the number of speakers using `min_speakers` and `max_speakers` options:
```python
diarization = pipeline("audio.wav", min_speakers=2, max_speakers=5)
```
## Benchmark
This pipeline has been benchmarked on a large collection of datasets.
Processing is fully automatic:
* no manual voice activity detection (as is sometimes the case in the literature)
* no manual number of speakers (though it is possible to provide it to the pipeline)
* no fine-tuning of the internal models nor tuning of the pipeline hyper-parameters to each dataset
... with the least forgiving diarization error rate (DER) setup (named *"Full"* in [this paper](https://doi.org/10.1016/j.csl.2021.101254)):
* no forgiveness collar
* evaluation of overlapped speech
| Benchmark | [DER%](. "Diarization error rate") | [FA%](. "False alarm rate") | [Miss%](. "Missed detection rate") | [Conf%](. "Speaker confusion rate") | Expected output | File-level evaluation |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | --------------------------- | ---------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [AISHELL-4](http://www.openslr.org/111/) | 12.3 | 3.8 | 4.4 | 4.1 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AISHELL.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AISHELL.SpeakerDiarization.Benchmark.test.eval) |
| [AliMeeting (*channel 1*)](https://www.openslr.org/119/) | 24.3 | 4.4 | 10.0 | 9.9 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AliMeeting.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AliMeeting.SpeakerDiarization.Benchmark.test.eval) |
| [AMI (*headset mix,*](https://groups.inf.ed.ac.uk/ami/corpus/) [*only_words*)](https://github.com/BUTSpeechFIT/AMI-diarization-setup) | 19.0 | 3.6 | 9.5 | 5.9 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AMI.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AMI.SpeakerDiarization.Benchmark.test.eval) |
| [AMI (*array1, channel 1,*](https://groups.inf.ed.ac.uk/ami/corpus/) [*only_words)*](https://github.com/BUTSpeechFIT/AMI-diarization-setup) | 22.2 | 3.8 | 11.2 | 7.3 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AMI-SDM.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AMI-SDM.SpeakerDiarization.Benchmark.test.eval) |
| [AVA-AVD](https://arxiv.org/abs/2111.14448) | 49.1 | 10.8 | 15.7| 22.5 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AVA-AVD.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/AVA-AVD.SpeakerDiarization.Benchmark.test.eval) |
| [DIHARD 3 (*Full*)](https://arxiv.org/abs/2012.01477) | 21.7 | 6.2 | 8.1 | 7.3 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/DIHARD.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/DIHARD.SpeakerDiarization.Benchmark.test.eval) |
| [MSDWild](https://x-lance.github.io/MSDWILD/) | 24.6 | 5.8 | 8.0 | 10.7 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/MSDWILD.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/MSDWILD.SpeakerDiarization.Benchmark.test.eval) |
| [REPERE (*phase 2*)](https://islrn.org/resources/360-758-359-485-0/) | 7.8 | 1.8 | 2.6 | 3.5 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/REPERE.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/REPERE.SpeakerDiarization.Benchmark.test.eval) |
| [VoxConverse (*v0.3*)](https://github.com/joonson/voxconverse) | 11.3 | 4.1 | 3.4 | 3.8 | [RTTM](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/VoxConverse.SpeakerDiarization.Benchmark.test.rttm) | [eval](https://huggingface.co/pyannote/speaker-diarization-3.0.0/blob/main/reproducible_research/VoxConverse.SpeakerDiarization.Benchmark.test.eval) |
## Citations
```bibtex
@inproceedings{Plaquet23,
author={Alexis Plaquet and Hervé Bredin},
title={{Powerset multi-class cross entropy loss for neural speaker diarization}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}
```
```bibtex
@inproceedings{Bredin23,
author={Hervé Bredin},
title={{pyannote.audio 2.1 speaker diarization pipeline: principle, benchmark, and recipe}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}
```
| [
-0.6659835577011108,
-0.7951610088348389,
0.11587908864021301,
0.5107489228248596,
-0.2107565999031067,
0.07246318459510803,
-0.5225633978843689,
-0.30586913228034973,
0.49465566873550415,
0.37571975588798523,
-0.4108301103115082,
-0.7389363050460815,
-0.4401939809322357,
0.01875116303563118,
-0.22071802616119385,
0.7801172137260437,
0.35832270979881287,
-0.011050714179873466,
0.12565061450004578,
0.010252445004880428,
-0.36598876118659973,
-0.20755881071090698,
-0.5457922220230103,
-0.20981210470199585,
0.13513556122779846,
0.600892961025238,
0.22964979708194733,
0.821570873260498,
0.3247345983982086,
0.33778145909309387,
-0.43851426243782043,
0.10334678739309311,
-0.07169444113969803,
0.009372654370963573,
0.1072273850440979,
0.020636674016714096,
-0.5476526021957397,
0.12394435703754425,
0.7946153283119202,
0.5904706716537476,
-0.24813832342624664,
0.317439466714859,
0.06672504544258118,
0.5667321085929871,
-0.2957328259944916,
0.2220230996608734,
-0.6872601509094238,
-0.17950215935707092,
-0.4871019124984741,
-0.2984660565853119,
-0.21845228970050812,
-0.2630367577075958,
0.1340010166168213,
-0.5626010298728943,
0.22554419934749603,
0.08096898347139359,
1.0407780408859253,
0.08809851855039597,
-0.010417384095489979,
-0.14454862475395203,
-0.7712233662605286,
0.7070332169532776,
-0.9326311349868774,
0.4122728705406189,
0.532222330570221,
0.08705677092075348,
-0.16413730382919312,
-0.7293744087219238,
-0.7129327058792114,
-0.055699389427900314,
-0.13715514540672302,
0.28687992691993713,
-0.13187798857688904,
0.14681397378444672,
0.38228780031204224,
0.5939918160438538,
-0.5860123038291931,
-0.03978251665830612,
-0.5877934694290161,
-0.4810086488723755,
0.7770068049430847,
-0.18002942204475403,
0.4156341850757599,
-0.5142768025398254,
-0.27216842770576477,
-0.29515063762664795,
-0.4010776877403259,
0.19597384333610535,
0.50388503074646,
0.46900439262390137,
-0.48211005330085754,
0.5794898867607117,
-0.12262722849845886,
0.5823402404785156,
0.12833820283412933,
-0.2840160131454468,
0.7321644425392151,
-0.569105863571167,
-0.17191801965236664,
0.3728725016117096,
1.1338213682174683,
0.3008132874965668,
-0.09695694595575333,
0.1294207125902176,
0.061708707362413406,
-0.022700361907482147,
-0.1301291584968567,
-0.6806355714797974,
-0.5219290256500244,
0.6227984428405762,
-0.5749955177307129,
-0.019085004925727844,
-0.19259390234947205,
-1.0330487489700317,
-0.11169477552175522,
-0.14114581048488617,
0.4069049060344696,
-0.6786266565322876,
-0.6269999146461487,
0.014051917009055614,
-0.26351398229599,
0.047222066670656204,
0.16261827945709229,
-1.1556512117385864,
0.25641509890556335,
0.6307085156440735,
1.1074836254119873,
0.05366881936788559,
-0.28956934809684753,
-0.5977533459663391,
0.0653809905052185,
-0.3537426292896271,
0.5849887132644653,
-0.10919415950775146,
-0.4784336984157562,
-0.22360214591026306,
-0.002540299203246832,
-0.402671217918396,
-0.5815972685813904,
0.9860715270042419,
0.017556432634592056,
0.2691520154476166,
-0.12649144232273102,
-0.6552583575248718,
0.08190950006246567,
-0.12218812853097916,
-0.5321180820465088,
1.0481722354888916,
0.05216602236032486,
-1.0521622896194458,
0.2866205871105194,
-0.7030685544013977,
-0.23451749980449677,
0.0009336897637695074,
-0.09300430119037628,
-0.657525360584259,
-0.274436354637146,
0.2610088288784027,
0.44434255361557007,
-0.20034609735012054,
0.06042402237653732,
0.05455314368009567,
-0.4433838725090027,
-0.01872597262263298,
-0.16614629328250885,
1.172338843345642,
0.3297537863254547,
-0.7460023760795593,
0.05531145632266998,
-1.100033164024353,
-0.09495808184146881,
-0.04057833552360535,
-0.582360029220581,
-0.15839290618896484,
0.049813397228717804,
0.2738820016384125,
-0.002104960847645998,
0.19394978880882263,
-0.8338613510131836,
-0.08087066560983658,
-0.7806958556175232,
0.5114627480506897,
0.7022870182991028,
0.030394166707992554,
0.3122868537902832,
-0.46452391147613525,
0.21139319241046906,
0.015172834508121014,
-0.08741871267557144,
-0.2638462483882904,
-0.6543995141983032,
-0.9591928720474243,
-0.6651941537857056,
0.3286188244819641,
0.7819647192955017,
-0.3755955100059509,
0.6682716012001038,
-0.22313745319843292,
-0.7684033513069153,
-0.9497262835502625,
0.07717517018318176,
0.6717448830604553,
0.41554078459739685,
0.4751504957675934,
-0.3395375907421112,
-0.828627347946167,
-0.8968144059181213,
-0.21412144601345062,
-0.6193299889564514,
-0.029529232531785965,
0.5035474300384521,
0.42448729276657104,
-0.07740554958581924,
0.8947339057922363,
-0.26638123393058777,
-0.3814567029476166,
0.04154631122946739,
0.14663082361221313,
0.632644772529602,
0.7171394228935242,
0.46501293778419495,
-0.8786052465438843,
-0.6690197587013245,
0.15919001400470734,
-0.5234656929969788,
-0.3014998435974121,
-0.07652464509010315,
0.01547771506011486,
0.15186187624931335,
0.40737923979759216,
-0.7069055438041687,
0.30167335271835327,
0.28912949562072754,
-0.1849319487810135,
0.7987956404685974,
0.04705231636762619,
0.20911581814289093,
-1.0671048164367676,
0.335908979177475,
0.09593464434146881,
-0.03639259934425354,
-0.7376508116722107,
-0.43950292468070984,
-0.1386975795030594,
0.12050379812717438,
-0.3737648129463196,
0.6522671580314636,
-0.40248963236808777,
-0.0935153067111969,
0.18065108358860016,
0.39223331212997437,
-0.25023606419563293,
0.5185419321060181,
0.03709175065159798,
0.8386786580085754,
0.645113468170166,
-0.6477234363555908,
0.4297598600387573,
0.6025969386100769,
-0.7036725878715515,
0.47113779187202454,
-0.7547126412391663,
0.14157742261886597,
0.22889572381973267,
0.13455796241760254,
-1.0982403755187988,
-0.12386061251163483,
0.6496719121932983,
-0.8349193930625916,
0.32657214999198914,
-0.3437745273113251,
-0.3266410231590271,
-0.5343348979949951,
-0.3351396322250366,
0.14395804703235626,
0.39860889315605164,
-0.5230734944343567,
0.40229395031929016,
0.4483557641506195,
-0.370726078748703,
-0.5949159264564514,
-0.602224588394165,
0.07501428574323654,
-0.39553847908973694,
-0.7066665291786194,
0.6690785884857178,
-0.23630444705486298,
-0.46428805589675903,
-0.1662517637014389,
-0.016717832535505295,
0.18470950424671173,
-0.23917065560817719,
0.3134172856807709,
0.15258629620075226,
-0.18825426697731018,
0.000678478681948036,
-0.2211502194404602,
-0.09936036914587021,
-0.2228866070508957,
-0.2746448218822479,
0.585229754447937,
-0.15632542967796326,
-0.23526184260845184,
-0.8136400580406189,
0.2708580195903778,
0.6914693117141724,
-0.5036512017250061,
0.5238419771194458,
1.014022946357727,
-0.16719239950180054,
-0.10257885605096817,
-0.714381217956543,
-0.04947765916585922,
-0.4816000759601593,
0.3643861711025238,
-0.37690845131874084,
-0.7841677069664001,
0.4779788851737976,
0.06639683991670609,
0.32543981075286865,
0.46630632877349854,
0.729669988155365,
-0.11702120304107666,
0.7088778614997864,
0.18586498498916626,
-0.1823398768901825,
0.5686129331588745,
-0.4416947662830353,
0.3410283029079437,
-1.0615181922912598,
-0.23051701486110687,
-0.8068626523017883,
0.01389317587018013,
-0.8559481501579285,
-0.45789197087287903,
0.42134708166122437,
0.13842371106147766,
-0.06673175096511841,
0.5483294129371643,
-0.8533541560173035,
0.15869660675525665,
0.6260855197906494,
-0.0762903019785881,
0.05004412308335304,
0.15935255587100983,
-0.25528234243392944,
-0.03283005952835083,
-0.394904226064682,
-0.6203187108039856,
1.093623161315918,
0.461495965719223,
0.27644363045692444,
0.0894298255443573,
0.773518443107605,
0.2753483057022095,
-0.2115844190120697,
-0.6837798953056335,
0.6348340511322021,
-0.08429161459207535,
-0.6271446347236633,
-0.46519050002098083,
-0.43993842601776123,
-0.996415913105011,
0.44316336512565613,
-0.04189366474747658,
-1.0809217691421509,
0.31139785051345825,
0.08103436976671219,
-0.2958941161632538,
0.37159472703933716,
-0.8924460411071777,
0.9297521710395813,
0.07125528901815414,
-0.24851064383983612,
-0.28786027431488037,
-0.7593072652816772,
0.21899431943893433,
0.16741903126239777,
0.4738672375679016,
-0.40718457102775574,
0.34933534264564514,
1.2055045366287231,
-0.3196558356285095,
0.6181140542030334,
-0.4229735732078552,
0.021158969029784203,
0.5348806381225586,
-0.19404317438602448,
0.3424853980541229,
0.10627037286758423,
-0.2756962478160858,
0.20992006361484528,
0.20366080105304718,
-0.3253035843372345,
-0.11547336727380753,
0.9227892160415649,
-0.9768168926239014,
-0.6229528188705444,
-0.32251933217048645,
-0.3340795338153839,
-0.0410146564245224,
0.12777750194072723,
0.32356342673301697,
0.4891795217990875,
-0.1284017115831375,
0.23344162106513977,
0.7163923382759094,
-0.39408838748931885,
0.724956214427948,
0.42102178931236267,
-0.016557112336158752,
-0.8527185320854187,
0.9719001650810242,
0.09007006883621216,
0.15519537031650543,
0.4198928475379944,
0.1639634221792221,
-0.23529808223247528,
-0.7749121189117432,
-0.46515217423439026,
0.28931957483291626,
-0.3984926640987396,
0.05397892743349075,
-0.9074088335037231,
-0.26572370529174805,
-0.8084260821342468,
0.25770869851112366,
-0.5612978339195251,
-0.612871527671814,
-0.33205080032348633,
-0.0702984407544136,
0.4176162779331207,
0.22528287768363953,
-0.32983943819999695,
0.27572986483573914,
-0.6633715629577637,
0.3489782214164734,
0.2714537978172302,
0.2209322452545166,
-0.24250808358192444,
-0.5351544618606567,
-0.46709421277046204,
0.14066879451274872,
-0.4216824471950531,
-0.7545863389968872,
0.5551787614822388,
0.45896342396736145,
0.682875394821167,
0.19921323657035828,
-0.0659668892621994,
0.6521615982055664,
-0.35458582639694214,
1.0635921955108643,
0.1739860326051712,
-1.130084753036499,
0.7580161094665527,
-0.5660167336463928,
0.1772264987230301,
0.5755302906036377,
0.2320944219827652,
-0.6799781918525696,
-0.2735157608985901,
-0.6537390351295471,
-1.186252474784851,
1.007886290550232,
0.4768899381160736,
-0.08352884650230408,
-0.03908713161945343,
0.01776973530650139,
-0.09118098020553589,
0.17418575286865234,
-0.5458808541297913,
-0.6962931156158447,
-0.2998243570327759,
0.024034688249230385,
-0.2152814269065857,
-0.13430075347423553,
-0.07242823392152786,
-0.6320847868919373,
1.1034892797470093,
0.20356465876102448,
0.5690706372261047,
0.5726444721221924,
0.024846063926815987,
-0.1516708880662918,
0.40646302700042725,
0.6691136956214905,
0.3979825973510742,
-0.6197104454040527,
0.018639003857970238,
0.0653306171298027,
-0.6384544372558594,
0.1107601746916771,
0.1205863505601883,
-0.0013138547074049711,
0.3671398162841797,
0.3977145254611969,
0.8938174247741699,
0.05358089506626129,
-0.42737239599227905,
0.4834756553173065,
-0.12690837681293488,
-0.3852023184299469,
-0.6137543320655823,
-0.08497423678636551,
0.37894436717033386,
0.20597544312477112,
0.4494578242301941,
-0.008221590891480446,
0.020412489771842957,
-0.5246446132659912,
0.2925678491592407,
0.13253985345363617,
-0.18711237609386444,
-0.2736893892288208,
0.6933713555335999,
0.28031089901924133,
-0.5906339883804321,
0.5941801071166992,
-0.20828348398208618,
-0.5016103386878967,
0.626960277557373,
0.36571839451789856,
0.9996060729026794,
-0.6052563786506653,
0.17151591181755066,
0.8487388491630554,
0.29761552810668945,
0.12231980264186859,
0.3573944568634033,
-0.4083987772464752,
-0.6111621856689453,
-0.22674278914928436,
-0.9682464003562927,
-0.3339362144470215,
0.2324984073638916,
-0.46775883436203003,
0.36778727173805237,
-0.446551114320755,
-0.27228718996047974,
0.43680286407470703,
0.2786136269569397,
-0.32632067799568176,
0.18563027679920197,
0.09591151773929596,
0.8455626964569092,
-0.8507956862449646,
0.8195220828056335,
0.5099328756332397,
-0.27936238050460815,
-0.954745888710022,
-0.0823313519358635,
0.06664897501468658,
-0.313906729221344,
0.2862056791782379,
0.04663074389100075,
0.019927754998207092,
-0.011005371809005737,
-0.2856571078300476,
-0.7349517345428467,
1.0551302433013916,
0.3168584108352661,
-0.9016863703727722,
0.2920510768890381,
-0.1660459339618683,
0.531557559967041,
-0.1927337646484375,
0.3354450762271881,
0.7501442432403564,
0.7563367486000061,
0.050576165318489075,
-1.4916571378707886,
-0.023035040125250816,
-0.7977182865142822,
-0.21026912331581116,
0.1320132613182068,
-0.8083056807518005,
0.9371298551559448,
-0.014335316605865955,
-0.27118000388145447,
0.081076480448246,
0.6347383856773376,
0.38524410128593445,
0.509187638759613,
0.6099571585655212,
0.7628762125968933,
0.7319537401199341,
-0.16058874130249023,
0.6111143231391907,
-0.44503870606422424,
0.33108893036842346,
1.0158940553665161,
0.03689805790781975,
0.8589426279067993,
0.5488936901092529,
-0.5027251243591309,
0.43378663063049316,
0.9209809899330139,
-0.16075533628463745,
0.592194139957428,
0.24977976083755493,
-0.4804703891277313,
-0.06364228576421738,
-0.1680014580488205,
-0.6831614375114441,
0.6406946182250977,
0.38118481636047363,
-0.3190217614173889,
0.3296033442020416,
-0.2010144740343094,
0.16138103604316711,
0.02554638311266899,
-0.10702019929885864,
0.6471405625343323,
0.1438736915588379,
-0.5712247490882874,
0.901692807674408,
-0.029061155393719673,
0.8950525522232056,
-0.4754740595817566,
0.10593101382255554,
0.0010674670338630676,
0.13821299374103546,
-0.5236428380012512,
-0.4338882565498352,
0.3508058190345764,
-0.09563697874546051,
-0.17142516374588013,
-0.2717415690422058,
0.4934777021408081,
-0.6045365333557129,
-0.3039717376232147,
0.4082376956939697,
0.3362652063369751,
0.4816244840621948,
0.20334459841251373,
-0.5547527074813843,
0.10204412788152695,
0.18538311123847961,
-0.3595014810562134,
0.211340993642807,
0.3195437788963318,
0.17490558326244354,
0.37128567695617676,
0.7915353178977966,
0.4650413393974304,
0.23331686854362488,
0.14320912957191467,
0.7613794207572937,
-0.5382829904556274,
-0.5780792832374573,
-0.8501709699630737,
0.4568614065647125,
-0.24231700599193573,
-0.4291776716709137,
1.0427929162979126,
0.8469064831733704,
0.9322530031204224,
0.11469299346208572,
0.7211629152297974,
-0.39246729016304016,
0.8150792121887207,
-0.27726417779922485,
0.841589093208313,
-0.4503955841064453,
0.44583824276924133,
-0.7182657122612,
-0.8607872128486633,
-0.09662318974733353,
0.6249884963035583,
-0.24834288656711578,
-0.016173535957932472,
0.6321659684181213,
1.019318699836731,
0.06638436019420624,
0.1665726602077484,
0.14691689610481262,
0.36267659068107605,
0.37363865971565247,
0.50056391954422,
0.6148096323013306,
-0.5155109763145447,
0.6170839071273804,
-0.6278937458992004,
-0.17905551195144653,
-0.1360311508178711,
-0.6057537198066711,
-0.7898434400558472,
-0.9422862529754639,
-0.684300422668457,
-0.37476104497909546,
0.07006839662790298,
1.141107201576233,
0.8997089266777039,
-0.8087998032569885,
-0.5633517503738403,
0.008337371982634068,
0.21594814956188202,
-0.45962342619895935,
-0.21452872455120087,
0.6688444018363953,
0.14536377787590027,
-0.8775783181190491,
0.6758636236190796,
0.24637426435947418,
-0.11784151196479797,
0.03980571776628494,
-0.21619100868701935,
-0.547023594379425,
0.023912418633699417,
0.24047943949699402,
0.39700496196746826,
-0.6454718112945557,
-0.1739964485168457,
-0.41626620292663574,
-0.004022074397653341,
0.3524095416069031,
0.5066542029380798,
-0.4562832713127136,
0.6690916419029236,
0.7168500423431396,
0.09386023133993149,
0.7947778105735779,
-0.10510631650686264,
0.26006773114204407,
-0.6771495342254639,
0.11473848670721054,
0.24735203385353088,
0.23791073262691498,
0.5368075966835022,
-0.2035607099533081,
0.5451125502586365,
0.444164514541626,
-0.7401115298271179,
-1.0296486616134644,
-0.2793926000595093,
-1.1205148696899414,
0.0005821044906042516,
1.1519460678100586,
-0.23736229538917542,
-0.3026426136493683,
-0.22207292914390564,
-0.4201187491416931,
0.6112344861030579,
-0.6509407162666321,
0.7498672604560852,
0.6540973782539368,
-0.14532174170017242,
-0.08331603556871414,
-0.6380972862243652,
0.662209689617157,
0.43321493268013,
-0.6358853578567505,
0.06730735301971436,
0.2799222767353058,
0.32660654187202454,
0.4721693694591522,
1.0675686597824097,
-0.22983984649181366,
0.1247422844171524,
0.14744648337364197,
0.27146267890930176,
-0.12045802175998688,
-0.09716016799211502,
-0.2374536395072937,
0.03242410346865654,
-0.11062584817409515,
-0.5477027893066406
] |
camembert-base | null | "2023-05-30T14:36:19Z" | 3,380,891 | 45 | transformers | [
"transformers",
"pytorch",
"tf",
"safetensors",
"camembert",
"fill-mask",
"fr",
"dataset:oscar",
"arxiv:1911.03894",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: fr
license: mit
datasets:
- oscar
---
# CamemBERT: a Tasty French Language Model
## Table of Contents
- [Model Details](#model-details)
- [Uses](#uses)
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
- [Training](#training)
- [Evaluation](#evaluation)
- [Citation Information](#citation-information)
- [How to Get Started With the Model](#how-to-get-started-with-the-model)
## Model Details
- **Model Description:**
CamemBERT is a state-of-the-art language model for French based on the RoBERTa model.
It is now available on Hugging Face in 6 different versions with varying number of parameters, amount of pretraining data and pretraining data source domains.
- **Developed by:** Louis Martin\*, Benjamin Muller\*, Pedro Javier Ortiz Suárez\*, Yoann Dupont, Laurent Romary, Éric Villemonte de la Clergerie, Djamé Seddah and Benoît Sagot.
- **Model Type:** Fill-Mask
- **Language(s):** French
- **License:** MIT
- **Parent Model:** See the [RoBERTa base model](https://huggingface.co/roberta-base) for more information about the RoBERTa base model.
- **Resources for more information:**
- [Research Paper](https://arxiv.org/abs/1911.03894)
- [Camembert Website](https://camembert-model.fr/)
## Uses
#### Direct Use
This model can be used for Fill-Mask tasks.
## Risks, Limitations and Biases
**CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.**
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
This model was pretrained on a subcorpus of OSCAR multilingual corpus. Some of the limitations and risks associated with the OSCAR dataset, which are further detailed in the [OSCAR dataset card](https://huggingface.co/datasets/oscar), include the following:
> The quality of some OSCAR sub-corpora might be lower than expected, specifically for the lowest-resource languages.
> Constructed from Common Crawl, Personal and sensitive information might be present.
## Training
#### Training Data
OSCAR or Open Super-large Crawled Aggregated coRpus is a multilingual corpus obtained by language classification and filtering of the Common Crawl corpus using the Ungoliant architecture.
#### Training Procedure
| Model | #params | Arch. | Training data |
|--------------------------------|--------------------------------|-------|-----------------------------------|
| `camembert-base` | 110M | Base | OSCAR (138 GB of text) |
| `camembert/camembert-large` | 335M | Large | CCNet (135 GB of text) |
| `camembert/camembert-base-ccnet` | 110M | Base | CCNet (135 GB of text) |
| `camembert/camembert-base-wikipedia-4gb` | 110M | Base | Wikipedia (4 GB of text) |
| `camembert/camembert-base-oscar-4gb` | 110M | Base | Subsample of OSCAR (4 GB of text) |
| `camembert/camembert-base-ccnet-4gb` | 110M | Base | Subsample of CCNet (4 GB of text) |
## Evaluation
The model developers evaluated CamemBERT using four different downstream tasks for French: part-of-speech (POS) tagging, dependency parsing, named entity recognition (NER) and natural language inference (NLI).
## Citation Information
```bibtex
@inproceedings{martin2020camembert,
title={CamemBERT: a Tasty French Language Model},
author={Martin, Louis and Muller, Benjamin and Su{\'a}rez, Pedro Javier Ortiz and Dupont, Yoann and Romary, Laurent and de la Clergerie, {\'E}ric Villemonte and Seddah, Djam{\'e} and Sagot, Beno{\^\i}t},
booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
year={2020}
}
```
## How to Get Started With the Model
##### Load CamemBERT and its sub-word tokenizer :
```python
from transformers import CamembertModel, CamembertTokenizer
# You can replace "camembert-base" with any other model from the table, e.g. "camembert/camembert-large".
tokenizer = CamembertTokenizer.from_pretrained("camembert-base")
camembert = CamembertModel.from_pretrained("camembert-base")
camembert.eval() # disable dropout (or leave in train mode to finetune)
```
##### Filling masks using pipeline
```python
from transformers import pipeline
camembert_fill_mask = pipeline("fill-mask", model="camembert-base", tokenizer="camembert-base")
results = camembert_fill_mask("Le camembert est <mask> :)")
# results
#[{'sequence': '<s> Le camembert est délicieux :)</s>', 'score': 0.4909103214740753, 'token': 7200},
# {'sequence': '<s> Le camembert est excellent :)</s>', 'score': 0.10556930303573608, 'token': 2183},
# {'sequence': '<s> Le camembert est succulent :)</s>', 'score': 0.03453315049409866, 'token': 26202},
# {'sequence': '<s> Le camembert est meilleur :)</s>', 'score': 0.03303130343556404, 'token': 528},
# {'sequence': '<s> Le camembert est parfait :)</s>', 'score': 0.030076518654823303, 'token': 1654}]
```
##### Extract contextual embedding features from Camembert output
```python
import torch
# Tokenize in sub-words with SentencePiece
tokenized_sentence = tokenizer.tokenize("J'aime le camembert !")
# ['▁J', "'", 'aime', '▁le', '▁ca', 'member', 't', '▁!']
# 1-hot encode and add special starting and end tokens
encoded_sentence = tokenizer.encode(tokenized_sentence)
# [5, 121, 11, 660, 16, 730, 25543, 110, 83, 6]
# NB: Can be done in one step : tokenize.encode("J'aime le camembert !")
# Feed tokens to Camembert as a torch tensor (batch dim 1)
encoded_sentence = torch.tensor(encoded_sentence).unsqueeze(0)
embeddings, _ = camembert(encoded_sentence)
# embeddings.detach()
# embeddings.size torch.Size([1, 10, 768])
# tensor([[[-0.0254, 0.0235, 0.1027, ..., -0.1459, -0.0205, -0.0116],
# [ 0.0606, -0.1811, -0.0418, ..., -0.1815, 0.0880, -0.0766],
# [-0.1561, -0.1127, 0.2687, ..., -0.0648, 0.0249, 0.0446],
# ...,
```
##### Extract contextual embedding features from all Camembert layers
```python
from transformers import CamembertConfig
# (Need to reload the model with new config)
config = CamembertConfig.from_pretrained("camembert-base", output_hidden_states=True)
camembert = CamembertModel.from_pretrained("camembert-base", config=config)
embeddings, _, all_layer_embeddings = camembert(encoded_sentence)
# all_layer_embeddings list of len(all_layer_embeddings) == 13 (input embedding layer + 12 self attention layers)
all_layer_embeddings[5]
# layer 5 contextual embedding : size torch.Size([1, 10, 768])
#tensor([[[-0.0032, 0.0075, 0.0040, ..., -0.0025, -0.0178, -0.0210],
# [-0.0996, -0.1474, 0.1057, ..., -0.0278, 0.1690, -0.2982],
# [ 0.0557, -0.0588, 0.0547, ..., -0.0726, -0.0867, 0.0699],
# ...,
```
| [
-0.2070927619934082,
-0.7769386768341064,
0.266449898481369,
0.2875369191169739,
-0.19093383848667145,
-0.0912766307592392,
-0.3455781042575836,
-0.12575390934944153,
0.41002902388572693,
0.4979154169559479,
-0.48610177636146545,
-0.6467690467834473,
-0.7167073488235474,
0.08152361959218979,
-0.425447553396225,
1.1187357902526855,
0.0787356048822403,
0.17178180813789368,
0.12120787054300308,
-0.07430192828178406,
-0.2343285083770752,
-0.6807337999343872,
-0.6634750962257385,
-0.340468168258667,
0.4654185175895691,
0.1419544667005539,
0.4853493571281433,
0.4900449514389038,
0.3337777554988861,
0.35972970724105835,
-0.1379079669713974,
0.04570191726088524,
-0.43888893723487854,
-0.1677868664264679,
-0.03999413177371025,
-0.5321385264396667,
-0.6115957498550415,
0.17155103385448456,
0.5555588006973267,
0.6310852766036987,
0.009094133041799068,
0.09562458097934723,
0.09327064454555511,
0.7416137456893921,
-0.23533612489700317,
0.3588613271713257,
-0.5179158449172974,
0.1210634857416153,
-0.18543729186058044,
-0.05925330892205238,
-0.4506530165672302,
-0.268050879240036,
0.11022133380174637,
-0.509780764579773,
0.15978360176086426,
0.025151584297418594,
1.1708441972732544,
0.046633314341306686,
-0.2837982177734375,
-0.09241984039545059,
-0.3426502048969269,
0.9940030574798584,
-0.9198299646377563,
0.6516249775886536,
0.4693313241004944,
0.018506070598959923,
-0.14464223384857178,
-1.0640995502471924,
-0.7318181991577148,
-0.2441163957118988,
-0.31788015365600586,
0.3461078107357025,
-0.256093829870224,
-0.2021382451057434,
0.11653248965740204,
0.40398967266082764,
-0.6839776039123535,
-0.22422662377357483,
-0.35830333828926086,
-0.2293001115322113,
0.6885553598403931,
-0.14508962631225586,
0.4242398142814636,
-0.41424745321273804,
-0.30678707361221313,
-0.37470194697380066,
-0.45465487241744995,
0.001073919702321291,
0.23051100969314575,
0.36411982774734497,
-0.41077718138694763,
0.7336089015007019,
-0.1811220496892929,
0.6783138513565063,
-0.04652146250009537,
-0.11608413606882095,
0.7304472327232361,
-0.41192626953125,
-0.2239084392786026,
-0.030498268082737923,
1.0412251949310303,
0.340416818857193,
0.3885027766227722,
-0.10539908707141876,
-0.1771899312734604,
-0.02046041749417782,
0.020220613107085228,
-0.6542843580245972,
-0.41215983033180237,
0.33729735016822815,
-0.3210911750793457,
-0.20656317472457886,
0.03633676469326019,
-0.7051790356636047,
0.1017153412103653,
-0.11097768694162369,
0.4898217022418976,
-0.7241063714027405,
-0.12725432217121124,
0.19815056025981903,
-0.22094033658504486,
0.25587528944015503,
0.16601435840129852,
-0.6625134348869324,
0.13297699391841888,
0.4550510346889496,
0.9432023167610168,
-0.07763443142175674,
-0.42078283429145813,
-0.44640830159187317,
-0.16289864480495453,
-0.11778182536363602,
0.5018124580383301,
-0.3811485469341278,
-0.18431133031845093,
-0.09821147471666336,
0.31563085317611694,
-0.2778093218803406,
-0.26082998514175415,
0.5829228758811951,
-0.3659677803516388,
0.5226643681526184,
-0.08827561885118484,
-0.6805098652839661,
-0.4072463810443878,
0.40736234188079834,
-0.6930243968963623,
1.1135869026184082,
0.4249843955039978,
-0.9752894639968872,
0.22598281502723694,
-0.5225355625152588,
-0.30856338143348694,
0.015235910192131996,
-0.25315988063812256,
-0.45485377311706543,
-0.08744870871305466,
0.5411642789840698,
0.5653753280639648,
-0.27423107624053955,
0.3207547664642334,
0.0740630105137825,
-0.18364624679088593,
0.40882840752601624,
-0.42636340856552124,
1.2097831964492798,
0.14377081394195557,
-0.3814091384410858,
0.06641169637441635,
-0.8511677980422974,
0.0573512427508831,
0.26023155450820923,
-0.5189068913459778,
0.05412464216351509,
-0.17091411352157593,
0.26475492119789124,
0.14012712240219116,
0.2364511638879776,
-0.5558851957321167,
0.002672243630513549,
-0.6988934874534607,
0.7365543246269226,
0.654536783695221,
0.06511908769607544,
0.18180157244205475,
-0.4519493281841278,
0.4137020707130432,
0.2318493276834488,
-0.04443474858999252,
-0.12640249729156494,
-0.5633297562599182,
-0.9980066418647766,
-0.5758472681045532,
0.6086481213569641,
0.8644822835922241,
-0.7488685250282288,
0.8846265077590942,
-0.40310052037239075,
-0.5917433500289917,
-0.5699043273925781,
-0.05762727931141853,
0.25806760787963867,
0.36552783846855164,
0.46007040143013,
-0.4457418620586395,
-0.497494637966156,
-0.978053629398346,
-0.05323421210050583,
-0.10066743940114975,
0.055395808070898056,
0.11417169868946075,
0.7236053943634033,
-0.19098667800426483,
1.041643500328064,
-0.5183318853378296,
-0.23975250124931335,
-0.36177319288253784,
-0.08059262484312057,
0.44912591576576233,
0.8024670481681824,
0.7056496739387512,
-0.6197960376739502,
-0.4913536310195923,
-0.02084464021027088,
-0.8159189820289612,
0.17713585495948792,
0.1107712909579277,
-0.13968294858932495,
0.15177971124649048,
0.4700145423412323,
-0.5474699139595032,
0.3720804452896118,
0.45905858278274536,
-0.3040297329425812,
0.5002972483634949,
-0.07510141283273697,
0.14029762148857117,
-1.3739579916000366,
-0.03437133505940437,
0.0792592316865921,
-0.2573487460613251,
-0.5703240633010864,
0.08187571913003922,
-0.07575596868991852,
-0.17720939218997955,
-0.6672412753105164,
0.6688834428787231,
-0.3679696023464203,
0.3248247802257538,
0.16493414342403412,
0.2837461829185486,
0.060154661536216736,
0.9857774972915649,
0.1858711689710617,
0.5819405913352966,
0.7183542251586914,
-0.3952402174472809,
0.4744337201118469,
0.3285937011241913,
-0.5247743129730225,
0.47039568424224854,
-0.7125722169876099,
0.060259971767663956,
-0.04811681807041168,
0.3211110234260559,
-1.083843469619751,
-0.1513768434524536,
0.5303059220314026,
-0.6528106927871704,
0.2528556287288666,
-0.16911445558071136,
-0.5268341302871704,
-0.2967546880245209,
-0.3168278932571411,
0.3206290602684021,
0.4110613167285919,
-0.38244038820266724,
0.5266299247741699,
0.2258489727973938,
-0.06954986602067947,
-0.6125079989433289,
-1.028951644897461,
0.08016899973154068,
-0.3228811025619507,
-0.7730215787887573,
0.3697158992290497,
-0.1957678496837616,
0.0730941891670227,
0.03292829915881157,
0.1439099907875061,
-0.018388276919722557,
-0.05880769342184067,
0.010166645981371403,
0.06657203286886215,
-0.22000278532505035,
-0.057652540504932404,
-0.11008748412132263,
-0.056508246809244156,
-0.2733965814113617,
-0.4581891596317291,
0.8376305103302002,
-0.3608521819114685,
-0.13908399641513824,
-0.4311908185482025,
0.30103200674057007,
0.35935521125793457,
-0.34295737743377686,
0.9272446632385254,
0.9557994604110718,
-0.4583802819252014,
0.016220808029174805,
-0.46994131803512573,
-0.22547844052314758,
-0.46839436888694763,
0.5678589940071106,
-0.44883838295936584,
-0.8824905753135681,
0.6035121083259583,
0.2851848304271698,
0.032649483531713486,
0.6818426847457886,
0.5627790689468384,
0.06205911561846733,
0.8743088245391846,
0.4753853976726532,
-0.1324191689491272,
0.4455188810825348,
-0.6923421025276184,
0.262372761964798,
-0.7848115563392639,
-0.31384995579719543,
-0.4577963948249817,
-0.19162242114543915,
-0.7852491736412048,
-0.4282299876213074,
0.33330339193344116,
0.10529640316963196,
-0.23320266604423523,
0.6152833700180054,
-0.5008321404457092,
0.15025343000888824,
0.6294376254081726,
0.35879233479499817,
0.058179620653390884,
0.21607360243797302,
-0.4207810163497925,
-0.13704654574394226,
-0.9596631526947021,
-0.5036923885345459,
0.9357978105545044,
0.5762865543365479,
0.6133278012275696,
0.17513461410999298,
0.7224481701850891,
0.22977089881896973,
0.04895983636379242,
-0.7706615924835205,
0.6634319424629211,
-0.24549663066864014,
-0.7140659689903259,
-0.21999503672122955,
-0.4897450804710388,
-0.9038904309272766,
0.30315858125686646,
-0.17572113871574402,
-0.9602953195571899,
0.26113221049308777,
0.11307758092880249,
-0.1818854659795761,
0.2631813883781433,
-0.8562856912612915,
1.0474613904953003,
-0.2868487238883972,
-0.34263381361961365,
0.10451466590166092,
-0.6256647706031799,
0.21552309393882751,
-0.010165325365960598,
0.305802583694458,
0.03877865523099899,
0.22640344500541687,
1.1133840084075928,
-0.4874689280986786,
1.0097005367279053,
0.11658637970685959,
-0.05380525439977646,
0.3154411017894745,
0.01354138646274805,
0.45374852418899536,
0.14684009552001953,
-0.07337409257888794,
0.3731861412525177,
0.029433168470859528,
-0.5445858240127563,
-0.4258035719394684,
0.7347083687782288,
-0.8373804688453674,
-0.45873624086380005,
-0.6554712057113647,
-0.4252380430698395,
-0.00970146618783474,
0.2628324031829834,
0.6368587613105774,
0.6361039876937866,
-0.17512470483779907,
0.2550908923149109,
0.39256536960601807,
-0.4761057198047638,
0.4712749123573303,
0.17424143850803375,
-0.16505704820156097,
-0.6028103828430176,
1.0767463445663452,
0.13749048113822937,
0.08604037016630173,
0.4982417821884155,
0.2236202508211136,
-0.23399586975574493,
-0.4014480412006378,
-0.35182058811187744,
0.42874348163604736,
-0.6779349446296692,
-0.09361381083726883,
-0.8557656407356262,
-0.5713219046592712,
-0.6236661672592163,
-0.14310985803604126,
-0.4336232841014862,
-0.6846891641616821,
-0.4046773612499237,
-0.18049022555351257,
0.47188499569892883,
0.38501298427581787,
-0.07002799212932587,
0.5543898940086365,
-0.7206758856773376,
-0.023309316486120224,
0.1964564025402069,
0.2548882067203522,
-0.08343537896871567,
-0.7673271894454956,
-0.4173106849193573,
0.06305162608623505,
-0.29057443141937256,
-0.8715652227401733,
0.5781864523887634,
0.19851185381412506,
0.5965977311134338,
0.21690987050533295,
-0.10663305968046188,
0.332023561000824,
-0.5924773216247559,
1.2077369689941406,
0.32207560539245605,
-0.9352037310600281,
0.4587792158126831,
-0.18551048636436462,
0.26542070508003235,
0.3922673463821411,
0.4768519401550293,
-0.6461285948753357,
-0.3839103877544403,
-0.7958201766014099,
-1.1395063400268555,
0.9273571968078613,
0.6279476284980774,
0.1354353129863739,
-0.2791042923927307,
0.12280555814504623,
-0.01805209368467331,
0.24295108020305634,
-1.219592809677124,
-0.44706615805625916,
-0.5797855257987976,
-0.3859685957431793,
-0.30912479758262634,
-0.13357949256896973,
-0.15917548537254333,
-0.4320646822452545,
0.9667790532112122,
0.15714682638645172,
0.5840411186218262,
0.2846158444881439,
-0.2830241620540619,
0.2036566287279129,
0.2580178678035736,
0.5737600922584534,
0.581550657749176,
-0.46365904808044434,
0.22106488049030304,
0.1277366578578949,
-0.512198805809021,
0.09643346816301346,
0.20417357981204987,
-0.0625682845711708,
0.020084142684936523,
0.7479631900787354,
1.0430961847305298,
-0.0006638362538069487,
-0.6233521699905396,
0.5087204575538635,
-0.015392731875181198,
-0.24287904798984528,
-0.46613553166389465,
0.008842137642204762,
0.08991369605064392,
0.34299489855766296,
0.16857485473155975,
-0.12097562849521637,
-0.20553624629974365,
-0.6246840357780457,
0.43865105509757996,
0.26521897315979004,
-0.4944210648536682,
-0.33091142773628235,
0.6462674140930176,
0.07650311291217804,
-0.4192731976509094,
0.694080114364624,
-0.23512819409370422,
-0.7735676169395447,
0.44081661105155945,
0.565473735332489,
0.876186728477478,
-0.06027614697813988,
0.2656620144844055,
0.6121359467506409,
0.5303942561149597,
0.04444729536771774,
0.1628478765487671,
0.20908421277999878,
-1.0041221380233765,
-0.20235715806484222,
-0.8107598423957825,
0.23678681254386902,
0.3547697067260742,
-0.3879098892211914,
0.09077656269073486,
-0.3676655888557434,
-0.28093039989471436,
0.039512597024440765,
0.002489472273737192,
-0.8144279718399048,
0.3899053931236267,
-0.10942131280899048,
0.8782755732536316,
-1.0013495683670044,
0.7727744579315186,
0.647252082824707,
-0.7276992797851562,
-0.7615512013435364,
0.00563563359901309,
-0.1391763985157013,
-0.9663750529289246,
0.7928305864334106,
0.10658469796180725,
0.1298031508922577,
0.24501439929008484,
-0.5780476927757263,
-0.8366810083389282,
0.9362972378730774,
0.33355042338371277,
-0.4489494860172272,
-0.011633945629000664,
-0.01818530447781086,
0.4631975591182709,
-0.4197714626789093,
0.3761138617992401,
0.6890490651130676,
0.4325732886791229,
0.03177680820226669,
-0.7323375344276428,
0.0668400451540947,
-0.40577706694602966,
-0.021821381524205208,
-0.08239664137363434,
-0.7744654417037964,
0.9564264416694641,
0.06981784850358963,
-0.0985802710056305,
-0.15221121907234192,
0.7888681888580322,
0.13899639248847961,
-0.008445396088063717,
0.4253062605857849,
0.8192796111106873,
0.5563415884971619,
-0.23917138576507568,
1.0039138793945312,
-0.26861435174942017,
0.5305231213569641,
0.9306675791740417,
0.12457256019115448,
0.748158872127533,
0.318163126707077,
-0.35555052757263184,
0.5803368091583252,
0.7627497911453247,
0.034561771899461746,
0.5760408639907837,
0.21366605162620544,
-0.14407846331596375,
-0.009854194708168507,
0.10606899112462997,
-0.42945998907089233,
0.49653729796409607,
0.35631227493286133,
-0.4391091763973236,
-0.11977531015872955,
0.07553870975971222,
0.2974563539028168,
-0.04299416393041611,
0.025238117203116417,
0.4956839978694916,
0.22695292532444,
-0.6051536798477173,
0.891351044178009,
0.2943339943885803,
0.706481397151947,
-0.5907391309738159,
0.1158846840262413,
-0.28568652272224426,
0.04993019625544548,
-0.18693657219409943,
-0.7666521072387695,
0.025024715811014175,
-0.027115676552057266,
-0.03318774327635765,
-0.025208009406924248,
0.36536848545074463,
-0.6724826693534851,
-0.842572033405304,
0.33259060978889465,
0.5636960864067078,
0.2837758958339691,
0.08219299465417862,
-1.0600261688232422,
0.13078445196151733,
0.2789050042629242,
-0.513985276222229,
0.05986270308494568,
0.35528209805488586,
0.1238442063331604,
0.49330171942710876,
0.42392799258232117,
0.06927647441625595,
0.10879911482334137,
0.13307037949562073,
0.7830026745796204,
-0.710451602935791,
-0.5809164643287659,
-0.8952577114105225,
0.6993532180786133,
0.022837143391370773,
-0.29741594195365906,
0.7349061369895935,
0.723940372467041,
0.9698793292045593,
-0.16456438601016998,
0.8107301592826843,
-0.2594033181667328,
0.3814103901386261,
-0.8267109394073486,
0.6720023155212402,
-0.8415936827659607,
0.16099561750888824,
-0.37504276633262634,
-1.0544270277023315,
-0.32311826944351196,
0.9117361903190613,
-0.2640768587589264,
0.3068670332431793,
0.8987795114517212,
1.0236445665359497,
-0.2845410406589508,
-0.23557385802268982,
0.21740815043449402,
0.4614766538143158,
0.37252408266067505,
0.5379915833473206,
0.4950312376022339,
-0.6467673182487488,
0.3298538327217102,
-0.42982757091522217,
-0.30782291293144226,
-0.18049319088459015,
-0.9370935559272766,
-1.0227724313735962,
-0.959510326385498,
-0.5374981760978699,
-0.5750638246536255,
0.06014063209295273,
1.0926460027694702,
0.7097266912460327,
-0.9778966307640076,
-0.40929678082466125,
-0.021693821996450424,
-0.026770923286676407,
-0.3094683289527893,
-0.2836100459098816,
0.7644985318183899,
-0.12935706973075867,
-0.7973750829696655,
0.4688512980937958,
-0.014111610129475594,
0.08249107748270035,
-0.04297354072332382,
-0.09036946296691895,
-0.734833300113678,
0.19052910804748535,
0.7058835625648499,
0.09066618233919144,
-0.6895275712013245,
-0.39320263266563416,
-0.10199156403541565,
-0.015082930214703083,
0.22241534292697906,
0.3866930902004242,
-0.5701892971992493,
0.34508493542671204,
0.5294347405433655,
0.426581472158432,
0.8132657408714294,
-0.20616531372070312,
0.4706002473831177,
-1.1168986558914185,
0.38695842027664185,
0.12867996096611023,
0.5368437170982361,
0.4687815010547638,
-0.26716288924217224,
0.617825984954834,
0.4703275263309479,
-0.44641560316085815,
-0.7674687504768372,
0.14419494569301605,
-1.2910048961639404,
-0.3350038528442383,
0.9643173217773438,
-0.15759824216365814,
-0.4037247598171234,
0.18105871975421906,
-0.25376129150390625,
0.5149141550064087,
-0.491005003452301,
0.49476009607315063,
0.8356090188026428,
0.001698327250778675,
-0.3318643271923065,
-0.6273629069328308,
0.4678065776824951,
0.41889238357543945,
-0.5869928598403931,
-0.18037326633930206,
0.2634943425655365,
0.45167267322540283,
0.2596563696861267,
0.6777139902114868,
-0.1349841058254242,
-0.03993600606918335,
-0.04848935827612877,
0.11507365852594376,
0.14965006709098816,
-0.2292601466178894,
-0.16176705062389374,
0.09744815528392792,
-0.056510187685489655,
-0.2893727421760559
] |
google/electra-base-discriminator | google | "2021-04-30T07:33:10Z" | 3,343,622 | 38 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"electra",
"pretraining",
"en",
"arxiv:1406.2661",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | null | "2022-03-02T23:29:05Z" | ---
language: en
thumbnail: https://huggingface.co/front/thumbnails/google.png
license: apache-2.0
---
## ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
**ELECTRA** is a new method for self-supervised language representation learning. It can be used to pre-train transformer networks using relatively little compute. ELECTRA models are trained to distinguish "real" input tokens vs "fake" input tokens generated by another neural network, similar to the discriminator of a [GAN](https://arxiv.org/pdf/1406.2661.pdf). At small scale, ELECTRA achieves strong results even when trained on a single GPU. At large scale, ELECTRA achieves state-of-the-art results on the [SQuAD 2.0](https://rajpurkar.github.io/SQuAD-explorer/) dataset.
For a detailed description and experimental results, please refer to our paper [ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators](https://openreview.net/pdf?id=r1xMH1BtvB).
This repository contains code to pre-train ELECTRA, including small ELECTRA models on a single GPU. It also supports fine-tuning ELECTRA on downstream tasks including classification tasks (e.g,. [GLUE](https://gluebenchmark.com/)), QA tasks (e.g., [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/)), and sequence tagging tasks (e.g., [text chunking](https://www.clips.uantwerpen.be/conll2000/chunking/)).
## How to use the discriminator in `transformers`
```python
from transformers import ElectraForPreTraining, ElectraTokenizerFast
import torch
discriminator = ElectraForPreTraining.from_pretrained("google/electra-base-discriminator")
tokenizer = ElectraTokenizerFast.from_pretrained("google/electra-base-discriminator")
sentence = "The quick brown fox jumps over the lazy dog"
fake_sentence = "The quick brown fox fake over the lazy dog"
fake_tokens = tokenizer.tokenize(fake_sentence)
fake_inputs = tokenizer.encode(fake_sentence, return_tensors="pt")
discriminator_outputs = discriminator(fake_inputs)
predictions = torch.round((torch.sign(discriminator_outputs[0]) + 1) / 2)
[print("%7s" % token, end="") for token in fake_tokens]
[print("%7s" % int(prediction), end="") for prediction in predictions.tolist()]
```
| [
-0.46786731481552124,
-0.5035800933837891,
0.15870589017868042,
0.18237003684043884,
-0.2396235466003418,
0.3421207070350647,
-0.24695323407649994,
-0.1805099993944168,
0.38204070925712585,
0.45707786083221436,
-0.34906333684921265,
-0.22032558917999268,
-0.516406774520874,
0.40777695178985596,
-0.6157708764076233,
1.0308805704116821,
-0.1857980191707611,
-0.1282731592655182,
-0.05228058248758316,
-0.06162406876683235,
-0.39490383863449097,
-0.6197439432144165,
-0.48777833580970764,
-0.6013688445091248,
0.37754738330841064,
0.3431233763694763,
0.14893405139446259,
0.3081524670124054,
0.33802732825279236,
0.5531553626060486,
0.20071765780448914,
0.20292755961418152,
-0.3660844564437866,
-0.009130733087658882,
0.044995855540037155,
-0.6122880578041077,
-0.1238613948225975,
0.044134471565485,
0.4443221390247345,
0.09383804351091385,
-0.19037982821464539,
0.07459661364555359,
-0.2028546929359436,
0.6975823640823364,
-0.7090725302696228,
0.14396239817142487,
-0.825715959072113,
0.05140487477183342,
-0.2729720175266266,
-0.1447269320487976,
-0.7651249170303345,
-0.282558798789978,
-0.12059980630874634,
-0.591403603553772,
0.5531177520751953,
0.03220100328326225,
1.139703631401062,
0.3558046817779541,
-0.1913052499294281,
-0.2794785797595978,
-0.8152005076408386,
0.7003665566444397,
-0.4502411484718323,
0.1675022542476654,
0.1694602370262146,
0.30313563346862793,
0.1737348586320877,
-1.0619702339172363,
-0.8828858733177185,
0.06862344592809677,
-0.09111928194761276,
0.43098902702331543,
-0.3889434337615967,
0.2527746260166168,
0.26088640093803406,
0.42597702145576477,
-0.40596655011177063,
0.23407749831676483,
-0.5772708058357239,
-0.17012019455432892,
0.6088951826095581,
-0.14442691206932068,
0.1989906132221222,
-0.006000718101859093,
-0.2493627518415451,
-0.35517483949661255,
-0.7643159627914429,
-0.04837173596024513,
0.4973934590816498,
0.16602221131324768,
-0.05935683473944664,
0.556891679763794,
-0.09659190475940704,
0.49732348322868347,
0.5765964388847351,
0.2701159119606018,
0.6433681845664978,
-0.03911818563938141,
-0.25510069727897644,
0.392735093832016,
1.0767662525177002,
-0.03248295560479164,
0.35690152645111084,
-0.19522669911384583,
-0.21946166455745697,
0.4121529161930084,
0.35847145318984985,
-1.0072557926177979,
-0.5517664551734924,
0.08071630448102951,
-0.4218267500400543,
-0.40146303176879883,
-0.03820844367146492,
-0.8958761692047119,
-0.07818519324064255,
0.1226731538772583,
0.5979523062705994,
-0.41477513313293457,
-0.3214628994464874,
0.12216611206531525,
-0.20380327105522156,
0.2949010729789734,
0.037971366196870804,
-1.1122229099273682,
0.33961716294288635,
0.2255469411611557,
0.7360561490058899,
-0.020587079226970673,
-0.42004284262657166,
-0.3694429099559784,
-0.10924629122018814,
-0.03821331262588501,
1.0614023208618164,
-0.21702416241168976,
-0.1316070854663849,
0.12427537888288498,
0.03420969843864441,
-0.3674127459526062,
-0.55693119764328,
0.36832475662231445,
-0.5851938128471375,
0.23876050114631653,
0.07396918535232544,
-0.6494746208190918,
-0.25707200169563293,
-0.21874333918094635,
-0.8665657639503479,
1.0891456604003906,
0.07732488214969635,
-0.7491143941879272,
0.4583355486392975,
-0.6570954918861389,
-0.5407304167747498,
0.12638135254383087,
-0.056190840899944305,
-0.6585291028022766,
0.06721344590187073,
0.2817690968513489,
0.329304963350296,
0.0017868332797661424,
0.036893248558044434,
0.014450429007411003,
-0.34191739559173584,
0.23733147978782654,
-0.3058196008205414,
0.5881789922714233,
0.22212934494018555,
-0.5998943448066711,
0.32385313510894775,
-0.6708123683929443,
0.061559002846479416,
0.17106884717941284,
-0.15278685092926025,
0.025973591953516006,
0.22624234855175018,
0.09972742944955826,
0.30478090047836304,
0.23499052226543427,
-0.5916194915771484,
-0.0019906095694750547,
-0.6568200588226318,
0.7140429019927979,
0.7799120545387268,
-0.4005926251411438,
0.49876296520233154,
-0.13091367483139038,
0.4737474322319031,
0.023893257603049278,
-0.21232938766479492,
-0.23455771803855896,
-0.28204262256622314,
-1.247557282447815,
-0.18018104135990143,
0.24171419441699982,
0.5186046957969666,
-0.9751527309417725,
0.9128643870353699,
-0.1222832202911377,
-0.6818627715110779,
-0.5619500875473022,
0.008047465234994888,
0.1748499870300293,
0.1728200614452362,
0.6233708262443542,
-0.04277723655104637,
-1.110663652420044,
-0.6136728525161743,
-0.17159076035022736,
-0.4180614650249481,
0.2290830910205841,
-0.31290799379348755,
0.79133141040802,
-0.08704496920108795,
1.078558087348938,
-0.2148909568786621,
-0.32485729455947876,
-0.8850105404853821,
0.11452698707580566,
0.2525997459888458,
0.4952768385410309,
0.4094217121601105,
-0.7108836770057678,
-0.40330418944358826,
-0.0909181460738182,
-0.5675150156021118,
0.04977511987090111,
-0.1025337502360344,
0.22529076039791107,
0.035605307668447495,
0.519364058971405,
-0.8166416883468628,
0.39436110854148865,
0.5016198754310608,
-0.442222535610199,
0.5513811707496643,
-0.3671051561832428,
-0.11621570587158203,
-0.9962042570114136,
-0.20395882427692413,
-0.03380362689495087,
-0.24762605130672455,
-0.7704535126686096,
-0.1659657210111618,
0.05499903857707977,
0.12202095985412598,
-0.6226652264595032,
0.38687241077423096,
-0.2950652837753296,
0.16751901805400848,
-0.22210398316383362,
-0.08367251604795456,
-0.03289126977324486,
0.48235243558883667,
0.07278211414813995,
1.0453662872314453,
0.3712318539619446,
-0.6786788702011108,
0.3654410243034363,
0.30743858218193054,
-0.32238897681236267,
0.23823373019695282,
-0.8787901401519775,
0.3032035827636719,
-0.24893216788768768,
0.30102625489234924,
-0.789017379283905,
0.012325610965490341,
0.10370532423257828,
-0.42518964409828186,
0.2718266248703003,
0.14676809310913086,
-0.6896830797195435,
-0.7310075163841248,
-0.3056110143661499,
0.37720420956611633,
0.7852373123168945,
-0.8106055855751038,
0.5617831945419312,
0.4584295451641083,
0.36112499237060547,
-0.3748151361942291,
-0.6044018268585205,
-0.15976397693157196,
-0.3356480598449707,
-0.25820890069007874,
0.5766503214836121,
0.10093165934085846,
0.11236101388931274,
-0.15151900053024292,
0.024273507297039032,
-0.24640823900699615,
-0.10394225269556046,
0.17705829441547394,
0.23823395371437073,
-0.0007736451807431877,
0.19687777757644653,
0.014715161174535751,
-0.20757970213890076,
0.03245176002383232,
-0.1654718667268753,
0.9810335040092468,
-0.4335159957408905,
-0.15189574658870697,
-0.44304704666137695,
0.08978106081485748,
0.24563941359519958,
-0.5220000743865967,
0.7451990842819214,
0.8408203125,
-0.3197384178638458,
-0.20879551768302917,
-0.7027915120124817,
-0.08542880415916443,
-0.6128014326095581,
0.5445824861526489,
-0.3793202042579651,
-0.9092311859130859,
0.4301937520503998,
0.012255452573299408,
-0.002486234297975898,
0.9247403740882874,
0.7635320425033569,
-0.15603353083133698,
1.206798791885376,
0.6172437071800232,
-0.16235847771167755,
0.74818354845047,
-0.6657273769378662,
0.39030539989471436,
-0.8115473985671997,
-0.298913836479187,
-0.6360396146774292,
-0.15150517225265503,
-0.5616489052772522,
-0.24462774395942688,
-0.18925714492797852,
0.10921425372362137,
-0.41095587611198425,
0.6207619905471802,
-0.9631084203720093,
0.46558061242103577,
0.34844061732292175,
0.03396981954574585,
-0.05171993002295494,
0.0908544734120369,
0.16769085824489594,
-0.040641993284225464,
-0.8252916932106018,
-0.5749652981758118,
1.110683560371399,
0.20016933977603912,
0.9560417532920837,
-0.44975095987319946,
0.9911748170852661,
0.18212264776229858,
0.3593507707118988,
-0.7131392359733582,
0.6332244873046875,
-0.2802499234676361,
-0.5834000706672668,
-0.1542137712240219,
-0.3753882348537445,
-1.215924859046936,
0.3671075403690338,
0.016907572746276855,
-0.7852813005447388,
0.23772357404232025,
0.0809519961476326,
-0.25666552782058716,
0.6126299500465393,
-0.8982350826263428,
0.9184730648994446,
-0.14927580952644348,
0.017117280513048172,
-0.14989027380943298,
-0.17586669325828552,
-0.06170665845274925,
0.11913060396909714,
-0.07147886604070663,
-0.05031190812587738,
0.2905833423137665,
1.1476917266845703,
-0.5538703203201294,
0.8141566514968872,
-0.15348374843597412,
0.23655474185943604,
0.5481458306312561,
-0.40329673886299133,
0.48451873660087585,
-0.2880099415779114,
0.02039082907140255,
0.029237210750579834,
-0.007597627583891153,
-0.13265322148799896,
-0.28741753101348877,
0.40366330742836,
-1.0259439945220947,
-0.34891757369041443,
-0.6038991808891296,
-0.1947016716003418,
0.27708926796913147,
0.3976852297782898,
0.883405864238739,
0.36869820952415466,
-0.2190110832452774,
0.1354561746120453,
0.621698796749115,
-0.11548705399036407,
0.7562589049339294,
0.10342870652675629,
-0.07223008573055267,
-0.36814162135124207,
1.082885980606079,
0.14792892336845398,
0.016430605202913284,
0.3931597173213959,
-0.059397123754024506,
-0.4748052656650543,
-0.5120141506195068,
-0.267538458108902,
0.27070674300193787,
-0.6770328879356384,
-0.41234058141708374,
-0.7637338638305664,
-0.45216402411460876,
-0.3053428530693054,
-0.16232073307037354,
-0.523722231388092,
-0.23644590377807617,
-0.5067686438560486,
-0.28680846095085144,
0.44506651163101196,
0.6572844386100769,
0.19036300480365753,
0.6128720641136169,
-0.41709426045417786,
0.40251293778419495,
0.3387960195541382,
-0.018848147243261337,
-0.2098393440246582,
-0.2736375033855438,
-0.2779742479324341,
-0.006422786973416805,
-0.3306921720504761,
-0.9636305570602417,
0.7088236212730408,
0.22925961017608643,
0.4625322222709656,
0.2659287452697754,
0.05257245525717735,
0.7087501883506775,
-0.7445379495620728,
0.7075873017311096,
0.43713533878326416,
-0.9871901273727417,
0.5065804719924927,
0.27779754996299744,
0.10802005976438522,
0.7827260494232178,
-0.11162352561950684,
-0.21496659517288208,
-0.3622213900089264,
-0.6821718215942383,
-0.7672258019447327,
0.7998864054679871,
0.42846164107322693,
0.23423178493976593,
-0.22733473777770996,
0.05180606245994568,
0.016381513327360153,
0.2889387011528015,
-0.8596004247665405,
-0.5586613416671753,
-0.6217283606529236,
-0.46600157022476196,
-0.28793108463287354,
-0.19643813371658325,
0.24817053973674774,
-0.5378396511077881,
0.6795234084129333,
0.050336357206106186,
0.6726112961769104,
0.25807732343673706,
-0.4806865155696869,
0.017081918194890022,
0.23441889882087708,
0.25452908873558044,
0.4747364819049835,
-0.10259213298559189,
0.215552419424057,
0.36267217993736267,
-0.6962692737579346,
0.4341096580028534,
0.34461089968681335,
-0.3283349871635437,
0.358287513256073,
0.15686114132404327,
0.9579110741615295,
-0.08761439472436905,
-0.4075399935245514,
0.382795125246048,
-0.0869055688381195,
-0.2875378429889679,
-0.6905466318130493,
-0.008759320713579655,
-0.23750613629817963,
-0.08608085662126541,
0.35733088850975037,
0.21134306490421295,
0.008343650959432125,
-0.3882414996623993,
0.13547936081886292,
0.2538544833660126,
-0.4305124282836914,
-0.6273062825202942,
0.8055480122566223,
0.3504481613636017,
-0.4090834856033325,
0.571965754032135,
-0.3405766189098358,
-0.9254944920539856,
0.7811408638954163,
0.8907254338264465,
1.0809077024459839,
-0.2965964674949646,
0.5573199987411499,
0.4302375018596649,
0.49789437651634216,
-0.25005173683166504,
0.15107403695583344,
-0.06662175804376602,
-1.1077221632003784,
-0.5325518250465393,
-0.44443705677986145,
-0.19108639657497406,
0.0036778170615434647,
-0.4257557690143585,
0.21553276479244232,
-0.2903749942779541,
-0.11836542189121246,
0.05403383448719978,
0.04539399966597557,
-1.0475221872329712,
0.0773765817284584,
-0.08665216714143753,
0.8067147731781006,
-0.7502578496932983,
0.9771485924720764,
0.7710206508636475,
-0.5249688625335693,
-0.846916675567627,
-0.3979773223400116,
-0.6412806510925293,
-0.7260199785232544,
0.7016164064407349,
0.6188948750495911,
-0.0028794691897928715,
0.3229939043521881,
-0.2824340760707855,
-0.6343790292739868,
0.9125710129737854,
0.3795146644115448,
-0.4400055408477783,
-0.2943074107170105,
0.18448486924171448,
0.47703951597213745,
-0.23551151156425476,
0.6032243967056274,
0.6602270603179932,
0.4204424023628235,
-0.18266327679157257,
-0.7117204070091248,
0.04756849259138107,
-0.31351542472839355,
-0.12163571268320084,
0.2675798535346985,
-0.6224284768104553,
1.066802740097046,
-0.01804181933403015,
-0.31717246770858765,
0.07288655638694763,
0.8481962084770203,
0.24505802989006042,
0.15952983498573303,
0.621522843837738,
0.6140827536582947,
0.7632027268409729,
-0.40368518233299255,
1.0351917743682861,
-0.10261315852403641,
0.6791108250617981,
0.7461012601852417,
-0.14318354427814484,
0.6482430696487427,
0.5598688721656799,
-0.45116251707077026,
0.8048098683357239,
0.43341049551963806,
-0.14282087981700897,
0.6610205769538879,
0.09494893997907639,
-0.33725234866142273,
-0.25797736644744873,
0.24519376456737518,
-0.5156134366989136,
0.41281095147132874,
0.27371805906295776,
-0.268804669380188,
-0.2130403220653534,
0.08482056856155396,
-0.029813416302204132,
-0.08483085036277771,
-0.299714595079422,
0.6869092583656311,
-0.019960837438702583,
-0.46852999925613403,
0.5327106714248657,
-0.07350417971611023,
1.1259793043136597,
-0.6160567998886108,
-0.05973184108734131,
0.020751051604747772,
0.46442341804504395,
-0.38847559690475464,
-0.4956207871437073,
0.10589060932397842,
0.10514669865369797,
0.08796610683202744,
-0.30106231570243835,
0.9585078954696655,
-0.38081094622612,
-0.6184874176979065,
0.017404096201062202,
0.29162439703941345,
0.09241454303264618,
-0.14698508381843567,
-0.4818250834941864,
-0.045048657804727554,
-0.10887311398983002,
-0.24573509395122528,
0.10431896895170212,
0.18844659626483917,
0.40120363235473633,
0.5681173801422119,
0.6032571196556091,
0.10543955862522125,
0.30741509795188904,
0.09158587455749512,
0.9303873777389526,
-0.46074286103248596,
-0.5544077157974243,
-1.0410596132278442,
0.38267382979393005,
-0.20974022150039673,
-0.4167839586734772,
0.9867702722549438,
0.6286826133728027,
1.0139216184616089,
-0.165944904088974,
0.7089004516601562,
-0.30271148681640625,
0.043787214905023575,
-0.49744686484336853,
0.7214856743812561,
-0.16273310780525208,
-0.12369656562805176,
-0.20302528142929077,
-0.8875980377197266,
-0.10859601944684982,
1.0873044729232788,
-0.28799688816070557,
0.16454124450683594,
0.7605889439582825,
0.4765549302101135,
0.19070927798748016,
-0.15454019606113434,
0.05660449340939522,
0.0634080320596695,
0.5398741364479065,
0.47741737961769104,
1.0003154277801514,
-0.5985186100006104,
0.7503849864006042,
-0.5031020045280457,
0.17280639708042145,
-0.10242132842540741,
-0.40154480934143066,
-1.2566941976547241,
-0.6176021099090576,
-0.3447974920272827,
-0.29842549562454224,
-0.031660743057727814,
0.7896798849105835,
0.810939371585846,
-0.8856558203697205,
-0.22432701289653778,
-0.627648651599884,
0.2775677442550659,
-0.28987956047058105,
-0.2337837964296341,
0.3912135064601898,
-0.5418631434440613,
-0.7201091051101685,
0.29704147577285767,
0.0059465342201292515,
-0.0956071987748146,
-0.27131736278533936,
-0.09236100316047668,
-0.13033761084079742,
-0.09091304987668991,
0.6689491271972656,
0.3708336353302002,
-0.5092010498046875,
-0.4335951507091522,
-0.08704492449760437,
0.021886125206947327,
0.34443241357803345,
0.7360571026802063,
-1.214436411857605,
0.5177366733551025,
0.40333735942840576,
0.38265588879585266,
0.9210877418518066,
-0.2731437087059021,
0.45744940638542175,
-0.5268595218658447,
0.3908618986606598,
0.23229879140853882,
0.5652963519096375,
0.246414914727211,
-0.13937030732631683,
0.3281402587890625,
0.11170897632837296,
-0.5513885021209717,
-0.7752942442893982,
0.09467512369155884,
-0.77414870262146,
0.10638058185577393,
0.8866105079650879,
-0.07926427572965622,
-0.2374504655599594,
-0.040241241455078125,
-0.2973863482475281,
0.5773462057113647,
-0.4791589677333832,
0.6143656969070435,
0.37185055017471313,
0.08054094761610031,
-0.1751718372106552,
-0.2646638751029968,
0.4795300364494324,
0.28843772411346436,
-1.0721771717071533,
-0.2896069586277008,
0.07177446782588959,
0.10216761380434036,
0.28891459107398987,
0.7617648839950562,
0.029579244554042816,
0.17958135902881622,
0.005886944476515055,
0.35965144634246826,
-0.10456032305955887,
-0.17038191854953766,
-0.29380103945732117,
-0.01320805773139,
-0.297527551651001,
-0.6201539039611816
] |
allenai/longformer-base-4096 | allenai | "2023-04-05T18:24:00Z" | 3,326,607 | 113 | transformers | [
"transformers",
"pytorch",
"tf",
"rust",
"longformer",
"en",
"arxiv:2004.05150",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | null | "2022-03-02T23:29:05Z" | ---
language: en
license: apache-2.0
---
# longformer-base-4096
[Longformer](https://arxiv.org/abs/2004.05150) is a transformer model for long documents.
`longformer-base-4096` is a BERT-like model started from the RoBERTa checkpoint and pretrained for MLM on long documents. It supports sequences of length up to 4,096.
Longformer uses a combination of a sliding window (local) attention and global attention. Global attention is user-configured based on the task to allow the model to learn task-specific representations.
Please refer to the examples in `modeling_longformer.py` and the paper for more details on how to set global attention.
### Citing
If you use `Longformer` in your research, please cite [Longformer: The Long-Document Transformer](https://arxiv.org/abs/2004.05150).
```
@article{Beltagy2020Longformer,
title={Longformer: The Long-Document Transformer},
author={Iz Beltagy and Matthew E. Peters and Arman Cohan},
journal={arXiv:2004.05150},
year={2020},
}
```
`Longformer` is an open-source project developed by [the Allen Institute for Artificial Intelligence (AI2)](http://www.allenai.org).
AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering. | [
-0.2357880175113678,
-0.5452734231948853,
0.5648034811019897,
0.39662879705429077,
0.10629427433013916,
-0.23787488043308258,
-0.3413194715976715,
-0.4734293818473816,
0.13723695278167725,
0.6008812785148621,
-0.6647308468818665,
-0.08220064640045166,
-0.643878698348999,
0.16652750968933105,
-0.40342286229133606,
1.2000482082366943,
-0.2823708653450012,
-0.12238790839910507,
-0.27622437477111816,
0.09638963639736176,
-0.028645886108279228,
-0.565761923789978,
-0.6353586316108704,
-0.5051551461219788,
0.8060497641563416,
-0.16034874320030212,
0.501228392124176,
0.33712053298950195,
0.5839401483535767,
0.3319031298160553,
-0.0827246904373169,
-0.3818272054195404,
-0.8327622413635254,
-0.029713744297623634,
-0.16871696710586548,
-0.670712411403656,
-0.6258071064949036,
-0.36341527104377747,
0.7089309096336365,
0.4044896066188812,
0.20294548571109772,
0.32240405678749084,
0.21206241846084595,
0.9314830899238586,
-0.4602777361869812,
0.380070298910141,
-0.18003834784030914,
-0.04089159891009331,
-0.3713831603527069,
0.4865359961986542,
-0.5359829068183899,
-0.3150855302810669,
0.08736804127693176,
-0.3393714725971222,
0.4568440616130829,
-0.12236683815717697,
0.7328375577926636,
0.29926806688308716,
-0.4507341980934143,
-0.15353639423847198,
-0.9773408770561218,
0.9539104104042053,
-0.6089102029800415,
0.42078396677970886,
0.1844254732131958,
0.5149577856063843,
-0.2182653546333313,
-0.9083977341651917,
-0.5854242444038391,
-0.0716128796339035,
-0.06569140404462814,
0.13799813389778137,
-0.4389421343803406,
0.22146761417388916,
0.5273504853248596,
0.4106878638267517,
-0.6345952749252319,
0.19626861810684204,
-1.0109367370605469,
-0.17367449402809143,
0.4214562773704529,
-0.22521531581878662,
-0.21619337797164917,
-0.27422723174095154,
-0.5734577178955078,
0.10230214148759842,
-0.3921910524368286,
0.4937833845615387,
0.20657461881637573,
0.019752152264118195,
-0.2551991641521454,
0.4548279941082001,
-0.13769249618053436,
0.5615532994270325,
0.4492134153842926,
-0.04475231096148491,
0.467678964138031,
0.13034993410110474,
-0.4270559847354889,
-0.00587246660143137,
0.7312123775482178,
0.21983300149440765,
0.26086607575416565,
-0.29333457350730896,
-0.18101854622364044,
-0.08462439477443695,
0.5376587510108948,
-0.8785263895988464,
0.17213174700737,
0.39404553174972534,
-0.7728683352470398,
-0.1851111799478531,
0.19123391807079315,
-0.6287485957145691,
-0.10249703377485275,
-0.39790135622024536,
0.5026648640632629,
-0.3801293969154358,
-0.05365832895040512,
-0.04861884191632271,
-0.005630175583064556,
0.4941493570804596,
0.274748295545578,
-0.8995166420936584,
0.35601261258125305,
0.6908673644065857,
0.8307771682739258,
-0.43497902154922485,
-0.32848605513572693,
-0.14680860936641693,
0.20145882666110992,
0.03177011013031006,
0.6002814769744873,
-0.07163110375404358,
-0.320818692445755,
0.10392459481954575,
0.5651960372924805,
-0.23634271323680878,
-0.47282761335372925,
0.8838059306144714,
-0.6389676928520203,
0.7772678136825562,
0.25430428981781006,
-0.4509008526802063,
-0.40839874744415283,
0.28876206278800964,
-1.1333469152450562,
1.3354135751724243,
0.5358083248138428,
-0.5495090484619141,
0.03441891074180603,
-1.1697142124176025,
-0.26172536611557007,
-0.008783375844359398,
0.016307460144162178,
-0.7680060863494873,
-0.0666583701968193,
-0.029792888090014458,
0.44661012291908264,
-0.055337950587272644,
0.4079415500164032,
-0.020921818912029266,
-0.5455231666564941,
-0.09393153339624405,
-0.4318366050720215,
0.6267921924591064,
-0.08789897710084915,
-0.7111822962760925,
0.5388205647468567,
-1.0805565118789673,
-0.10343208909034729,
0.17120212316513062,
-0.5814006924629211,
0.05122887343168259,
-0.11511500179767609,
0.32609277963638306,
0.3870600461959839,
0.39154717326164246,
-0.6321827173233032,
0.3376237750053406,
-0.45794713497161865,
0.573330819606781,
0.635343074798584,
-0.2481928914785385,
0.5697228312492371,
-0.5821994543075562,
0.4777693748474121,
-0.017471466213464737,
0.2511405646800995,
-0.19119489192962646,
-0.38582563400268555,
-1.0220896005630493,
-0.10802346467971802,
0.09199656546115875,
0.476207435131073,
-0.16000698506832123,
0.7827188968658447,
-0.5512478947639465,
-0.5600470304489136,
-0.5943750739097595,
0.20591451227664948,
0.04461793974041939,
0.24265052378177643,
0.5330355763435364,
-0.02408960834145546,
-0.6135294437408447,
-1.0716272592544556,
0.39548489451408386,
0.30159416794776917,
-0.14791378378868103,
-0.007114159408956766,
0.6470650434494019,
-0.5526724457740784,
1.026005506515503,
-0.19212190806865692,
-0.43546074628829956,
-0.3469479978084564,
0.08392512053251266,
0.8833172917366028,
0.39293476939201355,
0.5801204442977905,
-0.8961421251296997,
-0.455066978931427,
-0.6109663248062134,
-0.6011394262313843,
0.4572871923446655,
-0.3493213951587677,
-0.28242266178131104,
0.4597316086292267,
0.3865343928337097,
-1.1921859979629517,
0.5522417426109314,
0.5891713500022888,
-0.05645230785012245,
0.5116581916809082,
-0.08095227926969528,
-0.17364586889743805,
-1.2954505681991577,
0.23568658530712128,
0.03782366216182709,
-0.2156531810760498,
-0.5987238883972168,
-0.08567143231630325,
0.40481656789779663,
-0.28134873509407043,
-0.4812394082546234,
0.46490541100502014,
-0.5431115031242371,
0.31500518321990967,
-0.32568538188934326,
-0.37992870807647705,
-0.030979519709944725,
0.6247418522834778,
-0.05548177286982536,
0.6188507676124573,
0.4365372657775879,
-0.3111136257648468,
0.5625942349433899,
0.24933145940303802,
-0.38312122225761414,
0.26496899127960205,
-0.8567066788673401,
0.2914668619632721,
-0.4518668055534363,
0.7379093766212463,
-0.8263372182846069,
-0.16879935562610626,
0.21120832860469818,
-0.24131238460540771,
0.4183858036994934,
-0.17140883207321167,
-0.23666994273662567,
-0.8717062473297119,
-0.437258780002594,
0.47758421301841736,
0.4855291545391083,
-0.4020129442214966,
0.8487832546234131,
-0.316203236579895,
-0.234733447432518,
-0.6549779176712036,
-0.542629599571228,
-0.09774839878082275,
-0.19215388596057892,
-0.9152851700782776,
0.5827342867851257,
-0.28586429357528687,
0.06367597728967667,
-0.30369675159454346,
-0.06532977521419525,
0.17028899490833282,
-0.30433589220046997,
0.8207206726074219,
0.2934131920337677,
-0.5440357327461243,
0.07006127387285233,
-0.30404481291770935,
-0.1935480237007141,
0.44537389278411865,
-0.1280505657196045,
0.7272122502326965,
-0.0017268366646021605,
-0.39380061626434326,
-0.4018922448158264,
0.6067386865615845,
1.0306236743927002,
-0.2860243022441864,
0.7706878185272217,
0.654116690158844,
-0.4505319893360138,
-0.26333534717559814,
-0.7077363133430481,
0.032364245504140854,
-0.48154133558273315,
0.6420153975486755,
-0.25459152460098267,
-0.7236356735229492,
0.42608642578125,
-0.024511609226465225,
-0.11367406696081161,
0.8359578847885132,
0.6737983822822571,
-0.1758393496274948,
0.5478736758232117,
0.9296970963478088,
-0.5477828979492188,
0.5741191506385803,
-0.45473888516426086,
0.22894133627414703,
-0.7011217474937439,
-0.368196964263916,
-0.39204367995262146,
-0.5460733771324158,
-0.2659742534160614,
-0.6582789421081543,
0.18476277589797974,
0.06580659747123718,
-0.6599767208099365,
0.18855136632919312,
-0.5841585993766785,
0.3535924255847931,
0.7425894737243652,
0.1134510263800621,
-0.13130956888198853,
-0.13429254293441772,
0.3078311085700989,
0.1505335420370102,
-0.19640931487083435,
-0.46583765745162964,
0.9817145466804504,
0.7622472047805786,
0.9566020369529724,
0.1529376059770584,
0.920132040977478,
0.31006738543510437,
-0.009760405868291855,
-1.1294938325881958,
0.23099200427532196,
0.07987308502197266,
-0.7123767733573914,
-0.47138452529907227,
0.08230284601449966,
-1.1157242059707642,
-0.27908045053482056,
0.02009647525846958,
-0.744024395942688,
0.13884566724300385,
-0.11665620654821396,
-0.27529796957969666,
0.24106764793395996,
-0.43173518776893616,
0.9768530130386353,
-0.5408083200454712,
-0.05643820762634277,
-0.07661313563585281,
-0.805483877658844,
-0.043574631214141846,
-0.18833278119564056,
0.13008494675159454,
0.15474620461463928,
0.4087976813316345,
0.9153130054473877,
-0.0345919132232666,
1.1860747337341309,
-0.17678730189800262,
-0.24241705238819122,
0.09561962634325027,
-0.38957613706588745,
0.8741217255592346,
-0.34697484970092773,
-0.252265989780426,
0.14014258980751038,
-0.42983201146125793,
-0.42829638719558716,
-0.4850532114505768,
0.5738327503204346,
-1.095648169517517,
-0.5358036756515503,
-0.49599748849868774,
-0.4070214629173279,
0.1454135775566101,
0.674597442150116,
0.38547515869140625,
0.22762316465377808,
-0.3177204430103302,
0.6270189881324768,
0.705306351184845,
0.30327123403549194,
0.7370684146881104,
0.28002429008483887,
0.01066542323678732,
-0.33431997895240784,
0.4165130853652954,
0.029245156794786453,
0.1386467069387436,
0.7359326481819153,
-0.1132105216383934,
-0.2045169472694397,
-0.49550575017929077,
-0.26028767228126526,
0.4086371064186096,
-0.7521900534629822,
-0.155931293964386,
-0.48171481490135193,
-0.8505414724349976,
-0.4465347230434418,
-0.16954971849918365,
-0.16305187344551086,
-0.22105956077575684,
-0.49027934670448303,
-0.19793066382408142,
0.14316235482692719,
0.7990873456001282,
0.3356218636035919,
0.299803227186203,
-0.7718912959098816,
0.4356686472892761,
0.2132033407688141,
0.4564686119556427,
0.07850830256938934,
-0.5530961155891418,
-0.4001873731613159,
-0.07956793904304504,
-0.5924230813980103,
-0.6645508408546448,
0.1261114478111267,
0.23612727224826813,
0.9835315346717834,
0.3243672251701355,
-0.039091333746910095,
0.35416918992996216,
-0.6775150299072266,
0.8405848741531372,
0.25143179297447205,
-0.7584056258201599,
0.5772222280502319,
-0.36209261417388916,
0.5250288844108582,
0.2514377236366272,
0.8544567227363586,
-0.4752335548400879,
-0.17629283666610718,
-0.4488757848739624,
-1.133286714553833,
0.5908991694450378,
0.14818240702152252,
0.344338983297348,
0.27107319235801697,
0.1658407747745514,
0.27201882004737854,
-0.1453196257352829,
-1.2669516801834106,
-0.28497034311294556,
-0.5482136011123657,
-0.3699272871017456,
-0.2097182422876358,
-0.5580586194992065,
-0.2356170415878296,
-0.023418255150318146,
0.7448403835296631,
-0.09988562762737274,
0.5779449343681335,
0.15489615499973297,
-0.3594154417514801,
-0.2383413463830948,
0.5608685612678528,
0.7288053035736084,
0.8171970248222351,
-0.5006982684135437,
-0.18353202939033508,
-0.07008054107427597,
-0.49940645694732666,
-0.055481843650341034,
0.48328909277915955,
-0.09329080581665039,
0.07086179405450821,
0.4604353904724121,
1.050793170928955,
0.2277935892343521,
-0.23260946571826935,
0.49575650691986084,
0.2407349944114685,
-0.3908246159553528,
-0.8678634762763977,
-0.0005698530003428459,
0.2659902274608612,
0.38900473713874817,
0.7505225539207458,
0.12958694994449615,
0.053650762885808945,
-0.35726550221443176,
0.07298199832439423,
0.09175102412700653,
-0.4640815556049347,
-0.208609938621521,
0.6528547406196594,
0.31049254536628723,
-0.4841805696487427,
0.6837186813354492,
0.28159400820732117,
-0.44935378432273865,
0.6608811020851135,
0.9621997475624084,
0.7150664329528809,
0.005890078376978636,
-0.20876924693584442,
0.26567742228507996,
-0.058502841740846634,
-0.15031933784484863,
0.24115309119224548,
-0.08625570684671402,
-0.3340449333190918,
-0.5000421404838562,
-0.7938681244850159,
-0.25789135694503784,
0.5781251788139343,
-0.7367694973945618,
0.42417219281196594,
-0.15565811097621918,
-0.3011578321456909,
0.3950633704662323,
-0.04768603295087814,
-0.6439757347106934,
0.20422935485839844,
0.6737662553787231,
1.1204406023025513,
-0.479525625705719,
0.9681900143623352,
0.7910037636756897,
-0.35528483986854553,
-0.49009206891059875,
-0.08715707808732986,
-0.07321479171514511,
-0.8254573941230774,
0.8256170749664307,
0.5862588882446289,
-0.01834201067686081,
-0.22388143837451935,
-0.42834365367889404,
-1.1096354722976685,
1.2634174823760986,
0.03226648271083832,
-0.8412700295448303,
-0.7005815505981445,
0.3488870859146118,
0.45542824268341064,
-0.09156236052513123,
0.2797488570213318,
0.02002842165529728,
0.4258727729320526,
-0.08670009672641754,
-1.1203808784484863,
0.009039380587637424,
-0.50882488489151,
-0.03891883045434952,
0.4449947774410248,
-0.8925817012786865,
0.829143762588501,
-0.17127355933189392,
0.2295171171426773,
0.37423399090766907,
0.7878742814064026,
0.06853576749563217,
0.18102340400218964,
0.40913820266723633,
0.4072873294353485,
0.5242935419082642,
0.012028180062770844,
0.5847850441932678,
-0.5557082295417786,
0.6650027632713318,
1.0204143524169922,
-0.03569628298282623,
1.0058997869491577,
0.5252466201782227,
-0.3993992805480957,
0.9210976958274841,
0.2442273497581482,
-0.531550407409668,
0.38500043749809265,
0.25240060687065125,
-0.1485878974199295,
0.01156693696975708,
0.5376608967781067,
-0.5765535831451416,
0.35191914439201355,
0.14846545457839966,
-0.8686792850494385,
-0.24442459642887115,
0.050427503883838654,
0.06552449613809586,
-0.28912898898124695,
-0.392532080411911,
0.6453003883361816,
0.07342229783535004,
-0.7217313051223755,
0.7505968809127808,
-0.0005197899299673736,
1.1095067262649536,
-0.9041624069213867,
0.05914952605962753,
0.03414307162165642,
0.6450908780097961,
-0.3471537232398987,
-0.8474210500717163,
0.13572566211223602,
-0.07448453456163406,
-1.0618009567260742,
-0.3524508774280548,
0.8462265133857727,
-0.27054277062416077,
-0.7223231196403503,
0.42300593852996826,
0.1865835338830948,
0.005977537017315626,
-0.2863759398460388,
-0.6901546120643616,
-0.1463858038187027,
-0.019663207232952118,
-0.4994801878929138,
0.35246798396110535,
0.2592891454696655,
-0.3265792727470398,
0.5585274696350098,
0.6122612953186035,
-0.20748023688793182,
0.022401930764317513,
0.22837261855602264,
0.9614919424057007,
-0.9055678844451904,
-0.6260653734207153,
-0.7480078339576721,
0.7061002254486084,
-0.023875711485743523,
-0.21577724814414978,
0.530318021774292,
0.9743427038192749,
0.6145917773246765,
-0.5369945764541626,
0.9162101149559021,
-0.11911004036664963,
0.6541018486022949,
-0.2157997339963913,
0.95294189453125,
-0.21125802397727966,
-0.434234619140625,
0.09204676002264023,
-1.0646858215332031,
-0.05520007386803627,
0.5385302305221558,
-0.3172307014465332,
0.032814957201480865,
0.4223693907260895,
0.5419548153877258,
-0.2669590413570404,
-0.16368144750595093,
0.18864163756370544,
0.2823975384235382,
0.49617770314216614,
0.732775866985321,
0.619046151638031,
-0.4615752696990967,
0.677257776260376,
-0.3910869359970093,
-0.15764828026294708,
-0.2623344957828522,
-0.9039217829704285,
-1.0761752128601074,
-0.5093726515769958,
0.15397299826145172,
-0.5133050680160522,
0.13822577893733978,
1.015147089958191,
0.79241943359375,
-1.0041348934173584,
-0.2090909630060196,
0.2923619747161865,
-0.2283926159143448,
-0.04216036573052406,
-0.25686708092689514,
0.6425121426582336,
-0.25009071826934814,
-0.7352116703987122,
0.30159059166908264,
-0.0723259299993515,
0.17302246391773224,
-0.1883712112903595,
-0.09397045522928238,
0.09736417979001999,
-0.25179892778396606,
0.6793946623802185,
0.3903009593486786,
-0.8297097086906433,
-0.13578027486801147,
0.1352313607931137,
-0.24826276302337646,
0.4980151057243347,
0.5500411987304688,
-0.7520256042480469,
0.1972244828939438,
0.1856818050146103,
0.2683081030845642,
0.8627046942710876,
0.07548446953296661,
0.572737991809845,
-0.5205821990966797,
0.16688068211078644,
0.3407067656517029,
0.5372620820999146,
0.20708350837230682,
-0.6449458003044128,
0.2198004573583603,
0.0667537972331047,
-0.8743402361869812,
-0.400144100189209,
-0.07809113711118698,
-1.6339118480682373,
0.05540594831109047,
1.2077664136886597,
-0.08445480465888977,
-0.47216370701789856,
0.1527041792869568,
-0.4885125160217285,
0.30247220396995544,
-0.611904501914978,
0.881750762462616,
0.5978890061378479,
-0.32345882058143616,
-0.3218037486076355,
-0.4028627276420593,
0.37204253673553467,
-0.14890411496162415,
-0.7182379961013794,
-0.19869427382946014,
0.2591570019721985,
0.5844992399215698,
0.7953277230262756,
0.430893212556839,
0.04624751955270767,
0.2668563425540924,
-0.3959590494632721,
0.3143104314804077,
-0.2521183490753174,
-0.1210932508111,
-0.291623055934906,
0.2664717435836792,
-0.16574811935424805,
-0.18665340542793274
] |
distilroberta-base | null | "2022-11-16T23:22:40Z" | 3,272,076 | 88 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"roberta",
"fill-mask",
"exbert",
"en",
"dataset:openwebtext",
"arxiv:1910.01108",
"arxiv:1910.09700",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
tags:
- exbert
license: apache-2.0
datasets:
- openwebtext
---
# Model Card for DistilRoBERTa base
# Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
4. [Training Details](#training-details)
5. [Evaluation](#evaluation)
6. [Environmental Impact](#environmental-impact)
7. [Citation](#citation)
8. [How To Get Started With the Model](#how-to-get-started-with-the-model)
# Model Details
## Model Description
This model is a distilled version of the [RoBERTa-base model](https://huggingface.co/roberta-base). It follows the same training procedure as [DistilBERT](https://huggingface.co/distilbert-base-uncased).
The code for the distillation process can be found [here](https://github.com/huggingface/transformers/tree/master/examples/distillation).
This model is case-sensitive: it makes a difference between english and English.
The model has 6 layers, 768 dimension and 12 heads, totalizing 82M parameters (compared to 125M parameters for RoBERTa-base).
On average DistilRoBERTa is twice as fast as Roberta-base.
We encourage users of this model card to check out the [RoBERTa-base model card](https://huggingface.co/roberta-base) to learn more about usage, limitations and potential biases.
- **Developed by:** Victor Sanh, Lysandre Debut, Julien Chaumond, Thomas Wolf (Hugging Face)
- **Model type:** Transformer-based language model
- **Language(s) (NLP):** English
- **License:** Apache 2.0
- **Related Models:** [RoBERTa-base model card](https://huggingface.co/roberta-base)
- **Resources for more information:**
- [GitHub Repository](https://github.com/huggingface/transformers/blob/main/examples/research_projects/distillation/README.md)
- [Associated Paper](https://arxiv.org/abs/1910.01108)
# Uses
## Direct Use and Downstream Use
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=roberta) to look for fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation you should look at model like GPT2.
## Out of Scope Use
The model should not be used to intentionally create hostile or alienating environments for people. The model was not trained to be factual or true representations of people or events, and therefore using the models to generate such content is out-of-scope for the abilities of this model.
# Bias, Risks, and Limitations
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. For example:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='distilroberta-base')
>>> unmasker("The man worked as a <mask>.")
[{'score': 0.1237526461482048,
'sequence': 'The man worked as a waiter.',
'token': 38233,
'token_str': ' waiter'},
{'score': 0.08968018740415573,
'sequence': 'The man worked as a waitress.',
'token': 35698,
'token_str': ' waitress'},
{'score': 0.08387645334005356,
'sequence': 'The man worked as a bartender.',
'token': 33080,
'token_str': ' bartender'},
{'score': 0.061059024184942245,
'sequence': 'The man worked as a mechanic.',
'token': 25682,
'token_str': ' mechanic'},
{'score': 0.03804653510451317,
'sequence': 'The man worked as a courier.',
'token': 37171,
'token_str': ' courier'}]
>>> unmasker("The woman worked as a <mask>.")
[{'score': 0.23149248957633972,
'sequence': 'The woman worked as a waitress.',
'token': 35698,
'token_str': ' waitress'},
{'score': 0.07563332468271255,
'sequence': 'The woman worked as a waiter.',
'token': 38233,
'token_str': ' waiter'},
{'score': 0.06983394920825958,
'sequence': 'The woman worked as a bartender.',
'token': 33080,
'token_str': ' bartender'},
{'score': 0.05411609262228012,
'sequence': 'The woman worked as a nurse.',
'token': 9008,
'token_str': ' nurse'},
{'score': 0.04995106905698776,
'sequence': 'The woman worked as a maid.',
'token': 29754,
'token_str': ' maid'}]
```
## Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
# Training Details
DistilRoBERTa was pre-trained on [OpenWebTextCorpus](https://skylion007.github.io/OpenWebTextCorpus/), a reproduction of OpenAI's WebText dataset (it is ~4 times less training data than the teacher RoBERTa). See the [roberta-base model card](https://huggingface.co/roberta-base/blob/main/README.md) for further details on training.
# Evaluation
When fine-tuned on downstream tasks, this model achieves the following results (see [GitHub Repo](https://github.com/huggingface/transformers/blob/main/examples/research_projects/distillation/README.md)):
Glue test results:
| Task | MNLI | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE |
|:----:|:----:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|
| | 84.0 | 89.4 | 90.8 | 92.5 | 59.3 | 88.3 | 86.6 | 67.9 |
# Environmental Impact
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** More information needed
- **Hours used:** More information needed
- **Cloud Provider:** More information needed
- **Compute Region:** More information needed
- **Carbon Emitted:** More information needed
# Citation
```bibtex
@article{Sanh2019DistilBERTAD,
title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
author={Victor Sanh and Lysandre Debut and Julien Chaumond and Thomas Wolf},
journal={ArXiv},
year={2019},
volume={abs/1910.01108}
}
```
APA
- Sanh, V., Debut, L., Chaumond, J., & Wolf, T. (2019). DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108.
# How to Get Started With the Model
You can use the model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='distilroberta-base')
>>> unmasker("Hello I'm a <mask> model.")
[{'score': 0.04673689603805542,
'sequence': "Hello I'm a business model.",
'token': 265,
'token_str': ' business'},
{'score': 0.03846118599176407,
'sequence': "Hello I'm a freelance model.",
'token': 18150,
'token_str': ' freelance'},
{'score': 0.03308931365609169,
'sequence': "Hello I'm a fashion model.",
'token': 2734,
'token_str': ' fashion'},
{'score': 0.03018997237086296,
'sequence': "Hello I'm a role model.",
'token': 774,
'token_str': ' role'},
{'score': 0.02111748233437538,
'sequence': "Hello I'm a Playboy model.",
'token': 24526,
'token_str': ' Playboy'}]
```
<a href="https://huggingface.co/exbert/?model=distilroberta-base">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.23263071477413177,
-0.7745702266693115,
0.24639993906021118,
0.16414979100227356,
-0.2596116364002228,
-0.024702753871679306,
-0.25477370619773865,
-0.25066423416137695,
0.1312868893146515,
0.4469575881958008,
-0.5757401585578918,
-0.5130375623703003,
-0.767797589302063,
0.2032451182603836,
-0.2607065439224243,
1.1115254163742065,
0.27603426575660706,
0.04674852639436722,
0.06993012875318527,
0.22152453660964966,
-0.3514208197593689,
-0.5454055070877075,
-0.5756053924560547,
-0.3421233892440796,
0.21754202246665955,
0.05087253823876381,
0.5524172782897949,
0.5932685732841492,
0.2776375114917755,
0.3899897038936615,
-0.34932851791381836,
-0.016610022634267807,
-0.388201504945755,
-0.11875347048044205,
0.007472552824765444,
-0.435650110244751,
-0.43265998363494873,
0.08924408257007599,
0.36065173149108887,
0.7831841707229614,
-0.15063650906085968,
0.4792631268501282,
0.20748452842235565,
0.7263022661209106,
-0.19802705943584442,
0.4630016088485718,
-0.6508404612541199,
-0.09564289450645447,
-0.2793632447719574,
0.2882336974143982,
-0.3240449130535126,
-0.12575389444828033,
0.005001530051231384,
-0.39654338359832764,
0.23707523941993713,
0.10078629106283188,
1.2573693990707397,
0.3980773389339447,
-0.20654642581939697,
-0.26520028710365295,
-0.5762866139411926,
0.8332183361053467,
-1.0145702362060547,
0.18772782385349274,
0.3902115225791931,
0.19049298763275146,
-0.23760424554347992,
-0.870688796043396,
-0.6935374736785889,
-0.08183086663484573,
-0.39027777314186096,
0.1085180938243866,
-0.4000508189201355,
-0.18994224071502686,
0.3584667444229126,
0.5148513913154602,
-0.4955921471118927,
-0.04857996851205826,
-0.5789589285850525,
-0.0026960785035043955,
0.5827537178993225,
0.11619195342063904,
0.15107814967632294,
-0.4494474530220032,
-0.3565574586391449,
-0.284833163022995,
-0.2600310742855072,
0.1956169605255127,
0.510110080242157,
0.49352791905403137,
-0.3393799364566803,
0.6364470720291138,
-0.3047310709953308,
0.6591698527336121,
0.2544693648815155,
-0.2755240797996521,
0.5124931931495667,
-0.33541810512542725,
-0.3607257902622223,
-0.11319874227046967,
1.0498032569885254,
0.19019156694412231,
0.15933533012866974,
0.1726411134004593,
-0.08479289710521698,
0.01778322272002697,
0.07767762988805771,
-0.7487643361091614,
-0.45537152886390686,
0.34275853633880615,
-0.4856165647506714,
-0.4640755355358124,
0.19869336485862732,
-0.9040634632110596,
-0.05340553820133209,
-0.19051457941532135,
0.21565476059913635,
-0.24582143127918243,
-0.38848257064819336,
0.18080399930477142,
-0.33884793519973755,
0.04436203092336655,
0.0009546191431581974,
-0.8441959619522095,
0.21612489223480225,
0.5463974475860596,
0.9110789895057678,
0.15340755879878998,
-0.0688127726316452,
-0.1527131199836731,
-0.21731321513652802,
0.04277756065130234,
0.30061787366867065,
-0.2466263324022293,
-0.3072042465209961,
-0.23216429352760315,
0.300228089094162,
0.035893380641937256,
-0.4214819669723511,
0.6976408958435059,
-0.2840409278869629,
0.3637440800666809,
0.03037521429359913,
-0.36363813281059265,
-0.4084703028202057,
0.07760771363973618,
-0.7777525782585144,
1.2306395769119263,
0.29073962569236755,
-0.9977489113807678,
0.24227362871170044,
-0.778220534324646,
-0.4463106691837311,
-0.05910828337073326,
0.18967045843601227,
-0.666864812374115,
-0.07445141673088074,
0.23103325068950653,
0.5202949047088623,
-0.4911006987094879,
0.4470895826816559,
-0.14408960938453674,
-0.10704901069402695,
0.17034830152988434,
-0.38560453057289124,
1.5280770063400269,
0.34411221742630005,
-0.46693867444992065,
-0.04688769951462746,
-0.8503062725067139,
-0.10962436348199844,
0.41081589460372925,
-0.4660125970840454,
-0.26770782470703125,
-0.16868655383586884,
0.1939370334148407,
0.29938212037086487,
0.23862187564373016,
-0.44373711943626404,
0.20691226422786713,
-0.378288596868515,
0.7819519639015198,
0.6451002955436707,
-0.1470547467470169,
0.23112761974334717,
-0.360069215297699,
0.4766119122505188,
0.03384142741560936,
0.20318464934825897,
-0.10449487715959549,
-0.7644992470741272,
-0.7553267478942871,
-0.5197014808654785,
0.4529205858707428,
0.7175163626670837,
-0.6208337545394897,
0.7950410842895508,
-0.26004329323768616,
-0.8370795249938965,
-0.6490796208381653,
0.0001980085507966578,
0.48119810223579407,
0.6961833238601685,
0.31631335616111755,
-0.28125691413879395,
-0.7748107314109802,
-0.7311042547225952,
-0.03647103160619736,
-0.19027799367904663,
-0.11388267576694489,
0.23729467391967773,
0.7414738535881042,
-0.21794579923152924,
0.8655775189399719,
-0.722221314907074,
-0.44107621908187866,
-0.20156055688858032,
0.05442426726222038,
0.9032422304153442,
0.6023959517478943,
0.6226066946983337,
-0.7199050784111023,
-0.6689180135726929,
-0.23226536810398102,
-0.6937440037727356,
-0.03672390431165695,
0.05945529788732529,
-0.045492760837078094,
0.21358902752399445,
0.31976771354675293,
-0.692615270614624,
0.28143107891082764,
0.5163266658782959,
-0.34412240982055664,
0.6300765872001648,
-0.34086328744888306,
0.056704938411712646,
-1.3164738416671753,
0.31622403860092163,
0.10287141054868698,
-0.20423048734664917,
-0.7716268301010132,
-0.09413334727287292,
-0.19551123678684235,
-0.06981641799211502,
-0.6305659413337708,
0.458102822303772,
-0.6129134893417358,
0.16703753173351288,
0.01987074688076973,
-0.16398178040981293,
0.1640547662973404,
0.7975415587425232,
0.05820661038160324,
0.4954453408718109,
0.6311762928962708,
-0.4079885184764862,
0.3604413866996765,
0.244129478931427,
-0.4596005976200104,
0.2506282925605774,
-0.8092638254165649,
0.17617915570735931,
-0.03369363024830818,
0.241339311003685,
-1.0751301050186157,
-0.04612948000431061,
0.24867366254329681,
-0.5433893203735352,
0.39320096373558044,
-0.4302835464477539,
-0.6228199601173401,
-0.6564503908157349,
-0.14759701490402222,
0.2084093987941742,
0.7716944813728333,
-0.3748086392879486,
0.5133601427078247,
0.45627856254577637,
-0.06369362771511078,
-0.6894075274467468,
-0.7751544713973999,
-0.1291813999414444,
-0.5338119864463806,
-0.6021150946617126,
0.48133787512779236,
0.10904742777347565,
-0.2236201912164688,
-0.03939163312315941,
0.11098728328943253,
-0.23179343342781067,
0.20521123707294464,
0.35820356011390686,
0.458965003490448,
0.05693402886390686,
-0.3193586766719818,
-0.14827239513397217,
-0.15165963768959045,
0.036512553691864014,
-0.33320796489715576,
0.7258647084236145,
-0.1778203547000885,
0.03325248137116432,
-0.5002753734588623,
0.1465006172657013,
0.615838885307312,
-0.09538144618272781,
0.8148404955863953,
0.6949455738067627,
-0.4701184034347534,
0.06077196076512337,
-0.3450486958026886,
-0.18018804490566254,
-0.47953981161117554,
0.4046666920185089,
-0.4035995602607727,
-0.75120609998703,
0.7045319080352783,
0.12042117118835449,
-0.12372817099094391,
0.8207295536994934,
0.674953818321228,
-0.05790521949529648,
0.8479499816894531,
0.42798274755477905,
-0.24639545381069183,
0.3708701729774475,
-0.5009053349494934,
0.2842777371406555,
-0.7407100200653076,
-0.3321862518787384,
-0.7169932723045349,
-0.17877502739429474,
-0.6548061370849609,
-0.5560324192047119,
0.25102412700653076,
0.3116108179092407,
-0.3093755841255188,
0.7387886047363281,
-0.8008187413215637,
0.25288915634155273,
0.7208980917930603,
0.08374200016260147,
0.2177925705909729,
-0.1466684341430664,
-0.18996857106685638,
0.07600417733192444,
-0.6348995566368103,
-0.5305224061012268,
1.0025652647018433,
0.5416625738143921,
0.6863033771514893,
0.13009591400623322,
0.5547284483909607,
0.3443080484867096,
-0.022730723023414612,
-0.36204037070274353,
0.39101743698120117,
-0.33581334352493286,
-0.9700914621353149,
-0.36399248242378235,
-0.32307377457618713,
-0.9854525327682495,
0.22076793015003204,
-0.22413302958011627,
-0.7439345717430115,
0.12398986518383026,
0.04180176183581352,
-0.2436780035495758,
0.377855122089386,
-0.6984336972236633,
0.9998253583908081,
-0.3376438617706299,
-0.2900077700614929,
0.09885299950838089,
-0.8500122427940369,
0.44226405024528503,
0.007767981383949518,
0.34573182463645935,
-0.1579187661409378,
0.3446166217327118,
0.7027854919433594,
-0.7576851844787598,
1.0371558666229248,
-0.29450222849845886,
0.025934558361768723,
0.34046757221221924,
-0.18163049221038818,
0.4692956209182739,
-0.054523222148418427,
-0.0446566566824913,
0.7475588321685791,
-0.03978853300213814,
-0.2568010985851288,
-0.28430473804473877,
0.5105512738227844,
-0.6603919863700867,
-0.5089442729949951,
-0.5899385809898376,
-0.3806191384792328,
0.31017574667930603,
0.3168798089027405,
0.41772717237472534,
0.21173667907714844,
-0.005920703522861004,
0.16617465019226074,
0.4196610748767853,
-0.32294172048568726,
0.47221896052360535,
0.3543088734149933,
-0.13351455330848694,
-0.35845181345939636,
0.6025956273078918,
0.07263622432947159,
0.1641111820936203,
0.452953040599823,
0.2182970941066742,
-0.5746604204177856,
-0.3921813368797302,
-0.524966299533844,
0.21192137897014618,
-0.5828163027763367,
-0.30395159125328064,
-0.7725740671157837,
-0.2719232141971588,
-0.6134499311447144,
0.06750942766666412,
-0.3956916928291321,
-0.5156219601631165,
-0.5538666844367981,
-0.06650035083293915,
0.6637035608291626,
0.523959755897522,
-0.09505419433116913,
0.12592795491218567,
-0.6121208667755127,
0.2454480528831482,
0.27152565121650696,
0.22443430125713348,
-0.03904340788722038,
-0.7110451459884644,
-0.1994611620903015,
0.24330595135688782,
-0.2626352906227112,
-0.853564441204071,
0.7188449501991272,
0.1495015174150467,
0.5327944755554199,
0.28579607605934143,
0.12140005081892014,
0.7416768074035645,
-0.5387511849403381,
0.9675849080085754,
0.27988260984420776,
-0.9751572012901306,
0.6540176272392273,
-0.3003028929233551,
0.09031116217374802,
0.4145977795124054,
0.4172784388065338,
-0.354779452085495,
-0.35755470395088196,
-0.769251823425293,
-1.0771844387054443,
0.8585443496704102,
0.4582291841506958,
0.0969463363289833,
-0.04114873334765434,
0.16406725347042084,
0.0643586590886116,
0.22999846935272217,
-1.0056673288345337,
-0.6258837580680847,
-0.3672727644443512,
-0.23097248375415802,
-0.04923011362552643,
-0.051647432148456573,
0.032087069004774094,
-0.5269657969474792,
0.8945679068565369,
0.13609254360198975,
0.2872481942176819,
0.171418234705925,
-0.11275451630353928,
0.2961898446083069,
0.1296946257352829,
0.5157912373542786,
0.2891528010368347,
-0.42817285656929016,
0.05617624148726463,
0.18217182159423828,
-0.5098665356636047,
0.15252961218357086,
0.2310725450515747,
-0.07635299116373062,
0.15769287943840027,
0.22601178288459778,
0.9297683835029602,
-0.06534598022699356,
-0.6391185522079468,
0.48905637860298157,
0.010959564708173275,
-0.28479376435279846,
-0.49393847584724426,
0.04459110647439957,
0.22530867159366608,
0.30405524373054504,
0.40806522965431213,
0.011642285622656345,
0.17148147523403168,
-0.6327413320541382,
0.1502912938594818,
0.3265620172023773,
-0.3382526934146881,
-0.15827691555023193,
1.0295766592025757,
0.06210746243596077,
-0.4676368832588196,
0.6819369196891785,
-0.3967897891998291,
-0.5111743211746216,
0.7978330254554749,
0.4667207896709442,
0.9028526544570923,
0.005804929882287979,
0.0404483824968338,
0.6968024373054504,
0.31576845049858093,
-0.19931252300739288,
0.05394921079277992,
0.07924571633338928,
-0.5582305192947388,
-0.2857682406902313,
-0.850263774394989,
0.1406307965517044,
0.2441183477640152,
-0.6432200074195862,
0.3940606713294983,
-0.33068954944610596,
-0.396442174911499,
0.2067728191614151,
0.055220577865839005,
-0.7272274494171143,
0.10626135766506195,
-0.016893288120627403,
0.7435351014137268,
-1.1497324705123901,
0.9806491732597351,
0.6384009122848511,
-0.7320989966392517,
-0.9098058938980103,
-0.32874205708503723,
-0.05237223207950592,
-0.6633909344673157,
0.7592422366142273,
0.1526363044977188,
0.27775827050209045,
-0.12048748880624771,
-0.32668745517730713,
-0.7908362150192261,
1.2819628715515137,
0.2843911647796631,
-0.7174319624900818,
-0.07247263193130493,
0.13767480850219727,
0.6924502849578857,
-0.37502267956733704,
0.5716216564178467,
0.6103334426879883,
0.4059402048587799,
-0.00018972725956700742,
-1.1131383180618286,
0.27146974205970764,
-0.5102342367172241,
0.18445533514022827,
0.04934121295809746,
-0.6830426454544067,
1.1142619848251343,
-0.1462043672800064,
-0.1303396373987198,
0.05077246204018593,
0.42411839962005615,
0.23962387442588806,
0.12178672850131989,
0.5833349823951721,
0.7892953157424927,
0.7056623697280884,
-0.40231165289878845,
0.9395343661308289,
-0.29884248971939087,
0.6703980565071106,
1.0732065439224243,
-0.04589357599616051,
0.6328687071800232,
0.3436024487018585,
-0.5160391926765442,
0.7660115361213684,
0.6503106355667114,
-0.26567330956459045,
0.6869791746139526,
0.3173167407512665,
0.017879562452435493,
0.17153805494308472,
0.024930547922849655,
-0.34182778000831604,
0.4841606914997101,
0.12929974496364594,
-0.5488343834877014,
0.02564099244773388,
-0.1199321374297142,
0.2754059135913849,
-0.030757775530219078,
-0.03272351622581482,
0.7232661247253418,
-0.01868191733956337,
-0.7000453472137451,
0.8259854912757874,
0.1992742419242859,
0.9231657385826111,
-0.41022226214408875,
-0.08950871974229813,
-0.013565337285399437,
0.13216599822044373,
-0.1553204506635666,
-0.7525576949119568,
0.2592638432979584,
0.19347605109214783,
-0.41035717725753784,
-0.27969977259635925,
0.6112233996391296,
-0.49163010716438293,
-0.711728572845459,
0.20062531530857086,
0.3464573323726654,
0.3383747637271881,
-0.03484199196100235,
-0.9677399396896362,
-0.08393730968236923,
0.3121244013309479,
-0.17161063849925995,
0.07846849411725998,
0.37321075797080994,
0.12718233466148376,
0.5316622853279114,
0.8468888998031616,
-0.09432877600193024,
0.13603444397449493,
0.03132384642958641,
0.8096129894256592,
-0.5996537208557129,
-0.48355305194854736,
-0.9995908141136169,
0.8742091059684753,
-0.17178066074848175,
-0.3120882213115692,
0.7449162602424622,
0.7570749521255493,
0.8507340550422668,
-0.34425151348114014,
0.7869411110877991,
-0.4357110559940338,
0.45273497700691223,
-0.41991373896598816,
0.7799144983291626,
-0.5528422594070435,
0.21474595367908478,
-0.5550210475921631,
-0.8721922039985657,
-0.09833189100027084,
0.7818000316619873,
-0.005550862289965153,
0.16500240564346313,
0.49570930004119873,
0.8228620290756226,
-0.0003241921658627689,
-0.3308637738227844,
-0.017954057082533836,
0.34037601947784424,
0.2394666224718094,
0.5754275321960449,
0.45144879817962646,
-0.6542170643806458,
0.4414803981781006,
-0.5289413332939148,
-0.22292593121528625,
-0.29529350996017456,
-1.0378304719924927,
-0.9027385711669922,
-0.7470433712005615,
-0.43186184763908386,
-0.5208065509796143,
-0.19808951020240784,
0.7689593434333801,
0.8291573524475098,
-0.7456414699554443,
-0.31798481941223145,
-0.22194021940231323,
0.05702492222189903,
-0.44446349143981934,
-0.29284992814064026,
0.430362343788147,
-0.013198068365454674,
-1.0261558294296265,
0.1331757754087448,
0.039675600826740265,
0.16829796135425568,
-0.17962932586669922,
-0.12506389617919922,
-0.47909432649612427,
-0.12897443771362305,
0.48330387473106384,
0.16090437769889832,
-0.8091269731521606,
-0.08445021510124207,
0.04895102232694626,
-0.00658896379172802,
0.11072079092264175,
0.2573830783367157,
-0.5093176364898682,
0.34019097685813904,
0.5210925340652466,
0.19528499245643616,
0.7615716457366943,
-0.019835015758872032,
0.25500908493995667,
-0.846655547618866,
0.342240571975708,
0.10824792087078094,
0.599817156791687,
0.3274298906326294,
-0.4735308587551117,
0.6857010722160339,
0.3476676940917969,
-0.5033960938453674,
-0.8452588319778442,
-0.06571713835000992,
-1.1746342182159424,
-0.4286629259586334,
1.0941284894943237,
-0.24226924777030945,
-0.3674103915691376,
-0.08397313952445984,
-0.2932193875312805,
0.48949533700942993,
-0.4322872757911682,
0.7983462810516357,
0.6375301480293274,
0.016467396169900894,
0.036218829452991486,
-0.45982614159584045,
0.36239922046661377,
0.22573833167552948,
-0.5605728030204773,
-0.06113249063491821,
0.31625035405158997,
0.5992183089256287,
0.3268408477306366,
0.6146180033683777,
-0.20972177386283875,
-0.18522055447101593,
0.14936040341854095,
0.2385731190443039,
-0.1493632048368454,
-0.0501670278608799,
-0.2849922478199005,
0.004366612061858177,
-0.11316563934087753,
-0.2552964389324188
] |
facebook/mbart-large-50 | facebook | "2023-03-28T08:28:50Z" | 3,260,064 | 93 | transformers | [
"transformers",
"pytorch",
"tf",
"mbart",
"text2text-generation",
"mbart-50",
"multilingual",
"ar",
"cs",
"de",
"en",
"es",
"et",
"fi",
"fr",
"gu",
"hi",
"it",
"ja",
"kk",
"ko",
"lt",
"lv",
"my",
"ne",
"nl",
"ro",
"ru",
"si",
"tr",
"vi",
"zh",
"af",
"az",
"bn",
"fa",
"he",
"hr",
"id",
"ka",
"km",
"mk",
"ml",
"mn",
"mr",
"pl",
"ps",
"pt",
"sv",
"sw",
"ta",
"te",
"th",
"tl",
"uk",
"ur",
"xh",
"gl",
"sl",
"arxiv:2008.00401",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | text2text-generation | "2022-03-02T23:29:05Z" | ---
language:
- multilingual
- ar
- cs
- de
- en
- es
- et
- fi
- fr
- gu
- hi
- it
- ja
- kk
- ko
- lt
- lv
- my
- ne
- nl
- ro
- ru
- si
- tr
- vi
- zh
- af
- az
- bn
- fa
- he
- hr
- id
- ka
- km
- mk
- ml
- mn
- mr
- pl
- ps
- pt
- sv
- sw
- ta
- te
- th
- tl
- uk
- ur
- xh
- gl
- sl
license: mit
tags:
- mbart-50
---
# mBART-50
mBART-50 is a multilingual Sequence-to-Sequence model pre-trained using the "Multilingual Denoising Pretraining" objective. It was introduced in [Multilingual Translation with Extensible Multilingual Pretraining and Finetuning](https://arxiv.org/abs/2008.00401) paper.
## Model description
mBART-50 is a multilingual Sequence-to-Sequence model. It was introduced to show that multilingual translation models can be created through multilingual fine-tuning.
Instead of fine-tuning on one direction, a pre-trained model is fine-tuned on many directions simultaneously. mBART-50 is created using the original mBART model and extended to add extra 25 languages to support multilingual machine translation models of 50 languages. The pre-training objective is explained below.
**Multilingual Denoising Pretraining**: The model incorporates N languages by concatenating data:
`D = {D1, ..., DN }` where each Di is a collection of monolingual documents in language `i`. The source documents are noised using two schemes,
first randomly shuffling the original sentences' order, and second a novel in-filling scheme,
where spans of text are replaced with a single mask token. The model is then tasked to reconstruct the original text.
35% of each instance's words are masked by random sampling a span length according to a Poisson distribution `(λ = 3.5)`.
The decoder input is the original text with one position offset. A language id symbol `LID` is used as the initial token to predict the sentence.
## Intended uses & limitations
`mbart-large-50` is pre-trained model and primarily aimed at being fine-tuned on translation tasks. It can also be fine-tuned on other multilingual sequence-to-sequence tasks.
See the [model hub](https://huggingface.co/models?filter=mbart-50) to look for fine-tuned versions.
## Training
As the model is multilingual, it expects the sequences in a different format. A special language id token is used as a prefix in both the source and target text. The text format is `[lang_code] X [eos]` with `X` being the source or target text respectively and `lang_code` is `source_lang_code` for source text and `tgt_lang_code` for target text. `bos` is never used. Once the examples are prepared in this format, it can be trained as any other sequence-to-sequence model.
```python
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50")
tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50", src_lang="en_XX", tgt_lang="ro_RO")
src_text = " UN Chief Says There Is No Military Solution in Syria"
tgt_text = "Şeful ONU declară că nu există o soluţie militară în Siria"
model_inputs = tokenizer(src_text, return_tensors="pt")
with tokenizer.as_target_tokenizer():
labels = tokenizer(tgt_text, return_tensors="pt").input_ids
model(**model_inputs, labels=labels) # forward pass
```
## Languages covered
Arabic (ar_AR), Czech (cs_CZ), German (de_DE), English (en_XX), Spanish (es_XX), Estonian (et_EE), Finnish (fi_FI), French (fr_XX), Gujarati (gu_IN), Hindi (hi_IN), Italian (it_IT), Japanese (ja_XX), Kazakh (kk_KZ), Korean (ko_KR), Lithuanian (lt_LT), Latvian (lv_LV), Burmese (my_MM), Nepali (ne_NP), Dutch (nl_XX), Romanian (ro_RO), Russian (ru_RU), Sinhala (si_LK), Turkish (tr_TR), Vietnamese (vi_VN), Chinese (zh_CN), Afrikaans (af_ZA), Azerbaijani (az_AZ), Bengali (bn_IN), Persian (fa_IR), Hebrew (he_IL), Croatian (hr_HR), Indonesian (id_ID), Georgian (ka_GE), Khmer (km_KH), Macedonian (mk_MK), Malayalam (ml_IN), Mongolian (mn_MN), Marathi (mr_IN), Polish (pl_PL), Pashto (ps_AF), Portuguese (pt_XX), Swedish (sv_SE), Swahili (sw_KE), Tamil (ta_IN), Telugu (te_IN), Thai (th_TH), Tagalog (tl_XX), Ukrainian (uk_UA), Urdu (ur_PK), Xhosa (xh_ZA), Galician (gl_ES), Slovene (sl_SI)
## BibTeX entry and citation info
```
@article{tang2020multilingual,
title={Multilingual Translation with Extensible Multilingual Pretraining and Finetuning},
author={Yuqing Tang and Chau Tran and Xian Li and Peng-Jen Chen and Naman Goyal and Vishrav Chaudhary and Jiatao Gu and Angela Fan},
year={2020},
eprint={2008.00401},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
``` | [
-0.474958211183548,
-0.5132153630256653,
0.06597525626420975,
0.35463082790374756,
-0.39388760924339294,
0.13274335861206055,
-0.29443350434303284,
-0.2931402623653412,
0.2646331787109375,
0.19878819584846497,
-0.5877816081047058,
-0.6339622735977173,
-0.6813580393791199,
0.3131709098815918,
-0.1756046861410141,
1.080588936805725,
-0.11322429031133652,
0.36689528822898865,
0.3161998987197876,
-0.12976063787937164,
-0.35092970728874207,
-0.5285422205924988,
-0.47931796312332153,
-0.07525588572025299,
0.3109678328037262,
0.4786617159843445,
0.4217602014541626,
0.4389786124229431,
0.6021636128425598,
0.3508933484554291,
-0.23366083204746246,
0.11948106437921524,
-0.3150712549686432,
-0.32570990920066833,
-0.005102923139929771,
-0.37556779384613037,
-0.6677418351173401,
-0.13014563918113708,
0.7700955867767334,
0.5713263154029846,
0.0019214736530557275,
0.45153799653053284,
0.00953669659793377,
0.7061644792556763,
-0.41806110739707947,
0.04067004472017288,
-0.39357703924179077,
0.11493384093046188,
-0.35855916142463684,
-0.017648372799158096,
-0.46479687094688416,
-0.328203946352005,
-0.07246551662683487,
-0.37748172879219055,
0.11694987863302231,
-0.05906008183956146,
1.2297052145004272,
-0.13508020341396332,
-0.5541548132896423,
-0.0979091003537178,
-0.6337157487869263,
0.7316000461578369,
-0.9337531328201294,
0.4773881137371063,
0.5389286875724792,
0.21895302832126617,
-0.04963281378149986,
-0.7564706206321716,
-0.6834456324577332,
-0.08053263276815414,
-0.17617467045783997,
0.34431836009025574,
-0.08428990840911865,
-0.16784249246120453,
0.23610728979110718,
0.43065521121025085,
-0.8520986437797546,
-0.20907291769981384,
-0.674572229385376,
-0.0007862459169700742,
0.5835259556770325,
-0.03304070979356766,
0.35148322582244873,
-0.4383018910884857,
-0.42397022247314453,
-0.06817901879549026,
-0.5062556266784668,
0.36985471844673157,
0.2416357845067978,
0.3664811849594116,
-0.4119483232498169,
0.7282272577285767,
-0.26505810022354126,
0.8058283925056458,
0.11596672981977463,
-0.22744083404541016,
0.6755027174949646,
-0.618645429611206,
-0.2576560378074646,
-0.004733439534902573,
1.1431297063827515,
0.17409902811050415,
0.3177453577518463,
0.05725899711251259,
-0.031865861266851425,
-0.180449977517128,
0.005892431829124689,
-0.8414324522018433,
0.0013132230378687382,
0.19159387052059174,
-0.44810622930526733,
0.02931736595928669,
0.2943955659866333,
-0.733076274394989,
0.2522583603858948,
-0.08823394030332565,
0.46451449394226074,
-0.7618790864944458,
-0.23269064724445343,
0.07295084744691849,
-0.01067349873483181,
0.2713000178337097,
0.026103714480996132,
-0.8735867142677307,
-0.038054272532463074,
0.3566734492778778,
0.8934321403503418,
0.09091774374246597,
-0.6194652915000916,
-0.20496731996536255,
0.24339330196380615,
-0.3595549166202545,
0.5833819508552551,
-0.3916049599647522,
-0.504825234413147,
-0.2115696370601654,
0.3991714119911194,
-0.20455828309059143,
-0.3400934934616089,
0.6234937310218811,
-0.2652125954627991,
0.33602187037467957,
-0.3721693754196167,
-0.3153802156448364,
-0.342378169298172,
0.34349390864372253,
-0.687431812286377,
1.3321945667266846,
0.22563114762306213,
-0.7841856479644775,
0.34615546464920044,
-0.6049578189849854,
-0.6019800901412964,
-0.005632981192320585,
-0.0007313316455110908,
-0.5779687762260437,
-0.1340171843767166,
0.41569578647613525,
0.5060350894927979,
-0.2753642797470093,
0.391655296087265,
-0.03670327737927437,
-0.38036859035491943,
0.09094938635826111,
-0.335387647151947,
1.0975502729415894,
0.4111934304237366,
-0.5278021693229675,
0.09254051744937897,
-0.8913291096687317,
0.03494438901543617,
0.24349412322044373,
-0.57338947057724,
-0.14802950620651245,
-0.31665053963661194,
-0.046430159360170364,
0.5321468114852905,
0.17016902565956116,
-0.5679317712783813,
0.15116137266159058,
-0.44764888286590576,
0.35435280203819275,
0.5440946817398071,
-0.07877206057310104,
0.34109607338905334,
-0.3141035735607147,
0.6832196116447449,
0.2647101581096649,
0.15085162222385406,
-0.3699455261230469,
-0.6440886855125427,
-0.8437609672546387,
-0.4486149251461029,
0.2613683342933655,
0.8258868455886841,
-0.747305691242218,
0.43599268794059753,
-0.5613759160041809,
-0.6287165880203247,
-0.7464139461517334,
0.15004198253154755,
0.5896154642105103,
0.4247708022594452,
0.4393797516822815,
-0.36151331663131714,
-0.6589462757110596,
-0.780951738357544,
-0.19721287488937378,
-0.1652802973985672,
0.19411081075668335,
0.23104329407215118,
0.694789469242096,
-0.28840774297714233,
0.7910054922103882,
-0.3103525936603546,
-0.2449427843093872,
-0.39009714126586914,
0.07858476787805557,
0.370464950799942,
0.6715916991233826,
0.5780342221260071,
-1.0048962831497192,
-0.8196423053741455,
0.22573280334472656,
-0.5884411334991455,
0.1742425113916397,
0.03798948600888252,
-0.3061167299747467,
0.39721497893333435,
0.47459447383880615,
-0.5456205606460571,
0.3516298234462738,
0.6883950233459473,
-0.3760278820991516,
0.627903163433075,
-0.17139220237731934,
0.39267072081565857,
-1.6204352378845215,
0.37855690717697144,
-0.21069836616516113,
-0.048464421182870865,
-0.7272720336914062,
-0.13297995924949646,
0.28390535712242126,
-0.15538565814495087,
-0.6741125583648682,
0.6558705568313599,
-0.5607079863548279,
0.264551043510437,
0.16047698259353638,
-0.0178084596991539,
0.049252066761255264,
0.5507618188858032,
0.10541866719722748,
0.7395644783973694,
0.3659293055534363,
-0.5283374786376953,
0.251015841960907,
0.3107990324497223,
-0.45767495036125183,
0.5691665410995483,
-0.5243565440177917,
-0.18756912648677826,
-0.1794971078634262,
0.24354228377342224,
-1.1371902227401733,
-0.14485974609851837,
0.3580160439014435,
-0.8079469203948975,
0.3561864197254181,
-0.11506646871566772,
-0.4137550890445709,
-0.7111371159553528,
-0.18109281361103058,
0.5270417928695679,
0.32520559430122375,
-0.2499391734600067,
0.5123236179351807,
0.050898227840662,
-0.25648584961891174,
-0.8844499588012695,
-1.09394109249115,
0.07015994191169739,
-0.1458495408296585,
-0.5888000726699829,
0.34056100249290466,
-0.12298805266618729,
0.15291482210159302,
0.13013404607772827,
0.09739716351032257,
-0.0994611382484436,
0.049460601061582565,
0.19178162515163422,
0.3588949739933014,
-0.3569958806037903,
0.110221266746521,
-0.03587472438812256,
0.015497153624892235,
-0.2583002746105194,
-0.2597658634185791,
0.7328751683235168,
-0.19099180400371552,
-0.2423316389322281,
-0.4219719171524048,
0.4484873414039612,
0.4852842092514038,
-0.7964003086090088,
1.1067599058151245,
1.0317113399505615,
-0.3484709560871124,
0.19100907444953918,
-0.43882545828819275,
0.02942827343940735,
-0.4618277847766876,
0.6681513786315918,
-0.7709439396858215,
-0.8672118782997131,
0.608258843421936,
0.027164485305547714,
0.02233160100877285,
0.6688088774681091,
0.8773224353790283,
0.10843446105718613,
0.820139467716217,
0.6110357046127319,
-0.08495552837848663,
0.5675345063209534,
-0.5406591892242432,
0.1519709974527359,
-0.6961075067520142,
-0.40532827377319336,
-0.5371477603912354,
-0.09944655746221542,
-0.7363170385360718,
-0.5146540999412537,
0.12935346364974976,
0.17892029881477356,
-0.4865337312221527,
0.48896753787994385,
-0.31652340292930603,
0.2402397245168686,
0.7071783542633057,
0.052134498953819275,
0.15472549200057983,
0.08078930526971817,
-0.47234252095222473,
-0.009642967022955418,
-0.7670400142669678,
-0.4942116141319275,
1.1286227703094482,
0.1400170475244522,
0.39938125014305115,
0.3329470455646515,
0.7472748756408691,
-0.07469465583562851,
0.29521241784095764,
-0.5672776103019714,
0.5126426815986633,
-0.33658215403556824,
-0.99805748462677,
-0.2712952792644501,
-0.5575954914093018,
-1.0318621397018433,
0.21949611604213715,
-0.20357683300971985,
-0.6313126683235168,
0.26638489961624146,
-0.02908957190811634,
-0.4085995852947235,
0.24164879322052002,
-0.7996796369552612,
1.0693737268447876,
-0.30020639300346375,
-0.08172694593667984,
0.10414320230484009,
-0.8742690682411194,
0.5384745001792908,
-0.2529766261577606,
0.43207648396492004,
-0.16536471247673035,
0.1625843495130539,
0.8027004599571228,
-0.3529462516307831,
0.6460797786712646,
0.06203484535217285,
0.010130890645086765,
0.22843371331691742,
-0.12114844471216202,
0.3678267300128937,
-0.08580026030540466,
-0.08908957242965698,
0.2559191584587097,
0.07345516979694366,
-0.584638774394989,
-0.19208422303199768,
0.44081148505210876,
-0.8996222615242004,
-0.48125940561294556,
-0.5275888442993164,
-0.5111340284347534,
0.0377265028655529,
0.5879731178283691,
0.615964412689209,
0.21059684455394745,
-0.2490713894367218,
0.18050435185432434,
0.380021870136261,
-0.4617454409599304,
0.5335579514503479,
0.5797109603881836,
-0.23037002980709076,
-0.7447324395179749,
0.9315654039382935,
0.24406181275844574,
0.46111738681793213,
0.5950284600257874,
0.068467877805233,
-0.09150755405426025,
-0.20843659341335297,
-0.5755621194839478,
0.51066654920578,
-0.6070136427879333,
-0.135022833943367,
-0.7640208601951599,
-0.1978994607925415,
-0.8723715543746948,
-0.11210572719573975,
-0.4637118875980377,
-0.3777385652065277,
-0.24158427119255066,
-0.025913015007972717,
0.2575555741786957,
0.44907331466674805,
-0.10665583610534668,
0.3715406060218811,
-0.937458872795105,
0.5025765299797058,
-0.011344176717102528,
0.1535472720861435,
-0.09559590369462967,
-0.8031619191169739,
-0.6387550830841064,
0.22023095190525055,
-0.2752990126609802,
-0.9834885597229004,
0.622893214225769,
0.3423062860965729,
0.5230847597122192,
0.4736386239528656,
-0.014042953960597515,
0.9033279418945312,
-0.7094318270683289,
0.8707565665245056,
0.25091123580932617,
-1.0594182014465332,
0.6134781837463379,
-0.22400447726249695,
0.6136128306388855,
0.5754891037940979,
0.7380865812301636,
-0.8502020239830017,
-0.41673341393470764,
-0.41689637303352356,
-1.0899875164031982,
0.8655080199241638,
0.08918973058462143,
0.16244933009147644,
-0.08819296211004257,
0.14464685320854187,
-0.08113675564527512,
0.19087618589401245,
-1.0652104616165161,
-0.5656293034553528,
-0.3460681438446045,
-0.36178773641586304,
-0.5353426933288574,
-0.37505289912223816,
-0.05235699191689491,
-0.507506787776947,
0.8376062512397766,
0.1714317351579666,
0.4149232804775238,
0.22629806399345398,
-0.16735868155956268,
-0.066164530813694,
0.3436013460159302,
0.881022572517395,
0.5768733620643616,
-0.2860530614852905,
0.059943076223134995,
0.20286773145198822,
-0.7966263890266418,
0.3164403438568115,
0.30240121483802795,
-0.13697993755340576,
0.21244797110557556,
0.38731780648231506,
0.9720367789268494,
0.05506422743201256,
-0.5173013806343079,
0.45754513144493103,
0.01437470130622387,
-0.22315828502178192,
-0.3642752766609192,
-0.3332689702510834,
0.23438742756843567,
0.2979098856449127,
0.45069077610969543,
-0.1198214590549469,
-0.1272924244403839,
-0.6318432688713074,
0.21825174987316132,
0.36067402362823486,
-0.26277026534080505,
-0.3744629919528961,
0.7033637166023254,
-0.0011742054484784603,
-0.2676902711391449,
0.49492862820625305,
-0.28964483737945557,
-0.7455587983131409,
0.5458377003669739,
0.5785120725631714,
0.7452680468559265,
-0.6856778860092163,
0.30514851212501526,
0.7375496029853821,
0.5975270867347717,
-0.1417289823293686,
0.4385160803794861,
0.11746064573526382,
-0.6062403917312622,
-0.4180837869644165,
-0.8186497688293457,
0.008635081350803375,
0.0377853624522686,
-0.7410939931869507,
0.362170547246933,
-0.06439622491598129,
-0.4072844386100769,
-0.16215582191944122,
0.09527010470628738,
-0.6665588617324829,
0.3339328467845917,
0.031085120514035225,
0.857988178730011,
-0.9637139439582825,
1.1611121892929077,
0.8966400623321533,
-0.6196907758712769,
-0.982009768486023,
-0.1320616900920868,
-0.17492243647575378,
-0.6679675579071045,
0.9157553911209106,
0.15341517329216003,
0.19084052741527557,
0.19534185528755188,
-0.2182435393333435,
-0.9988616108894348,
1.1454741954803467,
0.4927896559238434,
-0.44855383038520813,
0.005626444239169359,
0.46687132120132446,
0.4054025709629059,
-0.12809999287128448,
0.15805546939373016,
0.3925754725933075,
0.5411385297775269,
0.1577768325805664,
-1.1171183586120605,
0.04594134911894798,
-0.5967025756835938,
-0.09894254058599472,
0.19950971007347107,
-0.8018280863761902,
1.1994056701660156,
-0.2519197463989258,
-0.08655976504087448,
0.03227825090289116,
0.6028555035591125,
0.33873021602630615,
0.1685805469751358,
0.1415358930826187,
0.6724536418914795,
0.6458268165588379,
-0.09115121513605118,
0.9166118502616882,
-0.4650458097457886,
0.4460148513317108,
1.0293618440628052,
0.17103101313114166,
1.0163171291351318,
0.5023834109306335,
-0.3102627098560333,
0.37213513255119324,
0.8067653775215149,
-0.032786231487989426,
0.5619073510169983,
-0.13702601194381714,
-0.15755599737167358,
-0.0447646826505661,
-0.03001127950847149,
-0.6119840145111084,
0.4564781188964844,
0.10946892946958542,
-0.5648443698883057,
0.0585080049932003,
0.23887060582637787,
0.48855555057525635,
-0.36955758929252625,
-0.22012487053871155,
0.538102388381958,
0.14188739657402039,
-0.7604857683181763,
0.8744751214981079,
0.23250707983970642,
0.6998860836029053,
-0.764906644821167,
0.20325049757957458,
-0.35214513540267944,
0.33385396003723145,
-0.12368334829807281,
-0.534928560256958,
0.09369565546512604,
0.05846196040511131,
-0.2593797445297241,
-0.1032814010977745,
0.24040398001670837,
-0.8237367868423462,
-0.9568094611167908,
0.2636280059814453,
0.5246698260307312,
0.19247540831565857,
0.09097255766391754,
-0.8363038897514343,
-0.11006203293800354,
0.2174750119447708,
-0.5773746371269226,
0.1684487909078598,
0.70332932472229,
0.035911478102207184,
0.5457058548927307,
0.5868728160858154,
0.19388455152511597,
0.36656779050827026,
-0.16465440392494202,
0.7454038858413696,
-0.7673303484916687,
-0.4486834406852722,
-1.094212532043457,
0.6195242404937744,
0.2231016308069229,
-0.41138356924057007,
1.1554193496704102,
0.7020419836044312,
1.0787855386734009,
-0.17538169026374817,
0.7530825138092041,
-0.16331501305103302,
0.37808316946029663,
-0.4002733826637268,
0.8452308773994446,
-0.838563084602356,
-0.09230104833841324,
-0.541354238986969,
-0.8167839050292969,
-0.4311618506908417,
0.6466726660728455,
-0.304953396320343,
0.33763420581817627,
0.683342695236206,
0.696533203125,
0.00529328640550375,
-0.33175429701805115,
0.21914324164390564,
0.30090439319610596,
0.22102464735507965,
0.7088239789009094,
0.41429489850997925,
-0.5480073094367981,
0.7077431678771973,
-0.4284149706363678,
-0.07954520732164383,
-0.2532384395599365,
-0.7000042796134949,
-0.8532936573028564,
-0.7763141393661499,
-0.12655691802501678,
-0.34558171033859253,
0.04507991671562195,
0.9377744197845459,
0.5886191129684448,
-0.9008293747901917,
-0.4396505355834961,
0.19110506772994995,
-0.13120777904987335,
-0.3068690598011017,
-0.13856381177902222,
0.6300640106201172,
-0.15887171030044556,
-0.8459050059318542,
0.11654721200466156,
0.04648714140057564,
0.3277507722377777,
-0.017274159938097,
-0.2669401168823242,
-0.755825936794281,
0.0418490469455719,
0.6763901710510254,
0.2849137485027313,
-0.6160746812820435,
0.2075808197259903,
0.12966565787792206,
-0.3367873430252075,
0.18956494331359863,
0.3236232399940491,
-0.40426474809646606,
0.5304104685783386,
0.4449225068092346,
0.4334467351436615,
0.6613543033599854,
0.01561678759753704,
0.4403873085975647,
-0.6738260984420776,
0.43742507696151733,
0.008030299097299576,
0.33515918254852295,
0.31153759360313416,
-0.11583706736564636,
0.5546184778213501,
0.37024176120758057,
-0.43231019377708435,
-0.9962176084518433,
-0.04938987269997597,
-0.9464465975761414,
-0.37765488028526306,
1.2678008079528809,
-0.5243693590164185,
-0.2855204939842224,
0.050211891531944275,
-0.25665029883384705,
0.6372267603874207,
-0.22561782598495483,
0.4646342992782593,
0.8285703659057617,
0.24856145679950714,
-0.2521795630455017,
-0.7126600742340088,
0.41081157326698303,
0.4998575448989868,
-0.7480679154396057,
-0.23130129277706146,
0.11608714610338211,
0.20436421036720276,
0.19731180369853973,
0.7456642985343933,
-0.15625253319740295,
0.268018513917923,
-0.12607748806476593,
0.41150689125061035,
0.005111990496516228,
-0.16013824939727783,
-0.304091215133667,
-0.039540912955999374,
0.028176352381706238,
-0.2802078127861023
] |
albert-base-v2 | null | "2023-05-30T07:52:10Z" | 3,217,580 | 73 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"albert",
"fill-mask",
"en",
"dataset:bookcorpus",
"dataset:wikipedia",
"arxiv:1909.11942",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: en
license: apache-2.0
datasets:
- bookcorpus
- wikipedia
---
# ALBERT Base v2
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
[this paper](https://arxiv.org/abs/1909.11942) and first released in
[this repository](https://github.com/google-research/albert). This model, as all ALBERT models, is uncased: it does not make a difference
between english and English.
Disclaimer: The team releasing ALBERT did not write a model card for this model so this model card has been written by
the Hugging Face team.
## Model description
ALBERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it
was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
was pretrained with two objectives:
- Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run
the entire masked sentence through the model and has to predict the masked words. This is different from traditional
recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like
GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the
sentence.
- Sentence Ordering Prediction (SOP): ALBERT uses a pretraining loss based on predicting the ordering of two consecutive segments of text.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
classifier using the features produced by the ALBERT model as inputs.
ALBERT is particular in that it shares its layers across its Transformer. Therefore, all layers have the same weights. Using repeating layers results in a small memory footprint, however, the computational cost remains similar to a BERT-like architecture with the same number of hidden layers as it has to iterate through the same number of (repeating) layers.
This is the second version of the base model. Version 2 is different from version 1 due to different dropout rates, additional training data, and longer training. It has better results in nearly all downstream tasks.
This model has the following configuration:
- 12 repeating layers
- 128 embedding dimension
- 768 hidden dimension
- 12 attention heads
- 11M parameters
## Intended uses & limitations
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=albert) to look for
fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
### How to use
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='albert-base-v2')
>>> unmasker("Hello I'm a [MASK] model.")
[
{
"sequence":"[CLS] hello i'm a modeling model.[SEP]",
"score":0.05816134437918663,
"token":12807,
"token_str":"▁modeling"
},
{
"sequence":"[CLS] hello i'm a modelling model.[SEP]",
"score":0.03748830780386925,
"token":23089,
"token_str":"▁modelling"
},
{
"sequence":"[CLS] hello i'm a model model.[SEP]",
"score":0.033725276589393616,
"token":1061,
"token_str":"▁model"
},
{
"sequence":"[CLS] hello i'm a runway model.[SEP]",
"score":0.017313428223133087,
"token":8014,
"token_str":"▁runway"
},
{
"sequence":"[CLS] hello i'm a lingerie model.[SEP]",
"score":0.014405295252799988,
"token":29104,
"token_str":"▁lingerie"
}
]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import AlbertTokenizer, AlbertModel
tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
model = AlbertModel.from_pretrained("albert-base-v2")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```
and in TensorFlow:
```python
from transformers import AlbertTokenizer, TFAlbertModel
tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
model = TFAlbertModel.from_pretrained("albert-base-v2")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
```
### Limitations and bias
Even if the training data used for this model could be characterized as fairly neutral, this model can have biased
predictions:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='albert-base-v2')
>>> unmasker("The man worked as a [MASK].")
[
{
"sequence":"[CLS] the man worked as a chauffeur.[SEP]",
"score":0.029577180743217468,
"token":28744,
"token_str":"▁chauffeur"
},
{
"sequence":"[CLS] the man worked as a janitor.[SEP]",
"score":0.028865724802017212,
"token":29477,
"token_str":"▁janitor"
},
{
"sequence":"[CLS] the man worked as a shoemaker.[SEP]",
"score":0.02581118606030941,
"token":29024,
"token_str":"▁shoemaker"
},
{
"sequence":"[CLS] the man worked as a blacksmith.[SEP]",
"score":0.01849772222340107,
"token":21238,
"token_str":"▁blacksmith"
},
{
"sequence":"[CLS] the man worked as a lawyer.[SEP]",
"score":0.01820771023631096,
"token":3672,
"token_str":"▁lawyer"
}
]
>>> unmasker("The woman worked as a [MASK].")
[
{
"sequence":"[CLS] the woman worked as a receptionist.[SEP]",
"score":0.04604868218302727,
"token":25331,
"token_str":"▁receptionist"
},
{
"sequence":"[CLS] the woman worked as a janitor.[SEP]",
"score":0.028220869600772858,
"token":29477,
"token_str":"▁janitor"
},
{
"sequence":"[CLS] the woman worked as a paramedic.[SEP]",
"score":0.0261906236410141,
"token":23386,
"token_str":"▁paramedic"
},
{
"sequence":"[CLS] the woman worked as a chauffeur.[SEP]",
"score":0.024797942489385605,
"token":28744,
"token_str":"▁chauffeur"
},
{
"sequence":"[CLS] the woman worked as a waitress.[SEP]",
"score":0.024124596267938614,
"token":13678,
"token_str":"▁waitress"
}
]
```
This bias will also affect all fine-tuned versions of this model.
## Training data
The ALBERT model was pretrained on [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038
unpublished books and [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and
headers).
## Training procedure
### Preprocessing
The texts are lowercased and tokenized using SentencePiece and a vocabulary size of 30,000. The inputs of the model are
then of the form:
```
[CLS] Sentence A [SEP] Sentence B [SEP]
```
### Training
The ALBERT procedure follows the BERT setup.
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
## Evaluation results
When fine-tuned on downstream tasks, the ALBERT models achieve the following results:
| | Average | SQuAD1.1 | SQuAD2.0 | MNLI | SST-2 | RACE |
|----------------|----------|----------|----------|----------|----------|----------|
|V2 |
|ALBERT-base |82.3 |90.2/83.2 |82.1/79.3 |84.6 |92.9 |66.8 |
|ALBERT-large |85.7 |91.8/85.2 |84.9/81.8 |86.5 |94.9 |75.2 |
|ALBERT-xlarge |87.9 |92.9/86.4 |87.9/84.1 |87.9 |95.4 |80.7 |
|ALBERT-xxlarge |90.9 |94.6/89.1 |89.8/86.9 |90.6 |96.8 |86.8 |
|V1 |
|ALBERT-base |80.1 |89.3/82.3 | 80.0/77.1|81.6 |90.3 | 64.0 |
|ALBERT-large |82.4 |90.6/83.9 | 82.3/79.4|83.5 |91.7 | 68.5 |
|ALBERT-xlarge |85.5 |92.5/86.1 | 86.1/83.1|86.4 |92.4 | 74.8 |
|ALBERT-xxlarge |91.0 |94.8/89.3 | 90.2/87.4|90.8 |96.9 | 86.5 |
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1909-11942,
author = {Zhenzhong Lan and
Mingda Chen and
Sebastian Goodman and
Kevin Gimpel and
Piyush Sharma and
Radu Soricut},
title = {{ALBERT:} {A} Lite {BERT} for Self-supervised Learning of Language
Representations},
journal = {CoRR},
volume = {abs/1909.11942},
year = {2019},
url = {http://arxiv.org/abs/1909.11942},
archivePrefix = {arXiv},
eprint = {1909.11942},
timestamp = {Fri, 27 Sep 2019 13:04:21 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1909-11942.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
``` | [
-0.09252004325389862,
-0.507871150970459,
0.19068437814712524,
0.3494366705417633,
-0.47714725136756897,
0.02343524619936943,
0.0905412882566452,
-0.17930316925048828,
0.31694284081459045,
0.6178159117698669,
-0.5070419907569885,
-0.47385677695274353,
-0.8251692056655884,
0.10841916501522064,
-0.48409897089004517,
1.1839287281036377,
0.06355275958776474,
0.3629854917526245,
-0.013368510641157627,
0.12989099323749542,
-0.39558520913124084,
-0.626023530960083,
-0.8129693865776062,
-0.3089815080165863,
0.4458708167076111,
0.35041487216949463,
0.6038568019866943,
0.7103646397590637,
0.5457624197006226,
0.39255061745643616,
-0.014293907210230827,
-0.18051202595233917,
-0.3204067349433899,
0.04969499260187149,
-0.041848260909318924,
-0.6828809976577759,
-0.4646800756454468,
0.08801435679197311,
0.6240216493606567,
0.8239193558692932,
-0.03919748216867447,
0.3272300958633423,
-0.10243066400289536,
0.5770178437232971,
-0.36026445031166077,
0.30313965678215027,
-0.3894519507884979,
0.0935407280921936,
-0.2629675269126892,
0.0882398784160614,
-0.3126581907272339,
-0.12102252244949341,
0.10390101373195648,
-0.6400966048240662,
0.22150589525699615,
0.3358986973762512,
1.1428773403167725,
0.09354682266712189,
-0.2096686214208603,
-0.15456338226795197,
-0.5550187826156616,
0.850570023059845,
-0.6585569381713867,
0.20060445368289948,
0.5384311079978943,
0.27419528365135193,
-0.020630881190299988,
-1.0030525922775269,
-0.31906118988990784,
-0.06949711591005325,
-0.23547013103961945,
-0.007462610490620136,
-0.02343861386179924,
-0.13801062107086182,
0.43738189339637756,
0.411395400762558,
-0.4687235653400421,
0.002483776770532131,
-0.7514610290527344,
-0.32032760977745056,
0.6753866672515869,
0.23523405194282532,
0.26785096526145935,
-0.2759711444377899,
-0.34149473905563354,
-0.32042691111564636,
-0.3807348906993866,
0.11054345220327377,
0.5309742093086243,
0.3371455669403076,
-0.25105974078178406,
0.7095140814781189,
-0.3653377890586853,
0.4720510244369507,
-0.03648848831653595,
-0.009648023173213005,
0.49564868211746216,
-0.06023086607456207,
-0.4334292709827423,
-0.0064280666410923,
1.084815263748169,
0.27910423278808594,
0.35986581444740295,
-0.079267218708992,
-0.44816991686820984,
-0.04614817723631859,
0.25577807426452637,
-0.7341069579124451,
-0.3653263449668884,
0.1541730761528015,
-0.4824488162994385,
-0.4267592430114746,
0.48890671133995056,
-0.6663634181022644,
-0.05498616024851799,
-0.08336730301380157,
0.483542799949646,
-0.2801341414451599,
-0.22638094425201416,
0.16938570141792297,
-0.4321464002132416,
0.11421035975217819,
0.10046306997537613,
-0.9616941213607788,
0.21936900913715363,
0.6147890686988831,
0.8677700757980347,
0.36454781889915466,
-0.19159696996212006,
-0.39416226744651794,
-0.11622045934200287,
-0.38310497999191284,
0.5063609480857849,
-0.3262557089328766,
-0.5304614305496216,
0.05178157985210419,
0.21939711272716522,
-0.02247765101492405,
-0.39080795645713806,
0.6033685207366943,
-0.6216135025024414,
0.5178284049034119,
-0.04048071801662445,
-0.4111354649066925,
-0.20460912585258484,
0.033704888075590134,
-0.7461858987808228,
1.1206412315368652,
0.4155799150466919,
-0.6756856441497803,
0.2817481458187103,
-0.9091048240661621,
-0.5501037240028381,
0.2461986243724823,
0.09653783589601517,
-0.5014124512672424,
0.13333967328071594,
0.11518491804599762,
0.3710169494152069,
-0.13053911924362183,
0.21009786427021027,
-0.19714173674583435,
-0.42460188269615173,
0.32372739911079407,
-0.18211118876934052,
1.0930774211883545,
0.22408227622509003,
-0.2649211287498474,
0.05363278090953827,
-0.856779932975769,
-0.04412783309817314,
0.28433531522750854,
-0.3032444715499878,
-0.24518567323684692,
-0.2632337808609009,
0.3267399072647095,
0.13246773183345795,
0.42150577902793884,
-0.526666522026062,
0.2532413899898529,
-0.6104635000228882,
0.4985503852367401,
0.745369017124176,
-0.0815817192196846,
0.41337770223617554,
-0.4175656735897064,
0.573153555393219,
0.04202733561396599,
-0.09971291571855545,
-0.2573983669281006,
-0.6321603059768677,
-0.8877818584442139,
-0.2980230748653412,
0.5216510891914368,
0.7705622911453247,
-0.4597979485988617,
0.6451404094696045,
-0.1137884259223938,
-0.6273060441017151,
-0.6554338932037354,
-0.03804924711585045,
0.4250698685646057,
0.4205418527126312,
0.3378899097442627,
-0.432644248008728,
-0.8793784976005554,
-0.8714771866798401,
-0.3040189743041992,
-0.20732170343399048,
-0.3416033387184143,
-0.0107514513656497,
0.8082508444786072,
-0.3251759707927704,
0.755801796913147,
-0.6844548583030701,
-0.37694740295410156,
-0.12784406542778015,
0.3418266475200653,
0.49253442883491516,
0.7852393984794617,
0.3658967614173889,
-0.6230639219284058,
-0.4538726806640625,
-0.2894885838031769,
-0.7643399834632874,
-0.030286505818367004,
-0.05439089983701706,
-0.26157069206237793,
-0.005165737122297287,
0.4846424162387848,
-0.7612286806106567,
0.5331313610076904,
0.21538406610488892,
-0.5272046327590942,
0.654880166053772,
-0.24891053140163422,
0.05286035314202309,
-1.2156301736831665,
0.17857764661312103,
-0.09397303313016891,
-0.30754268169403076,
-0.7383590936660767,
-0.023937538266181946,
-0.10459578037261963,
-0.006079976446926594,
-0.592748761177063,
0.5725721716880798,
-0.5352988243103027,
0.02396790124475956,
-0.07077427953481674,
-0.1513667106628418,
0.1779208928346634,
0.42457520961761475,
0.008718861266970634,
0.5856784582138062,
0.6681538224220276,
-0.5892157554626465,
0.5756362676620483,
0.4697234630584717,
-0.6326881051063538,
0.26463955640792847,
-0.8669662475585938,
0.2814260721206665,
-0.03313124179840088,
-0.07583656907081604,
-1.059149980545044,
-0.3313749134540558,
0.3840843737125397,
-0.5327070355415344,
0.36530259251594543,
-0.0582011453807354,
-0.6955764889717102,
-0.5018962025642395,
-0.2237355262041092,
0.5233058929443359,
0.5429298281669617,
-0.22317473590373993,
0.4340238571166992,
0.33606842160224915,
-0.13610871136188507,
-0.6429502964019775,
-0.7638938426971436,
0.10811548680067062,
-0.2516796886920929,
-0.5341083407402039,
0.32782626152038574,
-0.011606056243181229,
-0.26585879921913147,
-0.2668475806713104,
0.09446427971124649,
-0.05406258627772331,
0.08789615333080292,
0.2915222644805908,
0.48894715309143066,
-0.28277650475502014,
-0.2659331262111664,
-0.08760939538478851,
-0.20433904230594635,
0.33228662610054016,
-0.04222124069929123,
0.7242847681045532,
-0.022514646872878075,
-0.11708018183708191,
-0.4703344702720642,
0.45114415884017944,
0.6355311870574951,
-0.07499398291110992,
0.8148266077041626,
0.8053098917007446,
-0.5810316801071167,
0.0849727913737297,
-0.2704916000366211,
-0.19071240723133087,
-0.5324464440345764,
0.6421452164649963,
-0.5632666349411011,
-0.8442837595939636,
0.7345912456512451,
0.28076377511024475,
-0.16860131919384003,
0.720323383808136,
0.6410623788833618,
-0.17899347841739655,
1.199207067489624,
0.4488462209701538,
-0.06698243319988251,
0.47282588481903076,
-0.24906860291957855,
0.32762259244918823,
-0.9099462628364563,
-0.5269339084625244,
-0.4785594046115875,
-0.19911986589431763,
-0.4418177902698517,
-0.10748095065355301,
0.1998373419046402,
0.4129267632961273,
-0.5276789665222168,
0.6651936173439026,
-0.6091703772544861,
0.3812512159347534,
0.9229286909103394,
0.16061949729919434,
-0.13957428932189941,
-0.23646347224712372,
-0.059118978679180145,
0.024787725880742073,
-0.3973153531551361,
-0.5223668217658997,
1.0541127920150757,
0.5973559617996216,
0.712054431438446,
0.09532617032527924,
0.6103052496910095,
0.251730352640152,
0.1709808111190796,
-0.5634003281593323,
0.5852764248847961,
-0.08709923923015594,
-0.8996530771255493,
-0.3235940635204315,
-0.16074618697166443,
-1.015708565711975,
0.1664818823337555,
-0.2615239918231964,
-0.9507642984390259,
-0.1127314493060112,
-0.1352529376745224,
-0.4007868468761444,
0.10850989073514938,
-0.7110180258750916,
1.111354112625122,
-0.3280677795410156,
-0.13900746405124664,
0.18850068747997284,
-0.8978599905967712,
0.3056768476963043,
0.06949751079082489,
0.189533993601799,
-0.1531320959329605,
0.15650689601898193,
1.1815482378005981,
-0.46597230434417725,
0.828586220741272,
-0.14665056765079498,
0.21969667077064514,
0.0559796467423439,
0.06888389587402344,
0.3429855406284332,
0.14563019573688507,
0.13302244246006012,
0.42560845613479614,
0.094000905752182,
-0.4368150234222412,
-0.2565705180168152,
0.44410794973373413,
-0.8853508234024048,
-0.5550042390823364,
-0.628145158290863,
-0.5558170080184937,
0.212583526968956,
0.46841683983802795,
0.6300493478775024,
0.5003696084022522,
-0.17254221439361572,
0.18994562327861786,
0.3754124939441681,
-0.16994240880012512,
0.6470098495483398,
0.405850887298584,
-0.33172160387039185,
-0.5733725428581238,
0.6348181962966919,
0.024406298995018005,
0.0028802126180380583,
0.5765666961669922,
0.1002676859498024,
-0.5755791664123535,
-0.23416759073734283,
-0.47169551253318787,
0.21341362595558167,
-0.641565203666687,
-0.3552546203136444,
-0.6542255878448486,
-0.3873167037963867,
-0.7027558088302612,
-0.08517270535230637,
-0.23314298689365387,
-0.3613099157810211,
-0.7239886522293091,
-0.18209786713123322,
0.3234308660030365,
0.68858402967453,
-0.09993461519479752,
0.6213318705558777,
-0.7950014472007751,
0.25844597816467285,
0.24526070058345795,
0.42681068181991577,
-0.295800119638443,
-0.8083876371383667,
-0.5155494213104248,
0.03545350208878517,
-0.19084054231643677,
-0.8316453099250793,
0.6828278303146362,
0.11280223727226257,
0.4161072373390198,
0.6445120573043823,
-0.08444318175315857,
0.6094931960105896,
-0.6021454334259033,
0.9429446458816528,
0.2887624204158783,
-1.054619550704956,
0.5844630599021912,
-0.310573011636734,
0.21942543983459473,
0.40370452404022217,
0.2508257329463959,
-0.534755527973175,
-0.36816534399986267,
-0.8162532448768616,
-0.9977086186408997,
0.9503459930419922,
0.26996511220932007,
0.3058072626590729,
0.03466356545686722,
0.2219647765159607,
0.07926909625530243,
0.43966975808143616,
-0.8793870806694031,
-0.6608500480651855,
-0.4613330662250519,
-0.291132390499115,
-0.12308275699615479,
-0.3331905007362366,
-0.12358074635267258,
-0.47566595673561096,
0.7818566560745239,
0.24679149687290192,
0.5552111268043518,
-0.016907289624214172,
-0.11878038942813873,
-0.07269404828548431,
0.1616746485233307,
0.8045006990432739,
0.4982375502586365,
-0.4986981749534607,
0.05830668658018112,
0.020555391907691956,
-0.5638676881790161,
0.06898441910743713,
0.14379635453224182,
-0.050062473863363266,
0.2378239780664444,
0.5781813263893127,
1.0157034397125244,
0.14338970184326172,
-0.5062265396118164,
0.5756693482398987,
0.12501545250415802,
-0.24889837205410004,
-0.631676197052002,
0.18416662514209747,
-0.09066172689199448,
0.1192493587732315,
0.4638562500476837,
0.2107449471950531,
0.1545972377061844,
-0.45586755871772766,
0.36675041913986206,
0.3798498809337616,
-0.4887077510356903,
-0.29517462849617004,
1.0255953073501587,
0.01906348206102848,
-0.8702413439750671,
0.7501339316368103,
-0.20902621746063232,
-0.6719642877578735,
0.6926907896995544,
0.6956963539123535,
0.9311306476593018,
-0.2692204415798187,
0.16129885613918304,
0.5812556743621826,
0.3174031674861908,
-0.35285452008247375,
0.2244379222393036,
0.28507038950920105,
-0.8393211960792542,
-0.30669793486595154,
-0.7828927636146545,
-0.22895346581935883,
0.26288673281669617,
-0.8728101849555969,
0.38468506932258606,
-0.5015724301338196,
-0.13500770926475525,
0.12683486938476562,
-0.08131556957960129,
-0.7612374424934387,
0.5187309384346008,
0.1044614166021347,
0.9829379320144653,
-1.0365543365478516,
0.8837909698486328,
0.7998159527778625,
-0.6908411979675293,
-0.878341555595398,
-0.441244512796402,
-0.30349573493003845,
-1.1198170185089111,
0.7117969393730164,
0.4410349130630493,
0.31373363733291626,
0.04876942187547684,
-0.6269623637199402,
-0.774694561958313,
0.9219847321510315,
0.18161284923553467,
-0.5118610858917236,
-0.17816351354122162,
0.20981194078922272,
0.516228973865509,
-0.5922443270683289,
0.6442617177963257,
0.5738041996955872,
0.39934030175209045,
-0.050874512642621994,
-0.7628441452980042,
0.004297478590160608,
-0.4968947470188141,
0.08776327967643738,
0.08202052116394043,
-0.4530259072780609,
1.1025161743164062,
-0.07880672067403793,
-0.008510388433933258,
0.22891844809055328,
0.6841073632240295,
0.07046541571617126,
0.24332091212272644,
0.4651675522327423,
0.6587677597999573,
0.6338123679161072,
-0.2873844504356384,
0.8503454923629761,
-0.21945179998874664,
0.606754720211029,
0.8116392493247986,
0.03383158892393112,
0.7079058885574341,
0.40994390845298767,
-0.3288634717464447,
0.9826581478118896,
0.8111031651496887,
-0.29011252522468567,
0.7880549430847168,
0.11367206275463104,
-0.10352715849876404,
-0.0734468474984169,
0.10099755972623825,
-0.27410629391670227,
0.48435288667678833,
0.2116183489561081,
-0.5687128901481628,
0.0657660961151123,
-0.010615197941660881,
0.21835161745548248,
-0.20245139300823212,
-0.47630003094673157,
0.7026130557060242,
0.23767445981502533,
-0.7015852928161621,
0.34000107645988464,
0.24920034408569336,
0.5864606499671936,
-0.5259901285171509,
-0.014168551191687584,
-0.07641726732254028,
0.20780490338802338,
-0.13359779119491577,
-0.8344663977622986,
0.22936221957206726,
-0.1396704912185669,
-0.42013102769851685,
-0.3223220407962799,
0.5826929807662964,
-0.5103065371513367,
-0.7232270836830139,
-0.011108226142823696,
0.26533323526382446,
0.34719276428222656,
-0.16519127786159515,
-0.8197144269943237,
-0.1628509908914566,
0.030991315841674805,
-0.31881558895111084,
0.22615520656108856,
0.31837496161460876,
0.14086489379405975,
0.5396268963813782,
0.7339624166488647,
-0.10645263642072678,
-0.021781982854008675,
0.05645599961280823,
0.6995224356651306,
-0.910782516002655,
-0.8306048512458801,
-1.0625975131988525,
0.7798265218734741,
-0.10895425826311111,
-0.5696091055870056,
0.6664760708808899,
0.8286727666854858,
0.8428879976272583,
-0.40565919876098633,
0.6031414866447449,
-0.14957000315189362,
0.6026242971420288,
-0.36858439445495605,
0.7818020582199097,
-0.43322691321372986,
0.07865756750106812,
-0.335213303565979,
-0.8442091345787048,
-0.36176928877830505,
0.8966014981269836,
-0.10654956102371216,
0.09644213318824768,
0.715732991695404,
0.815097987651825,
0.06361010670661926,
-0.13971567153930664,
0.25645285844802856,
0.08676859736442566,
0.0945480689406395,
0.4186908006668091,
0.6301226019859314,
-0.8199008107185364,
0.39626508951187134,
-0.2786923050880432,
-0.08331426978111267,
-0.39564767479896545,
-0.7503940463066101,
-1.0794084072113037,
-0.6073393225669861,
-0.3323019742965698,
-0.7310482263565063,
-0.26049113273620605,
0.9249193668365479,
0.741741418838501,
-1.0265530347824097,
-0.2731362283229828,
-0.10509239137172699,
0.08538666367530823,
-0.18236257135868073,
-0.285664826631546,
0.4300002157688141,
-0.09875849634408951,
-0.8611290454864502,
0.2207438200712204,
0.04798073694109917,
0.07201476395130157,
-0.2055835723876953,
-0.07626456767320633,
-0.25742390751838684,
-0.03098752349615097,
0.35188281536102295,
0.13223525881767273,
-0.668634295463562,
-0.45625776052474976,
0.08278486877679825,
-0.30811741948127747,
0.18706834316253662,
0.5155673623085022,
-0.5168930888175964,
0.36260679364204407,
0.4037807881832123,
0.2711242139339447,
0.6385186910629272,
0.09716105461120605,
0.6120396256446838,
-0.9797710180282593,
0.2876618802547455,
0.2580294609069824,
0.5319502353668213,
0.45489010214805603,
-0.4271358251571655,
0.43374374508857727,
0.5406652092933655,
-0.5538979172706604,
-0.9246453642845154,
0.009761068969964981,
-0.9885228276252747,
-0.08356795459985733,
1.0256192684173584,
-0.11516954749822617,
-0.3483807146549225,
-0.09027767926454544,
-0.36287420988082886,
0.5030811429023743,
-0.4003271758556366,
0.6995521187782288,
0.7694183588027954,
0.08848609030246735,
-0.25789669156074524,
-0.40060365200042725,
0.43527752161026,
0.3934677243232727,
-0.42398202419281006,
-0.46728193759918213,
0.03555465117096901,
0.45474323630332947,
0.31744563579559326,
0.6374655961990356,
-0.001277536852285266,
0.16183848679065704,
0.26665711402893066,
0.2634454071521759,
-0.09884794056415558,
-0.17802231013774872,
-0.242760568857193,
0.14834046363830566,
-0.09576267749071121,
-0.6914359927177429
] |
timm/resnet50.a1_in1k | timm | "2023-04-05T18:08:16Z" | 3,143,968 | 9 | timm | [
"timm",
"pytorch",
"safetensors",
"image-classification",
"arxiv:2110.00476",
"arxiv:1512.03385",
"license:apache-2.0",
"has_space",
"region:us"
] | image-classification | "2023-04-05T18:07:45Z" | ---
tags:
- image-classification
- timm
library_tag: timm
license: apache-2.0
---
# Model card for resnet50.a1_in1k
A ResNet-B image classification model.
This model features:
* ReLU activations
* single layer 7x7 convolution with pooling
* 1x1 convolution shortcut downsample
Trained on ImageNet-1k in `timm` using recipe template described below.
Recipe details:
* ResNet Strikes Back `A1` recipe
* LAMB optimizer with BCE loss
* Cosine LR schedule with warmup
## Model Details
- **Model Type:** Image classification / feature backbone
- **Model Stats:**
- Params (M): 25.6
- GMACs: 4.1
- Activations (M): 11.1
- Image size: train = 224 x 224, test = 288 x 288
- **Papers:**
- ResNet strikes back: An improved training procedure in timm: https://arxiv.org/abs/2110.00476
- Deep Residual Learning for Image Recognition: https://arxiv.org/abs/1512.03385
- **Original:** https://github.com/huggingface/pytorch-image-models
## Model Usage
### Image Classification
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model('resnet50.a1_in1k', pretrained=True)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
```
### Feature Map Extraction
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'resnet50.a1_in1k',
pretrained=True,
features_only=True,
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
for o in output:
# print shape of each feature map in output
# e.g.:
# torch.Size([1, 64, 112, 112])
# torch.Size([1, 256, 56, 56])
# torch.Size([1, 512, 28, 28])
# torch.Size([1, 1024, 14, 14])
# torch.Size([1, 2048, 7, 7])
print(o.shape)
```
### Image Embeddings
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'resnet50.a1_in1k',
pretrained=True,
num_classes=0, # remove classifier nn.Linear
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
# or equivalently (without needing to set num_classes=0)
output = model.forward_features(transforms(img).unsqueeze(0))
# output is unpooled, a (1, 2048, 7, 7) shaped tensor
output = model.forward_head(output, pre_logits=True)
# output is a (1, num_features) shaped tensor
```
## Model Comparison
Explore the dataset and runtime metrics of this model in timm [model results](https://github.com/huggingface/pytorch-image-models/tree/main/results).
|model |img_size|top1 |top5 |param_count|gmacs|macts|img/sec|
|------------------------------------------|--------|-----|-----|-----------|-----|-----|-------|
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k_288](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k_288)|320 |86.72|98.17|93.6 |35.2 |69.7 |451 |
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k_288](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k_288)|288 |86.51|98.08|93.6 |28.5 |56.4 |560 |
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k)|288 |86.49|98.03|93.6 |28.5 |56.4 |557 |
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k)|224 |85.96|97.82|93.6 |17.2 |34.2 |923 |
|[resnext101_32x32d.fb_wsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x32d.fb_wsl_ig1b_ft_in1k)|224 |85.11|97.44|468.5 |87.3 |91.1 |254 |
|[resnetrs420.tf_in1k](https://huggingface.co/timm/resnetrs420.tf_in1k)|416 |85.0 |97.12|191.9 |108.4|213.8|134 |
|[ecaresnet269d.ra2_in1k](https://huggingface.co/timm/ecaresnet269d.ra2_in1k)|352 |84.96|97.22|102.1 |50.2 |101.2|291 |
|[ecaresnet269d.ra2_in1k](https://huggingface.co/timm/ecaresnet269d.ra2_in1k)|320 |84.73|97.18|102.1 |41.5 |83.7 |353 |
|[resnetrs350.tf_in1k](https://huggingface.co/timm/resnetrs350.tf_in1k)|384 |84.71|96.99|164.0 |77.6 |154.7|183 |
|[seresnextaa101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.ah_in1k)|288 |84.57|97.08|93.6 |28.5 |56.4 |557 |
|[resnetrs200.tf_in1k](https://huggingface.co/timm/resnetrs200.tf_in1k)|320 |84.45|97.08|93.2 |31.5 |67.8 |446 |
|[resnetrs270.tf_in1k](https://huggingface.co/timm/resnetrs270.tf_in1k)|352 |84.43|96.97|129.9 |51.1 |105.5|280 |
|[seresnext101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101d_32x8d.ah_in1k)|288 |84.36|96.92|93.6 |27.6 |53.0 |595 |
|[seresnet152d.ra2_in1k](https://huggingface.co/timm/seresnet152d.ra2_in1k)|320 |84.35|97.04|66.8 |24.1 |47.7 |610 |
|[resnetrs350.tf_in1k](https://huggingface.co/timm/resnetrs350.tf_in1k)|288 |84.3 |96.94|164.0 |43.7 |87.1 |333 |
|[resnext101_32x8d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x8d.fb_swsl_ig1b_ft_in1k)|224 |84.28|97.17|88.8 |16.5 |31.2 |1100 |
|[resnetrs420.tf_in1k](https://huggingface.co/timm/resnetrs420.tf_in1k)|320 |84.24|96.86|191.9 |64.2 |126.6|228 |
|[seresnext101_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101_32x8d.ah_in1k)|288 |84.19|96.87|93.6 |27.2 |51.6 |613 |
|[resnext101_32x16d.fb_wsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x16d.fb_wsl_ig1b_ft_in1k)|224 |84.18|97.19|194.0 |36.3 |51.2 |581 |
|[resnetaa101d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa101d.sw_in12k_ft_in1k)|288 |84.11|97.11|44.6 |15.1 |29.0 |1144 |
|[resnet200d.ra2_in1k](https://huggingface.co/timm/resnet200d.ra2_in1k)|320 |83.97|96.82|64.7 |31.2 |67.3 |518 |
|[resnetrs200.tf_in1k](https://huggingface.co/timm/resnetrs200.tf_in1k)|256 |83.87|96.75|93.2 |20.2 |43.4 |692 |
|[seresnextaa101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.ah_in1k)|224 |83.86|96.65|93.6 |17.2 |34.2 |923 |
|[resnetrs152.tf_in1k](https://huggingface.co/timm/resnetrs152.tf_in1k)|320 |83.72|96.61|86.6 |24.3 |48.1 |617 |
|[seresnet152d.ra2_in1k](https://huggingface.co/timm/seresnet152d.ra2_in1k)|256 |83.69|96.78|66.8 |15.4 |30.6 |943 |
|[seresnext101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101d_32x8d.ah_in1k)|224 |83.68|96.61|93.6 |16.7 |32.0 |986 |
|[resnet152d.ra2_in1k](https://huggingface.co/timm/resnet152d.ra2_in1k)|320 |83.67|96.74|60.2 |24.1 |47.7 |706 |
|[resnetrs270.tf_in1k](https://huggingface.co/timm/resnetrs270.tf_in1k)|256 |83.59|96.61|129.9 |27.1 |55.8 |526 |
|[seresnext101_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101_32x8d.ah_in1k)|224 |83.58|96.4 |93.6 |16.5 |31.2 |1013 |
|[resnetaa101d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa101d.sw_in12k_ft_in1k)|224 |83.54|96.83|44.6 |9.1 |17.6 |1864 |
|[resnet152.a1h_in1k](https://huggingface.co/timm/resnet152.a1h_in1k)|288 |83.46|96.54|60.2 |19.1 |37.3 |904 |
|[resnext101_32x16d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x16d.fb_swsl_ig1b_ft_in1k)|224 |83.35|96.85|194.0 |36.3 |51.2 |582 |
|[resnet200d.ra2_in1k](https://huggingface.co/timm/resnet200d.ra2_in1k)|256 |83.23|96.53|64.7 |20.0 |43.1 |809 |
|[resnext101_32x4d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x4d.fb_swsl_ig1b_ft_in1k)|224 |83.22|96.75|44.2 |8.0 |21.2 |1814 |
|[resnext101_64x4d.c1_in1k](https://huggingface.co/timm/resnext101_64x4d.c1_in1k)|288 |83.16|96.38|83.5 |25.7 |51.6 |590 |
|[resnet152d.ra2_in1k](https://huggingface.co/timm/resnet152d.ra2_in1k)|256 |83.14|96.38|60.2 |15.4 |30.5 |1096 |
|[resnet101d.ra2_in1k](https://huggingface.co/timm/resnet101d.ra2_in1k)|320 |83.02|96.45|44.6 |16.5 |34.8 |992 |
|[ecaresnet101d.miil_in1k](https://huggingface.co/timm/ecaresnet101d.miil_in1k)|288 |82.98|96.54|44.6 |13.4 |28.2 |1077 |
|[resnext101_64x4d.tv_in1k](https://huggingface.co/timm/resnext101_64x4d.tv_in1k)|224 |82.98|96.25|83.5 |15.5 |31.2 |989 |
|[resnetrs152.tf_in1k](https://huggingface.co/timm/resnetrs152.tf_in1k)|256 |82.86|96.28|86.6 |15.6 |30.8 |951 |
|[resnext101_32x8d.tv2_in1k](https://huggingface.co/timm/resnext101_32x8d.tv2_in1k)|224 |82.83|96.22|88.8 |16.5 |31.2 |1099 |
|[resnet152.a1h_in1k](https://huggingface.co/timm/resnet152.a1h_in1k)|224 |82.8 |96.13|60.2 |11.6 |22.6 |1486 |
|[resnet101.a1h_in1k](https://huggingface.co/timm/resnet101.a1h_in1k)|288 |82.8 |96.32|44.6 |13.0 |26.8 |1291 |
|[resnet152.a1_in1k](https://huggingface.co/timm/resnet152.a1_in1k)|288 |82.74|95.71|60.2 |19.1 |37.3 |905 |
|[resnext101_32x8d.fb_wsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x8d.fb_wsl_ig1b_ft_in1k)|224 |82.69|96.63|88.8 |16.5 |31.2 |1100 |
|[resnet152.a2_in1k](https://huggingface.co/timm/resnet152.a2_in1k)|288 |82.62|95.75|60.2 |19.1 |37.3 |904 |
|[resnetaa50d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa50d.sw_in12k_ft_in1k)|288 |82.61|96.49|25.6 |8.9 |20.6 |1729 |
|[resnet61q.ra2_in1k](https://huggingface.co/timm/resnet61q.ra2_in1k)|288 |82.53|96.13|36.8 |9.9 |21.5 |1773 |
|[wide_resnet101_2.tv2_in1k](https://huggingface.co/timm/wide_resnet101_2.tv2_in1k)|224 |82.5 |96.02|126.9 |22.8 |21.2 |1078 |
|[resnext101_64x4d.c1_in1k](https://huggingface.co/timm/resnext101_64x4d.c1_in1k)|224 |82.46|95.92|83.5 |15.5 |31.2 |987 |
|[resnet51q.ra2_in1k](https://huggingface.co/timm/resnet51q.ra2_in1k)|288 |82.36|96.18|35.7 |8.1 |20.9 |1964 |
|[ecaresnet50t.ra2_in1k](https://huggingface.co/timm/ecaresnet50t.ra2_in1k)|320 |82.35|96.14|25.6 |8.8 |24.1 |1386 |
|[resnet101.a1_in1k](https://huggingface.co/timm/resnet101.a1_in1k)|288 |82.31|95.63|44.6 |13.0 |26.8 |1291 |
|[resnetrs101.tf_in1k](https://huggingface.co/timm/resnetrs101.tf_in1k)|288 |82.29|96.01|63.6 |13.6 |28.5 |1078 |
|[resnet152.tv2_in1k](https://huggingface.co/timm/resnet152.tv2_in1k)|224 |82.29|96.0 |60.2 |11.6 |22.6 |1484 |
|[wide_resnet50_2.racm_in1k](https://huggingface.co/timm/wide_resnet50_2.racm_in1k)|288 |82.27|96.06|68.9 |18.9 |23.8 |1176 |
|[resnet101d.ra2_in1k](https://huggingface.co/timm/resnet101d.ra2_in1k)|256 |82.26|96.07|44.6 |10.6 |22.2 |1542 |
|[resnet101.a2_in1k](https://huggingface.co/timm/resnet101.a2_in1k)|288 |82.24|95.73|44.6 |13.0 |26.8 |1290 |
|[seresnext50_32x4d.racm_in1k](https://huggingface.co/timm/seresnext50_32x4d.racm_in1k)|288 |82.2 |96.14|27.6 |7.0 |23.8 |1547 |
|[ecaresnet101d.miil_in1k](https://huggingface.co/timm/ecaresnet101d.miil_in1k)|224 |82.18|96.05|44.6 |8.1 |17.1 |1771 |
|[resnext50_32x4d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext50_32x4d.fb_swsl_ig1b_ft_in1k)|224 |82.17|96.22|25.0 |4.3 |14.4 |2943 |
|[ecaresnet50t.a1_in1k](https://huggingface.co/timm/ecaresnet50t.a1_in1k)|288 |82.12|95.65|25.6 |7.1 |19.6 |1704 |
|[resnext50_32x4d.a1h_in1k](https://huggingface.co/timm/resnext50_32x4d.a1h_in1k)|288 |82.03|95.94|25.0 |7.0 |23.8 |1745 |
|[ecaresnet101d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet101d_pruned.miil_in1k)|288 |82.0 |96.15|24.9 |5.8 |12.7 |1787 |
|[resnet61q.ra2_in1k](https://huggingface.co/timm/resnet61q.ra2_in1k)|256 |81.99|95.85|36.8 |7.8 |17.0 |2230 |
|[resnext101_32x8d.tv2_in1k](https://huggingface.co/timm/resnext101_32x8d.tv2_in1k)|176 |81.98|95.72|88.8 |10.3 |19.4 |1768 |
|[resnet152.a1_in1k](https://huggingface.co/timm/resnet152.a1_in1k)|224 |81.97|95.24|60.2 |11.6 |22.6 |1486 |
|[resnet101.a1h_in1k](https://huggingface.co/timm/resnet101.a1h_in1k)|224 |81.93|95.75|44.6 |7.8 |16.2 |2122 |
|[resnet101.tv2_in1k](https://huggingface.co/timm/resnet101.tv2_in1k)|224 |81.9 |95.77|44.6 |7.8 |16.2 |2118 |
|[resnext101_32x16d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext101_32x16d.fb_ssl_yfcc100m_ft_in1k)|224 |81.84|96.1 |194.0 |36.3 |51.2 |583 |
|[resnet51q.ra2_in1k](https://huggingface.co/timm/resnet51q.ra2_in1k)|256 |81.78|95.94|35.7 |6.4 |16.6 |2471 |
|[resnet152.a2_in1k](https://huggingface.co/timm/resnet152.a2_in1k)|224 |81.77|95.22|60.2 |11.6 |22.6 |1485 |
|[resnetaa50d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa50d.sw_in12k_ft_in1k)|224 |81.74|96.06|25.6 |5.4 |12.4 |2813 |
|[ecaresnet50t.a2_in1k](https://huggingface.co/timm/ecaresnet50t.a2_in1k)|288 |81.65|95.54|25.6 |7.1 |19.6 |1703 |
|[ecaresnet50d.miil_in1k](https://huggingface.co/timm/ecaresnet50d.miil_in1k)|288 |81.64|95.88|25.6 |7.2 |19.7 |1694 |
|[resnext101_32x8d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext101_32x8d.fb_ssl_yfcc100m_ft_in1k)|224 |81.62|96.04|88.8 |16.5 |31.2 |1101 |
|[wide_resnet50_2.tv2_in1k](https://huggingface.co/timm/wide_resnet50_2.tv2_in1k)|224 |81.61|95.76|68.9 |11.4 |14.4 |1930 |
|[resnetaa50.a1h_in1k](https://huggingface.co/timm/resnetaa50.a1h_in1k)|288 |81.61|95.83|25.6 |8.5 |19.2 |1868 |
|[resnet101.a1_in1k](https://huggingface.co/timm/resnet101.a1_in1k)|224 |81.5 |95.16|44.6 |7.8 |16.2 |2125 |
|[resnext50_32x4d.a1_in1k](https://huggingface.co/timm/resnext50_32x4d.a1_in1k)|288 |81.48|95.16|25.0 |7.0 |23.8 |1745 |
|[gcresnet50t.ra2_in1k](https://huggingface.co/timm/gcresnet50t.ra2_in1k)|288 |81.47|95.71|25.9 |6.9 |18.6 |2071 |
|[wide_resnet50_2.racm_in1k](https://huggingface.co/timm/wide_resnet50_2.racm_in1k)|224 |81.45|95.53|68.9 |11.4 |14.4 |1929 |
|[resnet50d.a1_in1k](https://huggingface.co/timm/resnet50d.a1_in1k)|288 |81.44|95.22|25.6 |7.2 |19.7 |1908 |
|[ecaresnet50t.ra2_in1k](https://huggingface.co/timm/ecaresnet50t.ra2_in1k)|256 |81.44|95.67|25.6 |5.6 |15.4 |2168 |
|[ecaresnetlight.miil_in1k](https://huggingface.co/timm/ecaresnetlight.miil_in1k)|288 |81.4 |95.82|30.2 |6.8 |13.9 |2132 |
|[resnet50d.ra2_in1k](https://huggingface.co/timm/resnet50d.ra2_in1k)|288 |81.37|95.74|25.6 |7.2 |19.7 |1910 |
|[resnet101.a2_in1k](https://huggingface.co/timm/resnet101.a2_in1k)|224 |81.32|95.19|44.6 |7.8 |16.2 |2125 |
|[seresnet50.ra2_in1k](https://huggingface.co/timm/seresnet50.ra2_in1k)|288 |81.3 |95.65|28.1 |6.8 |18.4 |1803 |
|[resnext50_32x4d.a2_in1k](https://huggingface.co/timm/resnext50_32x4d.a2_in1k)|288 |81.3 |95.11|25.0 |7.0 |23.8 |1746 |
|[seresnext50_32x4d.racm_in1k](https://huggingface.co/timm/seresnext50_32x4d.racm_in1k)|224 |81.27|95.62|27.6 |4.3 |14.4 |2591 |
|[ecaresnet50t.a1_in1k](https://huggingface.co/timm/ecaresnet50t.a1_in1k)|224 |81.26|95.16|25.6 |4.3 |11.8 |2823 |
|[gcresnext50ts.ch_in1k](https://huggingface.co/timm/gcresnext50ts.ch_in1k)|288 |81.23|95.54|15.7 |4.8 |19.6 |2117 |
|[senet154.gluon_in1k](https://huggingface.co/timm/senet154.gluon_in1k)|224 |81.23|95.35|115.1 |20.8 |38.7 |545 |
|[resnet50.a1_in1k](https://huggingface.co/timm/resnet50.a1_in1k)|288 |81.22|95.11|25.6 |6.8 |18.4 |2089 |
|[resnet50_gn.a1h_in1k](https://huggingface.co/timm/resnet50_gn.a1h_in1k)|288 |81.22|95.63|25.6 |6.8 |18.4 |676 |
|[resnet50d.a2_in1k](https://huggingface.co/timm/resnet50d.a2_in1k)|288 |81.18|95.09|25.6 |7.2 |19.7 |1908 |
|[resnet50.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnet50.fb_swsl_ig1b_ft_in1k)|224 |81.18|95.98|25.6 |4.1 |11.1 |3455 |
|[resnext50_32x4d.tv2_in1k](https://huggingface.co/timm/resnext50_32x4d.tv2_in1k)|224 |81.17|95.34|25.0 |4.3 |14.4 |2933 |
|[resnext50_32x4d.a1h_in1k](https://huggingface.co/timm/resnext50_32x4d.a1h_in1k)|224 |81.1 |95.33|25.0 |4.3 |14.4 |2934 |
|[seresnet50.a2_in1k](https://huggingface.co/timm/seresnet50.a2_in1k)|288 |81.1 |95.23|28.1 |6.8 |18.4 |1801 |
|[seresnet50.a1_in1k](https://huggingface.co/timm/seresnet50.a1_in1k)|288 |81.1 |95.12|28.1 |6.8 |18.4 |1799 |
|[resnet152s.gluon_in1k](https://huggingface.co/timm/resnet152s.gluon_in1k)|224 |81.02|95.41|60.3 |12.9 |25.0 |1347 |
|[resnet50.d_in1k](https://huggingface.co/timm/resnet50.d_in1k)|288 |80.97|95.44|25.6 |6.8 |18.4 |2085 |
|[gcresnet50t.ra2_in1k](https://huggingface.co/timm/gcresnet50t.ra2_in1k)|256 |80.94|95.45|25.9 |5.4 |14.7 |2571 |
|[resnext101_32x4d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext101_32x4d.fb_ssl_yfcc100m_ft_in1k)|224 |80.93|95.73|44.2 |8.0 |21.2 |1814 |
|[resnet50.c1_in1k](https://huggingface.co/timm/resnet50.c1_in1k)|288 |80.91|95.55|25.6 |6.8 |18.4 |2084 |
|[seresnext101_32x4d.gluon_in1k](https://huggingface.co/timm/seresnext101_32x4d.gluon_in1k)|224 |80.9 |95.31|49.0 |8.0 |21.3 |1585 |
|[seresnext101_64x4d.gluon_in1k](https://huggingface.co/timm/seresnext101_64x4d.gluon_in1k)|224 |80.9 |95.3 |88.2 |15.5 |31.2 |918 |
|[resnet50.c2_in1k](https://huggingface.co/timm/resnet50.c2_in1k)|288 |80.86|95.52|25.6 |6.8 |18.4 |2085 |
|[resnet50.tv2_in1k](https://huggingface.co/timm/resnet50.tv2_in1k)|224 |80.85|95.43|25.6 |4.1 |11.1 |3450 |
|[ecaresnet50t.a2_in1k](https://huggingface.co/timm/ecaresnet50t.a2_in1k)|224 |80.84|95.02|25.6 |4.3 |11.8 |2821 |
|[ecaresnet101d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet101d_pruned.miil_in1k)|224 |80.79|95.62|24.9 |3.5 |7.7 |2961 |
|[seresnet33ts.ra2_in1k](https://huggingface.co/timm/seresnet33ts.ra2_in1k)|288 |80.79|95.36|19.8 |6.0 |14.8 |2506 |
|[ecaresnet50d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet50d_pruned.miil_in1k)|288 |80.79|95.58|19.9 |4.2 |10.6 |2349 |
|[resnet50.a2_in1k](https://huggingface.co/timm/resnet50.a2_in1k)|288 |80.78|94.99|25.6 |6.8 |18.4 |2088 |
|[resnet50.b1k_in1k](https://huggingface.co/timm/resnet50.b1k_in1k)|288 |80.71|95.43|25.6 |6.8 |18.4 |2087 |
|[resnext50_32x4d.ra_in1k](https://huggingface.co/timm/resnext50_32x4d.ra_in1k)|288 |80.7 |95.39|25.0 |7.0 |23.8 |1749 |
|[resnetrs101.tf_in1k](https://huggingface.co/timm/resnetrs101.tf_in1k)|192 |80.69|95.24|63.6 |6.0 |12.7 |2270 |
|[resnet50d.a1_in1k](https://huggingface.co/timm/resnet50d.a1_in1k)|224 |80.68|94.71|25.6 |4.4 |11.9 |3162 |
|[eca_resnet33ts.ra2_in1k](https://huggingface.co/timm/eca_resnet33ts.ra2_in1k)|288 |80.68|95.36|19.7 |6.0 |14.8 |2637 |
|[resnet50.a1h_in1k](https://huggingface.co/timm/resnet50.a1h_in1k)|224 |80.67|95.3 |25.6 |4.1 |11.1 |3452 |
|[resnext50d_32x4d.bt_in1k](https://huggingface.co/timm/resnext50d_32x4d.bt_in1k)|288 |80.67|95.42|25.0 |7.4 |25.1 |1626 |
|[resnetaa50.a1h_in1k](https://huggingface.co/timm/resnetaa50.a1h_in1k)|224 |80.63|95.21|25.6 |5.2 |11.6 |3034 |
|[ecaresnet50d.miil_in1k](https://huggingface.co/timm/ecaresnet50d.miil_in1k)|224 |80.61|95.32|25.6 |4.4 |11.9 |2813 |
|[resnext101_64x4d.gluon_in1k](https://huggingface.co/timm/resnext101_64x4d.gluon_in1k)|224 |80.61|94.99|83.5 |15.5 |31.2 |989 |
|[gcresnet33ts.ra2_in1k](https://huggingface.co/timm/gcresnet33ts.ra2_in1k)|288 |80.6 |95.31|19.9 |6.0 |14.8 |2578 |
|[gcresnext50ts.ch_in1k](https://huggingface.co/timm/gcresnext50ts.ch_in1k)|256 |80.57|95.17|15.7 |3.8 |15.5 |2710 |
|[resnet152.a3_in1k](https://huggingface.co/timm/resnet152.a3_in1k)|224 |80.56|95.0 |60.2 |11.6 |22.6 |1483 |
|[resnet50d.ra2_in1k](https://huggingface.co/timm/resnet50d.ra2_in1k)|224 |80.53|95.16|25.6 |4.4 |11.9 |3164 |
|[resnext50_32x4d.a1_in1k](https://huggingface.co/timm/resnext50_32x4d.a1_in1k)|224 |80.53|94.46|25.0 |4.3 |14.4 |2930 |
|[wide_resnet101_2.tv2_in1k](https://huggingface.co/timm/wide_resnet101_2.tv2_in1k)|176 |80.48|94.98|126.9 |14.3 |13.2 |1719 |
|[resnet152d.gluon_in1k](https://huggingface.co/timm/resnet152d.gluon_in1k)|224 |80.47|95.2 |60.2 |11.8 |23.4 |1428 |
|[resnet50.b2k_in1k](https://huggingface.co/timm/resnet50.b2k_in1k)|288 |80.45|95.32|25.6 |6.8 |18.4 |2086 |
|[ecaresnetlight.miil_in1k](https://huggingface.co/timm/ecaresnetlight.miil_in1k)|224 |80.45|95.24|30.2 |4.1 |8.4 |3530 |
|[resnext50_32x4d.a2_in1k](https://huggingface.co/timm/resnext50_32x4d.a2_in1k)|224 |80.45|94.63|25.0 |4.3 |14.4 |2936 |
|[wide_resnet50_2.tv2_in1k](https://huggingface.co/timm/wide_resnet50_2.tv2_in1k)|176 |80.43|95.09|68.9 |7.3 |9.0 |3015 |
|[resnet101d.gluon_in1k](https://huggingface.co/timm/resnet101d.gluon_in1k)|224 |80.42|95.01|44.6 |8.1 |17.0 |2007 |
|[resnet50.a1_in1k](https://huggingface.co/timm/resnet50.a1_in1k)|224 |80.38|94.6 |25.6 |4.1 |11.1 |3461 |
|[seresnet33ts.ra2_in1k](https://huggingface.co/timm/seresnet33ts.ra2_in1k)|256 |80.36|95.1 |19.8 |4.8 |11.7 |3267 |
|[resnext101_32x4d.gluon_in1k](https://huggingface.co/timm/resnext101_32x4d.gluon_in1k)|224 |80.34|94.93|44.2 |8.0 |21.2 |1814 |
|[resnext50_32x4d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext50_32x4d.fb_ssl_yfcc100m_ft_in1k)|224 |80.32|95.4 |25.0 |4.3 |14.4 |2941 |
|[resnet101s.gluon_in1k](https://huggingface.co/timm/resnet101s.gluon_in1k)|224 |80.28|95.16|44.7 |9.2 |18.6 |1851 |
|[seresnet50.ra2_in1k](https://huggingface.co/timm/seresnet50.ra2_in1k)|224 |80.26|95.08|28.1 |4.1 |11.1 |2972 |
|[resnetblur50.bt_in1k](https://huggingface.co/timm/resnetblur50.bt_in1k)|288 |80.24|95.24|25.6 |8.5 |19.9 |1523 |
|[resnet50d.a2_in1k](https://huggingface.co/timm/resnet50d.a2_in1k)|224 |80.22|94.63|25.6 |4.4 |11.9 |3162 |
|[resnet152.tv2_in1k](https://huggingface.co/timm/resnet152.tv2_in1k)|176 |80.2 |94.64|60.2 |7.2 |14.0 |2346 |
|[seresnet50.a2_in1k](https://huggingface.co/timm/seresnet50.a2_in1k)|224 |80.08|94.74|28.1 |4.1 |11.1 |2969 |
|[eca_resnet33ts.ra2_in1k](https://huggingface.co/timm/eca_resnet33ts.ra2_in1k)|256 |80.08|94.97|19.7 |4.8 |11.7 |3284 |
|[gcresnet33ts.ra2_in1k](https://huggingface.co/timm/gcresnet33ts.ra2_in1k)|256 |80.06|94.99|19.9 |4.8 |11.7 |3216 |
|[resnet50_gn.a1h_in1k](https://huggingface.co/timm/resnet50_gn.a1h_in1k)|224 |80.06|94.95|25.6 |4.1 |11.1 |1109 |
|[seresnet50.a1_in1k](https://huggingface.co/timm/seresnet50.a1_in1k)|224 |80.02|94.71|28.1 |4.1 |11.1 |2962 |
|[resnet50.ram_in1k](https://huggingface.co/timm/resnet50.ram_in1k)|288 |79.97|95.05|25.6 |6.8 |18.4 |2086 |
|[resnet152c.gluon_in1k](https://huggingface.co/timm/resnet152c.gluon_in1k)|224 |79.92|94.84|60.2 |11.8 |23.4 |1455 |
|[seresnext50_32x4d.gluon_in1k](https://huggingface.co/timm/seresnext50_32x4d.gluon_in1k)|224 |79.91|94.82|27.6 |4.3 |14.4 |2591 |
|[resnet50.d_in1k](https://huggingface.co/timm/resnet50.d_in1k)|224 |79.91|94.67|25.6 |4.1 |11.1 |3456 |
|[resnet101.tv2_in1k](https://huggingface.co/timm/resnet101.tv2_in1k)|176 |79.9 |94.6 |44.6 |4.9 |10.1 |3341 |
|[resnetrs50.tf_in1k](https://huggingface.co/timm/resnetrs50.tf_in1k)|224 |79.89|94.97|35.7 |4.5 |12.1 |2774 |
|[resnet50.c2_in1k](https://huggingface.co/timm/resnet50.c2_in1k)|224 |79.88|94.87|25.6 |4.1 |11.1 |3455 |
|[ecaresnet26t.ra2_in1k](https://huggingface.co/timm/ecaresnet26t.ra2_in1k)|320 |79.86|95.07|16.0 |5.2 |16.4 |2168 |
|[resnet50.a2_in1k](https://huggingface.co/timm/resnet50.a2_in1k)|224 |79.85|94.56|25.6 |4.1 |11.1 |3460 |
|[resnet50.ra_in1k](https://huggingface.co/timm/resnet50.ra_in1k)|288 |79.83|94.97|25.6 |6.8 |18.4 |2087 |
|[resnet101.a3_in1k](https://huggingface.co/timm/resnet101.a3_in1k)|224 |79.82|94.62|44.6 |7.8 |16.2 |2114 |
|[resnext50_32x4d.ra_in1k](https://huggingface.co/timm/resnext50_32x4d.ra_in1k)|224 |79.76|94.6 |25.0 |4.3 |14.4 |2943 |
|[resnet50.c1_in1k](https://huggingface.co/timm/resnet50.c1_in1k)|224 |79.74|94.95|25.6 |4.1 |11.1 |3455 |
|[ecaresnet50d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet50d_pruned.miil_in1k)|224 |79.74|94.87|19.9 |2.5 |6.4 |3929 |
|[resnet33ts.ra2_in1k](https://huggingface.co/timm/resnet33ts.ra2_in1k)|288 |79.71|94.83|19.7 |6.0 |14.8 |2710 |
|[resnet152.gluon_in1k](https://huggingface.co/timm/resnet152.gluon_in1k)|224 |79.68|94.74|60.2 |11.6 |22.6 |1486 |
|[resnext50d_32x4d.bt_in1k](https://huggingface.co/timm/resnext50d_32x4d.bt_in1k)|224 |79.67|94.87|25.0 |4.5 |15.2 |2729 |
|[resnet50.bt_in1k](https://huggingface.co/timm/resnet50.bt_in1k)|288 |79.63|94.91|25.6 |6.8 |18.4 |2086 |
|[ecaresnet50t.a3_in1k](https://huggingface.co/timm/ecaresnet50t.a3_in1k)|224 |79.56|94.72|25.6 |4.3 |11.8 |2805 |
|[resnet101c.gluon_in1k](https://huggingface.co/timm/resnet101c.gluon_in1k)|224 |79.53|94.58|44.6 |8.1 |17.0 |2062 |
|[resnet50.b1k_in1k](https://huggingface.co/timm/resnet50.b1k_in1k)|224 |79.52|94.61|25.6 |4.1 |11.1 |3459 |
|[resnet50.tv2_in1k](https://huggingface.co/timm/resnet50.tv2_in1k)|176 |79.42|94.64|25.6 |2.6 |6.9 |5397 |
|[resnet32ts.ra2_in1k](https://huggingface.co/timm/resnet32ts.ra2_in1k)|288 |79.4 |94.66|18.0 |5.9 |14.6 |2752 |
|[resnet50.b2k_in1k](https://huggingface.co/timm/resnet50.b2k_in1k)|224 |79.38|94.57|25.6 |4.1 |11.1 |3459 |
|[resnext50_32x4d.tv2_in1k](https://huggingface.co/timm/resnext50_32x4d.tv2_in1k)|176 |79.37|94.3 |25.0 |2.7 |9.0 |4577 |
|[resnext50_32x4d.gluon_in1k](https://huggingface.co/timm/resnext50_32x4d.gluon_in1k)|224 |79.36|94.43|25.0 |4.3 |14.4 |2942 |
|[resnext101_32x8d.tv_in1k](https://huggingface.co/timm/resnext101_32x8d.tv_in1k)|224 |79.31|94.52|88.8 |16.5 |31.2 |1100 |
|[resnet101.gluon_in1k](https://huggingface.co/timm/resnet101.gluon_in1k)|224 |79.31|94.53|44.6 |7.8 |16.2 |2125 |
|[resnetblur50.bt_in1k](https://huggingface.co/timm/resnetblur50.bt_in1k)|224 |79.31|94.63|25.6 |5.2 |12.0 |2524 |
|[resnet50.a1h_in1k](https://huggingface.co/timm/resnet50.a1h_in1k)|176 |79.27|94.49|25.6 |2.6 |6.9 |5404 |
|[resnext50_32x4d.a3_in1k](https://huggingface.co/timm/resnext50_32x4d.a3_in1k)|224 |79.25|94.31|25.0 |4.3 |14.4 |2931 |
|[resnet50.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnet50.fb_ssl_yfcc100m_ft_in1k)|224 |79.22|94.84|25.6 |4.1 |11.1 |3451 |
|[resnet33ts.ra2_in1k](https://huggingface.co/timm/resnet33ts.ra2_in1k)|256 |79.21|94.56|19.7 |4.8 |11.7 |3392 |
|[resnet50d.gluon_in1k](https://huggingface.co/timm/resnet50d.gluon_in1k)|224 |79.07|94.48|25.6 |4.4 |11.9 |3162 |
|[resnet50.ram_in1k](https://huggingface.co/timm/resnet50.ram_in1k)|224 |79.03|94.38|25.6 |4.1 |11.1 |3453 |
|[resnet50.am_in1k](https://huggingface.co/timm/resnet50.am_in1k)|224 |79.01|94.39|25.6 |4.1 |11.1 |3461 |
|[resnet32ts.ra2_in1k](https://huggingface.co/timm/resnet32ts.ra2_in1k)|256 |79.01|94.37|18.0 |4.6 |11.6 |3440 |
|[ecaresnet26t.ra2_in1k](https://huggingface.co/timm/ecaresnet26t.ra2_in1k)|256 |78.9 |94.54|16.0 |3.4 |10.5 |3421 |
|[resnet152.a3_in1k](https://huggingface.co/timm/resnet152.a3_in1k)|160 |78.89|94.11|60.2 |5.9 |11.5 |2745 |
|[wide_resnet101_2.tv_in1k](https://huggingface.co/timm/wide_resnet101_2.tv_in1k)|224 |78.84|94.28|126.9 |22.8 |21.2 |1079 |
|[seresnext26d_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26d_32x4d.bt_in1k)|288 |78.83|94.24|16.8 |4.5 |16.8 |2251 |
|[resnet50.ra_in1k](https://huggingface.co/timm/resnet50.ra_in1k)|224 |78.81|94.32|25.6 |4.1 |11.1 |3454 |
|[seresnext26t_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26t_32x4d.bt_in1k)|288 |78.74|94.33|16.8 |4.5 |16.7 |2264 |
|[resnet50s.gluon_in1k](https://huggingface.co/timm/resnet50s.gluon_in1k)|224 |78.72|94.23|25.7 |5.5 |13.5 |2796 |
|[resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k)|224 |78.71|94.24|25.6 |4.4 |11.9 |3154 |
|[wide_resnet50_2.tv_in1k](https://huggingface.co/timm/wide_resnet50_2.tv_in1k)|224 |78.47|94.09|68.9 |11.4 |14.4 |1934 |
|[resnet50.bt_in1k](https://huggingface.co/timm/resnet50.bt_in1k)|224 |78.46|94.27|25.6 |4.1 |11.1 |3454 |
|[resnet34d.ra2_in1k](https://huggingface.co/timm/resnet34d.ra2_in1k)|288 |78.43|94.35|21.8 |6.5 |7.5 |3291 |
|[gcresnext26ts.ch_in1k](https://huggingface.co/timm/gcresnext26ts.ch_in1k)|288 |78.42|94.04|10.5 |3.1 |13.3 |3226 |
|[resnet26t.ra2_in1k](https://huggingface.co/timm/resnet26t.ra2_in1k)|320 |78.33|94.13|16.0 |5.2 |16.4 |2391 |
|[resnet152.tv_in1k](https://huggingface.co/timm/resnet152.tv_in1k)|224 |78.32|94.04|60.2 |11.6 |22.6 |1487 |
|[seresnext26ts.ch_in1k](https://huggingface.co/timm/seresnext26ts.ch_in1k)|288 |78.28|94.1 |10.4 |3.1 |13.3 |3062 |
|[bat_resnext26ts.ch_in1k](https://huggingface.co/timm/bat_resnext26ts.ch_in1k)|256 |78.25|94.1 |10.7 |2.5 |12.5 |3393 |
|[resnet50.a3_in1k](https://huggingface.co/timm/resnet50.a3_in1k)|224 |78.06|93.78|25.6 |4.1 |11.1 |3450 |
|[resnet50c.gluon_in1k](https://huggingface.co/timm/resnet50c.gluon_in1k)|224 |78.0 |93.99|25.6 |4.4 |11.9 |3286 |
|[eca_resnext26ts.ch_in1k](https://huggingface.co/timm/eca_resnext26ts.ch_in1k)|288 |78.0 |93.91|10.3 |3.1 |13.3 |3297 |
|[seresnext26t_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26t_32x4d.bt_in1k)|224 |77.98|93.75|16.8 |2.7 |10.1 |3841 |
|[resnet34.a1_in1k](https://huggingface.co/timm/resnet34.a1_in1k)|288 |77.92|93.77|21.8 |6.1 |6.2 |3609 |
|[resnet101.a3_in1k](https://huggingface.co/timm/resnet101.a3_in1k)|160 |77.88|93.71|44.6 |4.0 |8.3 |3926 |
|[resnet26t.ra2_in1k](https://huggingface.co/timm/resnet26t.ra2_in1k)|256 |77.87|93.84|16.0 |3.4 |10.5 |3772 |
|[seresnext26ts.ch_in1k](https://huggingface.co/timm/seresnext26ts.ch_in1k)|256 |77.86|93.79|10.4 |2.4 |10.5 |4263 |
|[resnetrs50.tf_in1k](https://huggingface.co/timm/resnetrs50.tf_in1k)|160 |77.82|93.81|35.7 |2.3 |6.2 |5238 |
|[gcresnext26ts.ch_in1k](https://huggingface.co/timm/gcresnext26ts.ch_in1k)|256 |77.81|93.82|10.5 |2.4 |10.5 |4183 |
|[ecaresnet50t.a3_in1k](https://huggingface.co/timm/ecaresnet50t.a3_in1k)|160 |77.79|93.6 |25.6 |2.2 |6.0 |5329 |
|[resnext50_32x4d.a3_in1k](https://huggingface.co/timm/resnext50_32x4d.a3_in1k)|160 |77.73|93.32|25.0 |2.2 |7.4 |5576 |
|[resnext50_32x4d.tv_in1k](https://huggingface.co/timm/resnext50_32x4d.tv_in1k)|224 |77.61|93.7 |25.0 |4.3 |14.4 |2944 |
|[seresnext26d_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26d_32x4d.bt_in1k)|224 |77.59|93.61|16.8 |2.7 |10.2 |3807 |
|[resnet50.gluon_in1k](https://huggingface.co/timm/resnet50.gluon_in1k)|224 |77.58|93.72|25.6 |4.1 |11.1 |3455 |
|[eca_resnext26ts.ch_in1k](https://huggingface.co/timm/eca_resnext26ts.ch_in1k)|256 |77.44|93.56|10.3 |2.4 |10.5 |4284 |
|[resnet26d.bt_in1k](https://huggingface.co/timm/resnet26d.bt_in1k)|288 |77.41|93.63|16.0 |4.3 |13.5 |2907 |
|[resnet101.tv_in1k](https://huggingface.co/timm/resnet101.tv_in1k)|224 |77.38|93.54|44.6 |7.8 |16.2 |2125 |
|[resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k)|160 |77.22|93.27|25.6 |2.2 |6.1 |5982 |
|[resnext26ts.ra2_in1k](https://huggingface.co/timm/resnext26ts.ra2_in1k)|288 |77.17|93.47|10.3 |3.1 |13.3 |3392 |
|[resnet34.a2_in1k](https://huggingface.co/timm/resnet34.a2_in1k)|288 |77.15|93.27|21.8 |6.1 |6.2 |3615 |
|[resnet34d.ra2_in1k](https://huggingface.co/timm/resnet34d.ra2_in1k)|224 |77.1 |93.37|21.8 |3.9 |4.5 |5436 |
|[seresnet50.a3_in1k](https://huggingface.co/timm/seresnet50.a3_in1k)|224 |77.02|93.07|28.1 |4.1 |11.1 |2952 |
|[resnext26ts.ra2_in1k](https://huggingface.co/timm/resnext26ts.ra2_in1k)|256 |76.78|93.13|10.3 |2.4 |10.5 |4410 |
|[resnet26d.bt_in1k](https://huggingface.co/timm/resnet26d.bt_in1k)|224 |76.7 |93.17|16.0 |2.6 |8.2 |4859 |
|[resnet34.bt_in1k](https://huggingface.co/timm/resnet34.bt_in1k)|288 |76.5 |93.35|21.8 |6.1 |6.2 |3617 |
|[resnet34.a1_in1k](https://huggingface.co/timm/resnet34.a1_in1k)|224 |76.42|92.87|21.8 |3.7 |3.7 |5984 |
|[resnet26.bt_in1k](https://huggingface.co/timm/resnet26.bt_in1k)|288 |76.35|93.18|16.0 |3.9 |12.2 |3331 |
|[resnet50.tv_in1k](https://huggingface.co/timm/resnet50.tv_in1k)|224 |76.13|92.86|25.6 |4.1 |11.1 |3457 |
|[resnet50.a3_in1k](https://huggingface.co/timm/resnet50.a3_in1k)|160 |75.96|92.5 |25.6 |2.1 |5.7 |6490 |
|[resnet34.a2_in1k](https://huggingface.co/timm/resnet34.a2_in1k)|224 |75.52|92.44|21.8 |3.7 |3.7 |5991 |
|[resnet26.bt_in1k](https://huggingface.co/timm/resnet26.bt_in1k)|224 |75.3 |92.58|16.0 |2.4 |7.4 |5583 |
|[resnet34.bt_in1k](https://huggingface.co/timm/resnet34.bt_in1k)|224 |75.16|92.18|21.8 |3.7 |3.7 |5994 |
|[seresnet50.a3_in1k](https://huggingface.co/timm/seresnet50.a3_in1k)|160 |75.1 |92.08|28.1 |2.1 |5.7 |5513 |
|[resnet34.gluon_in1k](https://huggingface.co/timm/resnet34.gluon_in1k)|224 |74.57|91.98|21.8 |3.7 |3.7 |5984 |
|[resnet18d.ra2_in1k](https://huggingface.co/timm/resnet18d.ra2_in1k)|288 |73.81|91.83|11.7 |3.4 |5.4 |5196 |
|[resnet34.tv_in1k](https://huggingface.co/timm/resnet34.tv_in1k)|224 |73.32|91.42|21.8 |3.7 |3.7 |5979 |
|[resnet18.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnet18.fb_swsl_ig1b_ft_in1k)|224 |73.28|91.73|11.7 |1.8 |2.5 |10213 |
|[resnet18.a1_in1k](https://huggingface.co/timm/resnet18.a1_in1k)|288 |73.16|91.03|11.7 |3.0 |4.1 |6050 |
|[resnet34.a3_in1k](https://huggingface.co/timm/resnet34.a3_in1k)|224 |72.98|91.11|21.8 |3.7 |3.7 |5967 |
|[resnet18.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnet18.fb_ssl_yfcc100m_ft_in1k)|224 |72.6 |91.42|11.7 |1.8 |2.5 |10213 |
|[resnet18.a2_in1k](https://huggingface.co/timm/resnet18.a2_in1k)|288 |72.37|90.59|11.7 |3.0 |4.1 |6051 |
|[resnet14t.c3_in1k](https://huggingface.co/timm/resnet14t.c3_in1k)|224 |72.26|90.31|10.1 |1.7 |5.8 |7026 |
|[resnet18d.ra2_in1k](https://huggingface.co/timm/resnet18d.ra2_in1k)|224 |72.26|90.68|11.7 |2.1 |3.3 |8707 |
|[resnet18.a1_in1k](https://huggingface.co/timm/resnet18.a1_in1k)|224 |71.49|90.07|11.7 |1.8 |2.5 |10187 |
|[resnet14t.c3_in1k](https://huggingface.co/timm/resnet14t.c3_in1k)|176 |71.31|89.69|10.1 |1.1 |3.6 |10970 |
|[resnet18.gluon_in1k](https://huggingface.co/timm/resnet18.gluon_in1k)|224 |70.84|89.76|11.7 |1.8 |2.5 |10210 |
|[resnet18.a2_in1k](https://huggingface.co/timm/resnet18.a2_in1k)|224 |70.64|89.47|11.7 |1.8 |2.5 |10194 |
|[resnet34.a3_in1k](https://huggingface.co/timm/resnet34.a3_in1k)|160 |70.56|89.52|21.8 |1.9 |1.9 |10737 |
|[resnet18.tv_in1k](https://huggingface.co/timm/resnet18.tv_in1k)|224 |69.76|89.07|11.7 |1.8 |2.5 |10205 |
|[resnet10t.c3_in1k](https://huggingface.co/timm/resnet10t.c3_in1k)|224 |68.34|88.03|5.4 |1.1 |2.4 |13079 |
|[resnet18.a3_in1k](https://huggingface.co/timm/resnet18.a3_in1k)|224 |68.25|88.17|11.7 |1.8 |2.5 |10167 |
|[resnet10t.c3_in1k](https://huggingface.co/timm/resnet10t.c3_in1k)|176 |66.71|86.96|5.4 |0.7 |1.5 |20327 |
|[resnet18.a3_in1k](https://huggingface.co/timm/resnet18.a3_in1k)|160 |65.66|86.26|11.7 |0.9 |1.3 |18229 |
## Citation
```bibtex
@inproceedings{wightman2021resnet,
title={ResNet strikes back: An improved training procedure in timm},
author={Wightman, Ross and Touvron, Hugo and Jegou, Herve},
booktitle={NeurIPS 2021 Workshop on ImageNet: Past, Present, and Future}
}
```
```bibtex
@misc{rw2019timm,
author = {Ross Wightman},
title = {PyTorch Image Models},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
doi = {10.5281/zenodo.4414861},
howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
}
```
```bibtex
@article{He2015,
author = {Kaiming He and Xiangyu Zhang and Shaoqing Ren and Jian Sun},
title = {Deep Residual Learning for Image Recognition},
journal = {arXiv preprint arXiv:1512.03385},
year = {2015}
}
```
| [
-0.8923001289367676,
-0.21555957198143005,
0.02489861659705639,
0.38675379753112793,
-0.41563940048217773,
-0.11546292901039124,
-0.13616183400154114,
-0.3938218057155609,
1.182558536529541,
0.2945999801158905,
-0.6678751111030579,
-0.5494182705879211,
-0.6189887523651123,
-0.008922494016587734,
0.3176206648349762,
0.8847732543945312,
-0.003548097563907504,
-0.08104601502418518,
0.2212887555360794,
-0.2507534325122833,
-0.050528641790151596,
-0.34651562571525574,
-1.0949347019195557,
-0.1855485886335373,
0.4331795871257782,
0.1768948882818222,
0.6776541471481323,
0.6238290071487427,
0.39284950494766235,
0.6152766346931458,
-0.2690243124961853,
0.2773897647857666,
-0.05809175595641136,
-0.13032938539981842,
0.6375414729118347,
-0.4260406196117401,
-0.9580729603767395,
-0.042737219482660294,
0.7332022786140442,
0.6343368887901306,
0.07057322561740875,
0.3607299029827118,
0.3639969527721405,
0.6342625021934509,
0.020547805353999138,
-0.06618361920118332,
0.01659557782113552,
0.15140195190906525,
-0.3116915822029114,
0.09690076112747192,
-0.07532834261655807,
-0.7266765236854553,
0.16411364078521729,
-0.6185564398765564,
-0.05016084387898445,
0.0015176002634689212,
1.3655160665512085,
-0.12383192032575607,
-0.22404475510120392,
0.08696775138378143,
0.14761275053024292,
0.7831276655197144,
-0.856870710849762,
0.35187238454818726,
0.5700366497039795,
0.020595578476786613,
-0.1969224512577057,
-0.6845505833625793,
-0.5314964652061462,
0.13166742026805878,
-0.4331325590610504,
0.3173539340496063,
-0.32555505633354187,
-0.24435986578464508,
0.3925696015357971,
0.33977997303009033,
-0.456601083278656,
-0.12356232106685638,
-0.366475909948349,
-0.09492255747318268,
0.71549391746521,
0.0834340900182724,
0.7068780064582825,
-0.3643459677696228,
-0.5155923962593079,
-0.13438791036605835,
-0.17475594580173492,
0.49222004413604736,
0.26286691427230835,
0.14561033248901367,
-1.1014827489852905,
0.43919381499290466,
0.1117212101817131,
0.24658270180225372,
0.3775192201137543,
-0.1371975541114807,
0.8429838418960571,
-0.09632980823516846,
-0.5260565876960754,
-0.49622195959091187,
1.103624701499939,
0.6536237001419067,
0.28318697214126587,
-0.08792214095592499,
-0.06017981469631195,
-0.19440382719039917,
-0.38987576961517334,
-0.961281418800354,
-0.03811518847942352,
0.281649112701416,
-0.562068521976471,
-0.2418803870677948,
0.3386442959308624,
-0.9138381481170654,
-0.04316457360982895,
-0.09284645318984985,
0.0679866373538971,
-0.770745575428009,
-0.4484987258911133,
0.012295043095946312,
-0.2523531913757324,
0.5315041542053223,
0.21585479378700256,
-0.3161407709121704,
0.4468512535095215,
0.0829649418592453,
0.9010745286941528,
0.29516130685806274,
-0.0622965507209301,
-0.21618396043777466,
0.02519308216869831,
-0.3593003451824188,
0.37160438299179077,
0.16461281478405,
-0.1862485408782959,
-0.35347995162010193,
0.4449000954627991,
-0.26046594977378845,
-0.25637105107307434,
0.6211658120155334,
0.2824804186820984,
0.17366330325603485,
-0.3017677664756775,
-0.24704666435718536,
-0.24824786186218262,
0.3714599013328552,
-0.5979445576667786,
1.0452439785003662,
0.3892688751220703,
-1.140124797821045,
0.15723268687725067,
-0.5292525291442871,
-0.02090119570493698,
-0.29613906145095825,
0.10533901304006577,
-0.9209153056144714,
0.029656346887350082,
0.2162221074104309,
0.711938738822937,
-0.22615353763103485,
-0.19015814363956451,
-0.3640538454055786,
0.04390813782811165,
0.42423850297927856,
0.18430033326148987,
0.9444107413291931,
0.317771852016449,
-0.4903675317764282,
-0.2286682277917862,
-0.7317836284637451,
0.46062523126602173,
0.4518972635269165,
-0.010055532678961754,
-0.052090585231781006,
-0.8143883347511292,
0.024863384664058685,
0.6006640195846558,
0.2523297965526581,
-0.7261098623275757,
0.24629320204257965,
-0.1905461698770523,
0.342586874961853,
0.6387771368026733,
0.03281741589307785,
0.16652169823646545,
-0.7239653468132019,
0.633436381816864,
-0.014366261661052704,
0.2872750759124756,
-0.015942072495818138,
-0.4097999334335327,
-0.7824347615242004,
-0.7527133226394653,
0.24827079474925995,
0.43549948930740356,
-0.41150182485580444,
0.8802873492240906,
0.13438008725643158,
-0.62579345703125,
-0.6505130529403687,
0.06098739057779312,
0.6021921634674072,
0.244925856590271,
0.11351098865270615,
-0.3831274211406708,
-0.758878767490387,
-0.9874166250228882,
-0.35413768887519836,
0.12035016715526581,
-0.04004191234707832,
0.6988660097122192,
0.4445970356464386,
-0.21050961315631866,
0.5531226992607117,
-0.38526636362075806,
-0.22224800288677216,
-0.1549907922744751,
-0.09419596940279007,
0.45083242654800415,
0.8065528273582458,
1.0426924228668213,
-0.7528700828552246,
-0.9513305425643921,
0.1435404121875763,
-1.1174952983856201,
-0.07330413907766342,
-0.0020418178755789995,
-0.2619374692440033,
0.4560655653476715,
0.24721485376358032,
-0.8861372470855713,
0.7896992564201355,
0.3898867666721344,
-0.8257545828819275,
0.4674972593784332,
-0.34131747484207153,
0.5836845636367798,
-1.1169192790985107,
0.28532934188842773,
0.29481959342956543,
-0.26232802867889404,
-0.5902584195137024,
0.06529243290424347,
-0.09827171266078949,
0.12112167477607727,
-0.5821880102157593,
0.8008275628089905,
-0.7227410078048706,
-0.03390287980437279,
0.14998000860214233,
0.05809644237160683,
-0.015350383706390858,
0.4372018575668335,
-0.05687655881047249,
0.5896251201629639,
0.8878223896026611,
-0.16699960827827454,
0.34204789996147156,
0.4183103144168854,
0.06957179307937622,
0.7995873093605042,
-0.6439213156700134,
0.13560599088668823,
0.02629544772207737,
0.4765031635761261,
-1.0248838663101196,
-0.3980432450771332,
0.559027910232544,
-0.8355761766433716,
0.6744966506958008,
-0.2772408425807953,
-0.28503984212875366,
-0.8563425540924072,
-0.8961394429206848,
0.2681547999382019,
0.6680687069892883,
-0.601618230342865,
0.388508141040802,
0.20958144962787628,
-0.053760867565870285,
-0.5005641579627991,
-0.716351330280304,
0.10148359090089798,
-0.4409172832965851,
-0.833023726940155,
0.45760467648506165,
0.32424142956733704,
-0.190945103764534,
0.10162024945020676,
-0.1384403556585312,
-0.14280572533607483,
-0.22501976788043976,
0.629305362701416,
0.3321521580219269,
-0.3035632073879242,
-0.41448062658309937,
-0.40108102560043335,
-0.2877475619316101,
-0.06950569897890091,
-0.11927012354135513,
0.530285120010376,
-0.4683218002319336,
0.09032537043094635,
-1.4891607761383057,
0.12963928282260895,
0.9008846879005432,
-0.03261895477771759,
1.0018644332885742,
0.7877764701843262,
-0.4931201934814453,
0.17304906249046326,
-0.46551546454429626,
-0.22924481332302094,
-0.5323525667190552,
-0.2307634949684143,
-0.7313753962516785,
-0.5810463428497314,
0.9322121143341064,
0.053724322468042374,
-0.14259015023708344,
0.8020480871200562,
0.15462131798267365,
-0.26433882117271423,
0.836580216884613,
0.48951947689056396,
-0.03883810713887215,
0.5721235871315002,
-0.857791543006897,
0.08147239685058594,
-0.8383400440216064,
-0.7675544619560242,
-0.2643613815307617,
-0.588238537311554,
-0.599057674407959,
-0.3428146243095398,
0.24126824736595154,
0.3866496980190277,
-0.26890528202056885,
0.6149839758872986,
-0.5680396556854248,
0.03319774940609932,
0.3364770710468292,
0.5552740097045898,
-0.22997960448265076,
-0.1251329630613327,
-0.1183229386806488,
-0.3440224230289459,
-0.5414024591445923,
-0.3673652410507202,
0.7854252457618713,
0.6483604907989502,
0.42721638083457947,
0.10041431337594986,
0.6138951778411865,
0.06300879269838333,
0.2106398642063141,
-0.3165459632873535,
0.7100290656089783,
0.03421798348426819,
-0.46069878339767456,
-0.34143587946891785,
-0.4325752556324005,
-1.0910440683364868,
0.1421816349029541,
-0.45704829692840576,
-0.8519278764724731,
-0.18336258828639984,
-0.05297204479575157,
-0.3625337481498718,
0.7675790190696716,
-0.627560019493103,
0.6386383175849915,
-0.07319261878728867,
-0.5360988974571228,
-0.033175282180309296,
-0.8201572895050049,
0.070660799741745,
0.38026222586631775,
0.04869278520345688,
0.011440328322350979,
-0.05259288102388382,
0.801796019077301,
-0.8365078568458557,
0.6298643946647644,
-0.3583623170852661,
0.14351099729537964,
0.3996987044811249,
-0.03565790876746178,
0.40053898096084595,
-0.03369450569152832,
-0.20309370756149292,
-0.07822918146848679,
0.12059841305017471,
-0.8569182753562927,
-0.324451744556427,
0.6630375981330872,
-0.7454646825790405,
-0.38813695311546326,
-0.6579083204269409,
-0.27340948581695557,
0.10661018639802933,
0.029316788539290428,
0.4957773685455322,
0.6600085496902466,
-0.014712881296873093,
0.23811958730220795,
0.5346931219100952,
-0.45196542143821716,
0.5387238264083862,
-0.12629327178001404,
0.017564326524734497,
-0.5818905234336853,
0.7123729586601257,
0.06390383839607239,
0.002969003515318036,
-0.015537927858531475,
0.013433579355478287,
-0.4255475699901581,
-0.21732738614082336,
-0.3064747452735901,
0.7575985193252563,
-0.17897751927375793,
-0.3107393980026245,
-0.6496368050575256,
-0.345391184091568,
-0.5805352330207825,
-0.4219014048576355,
-0.461620956659317,
-0.37159234285354614,
-0.3044321537017822,
0.048040613532066345,
0.7205753922462463,
0.8932045698165894,
-0.3446670472621918,
0.4135928750038147,
-0.5292153358459473,
0.2996721565723419,
0.08019199967384338,
0.5738412737846375,
-0.33987897634506226,
-0.7023760676383972,
0.04894045740365982,
-0.026056313887238503,
-0.08528061956167221,
-0.869185209274292,
0.6686297059059143,
0.010258292779326439,
0.37189072370529175,
0.3984200358390808,
-0.21774689853191376,
0.7506033182144165,
-0.02921353653073311,
0.4770737588405609,
0.6293847560882568,
-0.7515389919281006,
0.3642731010913849,
-0.4231666922569275,
0.03398122638463974,
0.28835099935531616,
0.23424401879310608,
-0.4118112027645111,
-0.3506717085838318,
-0.9109717011451721,
-0.42793118953704834,
0.7447065114974976,
0.09595002979040146,
-0.02979193814098835,
-0.016688933596014977,
0.7602027058601379,
-0.07690899074077606,
0.06078953295946121,
-0.5470207333564758,
-0.9192009568214417,
-0.12163129448890686,
-0.1638699173927307,
0.06401876360177994,
-0.04928705468773842,
0.03901374712586403,
-0.6800785064697266,
0.6789340972900391,
0.059772539883852005,
0.5026847720146179,
0.18055933713912964,
0.07262495160102844,
0.039298783987760544,
-0.3036752939224243,
0.6138532757759094,
0.3686610162258148,
-0.19197767972946167,
-0.1254790723323822,
0.3924861550331116,
-0.508027970790863,
0.0978352427482605,
0.2189432978630066,
0.0025567759294062853,
0.09133601933717728,
0.09293586760759354,
0.5185462832450867,
0.3506055176258087,
-0.07136667519807816,
0.515737771987915,
-0.25399112701416016,
-0.5492148995399475,
-0.22742322087287903,
-0.2055862993001938,
0.26936957240104675,
0.4546523988246918,
0.33371224999427795,
0.043239716440439224,
-0.40823668241500854,
-0.3921288549900055,
0.5558438897132874,
0.7555071115493774,
-0.41437166929244995,
-0.41875025629997253,
0.6033675670623779,
-0.04880661889910698,
-0.24751296639442444,
0.3982180058956146,
-0.09861799329519272,
-0.7135673761367798,
1.050955057144165,
0.352388858795166,
0.6488243341445923,
-0.511624813079834,
0.10034072399139404,
0.877910315990448,
-0.011180112138390541,
0.20048415660858154,
0.34673938155174255,
0.4772665500640869,
-0.3159363865852356,
-0.07068753987550735,
-0.5623206496238708,
0.16761188209056854,
0.49265193939208984,
-0.4294312298297882,
0.29502713680267334,
-0.7268498539924622,
-0.3805284798145294,
0.09833461046218872,
0.5017392039299011,
-0.6502225399017334,
0.3748641014099121,
-0.046091414988040924,
1.0982826948165894,
-0.8346205949783325,
0.8603323101997375,
0.9299618005752563,
-0.5568975210189819,
-0.8808866143226624,
0.0002902077976614237,
0.11974626779556274,
-0.8796932697296143,
0.4815368056297302,
0.08923143148422241,
0.029482774436473846,
-0.01358660589903593,
-0.5133152008056641,
-0.6743776202201843,
1.4079772233963013,
0.41143798828125,
-0.05108311399817467,
0.2828090190887451,
-0.4326590895652771,
0.3894582986831665,
-0.18117375671863556,
0.5950883030891418,
0.37531882524490356,
0.5194995999336243,
0.17376480996608734,
-0.8971313834190369,
0.38877153396606445,
-0.43069157004356384,
-0.1232428252696991,
0.32437625527381897,
-1.3388493061065674,
0.9207244515419006,
-0.24857360124588013,
-0.03581744059920311,
0.24685470759868622,
0.6522740721702576,
0.3310208022594452,
-0.018821123987436295,
0.2678803503513336,
0.9531771540641785,
0.4873844087123871,
-0.25568369030952454,
1.089888572692871,
-0.21714827418327332,
0.5482611060142517,
0.20936009287834167,
0.5718463659286499,
0.3820336163043976,
0.4044802486896515,
-0.5918807983398438,
0.2759930491447449,
0.839747965335846,
-0.041640765964984894,
0.11614680290222168,
0.30152830481529236,
-0.41397538781166077,
-0.18769533932209015,
-0.22522355616092682,
-0.7009457349777222,
0.22864843904972076,
0.08483929932117462,
-0.1473180651664734,
-0.1305033564567566,
-0.053712401539087296,
0.26349157094955444,
0.2808699905872345,
-0.2611299455165863,
0.5317181944847107,
0.09104592353105545,
-0.39785391092300415,
0.479591429233551,
-0.007450322154909372,
1.0790318250656128,
-0.35754743218421936,
0.17531085014343262,
-0.37386560440063477,
0.29554569721221924,
-0.25018227100372314,
-1.0960547924041748,
0.3326103091239929,
-0.08291775733232498,
0.07757605612277985,
-0.22647053003311157,
0.6699405908584595,
-0.35268452763557434,
-0.35404887795448303,
0.39098355174064636,
0.3926321268081665,
0.52793949842453,
0.2900386452674866,
-1.1400762796401978,
0.2652970254421234,
0.08388426899909973,
-0.6358926296234131,
0.4382708668708801,
0.5077510476112366,
0.38297605514526367,
0.7711871266365051,
0.33646538853645325,
0.3261665105819702,
0.21058401465415955,
-0.3794560432434082,
0.7639057636260986,
-0.6696545481681824,
-0.4587794244289398,
-0.835529088973999,
0.5484500527381897,
-0.41753479838371277,
-0.5351832509040833,
0.7530344128608704,
0.5620371103286743,
0.3754134178161621,
0.025912214070558548,
0.6818530559539795,
-0.5469644069671631,
0.5047733187675476,
-0.26416635513305664,
0.7706056237220764,
-0.6953741312026978,
-0.25608816742897034,
-0.2052152156829834,
-0.6080245971679688,
-0.40544983744621277,
0.8383496999740601,
-0.11945483088493347,
0.26691946387290955,
0.29197120666503906,
0.67743980884552,
0.07857096195220947,
-0.12982863187789917,
-0.005939017049968243,
0.17077362537384033,
-0.13618050515651703,
0.9038750529289246,
0.5193291306495667,
-0.7798727750778198,
0.059269968420267105,
-0.4924759566783905,
-0.2965541183948517,
-0.36426568031311035,
-0.7686936855316162,
-1.1908090114593506,
-0.6778608560562134,
-0.5376763939857483,
-0.6927571296691895,
-0.24542951583862305,
1.2010363340377808,
0.8332954049110413,
-0.6178747415542603,
-0.15309104323387146,
0.15321463346481323,
0.07829054445028305,
-0.1550845354795456,
-0.22009479999542236,
0.5408587455749512,
0.1006610319018364,
-1.0154414176940918,
-0.4255673289299011,
0.14378605782985687,
0.6301944255828857,
0.3918127715587616,
-0.504456639289856,
-0.23715601861476898,
-0.06241032853722572,
0.3423682153224945,
0.876262366771698,
-0.8115507960319519,
-0.27435171604156494,
0.023757314309477806,
-0.4990415871143341,
0.12633201479911804,
0.29778578877449036,
-0.4610272943973541,
-0.10973338782787323,
0.4916461408138275,
0.4043913185596466,
0.7564445734024048,
0.08105043321847916,
0.16895122826099396,
-0.4697592556476593,
0.563675582408905,
-0.01549581065773964,
0.3414841592311859,
0.22992095351219177,
-0.29412707686424255,
0.777461051940918,
0.5505807399749756,
-0.4009000360965729,
-1.0508397817611694,
-0.17593368887901306,
-1.3312815427780151,
-0.06718644499778748,
0.663445234298706,
-0.08395089209079742,
-0.44175681471824646,
0.44008758664131165,
-0.45708733797073364,
0.5385839343070984,
-0.2063400149345398,
0.27166855335235596,
0.24645711481571198,
-0.36091557145118713,
-0.3723888099193573,
-0.5763813853263855,
0.6191673278808594,
0.3972359597682953,
-0.7106149792671204,
-0.41963374614715576,
-0.014907777309417725,
0.32022762298583984,
0.19736747443675995,
0.7567947506904602,
-0.3985092341899872,
0.13996398448944092,
-0.11470309644937515,
0.265109121799469,
-0.023049231618642807,
0.16181354224681854,
-0.31755757331848145,
-0.1225174218416214,
-0.23727965354919434,
-0.6547049283981323
] |
stabilityai/StableBeluga-7B | stabilityai | "2023-08-29T20:21:36Z" | 3,092,291 | 124 | transformers | [
"transformers",
"safetensors",
"llama",
"text-generation",
"en",
"dataset:conceptofmind/cot_submix_original",
"dataset:conceptofmind/flan2021_submix_original",
"dataset:conceptofmind/t0_submix_original",
"dataset:conceptofmind/niv2_submix_original",
"arxiv:2307.09288",
"arxiv:2306.02707",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text-generation | "2023-07-27T02:01:15Z" | ---
datasets:
- conceptofmind/cot_submix_original
- conceptofmind/flan2021_submix_original
- conceptofmind/t0_submix_original
- conceptofmind/niv2_submix_original
language:
- en
pipeline_tag: text-generation
---
# Stable Beluga 7B
Use [Stable Chat (Research Preview)](https://chat.stability.ai/chat) to test Stability AI's best language models for free
## Model Description
`Stable Beluga 7B` is a Llama2 7B model finetuned on an Orca style Dataset
## Usage
Start chatting with `Stable Beluga 7B` using the following code snippet:
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("stabilityai/StableBeluga-7B", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("stabilityai/StableBeluga-7B", torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
system_prompt = "### System:\nYou are StableBeluga, an AI that follows instructions extremely well. Help as much as you can. Remember, be safe, and don't do anything illegal.\n\n"
message = "Write me a poem please"
prompt = f"{system_prompt}### User: {message}\n\n### Assistant:\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=256)
print(tokenizer.decode(output[0], skip_special_tokens=True))
```
Stable Beluga 7B should be used with this prompt format:
```
### System:
This is a system prompt, please behave and help the user.
### User:
Your prompt here
### Assistant:
The output of Stable Beluga 7B
```
## Model Details
* **Developed by**: [Stability AI](https://stability.ai/)
* **Model type**: Stable Beluga 7B is an auto-regressive language model fine-tuned on Llama2 7B.
* **Language(s)**: English
* **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
* **License**: Fine-tuned checkpoints (`Stable Beluga 7B`) is licensed under the [STABLE BELUGA NON-COMMERCIAL COMMUNITY LICENSE AGREEMENT](https://huggingface.co/stabilityai/StableBeluga-7B/blob/main/LICENSE.txt)
* **Contact**: For questions and comments about the model, please email `[email protected]`
### Training Dataset
` Stable Beluga 7B` is trained on our internal Orca-style dataset
### Training Procedure
Models are learned via supervised fine-tuning on the aforementioned datasets, trained in mixed-precision (BF16), and optimized with AdamW. We outline the following hyperparameters:
| Dataset | Batch Size | Learning Rate |Learning Rate Decay| Warm-up | Weight Decay | Betas |
|-------------------|------------|---------------|-------------------|---------|--------------|-------------|
| Orca pt1 packed | 256 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
| Orca pt2 unpacked | 512 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
## Ethical Considerations and Limitations
Beluga is a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Beluga's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Beluga, developers should perform safety testing and tuning tailored to their specific applications of the model.
## Citations
```bibtext
@misc{touvron2023llama,
title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
year={2023},
eprint={2307.09288},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
```
```bibtext
@misc{mukherjee2023orca,
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
year={2023},
eprint={2306.02707},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
``` | [
-0.4614315330982208,
-1.0016154050827026,
0.05207406356930733,
0.3998693823814392,
-0.2949399948120117,
0.061662640422582626,
-0.13664621114730835,
-0.5331628322601318,
0.015180854126811028,
0.30468323826789856,
-0.5543938875198364,
-0.5328834056854248,
-0.6630096435546875,
-0.06147634983062744,
-0.3333529531955719,
1.0803239345550537,
0.11388065665960312,
-0.19513750076293945,
0.12943142652511597,
-0.14692600071430206,
-0.7104756236076355,
-0.32630661129951477,
-0.9512048959732056,
-0.27716773748397827,
0.2574706971645355,
0.22527405619621277,
0.7620717883110046,
0.7590333819389343,
0.22418224811553955,
0.3653338551521301,
-0.43794459104537964,
0.033165089786052704,
-0.6447106003761292,
-0.17576636373996735,
0.16411706805229187,
-0.5710286498069763,
-0.6275227069854736,
-0.03550263121724129,
0.4650973677635193,
0.4309871196746826,
-0.16228434443473816,
0.22535499930381775,
0.2042597532272339,
0.36464232206344604,
-0.3946107029914856,
0.4013245403766632,
-0.48070865869522095,
-0.19299253821372986,
-0.18049657344818115,
0.0917394831776619,
-0.23397795855998993,
-0.7103894948959351,
0.06983336061239243,
-0.6025360226631165,
0.03781146928668022,
-0.05344691872596741,
1.4638078212738037,
0.37655121088027954,
-0.5059183239936829,
-0.13707830011844635,
-0.5631502270698547,
0.8955022096633911,
-0.9573889970779419,
0.45438772439956665,
0.2966325581073761,
0.3728238344192505,
-0.4021369516849518,
-0.6620357632637024,
-0.7137425541877747,
-0.2272745966911316,
-0.04073847830295563,
0.34530240297317505,
-0.13588081300258636,
0.000598043785430491,
0.3349912166595459,
0.4259284734725952,
-0.5552663207054138,
0.2316841185092926,
-0.6190798878669739,
-0.4474911391735077,
0.5416578650474548,
0.09535712748765945,
0.10786858946084976,
-0.12448614090681076,
-0.3219888508319855,
-0.3915689289569855,
-0.7484462857246399,
0.358997642993927,
0.41709473729133606,
0.1925830990076065,
-0.5532739162445068,
0.5688021779060364,
-0.08442015200853348,
0.6518476605415344,
0.05836780369281769,
-0.3937196731567383,
0.4627443552017212,
-0.3805718421936035,
-0.4170803725719452,
0.03242536634206772,
0.9727569222450256,
0.38695845007896423,
0.06613066792488098,
0.3350050747394562,
-0.04061964526772499,
0.447454035282135,
-0.0388297438621521,
-0.8612092733383179,
-0.18756571412086487,
0.36802101135253906,
-0.48665547370910645,
-0.5389693379402161,
-0.3499700427055359,
-1.0584439039230347,
-0.18136556446552277,
-0.03510947898030281,
0.3200133740901947,
-0.4399571716785431,
-0.4340943694114685,
0.19742456078529358,
0.33237946033477783,
0.5665278434753418,
0.03473738208413124,
-1.0095294713974,
0.3009939193725586,
0.4316393733024597,
0.7286962270736694,
0.13635390996932983,
-0.29323849081993103,
-0.29798492789268494,
-0.0893435925245285,
-0.46754956245422363,
0.6115087866783142,
-0.20699074864387512,
-0.4918705224990845,
-0.03322494775056839,
0.155624121427536,
-0.06730815768241882,
-0.3327254354953766,
0.7180456519126892,
-0.2763279676437378,
0.42967331409454346,
-0.18232031166553497,
-0.4063771665096283,
-0.49828556180000305,
0.24408024549484253,
-0.4154433608055115,
1.2102274894714355,
-0.07174204289913177,
-0.6844533085823059,
0.24343840777873993,
-0.6630691885948181,
-0.3195822238922119,
-0.35725969076156616,
-0.13179202377796173,
-0.7303886413574219,
-0.3673482835292816,
0.24846820533275604,
0.4969382584095001,
-0.26881080865859985,
0.2902621924877167,
-0.4871079921722412,
-0.2970842123031616,
0.17511601746082306,
-0.3087368905544281,
1.0978761911392212,
0.3462396562099457,
-0.7104498147964478,
0.19892814755439758,
-0.9564943313598633,
-0.14923202991485596,
0.36686432361602783,
-0.38979846239089966,
-0.00504276854917407,
-0.13817249238491058,
-0.3179076313972473,
0.015378633514046669,
0.3450343906879425,
-0.5516649484634399,
0.14097917079925537,
-0.4843611419200897,
0.4691096544265747,
0.7313490509986877,
-0.06703018397092819,
0.18947072327136993,
-0.3732927441596985,
0.34077131748199463,
-0.008577282540500164,
0.4362243115901947,
-0.10096541047096252,
-0.8405201435089111,
-1.0102462768554688,
-0.2991856634616852,
0.3592499792575836,
0.7144807577133179,
-0.3789123296737671,
0.6617295145988464,
0.04799913614988327,
-0.7447811365127563,
-0.6679997444152832,
-0.029494620859622955,
0.6579723954200745,
0.6966382265090942,
0.3478398621082306,
-0.3292924165725708,
-0.6394702196121216,
-0.83132404088974,
0.1531417965888977,
-0.3748696446418762,
0.1776908040046692,
0.10914544761180878,
0.34669479727745056,
-0.45100054144859314,
0.7995474338531494,
-0.4846852719783783,
-0.16883796453475952,
-0.14451242983341217,
0.13044340908527374,
0.37824517488479614,
0.5712974071502686,
0.8583931922912598,
-0.6008182168006897,
-0.2574125826358795,
-0.11299009621143341,
-0.7404307126998901,
-0.07004936784505844,
0.10213187336921692,
-0.2674923241138458,
0.556390643119812,
0.25950196385383606,
-0.5683132410049438,
0.5766054391860962,
0.8159142136573792,
-0.3546426594257355,
0.6063312888145447,
-0.16562409698963165,
0.09111995995044708,
-1.244622826576233,
0.11229044944047928,
0.10949704796075821,
-0.09226123988628387,
-0.5523227453231812,
-0.04934578761458397,
0.05450057610869408,
0.01138135977089405,
-0.425685316324234,
0.5285150408744812,
-0.3695448935031891,
-0.021298840641975403,
-0.19501283764839172,
0.13826580345630646,
-0.15117201209068298,
0.6525142192840576,
-0.05388389155268669,
0.4719617962837219,
0.7838618755340576,
-0.7656136155128479,
0.3524180054664612,
0.4643378257751465,
-0.36711496114730835,
0.23826347291469574,
-0.9339178204536438,
0.13779129087924957,
0.17353132367134094,
0.19186481833457947,
-1.2727515697479248,
-0.16579775512218475,
0.4179443418979645,
-0.6677166819572449,
0.487574964761734,
-0.27602624893188477,
-0.3867206275463104,
-0.5031980276107788,
-0.23849418759346008,
0.09530367702245712,
0.8561162352561951,
-0.5105947256088257,
0.46144580841064453,
0.4513610303401947,
-0.04597777500748634,
-0.7461721301078796,
-0.7763927578926086,
-0.29882484674453735,
-0.31397175788879395,
-0.8544855117797852,
0.10404092073440552,
-0.40133941173553467,
0.13619761168956757,
-0.13331060111522675,
-0.07823473960161209,
0.06603461503982544,
0.26234084367752075,
0.3466959595680237,
0.563109278678894,
-0.11630554497241974,
-0.4065638482570648,
0.28087717294692993,
-0.2236320674419403,
0.050565775483846664,
0.00785280205309391,
0.7098711729049683,
-0.5746963024139404,
-0.1796993613243103,
-0.4325265884399414,
-0.08446906507015228,
0.554264485836029,
-0.33122411370277405,
0.7945300340652466,
0.717686653137207,
-0.4617643654346466,
0.35761865973472595,
-0.6616179943084717,
-0.252231627702713,
-0.5374804139137268,
0.3755190074443817,
-0.3702335059642792,
-0.833008885383606,
0.9610159397125244,
0.07421844452619553,
0.5033429265022278,
0.5539376735687256,
0.8373799324035645,
0.16607113182544708,
1.0615260601043701,
0.7235260605812073,
-0.0008176314877346158,
0.27589941024780273,
-0.5463787317276001,
0.12304512411355972,
-0.7702633738517761,
-0.5294037461280823,
-0.6097793579101562,
-0.1772419810295105,
-0.6243447065353394,
0.04206604138016701,
0.24142874777317047,
0.15204864740371704,
-0.5088258385658264,
0.3819670081138611,
-0.587477445602417,
0.06899770349264145,
0.4694819450378418,
0.0332510769367218,
0.15869902074337006,
-0.22611317038536072,
-0.39337053894996643,
0.08207828551530838,
-0.6740831732749939,
-0.5404551029205322,
1.0159657001495361,
0.6324935555458069,
0.7896518707275391,
0.1062619760632515,
0.45044296979904175,
-0.26282206177711487,
0.21257056295871735,
-0.5167199969291687,
0.6407803297042847,
0.07886209338903427,
-0.8599227070808411,
-0.17138925194740295,
-0.45292311906814575,
-1.2685517072677612,
0.12597322463989258,
-0.2868153750896454,
-0.7483226656913757,
0.34664303064346313,
0.23496079444885254,
-0.5086577534675598,
0.1980571746826172,
-0.789764404296875,
1.1146607398986816,
-0.31024307012557983,
-0.15663352608680725,
-0.05723218247294426,
-0.8807449340820312,
0.6977593302726746,
0.04086042568087578,
0.3599528670310974,
-0.03624826669692993,
0.03994620591402054,
0.7856292724609375,
-0.40941059589385986,
1.002071738243103,
-0.010723423212766647,
-0.10635817050933838,
0.40181106328964233,
0.20501962304115295,
0.4086810350418091,
0.1464894413948059,
0.003061705967411399,
0.29481956362724304,
0.15901091694831848,
-0.4578782320022583,
-0.3036588728427887,
0.7624762058258057,
-1.277360439300537,
-0.522413969039917,
-0.5089257955551147,
-0.2723652422428131,
0.02632085606455803,
0.3893662393093109,
0.36412858963012695,
0.42354097962379456,
0.24507422745227814,
0.2544501721858978,
0.7320932745933533,
-0.4137226939201355,
0.3680226802825928,
0.5620611310005188,
-0.461942583322525,
-0.5524916648864746,
0.7100917100906372,
0.17571087181568146,
0.3403022587299347,
0.03251677751541138,
0.34147873520851135,
-0.4930945336818695,
-0.6103414297103882,
-0.4689074754714966,
0.38675716519355774,
-0.5888279676437378,
-0.2206336110830307,
-0.5841999053955078,
-0.2522270381450653,
-0.5353599786758423,
0.002794155851006508,
-0.6777589917182922,
-0.2626921832561493,
-0.4109650254249573,
-0.29394543170928955,
0.6310417652130127,
0.4646976888179779,
-0.07202468067407608,
0.23532675206661224,
-0.761585533618927,
0.186422660946846,
0.22826790809631348,
0.2976421117782593,
-0.0635390356183052,
-0.7935491800308228,
-0.15058763325214386,
0.24736493825912476,
-0.5226932168006897,
-0.9369195699691772,
0.3812531530857086,
-0.017750423401594162,
0.7809621691703796,
0.3335067927837372,
0.06784739345312119,
0.8285017013549805,
-0.08093880861997604,
0.9701825976371765,
0.23868046700954437,
-0.8166548013687134,
0.6102737188339233,
-0.42575976252555847,
0.09565044194459915,
0.3557286560535431,
0.5421406030654907,
-0.3068731129169464,
-0.399768203496933,
-0.7660800814628601,
-0.827888011932373,
0.6955423951148987,
0.332060307264328,
0.0018427380127832294,
0.078486867249012,
0.5618419647216797,
0.07970796525478363,
0.1371862292289734,
-0.9285128116607666,
-0.5220397114753723,
-0.6530886292457581,
-0.03899021074175835,
0.03395397588610649,
-0.2570649981498718,
-0.12540753185749054,
-0.28224605321884155,
0.8467317223548889,
0.046931516379117966,
0.3812748193740845,
0.1802406758069992,
0.20475783944129944,
-0.15722523629665375,
0.020893098786473274,
0.7314613461494446,
0.5599740147590637,
-0.42650026082992554,
-0.10620786994695663,
0.36866119503974915,
-0.6280205249786377,
-0.03730399161577225,
0.308260053396225,
-0.2829667031764984,
-0.2923462986946106,
0.02767164632678032,
0.9673066735267639,
0.10012340545654297,
-0.4163643717765808,
0.2372133433818817,
-0.230928435921669,
-0.330890953540802,
-0.3453620672225952,
0.08503200113773346,
0.2111327201128006,
0.31825751066207886,
0.15707820653915405,
0.019881054759025574,
-0.24106159806251526,
-0.7374655604362488,
-0.09197398275136948,
0.1433113068342209,
-0.2529330253601074,
-0.3351860046386719,
0.9354304671287537,
0.19452328979969025,
-0.1431707888841629,
0.623202919960022,
-0.16045476496219635,
-0.5384626388549805,
0.6298771500587463,
0.5486654043197632,
0.6972044110298157,
-0.43595099449157715,
0.003896149806678295,
0.5854575037956238,
0.5239840745925903,
-0.15906967222690582,
0.4793960452079773,
0.49762535095214844,
-0.6428351402282715,
-0.4562917649745941,
-0.5406333804130554,
-0.497648149728775,
0.4768218994140625,
-0.5292173624038696,
0.5634733438491821,
-0.5174829959869385,
-0.26008230447769165,
-0.29876580834388733,
0.2945038974285126,
-0.4534723460674286,
0.2990390658378601,
0.013897639699280262,
0.8770419359207153,
-0.7945436835289001,
0.8053998947143555,
0.6874608993530273,
-0.566443681716919,
-1.1026954650878906,
-0.37274235486984253,
-0.017965715378522873,
-0.6965615749359131,
0.1940988451242447,
0.09278114885091782,
0.11765694618225098,
0.05888967588543892,
-0.640692412853241,
-0.953192412853241,
1.3280576467514038,
0.518949031829834,
-0.5371548533439636,
0.282499760389328,
-0.000597212347202003,
0.6113558411598206,
-0.05449238792061806,
0.5295457243919373,
0.6231254935264587,
0.5836272835731506,
0.15957927703857422,
-1.0324125289916992,
0.34572651982307434,
-0.3266581594944,
-0.12429558485746384,
0.07496146857738495,
-1.144336223602295,
0.823376476764679,
-0.12973204255104065,
-0.027777953073382378,
0.250089555978775,
0.8981980085372925,
0.7704677581787109,
0.3570285141468048,
0.5744935274124146,
0.6846086382865906,
0.7027783393859863,
-0.2165556401014328,
1.1037204265594482,
-0.38902491331100464,
0.4365741014480591,
0.658458948135376,
0.04647847265005112,
0.7431302666664124,
0.07040068507194519,
-0.243705615401268,
0.6068236231803894,
1.0840624570846558,
-0.130364790558815,
0.5646767616271973,
-0.012007910758256912,
0.13264542818069458,
-0.06132826209068298,
0.2125590443611145,
-0.6580094695091248,
0.14291323721408844,
0.4906020760536194,
-0.06596074253320694,
-0.05889862775802612,
-0.09908000379800797,
0.42689380049705505,
-0.2225932627916336,
-0.14779503643512726,
0.49811720848083496,
0.25136759877204895,
-0.6571682691574097,
1.288586974143982,
0.013265791349112988,
0.7602744698524475,
-0.8905661106109619,
0.15833206474781036,
-0.42120757699012756,
0.3006596565246582,
-0.34843024611473083,
-0.726544201374054,
0.31922733783721924,
-0.04743894189596176,
0.15037107467651367,
0.2054291069507599,
0.7719807624816895,
-0.20481906831264496,
-0.333330363035202,
0.49359503388404846,
0.09635180234909058,
0.3920922577381134,
0.29963308572769165,
-0.967557966709137,
0.36159026622772217,
0.09506694972515106,
-0.60673987865448,
0.34763920307159424,
0.4179717004299164,
-0.025480590760707855,
0.7949923872947693,
0.7878354787826538,
-0.14512033760547638,
0.4405873715877533,
-0.13206331431865692,
1.0353636741638184,
-0.42955055832862854,
-0.3693329989910126,
-0.7544209957122803,
0.5723018646240234,
0.1017131581902504,
-0.5362550020217896,
0.8629010915756226,
0.5769041180610657,
0.8200311064720154,
0.17653201520442963,
0.743019163608551,
-0.17629407346248627,
0.4894988238811493,
-0.48278528451919556,
0.7128432393074036,
-0.5091690421104431,
0.31515297293663025,
-0.23200689256191254,
-1.005974531173706,
-0.2362651377916336,
0.8072806000709534,
-0.2524881660938263,
0.09471022337675095,
0.573244035243988,
0.9582818746566772,
-0.09277864545583725,
0.018902190029621124,
0.18204593658447266,
0.7190207839012146,
0.5482064485549927,
0.5700461864471436,
0.6944646239280701,
-0.6336264610290527,
1.0527924299240112,
-0.5923726558685303,
-0.4688473641872406,
-0.28827613592147827,
-1.037472128868103,
-1.146761417388916,
-0.46740737557411194,
-0.4633060693740845,
-0.6945990324020386,
0.06209302693605423,
0.7292546033859253,
0.6692902445793152,
-0.75436931848526,
-0.3926438093185425,
-0.12199717015028,
0.013807738199830055,
-0.3278347849845886,
-0.18806545436382294,
0.49694862961769104,
-0.09426683187484741,
-0.7633683681488037,
0.30367133021354675,
0.0022936773020774126,
0.4259802997112274,
-0.39726006984710693,
-0.2338949739933014,
-0.26128220558166504,
0.10490472614765167,
0.34826770424842834,
0.5882576107978821,
-0.4805341958999634,
-0.36403438448905945,
0.1457153558731079,
-0.05847989767789841,
-0.01164659671485424,
0.004982075188308954,
-0.5733217597007751,
0.3146932125091553,
0.538672149181366,
0.4246950149536133,
0.8184695243835449,
-0.2504623234272003,
0.39351460337638855,
-0.38631612062454224,
0.2644813656806946,
-0.06447497755289078,
0.4945087432861328,
0.22602559626102448,
-0.238310307264328,
0.6363365650177002,
0.34301984310150146,
-0.8322969079017639,
-0.9414904713630676,
0.08603362739086151,
-1.3628132343292236,
-0.027931759133934975,
1.2355092763900757,
-0.27354252338409424,
-0.4436526596546173,
-0.1632099747657776,
-0.4520588517189026,
0.6201698780059814,
-0.5233384966850281,
1.0417355298995972,
0.4584749937057495,
0.06527995318174362,
-0.3048640489578247,
-0.6285671591758728,
0.4433572590351105,
0.36800193786621094,
-0.7402790784835815,
-0.19910189509391785,
0.26504775881767273,
0.38238590955734253,
0.3076252043247223,
0.5043210983276367,
-0.3846554756164551,
0.2583233416080475,
-0.21614722907543182,
0.1709345281124115,
-0.1753181368112564,
-0.06609373539686203,
-0.17626719176769257,
-0.23531413078308105,
-0.13092365860939026,
-0.3128204047679901
] |
facebook/bart-large-mnli | facebook | "2023-09-05T14:49:34Z" | 2,900,740 | 754 | transformers | [
"transformers",
"pytorch",
"jax",
"rust",
"safetensors",
"bart",
"text-classification",
"zero-shot-classification",
"dataset:multi_nli",
"arxiv:1910.13461",
"arxiv:1909.00161",
"license:mit",
"endpoints_compatible",
"has_space",
"region:us"
] | zero-shot-classification | "2022-03-02T23:29:05Z" | ---
license: mit
thumbnail: https://huggingface.co/front/thumbnails/facebook.png
pipeline_tag: zero-shot-classification
datasets:
- multi_nli
---
# bart-large-mnli
This is the checkpoint for [bart-large](https://huggingface.co/facebook/bart-large) after being trained on the [MultiNLI (MNLI)](https://huggingface.co/datasets/multi_nli) dataset.
Additional information about this model:
- The [bart-large](https://huggingface.co/facebook/bart-large) model page
- [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
](https://arxiv.org/abs/1910.13461)
- [BART fairseq implementation](https://github.com/pytorch/fairseq/tree/master/fairseq/models/bart)
## NLI-based Zero Shot Text Classification
[Yin et al.](https://arxiv.org/abs/1909.00161) proposed a method for using pre-trained NLI models as a ready-made zero-shot sequence classifiers. The method works by posing the sequence to be classified as the NLI premise and to construct a hypothesis from each candidate label. For example, if we want to evaluate whether a sequence belongs to the class "politics", we could construct a hypothesis of `This text is about politics.`. The probabilities for entailment and contradiction are then converted to label probabilities.
This method is surprisingly effective in many cases, particularly when used with larger pre-trained models like BART and Roberta. See [this blog post](https://joeddav.github.io/blog/2020/05/29/ZSL.html) for a more expansive introduction to this and other zero shot methods, and see the code snippets below for examples of using this model for zero-shot classification both with Hugging Face's built-in pipeline and with native Transformers/PyTorch code.
#### With the zero-shot classification pipeline
The model can be loaded with the `zero-shot-classification` pipeline like so:
```python
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="facebook/bart-large-mnli")
```
You can then use this pipeline to classify sequences into any of the class names you specify.
```python
sequence_to_classify = "one day I will see the world"
candidate_labels = ['travel', 'cooking', 'dancing']
classifier(sequence_to_classify, candidate_labels)
#{'labels': ['travel', 'dancing', 'cooking'],
# 'scores': [0.9938651323318481, 0.0032737774308770895, 0.002861034357920289],
# 'sequence': 'one day I will see the world'}
```
If more than one candidate label can be correct, pass `multi_label=True` to calculate each class independently:
```python
candidate_labels = ['travel', 'cooking', 'dancing', 'exploration']
classifier(sequence_to_classify, candidate_labels, multi_label=True)
#{'labels': ['travel', 'exploration', 'dancing', 'cooking'],
# 'scores': [0.9945111274719238,
# 0.9383890628814697,
# 0.0057061901316046715,
# 0.0018193122232332826],
# 'sequence': 'one day I will see the world'}
```
#### With manual PyTorch
```python
# pose sequence as a NLI premise and label as a hypothesis
from transformers import AutoModelForSequenceClassification, AutoTokenizer
nli_model = AutoModelForSequenceClassification.from_pretrained('facebook/bart-large-mnli')
tokenizer = AutoTokenizer.from_pretrained('facebook/bart-large-mnli')
premise = sequence
hypothesis = f'This example is {label}.'
# run through model pre-trained on MNLI
x = tokenizer.encode(premise, hypothesis, return_tensors='pt',
truncation_strategy='only_first')
logits = nli_model(x.to(device))[0]
# we throw away "neutral" (dim 1) and take the probability of
# "entailment" (2) as the probability of the label being true
entail_contradiction_logits = logits[:,[0,2]]
probs = entail_contradiction_logits.softmax(dim=1)
prob_label_is_true = probs[:,1]
```
| [
-0.37607020139694214,
-0.5773875117301941,
0.3298405706882477,
0.13194409012794495,
-0.024266503751277924,
-0.13219919800758362,
0.024292996153235435,
-0.37892594933509827,
0.31868380308151245,
0.33929935097694397,
-0.6636547446250916,
-0.6483103036880493,
-0.4334248900413513,
0.18171559274196625,
-0.33315426111221313,
1.1901085376739502,
0.05942007154226303,
-0.2397087663412094,
0.02872704155743122,
-0.15664653480052948,
-0.31780171394348145,
-0.5013366937637329,
-0.4875956177711487,
-0.32199105620384216,
0.5868814587593079,
0.23584316670894623,
0.5505878329277039,
0.32259616255760193,
0.34078702330589294,
0.3005506694316864,
-0.16631737351417542,
-0.18890535831451416,
-0.20931772887706757,
-0.1461016833782196,
0.08328083157539368,
-0.5774343609809875,
-0.4000644385814667,
0.18802879750728607,
0.7123473286628723,
0.5913857221603394,
-0.012970020063221455,
0.4778271019458771,
-0.12314838171005249,
0.4602139890193939,
-0.6607846021652222,
0.03291710093617439,
-0.4659368693828583,
0.3296249210834503,
-0.03371647745370865,
-0.09277508407831192,
-0.4742242395877838,
-0.28063249588012695,
0.15238624811172485,
-0.6394926309585571,
0.2705594003200531,
-0.07426463812589645,
1.1471469402313232,
0.21145804226398468,
-0.4079814851284027,
-0.07364138960838318,
-0.435981422662735,
0.9042938947677612,
-0.9525423645973206,
0.1620667725801468,
0.21637161076068878,
0.2155984342098236,
-0.12373065948486328,
-0.6170580387115479,
-0.9400507211685181,
0.00407783780246973,
-0.03385660797357559,
0.30273687839508057,
0.01281454786658287,
0.05429590120911598,
0.5507811903953552,
0.38746926188468933,
-0.9314277172088623,
-0.10315170884132385,
-0.34263160824775696,
-0.27482685446739197,
0.7740126848220825,
0.06390601396560669,
0.25156670808792114,
-0.481534868478775,
-0.31279319524765015,
-0.4130173623561859,
-0.45577406883239746,
0.09685632586479187,
0.22558914124965668,
0.2824718952178955,
-0.2709141671657562,
0.6030061841011047,
-0.3463205099105835,
0.8910102248191833,
0.06132521107792854,
-0.39372318983078003,
0.825433075428009,
-0.2773714065551758,
-0.3797321319580078,
0.2072409689426422,
0.9404522180557251,
0.41764310002326965,
0.1779741495847702,
0.14192605018615723,
-0.0033413071651011705,
0.14500421285629272,
-0.2137020081281662,
-0.9520101547241211,
-0.11367526650428772,
0.3280072510242462,
-0.41621124744415283,
-0.5195963382720947,
0.06583673506975174,
-0.5922907590866089,
-0.14871634542942047,
-0.3208642601966858,
0.8977238535881042,
-0.48372572660446167,
-0.2106737196445465,
0.22959944605827332,
-0.2901778221130371,
0.3387424945831299,
0.20168913900852203,
-0.5252636671066284,
-0.09531469643115997,
0.4801933467388153,
0.9705644249916077,
0.29396581649780273,
-0.3534761965274811,
-0.33459943532943726,
-0.06279736012220383,
-0.24315054714679718,
0.4624837636947632,
-0.23337692022323608,
-0.031285159289836884,
-0.15879331529140472,
0.19155138731002808,
-0.20174384117126465,
-0.2910940945148468,
0.4844835698604584,
-0.44114887714385986,
0.4049927890300751,
0.04450851306319237,
-0.6597055792808533,
-0.3855800926685333,
0.47464054822921753,
-0.45868030190467834,
0.7545104622840881,
-0.03985583037137985,
-1.005781888961792,
0.22375455498695374,
-0.661383330821991,
-0.4107428789138794,
-0.020198127254843712,
0.025404708459973335,
-0.5767425894737244,
-0.10383051633834839,
0.1279602348804474,
0.5074130296707153,
0.010707810521125793,
0.4586848318576813,
-0.3852112889289856,
-0.4782103896141052,
0.3337813913822174,
-0.38570353388786316,
1.207957148551941,
0.33339381217956543,
-0.4107476770877838,
0.12751120328903198,
-0.880259096622467,
0.20875191688537598,
0.21569325029850006,
-0.24625398218631744,
-0.15138211846351624,
-0.3242344558238983,
0.11074262112379074,
0.3088386654853821,
0.1167912632226944,
-0.6927722692489624,
0.2505456209182739,
-0.48141002655029297,
0.5731997489929199,
0.5182079076766968,
0.12089714407920837,
0.2605226933956146,
-0.32743412256240845,
0.2826763093471527,
0.13182203471660614,
0.20238718390464783,
-0.47022026777267456,
-0.6967762112617493,
-0.9111568927764893,
-0.04495260864496231,
0.4872802197933197,
0.8182129263877869,
-0.766420841217041,
0.8532730340957642,
-0.24092887341976166,
-0.6622464060783386,
-0.41992953419685364,
-0.2506830394268036,
0.301318496465683,
0.4642682373523712,
0.4195396602153778,
-0.3405262231826782,
-0.7193127274513245,
-0.5932842493057251,
-0.06688833981752396,
-0.20920449495315552,
-0.10063783824443817,
0.04387775436043739,
0.5888882279396057,
-0.3174208700656891,
0.9880391359329224,
-0.5131531953811646,
-0.23351310193538666,
-0.17728233337402344,
0.2814118266105652,
0.7426048517227173,
0.6267625689506531,
0.4495573043823242,
-0.6642594933509827,
-0.4397701621055603,
-0.2695893347263336,
-1.008970856666565,
0.1219061091542244,
-0.34946396946907043,
-0.25477370619773865,
0.3309785723686218,
0.34981173276901245,
-0.55463707447052,
0.6745839715003967,
0.2290966659784317,
-0.41143089532852173,
0.5200608968734741,
0.04137220233678818,
-0.05956890806555748,
-1.0470033884048462,
0.15954391658306122,
0.0820462554693222,
-0.14547446370124817,
-0.7686599493026733,
0.09715814143419266,
-0.020406240597367287,
-0.16910725831985474,
-0.48925697803497314,
0.562027096748352,
-0.26040178537368774,
0.02185487002134323,
-0.1027207002043724,
-0.03114527463912964,
0.07332921773195267,
0.5912980437278748,
0.15581338107585907,
0.18599089980125427,
0.8418335914611816,
-0.7231882214546204,
0.2890978455543518,
0.40416234731674194,
-0.4333297312259674,
0.35614287853240967,
-0.5872688889503479,
-0.06817323714494705,
-0.35914915800094604,
0.47910061478614807,
-0.9772513508796692,
-0.3227476477622986,
0.46913620829582214,
-0.6136446595191956,
0.2959207594394684,
0.02423003688454628,
-0.42701610922813416,
-0.6257359981536865,
-0.22500057518482208,
0.41470569372177124,
0.5891444087028503,
-0.5952763557434082,
0.4290607273578644,
0.09295545518398285,
0.21175488829612732,
-0.7533705234527588,
-0.8455681800842285,
0.08002831041812897,
-0.20669078826904297,
-0.35482561588287354,
0.32204774022102356,
-0.23477572202682495,
0.044421643018722534,
-0.01932104304432869,
0.015973228961229324,
0.04834100231528282,
0.018787719309329987,
0.3296172022819519,
0.46706733107566833,
-0.22775483131408691,
0.008745999075472355,
-0.08251620829105377,
-0.17600110173225403,
-0.010718739591538906,
-0.33849430084228516,
0.5861152410507202,
-0.317298948764801,
-0.20602816343307495,
-0.7775776982307434,
0.07311925292015076,
0.36049458384513855,
-0.007142252288758755,
0.7061206698417664,
0.845353364944458,
-0.43420282006263733,
0.06322774291038513,
-0.5116361975669861,
-0.04736766591668129,
-0.4812583029270172,
0.3171839118003845,
-0.40506699681282043,
-0.63511723279953,
0.38902923464775085,
0.17130020260810852,
0.1383833885192871,
0.6967337727546692,
0.3069268465042114,
0.04692075029015541,
0.8862926959991455,
0.5013698935508728,
-0.15737241506576538,
0.4099535048007965,
-0.6739093065261841,
0.30557405948638916,
-0.679602861404419,
-0.16556978225708008,
-0.16888387501239777,
-0.4544547200202942,
-0.6212237477302551,
-0.40736788511276245,
0.29596471786499023,
0.3003448247909546,
-0.6111498475074768,
0.6313036680221558,
-0.6896451115608215,
0.5920222401618958,
0.7068800926208496,
0.1472204029560089,
0.18657523393630981,
0.031271129846572876,
-0.021894032135605812,
0.08972849696874619,
-0.7397799491882324,
-0.30514460802078247,
1.1861010789871216,
0.3543412387371063,
0.4850780963897705,
-0.07386597990989685,
1.1007280349731445,
-0.028069963678717613,
0.529857873916626,
-0.7696338295936584,
0.7642377018928528,
-0.11404573917388916,
-0.8145554661750793,
-0.34221354126930237,
-0.5084848403930664,
-0.8929850459098816,
0.3001232147216797,
-0.3534616231918335,
-0.5829550623893738,
0.2756481170654297,
-0.1044694110751152,
-0.5756683945655823,
0.35755622386932373,
-0.6218259334564209,
1.0925967693328857,
-0.22888535261154175,
-0.18861395120620728,
0.038809794932603836,
-0.939326822757721,
0.42669010162353516,
-0.0301510039716959,
0.22489604353904724,
-0.2993665933609009,
0.27974432706832886,
0.7929604649543762,
-0.3337564766407013,
0.99281245470047,
-0.34341949224472046,
0.09572961181402206,
0.6116049885749817,
-0.14402562379837036,
-0.0048669008538126945,
0.043836113065481186,
-0.16132806241512299,
0.44079339504241943,
0.14022086560726166,
-0.35600942373275757,
-0.4530998766422272,
0.496379554271698,
-0.765781581401825,
-0.2710847854614258,
-0.655590295791626,
-0.3507877588272095,
0.14012223482131958,
0.284028023481369,
0.5618124604225159,
0.5491664409637451,
-0.11882875114679337,
-0.07789694517850876,
0.3891225755214691,
-0.5947331786155701,
0.6772863268852234,
0.3530566692352295,
-0.3433228135108948,
-0.5307471752166748,
1.1645121574401855,
0.06262679398059845,
0.20714806020259857,
0.4233328700065613,
0.24990925192832947,
-0.3326478600502014,
-0.0761360377073288,
-0.4406541585922241,
0.34334057569503784,
-0.6722363233566284,
-0.4033697843551636,
-0.6342973709106445,
-0.6214593648910522,
-0.6143040060997009,
-0.07330048084259033,
-0.050123557448387146,
-0.5972568392753601,
-0.18743576109409332,
-0.046473175287246704,
0.29636672139167786,
0.4353109896183014,
-0.2549118101596832,
0.21347881853580475,
-0.7567077279090881,
0.33803194761276245,
0.2216196358203888,
0.22321176528930664,
0.09388380497694016,
-0.7181774377822876,
-0.021399952471256256,
0.07215946912765503,
-0.5599408745765686,
-0.8604090809822083,
0.5144705176353455,
0.5450656414031982,
0.45231613516807556,
0.5814672112464905,
0.15878506004810333,
0.8203549385070801,
-0.5697171092033386,
0.7022714614868164,
0.49717026948928833,
-1.0105918645858765,
0.7411200404167175,
-0.06532111763954163,
0.24746538698673248,
0.37889984250068665,
0.6684102416038513,
-0.6976367235183716,
-0.4310459792613983,
-0.8057841062545776,
-0.8546340465545654,
0.7840520739555359,
0.2595527172088623,
0.09359509497880936,
-0.14735260605812073,
0.432655394077301,
-0.03038511797785759,
0.22105549275875092,
-1.2325116395950317,
-0.5002480745315552,
-0.4699067175388336,
-0.4243723452091217,
-0.3917573094367981,
0.04395407438278198,
-0.061328645795583725,
-0.6447187662124634,
0.7614830732345581,
-0.15863315761089325,
0.4418971538543701,
0.5218262076377869,
-0.11019447445869446,
0.011895851232111454,
0.23637861013412476,
0.3354458212852478,
0.2966415286064148,
-0.3370262384414673,
0.026160603389143944,
0.19685621559619904,
-0.3157782554626465,
0.2615739107131958,
0.10587311536073685,
-0.4488022029399872,
0.2154737412929535,
0.4736504554748535,
1.0618095397949219,
0.02163233794271946,
-0.7164149284362793,
0.6388651132583618,
0.13082745671272278,
-0.380543977022171,
-0.4964083731174469,
0.0990505963563919,
-0.11670362949371338,
0.27797430753707886,
0.2550436854362488,
0.14653746783733368,
0.21163617074489594,
-0.7362651228904724,
0.25805044174194336,
0.25519439578056335,
-0.17571479082107544,
-0.36908963322639465,
0.7316837310791016,
-0.09909381717443466,
-0.2838769555091858,
0.5893388390541077,
-0.5653665065765381,
-0.6563434600830078,
0.8213592171669006,
0.6115197539329529,
0.9043941497802734,
-0.14850164949893951,
0.4966806471347809,
1.0632973909378052,
0.12631916999816895,
-0.12474656105041504,
0.16148842871189117,
-0.07184462249279022,
-0.869109034538269,
-0.5128819346427917,
-0.9389704465866089,
-0.2900203466415405,
0.22677022218704224,
-0.6302513480186462,
0.2878827452659607,
-0.5761218070983887,
-0.17182712256908417,
0.2510405480861664,
-0.11710971593856812,
-0.6743456721305847,
0.2713630199432373,
0.465057373046875,
0.7482466697692871,
-1.012362003326416,
0.7341246604919434,
0.5930498838424683,
-0.4304106533527374,
-0.7584324479103088,
0.01950976252555847,
-0.03682221844792366,
-0.6258314847946167,
0.6938652992248535,
0.834657609462738,
0.28600013256073,
-0.0026249210350215435,
-0.7150349020957947,
-0.9682704210281372,
1.0328415632247925,
-0.052347779273986816,
-0.5398770570755005,
0.014098243787884712,
0.11904073506593704,
0.5937420725822449,
-0.2166806161403656,
0.3834616243839264,
0.4599240720272064,
0.41542848944664,
0.3246956467628479,
-0.7664445638656616,
0.1430440992116928,
-0.32511746883392334,
-0.11879323422908783,
0.13277554512023926,
-0.5192264914512634,
0.8709200620651245,
-0.49744439125061035,
-0.24632865190505981,
0.18806347250938416,
0.6866868138313293,
0.4312509000301361,
0.6769979596138,
0.7317085266113281,
0.8575363755226135,
0.6974647641181946,
-0.12228711694478989,
0.7716189026832581,
-0.13514144718647003,
0.5936989188194275,
0.9352919459342957,
-0.209844708442688,
0.9951282739639282,
0.1292516589164734,
-0.40676793456077576,
0.7751505970954895,
0.8201449513435364,
-0.2578737139701843,
0.5379267930984497,
0.2776276469230652,
-0.251848965883255,
-0.26007455587387085,
0.15736061334609985,
-0.43457427620887756,
0.3693191111087799,
0.2759343385696411,
-0.11804111301898956,
-0.1368110030889511,
0.25427961349487305,
-0.17195159196853638,
-0.3489355742931366,
-0.171639546751976,
0.6847841739654541,
0.04856123402714729,
-0.8277589082717896,
0.8823896050453186,
0.008499789983034134,
0.9494928121566772,
-0.34386733174324036,
0.10436775535345078,
0.023048020899295807,
0.2753466069698334,
-0.36806532740592957,
-0.8185334801673889,
0.2975979149341583,
-0.12667769193649292,
0.03343166410923004,
-0.05755363777279854,
0.5543110966682434,
-0.5670504570007324,
-0.6280055046081543,
0.17119210958480835,
0.09615237265825272,
0.4312218725681305,
-0.09018076956272125,
-0.8976014256477356,
-0.2057829648256302,
0.11154064536094666,
-0.30008265376091003,
0.2644517123699188,
0.3364397883415222,
0.17549176514148712,
0.5223145484924316,
0.6916126012802124,
-0.2948162853717804,
0.15506090223789215,
0.11715178936719894,
0.6608696579933167,
-0.871502161026001,
-0.42720305919647217,
-0.8327684998512268,
0.5376566052436829,
-0.045735690742731094,
-0.3126523494720459,
0.6662542819976807,
0.6367449164390564,
0.8895072937011719,
-0.18470612168312073,
0.5585455298423767,
-0.3181731700897217,
0.3936823010444641,
-0.32727116346359253,
0.5470278859138489,
-0.8245409727096558,
-0.1482289880514145,
-0.3682584762573242,
-0.7811840772628784,
-0.5950289964675903,
0.9713569283485413,
-0.11735960096120834,
-0.05793916806578636,
0.48458507657051086,
0.7354776263237,
0.14486338198184967,
0.07996969670057297,
0.1168263703584671,
0.26126980781555176,
0.15938414633274078,
0.7887998223304749,
0.7695754766464233,
-0.8602264523506165,
0.40239858627319336,
-0.516591489315033,
-0.33351051807403564,
-0.05913979932665825,
-0.8007445335388184,
-0.9287341833114624,
-0.4878724217414856,
-0.6699455380439758,
-0.48494794964790344,
-0.16925141215324402,
0.7668303847312927,
0.6667464971542358,
-0.9810675978660583,
-0.14431272447109222,
-0.2724570631980896,
0.046394240111112595,
-0.20946264266967773,
-0.34829434752464294,
0.2988733649253845,
-0.29288041591644287,
-0.7380021810531616,
0.2029225081205368,
0.06110657751560211,
0.23776091635227203,
0.014872322790324688,
-0.04221649840474129,
-0.2941591739654541,
-0.08879456669092178,
0.677401065826416,
0.44594764709472656,
-0.7709274888038635,
-0.20588062703609467,
0.030843030661344528,
0.05265389382839203,
0.050203610211610794,
0.29378145933151245,
-0.8548269867897034,
0.2772659659385681,
0.42267560958862305,
0.3545394539833069,
0.6818253397941589,
-0.07303392887115479,
0.06894296407699585,
-0.6257811784744263,
0.31751036643981934,
0.14144133031368256,
0.29442840814590454,
0.27472826838493347,
-0.1883796602487564,
0.6546717882156372,
0.47983962297439575,
-0.6597846746444702,
-0.9102944135665894,
0.1528155505657196,
-1.1676440238952637,
-0.3223971426486969,
0.9938880801200867,
-0.08418378978967667,
-0.3716292083263397,
0.1216173768043518,
-0.06642106175422668,
0.3707634508609772,
-0.019871214404702187,
0.6466339230537415,
0.4574125409126282,
-0.1252121925354004,
0.019707461819052696,
-0.5862954258918762,
0.2619131803512573,
0.4497097134590149,
-0.6055817008018494,
-0.3587195575237274,
0.1923048198223114,
0.50308758020401,
0.6260056495666504,
0.6629961729049683,
-0.028782689943909645,
0.057660214602947235,
-0.01516331173479557,
0.3532351851463318,
0.163309708237648,
-0.2699339985847473,
-0.39789316058158875,
0.08844204992055893,
-0.3618650436401367,
-0.39155542850494385
] |
nateraw/vit-age-classifier | nateraw | "2023-09-19T15:53:10Z" | 2,820,991 | 62 | transformers | [
"transformers",
"pytorch",
"vit",
"image-classification",
"dataset:fairface",
"doi:10.57967/hf/1259",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | image-classification | "2022-03-02T23:29:05Z" | ---
tags:
- image-classification
- pytorch
datasets:
- fairface
---
A vision transformer finetuned to classify the age of a given person's face.
```python
import requests
from PIL import Image
from io import BytesIO
from transformers import ViTFeatureExtractor, ViTForImageClassification
# Get example image from official fairface repo + read it in as an image
r = requests.get('https://github.com/dchen236/FairFace/blob/master/detected_faces/race_Asian_face0.jpg?raw=true')
im = Image.open(BytesIO(r.content))
# Init model, transforms
model = ViTForImageClassification.from_pretrained('nateraw/vit-age-classifier')
transforms = ViTFeatureExtractor.from_pretrained('nateraw/vit-age-classifier')
# Transform our image and pass it through the model
inputs = transforms(im, return_tensors='pt')
output = model(**inputs)
# Predicted Class probabilities
proba = output.logits.softmax(1)
# Predicted Classes
preds = proba.argmax(1)
``` | [
-0.4082125127315521,
-0.3418203294277191,
0.26698926091194153,
0.19221821427345276,
-0.06216701865196228,
-0.32742831110954285,
0.19444367289543152,
-0.43738415837287903,
-0.29527661204338074,
0.43287214636802673,
-0.6152831315994263,
-0.15836867690086365,
-0.5482438802719116,
-0.007518466096371412,
-0.2940252125263214,
0.9152114391326904,
0.0953846275806427,
0.12395209074020386,
-0.033175475895404816,
-0.16415326297283173,
-0.42035922408103943,
0.1605985015630722,
-0.7431370615959167,
-0.4809991419315338,
0.09317993372678757,
0.4492531716823578,
0.7478705644607544,
0.28863027691841125,
0.4253678619861603,
0.5787213444709778,
-0.20130962133407593,
-0.1626618206501007,
-0.281543105840683,
-0.15975958108901978,
-0.27513569593429565,
-0.9542778730392456,
-0.30332908034324646,
0.27847015857696533,
0.40682610869407654,
0.6554020047187805,
-0.019546134397387505,
0.3833651542663574,
-0.05652078613638878,
0.7680647969245911,
-0.5908461809158325,
0.3288613259792328,
-0.4621741473674774,
0.3101102113723755,
-0.3882159888744354,
-0.0936974585056305,
-0.4949987232685089,
-0.31654930114746094,
0.30589544773101807,
-0.6240967512130737,
0.5325609445571899,
0.0686933845281601,
1.1302624940872192,
0.28863444924354553,
-0.13357174396514893,
0.360770583152771,
-0.5626189708709717,
0.7706438899040222,
-0.3596361577510834,
0.3671659231185913,
0.008798511698842049,
0.9912013411521912,
0.06830492615699768,
-1.0996499061584473,
-0.8357822895050049,
0.03164895996451378,
0.02854951098561287,
-0.13035385310649872,
-0.44057074189186096,
0.03374968096613884,
0.5184820294380188,
0.5859826803207397,
-0.5294663906097412,
-0.18418021500110626,
-0.9766626358032227,
-0.38253480195999146,
0.5848309397697449,
0.15177957713603973,
0.3800545930862427,
-0.11476590484380722,
-0.6387184262275696,
-0.42785096168518066,
-0.028522193431854248,
0.5478724837303162,
0.20063574612140656,
0.13102293014526367,
-0.31338658928871155,
0.6900951266288757,
-0.6695011854171753,
0.7385666370391846,
0.7253409624099731,
-0.3831356465816498,
0.9234169125556946,
0.21534590423107147,
-0.43231263756752014,
-0.11202169209718704,
0.520935595035553,
0.7582312822341919,
0.7969452738761902,
0.17500373721122742,
-0.3583414852619171,
0.2050115019083023,
0.10508807748556137,
-1.1725342273712158,
-0.38844916224479675,
-0.024465544149279594,
-0.68062824010849,
-0.4850853681564331,
0.3140869140625,
-0.91969233751297,
-0.21472018957138062,
-0.18784132599830627,
0.937436580657959,
-0.3458283543586731,
-0.1977570652961731,
0.0017896175850182772,
-0.33900773525238037,
0.39622199535369873,
0.5154817700386047,
-0.6460403203964233,
0.2634340524673462,
0.023319946601986885,
0.6584838628768921,
0.025765826925635338,
-0.17212964594364166,
-0.4937290847301483,
-0.370068222284317,
0.019703155383467674,
0.5929449796676636,
-0.15480682253837585,
-0.015579493716359138,
-0.06247301399707794,
0.6609825491905212,
-0.16444239020347595,
-0.8226820826530457,
0.4632682502269745,
-0.562347412109375,
0.4970102906227112,
0.45247411727905273,
-0.006067836191505194,
-0.4149179458618164,
0.03429796174168587,
-0.5950044989585876,
0.704122006893158,
0.6321377158164978,
-0.7292715311050415,
0.3888648450374603,
-0.39132484793663025,
-0.24393333494663239,
0.5382747054100037,
-0.18012495338916779,
-0.8733968734741211,
0.24222469329833984,
0.2073008120059967,
0.7332105040550232,
0.13703656196594238,
0.5028574466705322,
-0.3539265990257263,
-0.42511311173439026,
0.32741376757621765,
-0.7390787601470947,
1.1492806673049927,
0.4958045184612274,
-0.6043753623962402,
0.06236795336008072,
-0.7913113236427307,
-0.07187947630882263,
0.39710596203804016,
-0.1608465611934662,
0.1623162180185318,
-0.4022686183452606,
0.45965996384620667,
0.29749053716659546,
0.23968955874443054,
-0.8467941284179688,
0.04485879838466644,
-0.33274659514427185,
0.3772502839565277,
0.7276456356048584,
-0.3101837635040283,
0.5716291666030884,
-0.5910962224006653,
0.18486268818378448,
0.43465855717658997,
0.5536690950393677,
0.17480841279029846,
-0.655593752861023,
-1.0170958042144775,
0.016493577510118484,
-0.16251033544540405,
0.6415566205978394,
-1.0540531873703003,
0.16004909574985504,
-0.43437156081199646,
-0.61481112241745,
-0.1850692629814148,
-0.326987087726593,
0.07367179542779922,
0.5639551281929016,
0.4556824266910553,
-0.5407095551490784,
-0.5245854258537292,
-1.0706806182861328,
-0.07079266011714935,
-0.1921464055776596,
-0.11762436479330063,
0.04176739603281021,
0.4376739263534546,
-0.5381250381469727,
0.834876298904419,
-0.5977857708930969,
-0.5842562913894653,
0.0740816593170166,
-0.0619531013071537,
0.5989775657653809,
0.8403847217559814,
0.7692334055900574,
-1.1921250820159912,
-0.3676164150238037,
-0.21928773820400238,
-0.5396676659584045,
-0.07196202874183655,
0.06999523192644119,
-0.11062943935394287,
0.027296360582113266,
0.3443455696105957,
-0.37102997303009033,
0.9352129697799683,
0.20789732038974762,
-0.6285349726676941,
0.6415084004402161,
0.02919720858335495,
0.13923004269599915,
-0.5761256217956543,
0.15613660216331482,
0.2525736391544342,
-0.49030423164367676,
-0.5659303069114685,
-0.11028235405683517,
0.1241389811038971,
-0.3149879574775696,
-0.8928162455558777,
0.718392550945282,
-0.01782797835767269,
0.19347985088825226,
-0.07227063924074173,
-0.618736743927002,
-0.1396886706352234,
0.4813855290412903,
0.010682252235710621,
0.6082371473312378,
0.504547655582428,
-0.6318078637123108,
0.5777226090431213,
0.31813833117485046,
-0.4220665395259857,
0.8406199812889099,
-0.5017378926277161,
-0.21931307017803192,
-0.31431418657302856,
0.0372663214802742,
-0.9328367114067078,
-0.4917543828487396,
0.3863010108470917,
-0.5886221528053284,
0.3990519642829895,
-0.28334635496139526,
0.07136186957359314,
-0.6001128554344177,
-0.2738626003265381,
0.6536519527435303,
0.7025408744812012,
-0.7712107300758362,
0.9161026477813721,
0.1886850744485855,
0.014745973981916904,
-0.5912200808525085,
-1.1244903802871704,
-0.48345890641212463,
-0.23972320556640625,
-0.8947076797485352,
0.7483025193214417,
-0.005981130991131067,
-0.1928529590368271,
0.09264843165874481,
-0.181824192404747,
-0.30816197395324707,
-0.094147689640522,
0.41777303814888,
0.44293057918548584,
-0.2474546581506729,
-0.2394663542509079,
-0.1403469294309616,
-0.3312608301639557,
0.1508551388978958,
-0.10665620118379593,
0.6413078308105469,
-0.6797060370445251,
-0.010071429423987865,
-0.9157997965812683,
-0.16416126489639282,
0.6871330738067627,
-0.06355711072683334,
0.5437512397766113,
0.9345135688781738,
-0.5708739161491394,
-0.2572406828403473,
-0.6303993463516235,
0.02420566789805889,
-0.6093319654464722,
0.45638415217399597,
-0.5759862661361694,
-0.47497230768203735,
0.6824192404747009,
0.031634408980607986,
-0.15828710794448853,
1.0484563112258911,
0.48034805059432983,
0.025299828499555588,
0.9948136806488037,
0.6069253087043762,
0.4524107575416565,
0.8414480686187744,
-0.5708208084106445,
-0.23860818147659302,
-0.6234312653541565,
-0.6193638443946838,
-0.13225753605365753,
-0.5001437664031982,
-0.7403744459152222,
-0.2225867360830307,
0.16403116285800934,
-0.04034549742937088,
-0.7476816773414612,
0.29958128929138184,
-0.8961279392242432,
0.34374678134918213,
0.7138921618461609,
0.6697955131530762,
0.054257746785879135,
0.008976577781140804,
0.1520024836063385,
-0.11747905611991882,
-0.2911956012248993,
-0.24672771990299225,
0.9448603987693787,
0.4641517102718353,
1.0107157230377197,
-0.10311448574066162,
0.6953686475753784,
0.09436683356761932,
0.5729244947433472,
-0.716259241104126,
0.5751463770866394,
-0.6241747736930847,
-0.8454664349555969,
-0.10882610082626343,
-0.48116838932037354,
-0.9031886458396912,
0.13666556775569916,
-0.2974255383014679,
-0.7376292943954468,
0.6597334146499634,
0.0719803124666214,
-0.5141386389732361,
0.36352571845054626,
-0.7362782955169678,
1.0590474605560303,
-0.22993187606334686,
-0.3086867034435272,
0.08398117125034332,
-0.8771198391914368,
0.49161478877067566,
0.15462371706962585,
0.0180206298828125,
-0.38434168696403503,
0.603748619556427,
1.1374648809432983,
-0.3129456043243408,
0.8021427989006042,
-0.7860680818557739,
0.5830557942390442,
0.3130533993244171,
-0.12592050433158875,
-0.18270184099674225,
0.09354047477245331,
0.24250178039073944,
0.14064449071884155,
0.21551614999771118,
-0.27302786707878113,
-0.32133185863494873,
0.5410948991775513,
-0.983820378780365,
-0.5589151382446289,
-0.7172636389732361,
-0.386306494474411,
0.21441961824893951,
0.3292737603187561,
0.5648994445800781,
0.6098657846450806,
0.13817031681537628,
0.28898975253105164,
0.43037888407707214,
-0.2993324100971222,
0.4210813045501709,
-0.057481732219457626,
-0.5244315266609192,
-0.3114011883735657,
0.8318639993667603,
0.14299194514751434,
0.3545245826244354,
0.12944744527339935,
0.3655523359775543,
-0.1490805298089981,
-0.164964497089386,
-0.291502445936203,
-0.025466356426477432,
-0.9084804654121399,
-0.5194945335388184,
-0.20016109943389893,
-0.7472599148750305,
-0.5024780631065369,
-0.030491644516587257,
-0.18908868730068207,
-0.3776845335960388,
-0.3290334641933441,
0.42999932169914246,
0.19709856808185577,
0.23842258751392365,
-0.14444541931152344,
0.6425159573554993,
-0.46122995018959045,
0.4930228888988495,
0.7895650863647461,
0.37274467945098877,
-0.22459261119365692,
-0.7854794859886169,
0.3257550895214081,
-0.09128490835428238,
-0.6044301390647888,
-0.8109055161476135,
0.5990220904350281,
0.3988324999809265,
0.46666643023490906,
0.5885935425758362,
-0.014065206982195377,
0.6377519369125366,
-0.4978860318660736,
0.447633296251297,
0.52161705493927,
-0.9658015370368958,
0.5218124985694885,
0.11256960034370422,
0.2892571985721588,
0.6381960511207581,
0.042225297540426254,
-0.5457859039306641,
0.03426017239689827,
-0.8205110430717468,
-0.4838079810142517,
0.9299197196960449,
0.09570850431919098,
0.1274588257074356,
0.36695659160614014,
0.30612385272979736,
0.2628057599067688,
-0.17917737364768982,
-1.0740313529968262,
-0.36626824736595154,
-0.46054595708847046,
-0.5627102851867676,
0.180072620511055,
0.11567439138889313,
0.09746401011943817,
-0.6856208443641663,
0.5468869209289551,
-0.2933782637119293,
0.643684446811676,
0.2646785080432892,
-0.34899118542671204,
-0.2475142925977707,
-0.060418751090765,
0.4067571461200714,
0.5429370403289795,
-0.44323891401290894,
0.4113837778568268,
0.177035391330719,
-0.6721242070198059,
0.09537280350923538,
0.47621771693229675,
-0.08994381129741669,
-0.09348499029874802,
0.2214648723602295,
0.7416021227836609,
-0.19194528460502625,
-0.2517874538898468,
1.0924581289291382,
-0.34979483485221863,
-0.24696794152259827,
-0.5645884871482849,
0.3258199393749237,
-0.34777697920799255,
0.7225196361541748,
0.7714433670043945,
0.927256166934967,
0.2149731069803238,
-0.4014086127281189,
0.4028584659099579,
0.061202891170978546,
-0.49534669518470764,
-0.21285578608512878,
0.9298139214515686,
0.17630226910114288,
-0.49347731471061707,
0.8802037239074707,
-0.19560754299163818,
-0.8563973903656006,
0.8038510084152222,
0.2752854824066162,
0.8496006727218628,
-0.4157518446445465,
0.1380583941936493,
0.48246634006500244,
0.1581539511680603,
-0.007029607426375151,
0.20054063200950623,
0.16843925416469574,
-0.9306458830833435,
-0.35356956720352173,
-0.8341570496559143,
0.11380298435688019,
0.15391480922698975,
-0.7453247308731079,
0.5227249264717102,
-0.44502997398376465,
-0.3932914137840271,
0.4371822476387024,
0.0643467828631401,
-1.4697896242141724,
0.6402218341827393,
0.5017368197441101,
0.769752025604248,
-1.1393159627914429,
0.5929915904998779,
0.5043286085128784,
-0.4214929938316345,
-0.5792064666748047,
-0.42696306109428406,
-0.08536168187856674,
-1.272943377494812,
1.0450890064239502,
0.9071142077445984,
0.10015393048524857,
0.08459051698446274,
-0.9621633887290955,
-0.580318808555603,
1.1128491163253784,
0.3146950304508209,
-0.47752267122268677,
-0.13869179785251617,
-0.030444562435150146,
0.11162988096475601,
-0.1891808658838272,
0.22682535648345947,
0.3820234537124634,
0.49333101511001587,
0.07059107720851898,
-0.9517018795013428,
-0.08928655087947845,
-0.37857258319854736,
0.19076959788799286,
0.047066785395145416,
-0.3937664330005646,
1.263448715209961,
-0.3912840783596039,
-0.4640038311481476,
0.16088427603244781,
0.7705475687980652,
0.1373567432165146,
0.5063351392745972,
1.0762590169906616,
0.7220215797424316,
0.3141205310821533,
-0.36320897936820984,
0.7970805168151855,
0.26468294858932495,
0.6732923984527588,
0.3751457631587982,
0.4672146141529083,
0.5312179923057556,
0.4274457097053528,
-0.4372992515563965,
0.5534455180168152,
0.7022275924682617,
-0.4029795825481415,
0.7758144736289978,
0.15502330660820007,
-0.014352554455399513,
-0.2287021279335022,
0.2724578380584717,
-0.3968370258808136,
0.6408365368843079,
0.25108784437179565,
-0.30399373173713684,
-0.16152450442314148,
0.5015391111373901,
-0.31108641624450684,
-0.2602764070034027,
-0.5490362048149109,
0.3704376220703125,
0.0273144468665123,
-0.4023359417915344,
0.536041796207428,
0.08609312772750854,
1.0308783054351807,
-0.09204266965389252,
-0.1348106414079666,
0.02246822975575924,
0.9059475660324097,
-0.38818255066871643,
-1.144210934638977,
0.2978379428386688,
-0.4149109721183777,
-0.14002913236618042,
0.1589982509613037,
0.7758192420005798,
-0.5339296460151672,
-0.589211106300354,
0.014517027884721756,
0.18707329034805298,
0.1618167906999588,
-0.0750219076871872,
-0.7599351406097412,
-0.2243606448173523,
-0.015260855667293072,
-0.36643052101135254,
-0.07825703918933868,
0.32569682598114014,
-0.08378594368696213,
0.6777167320251465,
0.41371244192123413,
-0.26321884989738464,
0.20359894633293152,
-0.06463135778903961,
0.7297915816307068,
-0.4264619052410126,
-0.3538731634616852,
-0.6655579805374146,
0.6295621395111084,
-0.08020966500043869,
-0.7556354403495789,
0.21285121142864227,
0.4140305817127228,
1.172073483467102,
-0.2202630490064621,
0.20484229922294617,
-0.2471475452184677,
0.12370762228965759,
-0.380229115486145,
0.8280885219573975,
-0.6501215100288391,
-0.41950035095214844,
-0.13471947610378265,
-1.1830729246139526,
-0.38365843892097473,
1.1599432229995728,
-0.243046373128891,
0.266124963760376,
0.5188536643981934,
0.6189164519309998,
-0.24561750888824463,
-0.07065322250127792,
0.2112095206975937,
-0.13283203542232513,
0.28649747371673584,
0.7520259022712708,
0.7948974370956421,
-0.6206302046775818,
0.3368339240550995,
-0.7989049553871155,
-0.5061696171760559,
-0.36477333307266235,
-0.35746195912361145,
-0.7656213641166687,
-0.6315367221832275,
-0.25091856718063354,
-0.5879145860671997,
-0.3304969370365143,
0.6275396943092346,
1.0026575326919556,
-0.8768083453178406,
0.06277448683977127,
0.04304397851228714,
-0.2944658100605011,
-0.17264622449874878,
-0.37143898010253906,
0.3609207570552826,
-0.1140647754073143,
-0.9750269055366516,
-0.2402348816394806,
-0.12367963790893555,
0.4504375457763672,
-0.2563208043575287,
0.023939572274684906,
0.09377186745405197,
-0.5741884708404541,
0.3055272400379181,
0.21185116469860077,
-0.6972795128822327,
-0.4939812421798706,
-0.07869874686002731,
-0.11308199167251587,
0.32880401611328125,
0.16489312052726746,
-0.9601410031318665,
0.6119140386581421,
0.4727308452129364,
0.42231717705726624,
0.8863918781280518,
-0.1839120090007782,
0.16911961138248444,
-0.47619324922561646,
0.40380316972732544,
0.4092189073562622,
0.6439865827560425,
0.4097985029220581,
-0.29697385430336,
0.4894457161426544,
0.5577977895736694,
-0.5385628938674927,
-0.7007641792297363,
-0.08582472801208496,
-1.1981935501098633,
-0.1262681633234024,
0.7349677085876465,
-0.006674600299447775,
-0.6939281225204468,
0.060928117483854294,
-0.16985304653644562,
0.49962112307548523,
-0.1118665263056755,
0.41623303294181824,
0.07487871497869492,
0.05841619148850441,
-0.28055858612060547,
-0.3742084503173828,
0.2891402542591095,
0.22614942491054535,
-0.7361607551574707,
-0.6539683938026428,
0.094632089138031,
0.7060410380363464,
0.6646603345870972,
0.29776322841644287,
-0.2787548005580902,
0.5943043231964111,
0.15847498178482056,
0.3060440421104431,
-0.138877734541893,
-0.33664026856422424,
-0.3872494101524353,
0.2129996120929718,
-0.258766770362854,
-0.5624829530715942
] |
t5-small | null | "2023-06-30T02:31:26Z" | 2,629,831 | 174 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"onnx",
"safetensors",
"t5",
"text2text-generation",
"summarization",
"translation",
"en",
"fr",
"ro",
"de",
"multilingual",
"dataset:c4",
"arxiv:1805.12471",
"arxiv:1708.00055",
"arxiv:1704.05426",
"arxiv:1606.05250",
"arxiv:1808.09121",
"arxiv:1810.12885",
"arxiv:1905.10044",
"arxiv:1910.09700",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | translation | "2022-03-02T23:29:04Z" | ---
language:
- en
- fr
- ro
- de
- multilingual
license: apache-2.0
tags:
- summarization
- translation
datasets:
- c4
---
# Model Card for T5 Small
![model image](https://camo.githubusercontent.com/623b4dea0b653f2ad3f36c71ebfe749a677ac0a1/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f343030362f312a44304a31674e51663876727255704b657944387750412e706e67)
# Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
4. [Training Details](#training-details)
5. [Evaluation](#evaluation)
6. [Environmental Impact](#environmental-impact)
7. [Citation](#citation)
8. [Model Card Authors](#model-card-authors)
9. [How To Get Started With the Model](#how-to-get-started-with-the-model)
# Model Details
## Model Description
The developers of the Text-To-Text Transfer Transformer (T5) [write](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html):
> With T5, we propose reframing all NLP tasks into a unified text-to-text-format where the input and output are always text strings, in contrast to BERT-style models that can only output either a class label or a span of the input. Our text-to-text framework allows us to use the same model, loss function, and hyperparameters on any NLP task.
T5-Small is the checkpoint with 60 million parameters.
- **Developed by:** Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. See [associated paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) and [GitHub repo](https://github.com/google-research/text-to-text-transfer-transformer#released-model-checkpoints)
- **Model type:** Language model
- **Language(s) (NLP):** English, French, Romanian, German
- **License:** Apache 2.0
- **Related Models:** [All T5 Checkpoints](https://huggingface.co/models?search=t5)
- **Resources for more information:**
- [Research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf)
- [Google's T5 Blog Post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html)
- [GitHub Repo](https://github.com/google-research/text-to-text-transfer-transformer)
- [Hugging Face T5 Docs](https://huggingface.co/docs/transformers/model_doc/t5)
# Uses
## Direct Use and Downstream Use
The developers write in a [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) that the model:
> Our text-to-text framework allows us to use the same model, loss function, and hyperparameters on any NLP task, including machine translation, document summarization, question answering, and classification tasks (e.g., sentiment analysis). We can even apply T5 to regression tasks by training it to predict the string representation of a number instead of the number itself.
See the [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) and [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for further details.
## Out-of-Scope Use
More information needed.
# Bias, Risks, and Limitations
More information needed.
## Recommendations
More information needed.
# Training Details
## Training Data
The model is pre-trained on the [Colossal Clean Crawled Corpus (C4)](https://www.tensorflow.org/datasets/catalog/c4), which was developed and released in the context of the same [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) as T5.
The model was pre-trained on a on a **multi-task mixture of unsupervised (1.) and supervised tasks (2.)**.
Thereby, the following datasets were being used for (1.) and (2.):
1. **Datasets used for Unsupervised denoising objective**:
- [C4](https://huggingface.co/datasets/c4)
- [Wiki-DPR](https://huggingface.co/datasets/wiki_dpr)
2. **Datasets used for Supervised text-to-text language modeling objective**
- Sentence acceptability judgment
- CoLA [Warstadt et al., 2018](https://arxiv.org/abs/1805.12471)
- Sentiment analysis
- SST-2 [Socher et al., 2013](https://nlp.stanford.edu/~socherr/EMNLP2013_RNTN.pdf)
- Paraphrasing/sentence similarity
- MRPC [Dolan and Brockett, 2005](https://aclanthology.org/I05-5002)
- STS-B [Ceret al., 2017](https://arxiv.org/abs/1708.00055)
- QQP [Iyer et al., 2017](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs)
- Natural language inference
- MNLI [Williams et al., 2017](https://arxiv.org/abs/1704.05426)
- QNLI [Rajpurkar et al.,2016](https://arxiv.org/abs/1606.05250)
- RTE [Dagan et al., 2005](https://link.springer.com/chapter/10.1007/11736790_9)
- CB [De Marneff et al., 2019](https://semanticsarchive.net/Archive/Tg3ZGI2M/Marneffe.pdf)
- Sentence completion
- COPA [Roemmele et al., 2011](https://www.researchgate.net/publication/221251392_Choice_of_Plausible_Alternatives_An_Evaluation_of_Commonsense_Causal_Reasoning)
- Word sense disambiguation
- WIC [Pilehvar and Camacho-Collados, 2018](https://arxiv.org/abs/1808.09121)
- Question answering
- MultiRC [Khashabi et al., 2018](https://aclanthology.org/N18-1023)
- ReCoRD [Zhang et al., 2018](https://arxiv.org/abs/1810.12885)
- BoolQ [Clark et al., 2019](https://arxiv.org/abs/1905.10044)
## Training Procedure
In their [abstract](https://jmlr.org/papers/volume21/20-074/20-074.pdf), the model developers write:
> In this paper, we explore the landscape of transfer learning techniques for NLP by introducing a unified framework that converts every language problem into a text-to-text format. Our systematic study compares pre-training objectives, architectures, unlabeled datasets, transfer approaches, and other factors on dozens of language understanding tasks.
The framework introduced, the T5 framework, involves a training procedure that brings together the approaches studied in the paper. See the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for further details.
# Evaluation
## Testing Data, Factors & Metrics
The developers evaluated the model on 24 tasks, see the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for full details.
## Results
For full results for T5-small, see the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf), Table 14.
# Environmental Impact
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** Google Cloud TPU Pods
- **Hours used:** More information needed
- **Cloud Provider:** GCP
- **Compute Region:** More information needed
- **Carbon Emitted:** More information needed
# Citation
**BibTeX:**
```bibtex
@article{2020t5,
author = {Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
journal = {Journal of Machine Learning Research},
year = {2020},
volume = {21},
number = {140},
pages = {1-67},
url = {http://jmlr.org/papers/v21/20-074.html}
}
```
**APA:**
- Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., ... & Liu, P. J. (2020). Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140), 1-67.
# Model Card Authors
This model card was written by the team at Hugging Face.
# How to Get Started with the Model
Use the code below to get started with the model.
<details>
<summary> Click to expand </summary>
```python
from transformers import T5Tokenizer, T5Model
tokenizer = T5Tokenizer.from_pretrained("t5-small")
model = T5Model.from_pretrained("t5-small")
input_ids = tokenizer(
"Studies have been shown that owning a dog is good for you", return_tensors="pt"
).input_ids # Batch size 1
decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids # Batch size 1
# forward pass
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
last_hidden_states = outputs.last_hidden_state
```
See the [Hugging Face T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Model) docs and a [Colab Notebook](https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb) created by the model developers for more examples.
</details>
| [
-0.28572484850883484,
-0.33532556891441345,
0.4813416004180908,
0.10642410069704056,
-0.14890019595623016,
-0.12051080912351608,
-0.26422208547592163,
-0.5589577555656433,
-0.3091917634010315,
0.39851292967796326,
-0.5073764324188232,
-0.5743420720100403,
-0.7816708087921143,
0.33911019563674927,
-0.5052919983863831,
1.0424214601516724,
-0.08109670132398605,
-0.1449013501405716,
-0.11698346585035324,
-0.13006968796253204,
-0.34843382239341736,
-0.4826267659664154,
-0.6176862120628357,
-0.34184956550598145,
0.41435372829437256,
0.2547864019870758,
0.27885380387306213,
0.432752788066864,
0.6645153760910034,
0.23258699476718903,
-0.1161697655916214,
-0.021099206060171127,
-0.4483434557914734,
-0.3088480234146118,
-0.2593088448047638,
-0.32468780875205994,
-0.3394290506839752,
-0.04752453789114952,
0.560394287109375,
0.7070041298866272,
0.037450745701789856,
0.3816570043563843,
0.15629568696022034,
0.49242785573005676,
-0.5892958641052246,
0.13097327947616577,
-0.5650761723518372,
0.09784996509552002,
-0.03146350011229515,
0.08105158805847168,
-0.5830808281898499,
-0.04590838775038719,
0.19955044984817505,
-0.5896459817886353,
0.3246689736843109,
-0.002503474708646536,
1.1610571146011353,
0.3336239159107208,
-0.4525183439254761,
-0.18235619366168976,
-0.7372093796730042,
1.074626088142395,
-0.7636168003082275,
0.5033720135688782,
0.155411496758461,
0.1496046483516693,
0.1410144716501236,
-1.1167569160461426,
-0.6825230121612549,
-0.007793871685862541,
-0.24080736935138702,
0.21549932658672333,
-0.3056052029132843,
0.03333331272006035,
0.3356136977672577,
0.3411770462989807,
-0.41665539145469666,
-0.02241182141005993,
-0.5831766724586487,
-0.11566360294818878,
0.5510755777359009,
-0.005401537287980318,
0.32045817375183105,
-0.21477441489696503,
-0.4411347806453705,
-0.2980429232120514,
-0.34380289912223816,
0.1132386326789856,
-0.127200648188591,
0.28880611062049866,
-0.360806941986084,
0.2886556386947632,
0.0849548950791359,
0.5794442296028137,
0.19508706033229828,
-0.205600768327713,
0.37496834993362427,
-0.7644718885421753,
-0.23919886350631714,
-0.34594476222991943,
1.0952900648117065,
0.28053736686706543,
0.10880912095308304,
-0.39677760004997253,
-0.04700370132923126,
-0.12817659974098206,
0.35934093594551086,
-0.9680263996124268,
-0.1321972906589508,
0.2871784269809723,
-0.5137026906013489,
-0.46880772709846497,
-0.058122970163822174,
-0.7698225975036621,
-0.039297811686992645,
-0.09319889545440674,
0.4819503128528595,
-0.47988972067832947,
-0.16465917229652405,
0.16822664439678192,
-0.26794347167015076,
0.3307431936264038,
0.2956487536430359,
-0.8503504395484924,
0.34591028094291687,
0.3007579445838928,
0.7277331352233887,
-0.42817890644073486,
-0.34466785192489624,
-0.1630779355764389,
0.10904277116060257,
-0.10778169333934784,
0.6830316781997681,
-0.3931751549243927,
-0.4144899249076843,
-0.15709969401359558,
0.17872010171413422,
-0.2394382357597351,
-0.28094881772994995,
0.8136497139930725,
-0.25161290168762207,
0.6987916827201843,
-0.3035825788974762,
-0.5007902979850769,
-0.3735067844390869,
0.14471279084682465,
-0.6153568625450134,
1.1548793315887451,
-0.011904953978955746,
-0.7833443880081177,
0.289922297000885,
-0.9163821935653687,
-0.2643609046936035,
-0.2787743806838989,
0.280567467212677,
-0.5483813285827637,
-0.2396092563867569,
0.28950849175453186,
0.600054919719696,
-0.3922139108181,
0.31010961532592773,
-0.2855887711048126,
-0.25634703040122986,
0.08364309370517731,
-0.32309386134147644,
0.9925580024719238,
0.28350451588630676,
-0.473886102437973,
0.022644923999905586,
-0.7072417140007019,
0.026044104248285294,
0.01359536126255989,
-0.2628231346607208,
0.004380503669381142,
-0.2099612057209015,
0.23097392916679382,
0.45225200057029724,
0.23250867426395416,
-0.5029969811439514,
0.04335524141788483,
-0.3183380365371704,
0.6427609324455261,
0.454693466424942,
-0.06952384859323502,
0.5832358598709106,
-0.4910651445388794,
0.3656978905200958,
0.18197330832481384,
0.07985933125019073,
-0.15539796650409698,
-0.35897353291511536,
-0.7954628467559814,
0.004425735678523779,
0.5181562304496765,
0.5199303030967712,
-0.6135453581809998,
0.5247277021408081,
-0.5412622094154358,
-0.6853897571563721,
-0.6499157547950745,
-0.04054516181349754,
0.35545262694358826,
0.6337839961051941,
0.780693531036377,
-0.09151605516672134,
-0.5860620141029358,
-0.6270583271980286,
-0.33306342363357544,
-0.04734870046377182,
-0.040954265743494034,
0.12015209347009659,
0.7177823185920715,
-0.13268321752548218,
0.8249403238296509,
-0.2957884669303894,
-0.3991805613040924,
-0.525862991809845,
0.00716410530731082,
-0.06177528575062752,
0.569271981716156,
0.6324378252029419,
-0.7209452986717224,
-0.5002157688140869,
-0.18368995189666748,
-0.795827329158783,
-0.0008816742920316756,
-0.14904189109802246,
0.01683664880692959,
0.38729360699653625,
0.5285193920135498,
-0.5821676254272461,
0.23321464657783508,
0.5842597484588623,
-0.32206907868385315,
0.27542972564697266,
-0.14299654960632324,
-0.02086479775607586,
-1.5722318887710571,
0.5049795508384705,
0.13271579146385193,
-0.20578764379024506,
-0.722944974899292,
-0.10971387475728989,
0.04751472920179367,
-0.09232432395219803,
-0.5499889254570007,
0.7122514247894287,
-0.40052589774131775,
0.03595922142267227,
-0.014316846616566181,
0.07429840415716171,
0.11812962591648102,
0.6469656229019165,
-0.035460591316223145,
0.7676171660423279,
0.21751408278942108,
-0.6898727416992188,
-0.017829835414886475,
0.3352101445198059,
-0.07246509194374084,
0.2906351387500763,
-0.7178853750228882,
0.2849297523498535,
-0.05212641507387161,
0.45328566431999207,
-0.9123618006706238,
0.13712893426418304,
0.3433583080768585,
-0.6528587937355042,
0.30457887053489685,
-0.010405116714537144,
-0.408905565738678,
-0.36908113956451416,
-0.31921571493148804,
0.26580509543418884,
0.6671831011772156,
-0.4964582622051239,
0.692108690738678,
0.12872357666492462,
0.28357475996017456,
-0.7309965491294861,
-0.8484084010124207,
0.13933974504470825,
-0.39904534816741943,
-0.5151214599609375,
0.7818639874458313,
-0.1376132220029831,
0.09047278016805649,
0.1486358940601349,
0.036452680826187134,
-0.19715982675552368,
0.12446189671754837,
0.03579914942383766,
0.17605511844158173,
0.016903666779398918,
0.18254411220550537,
-0.09883973002433777,
-0.15475060045719147,
-0.028040962293744087,
-0.4464394152164459,
0.2700519561767578,
-0.18817242980003357,
0.17331790924072266,
-0.6531100869178772,
0.16947650909423828,
0.5532306432723999,
-0.15486709773540497,
0.826113760471344,
0.9827443957328796,
-0.25588467717170715,
-0.07744874805212021,
-0.4252083897590637,
-0.2511157691478729,
-0.44956910610198975,
0.36193418502807617,
-0.4432012736797333,
-0.8659140467643738,
0.41967451572418213,
0.03075045347213745,
0.3486699163913727,
0.8759773373603821,
0.3451400101184845,
-0.1725364625453949,
0.7578571438789368,
0.8590009808540344,
-0.033790405839681625,
0.5524449348449707,
-0.454522967338562,
0.2916339933872223,
-0.8456985950469971,
-0.22916503250598907,
-0.7452788352966309,
-0.28573930263519287,
-0.7918068170547485,
-0.3664000332355499,
0.10862995684146881,
-0.009740879759192467,
-0.3349252939224243,
0.48645979166030884,
-0.5400938391685486,
0.11627419292926788,
0.4185228943824768,
0.07625380158424377,
0.36098864674568176,
-0.006773519329726696,
-0.07619550079107285,
-0.1784408539533615,
-0.8914109468460083,
-0.4826850891113281,
1.2496815919876099,
0.35624179244041443,
0.39550521969795227,
-0.011319695971906185,
0.6523822546005249,
0.24269281327724457,
0.20847445726394653,
-0.7404364943504333,
0.6741621494293213,
-0.3999153971672058,
-0.48061591386795044,
-0.24794289469718933,
-0.41506925225257874,
-1.1228723526000977,
0.2924997806549072,
-0.33798661828041077,
-0.6869922876358032,
0.15570765733718872,
0.003997318912297487,
-0.25109368562698364,
0.5003617405891418,
-0.8593087196350098,
1.0876160860061646,
-0.05197522044181824,
-0.3281058371067047,
-0.019203536212444305,
-0.7072829008102417,
0.23210525512695312,
0.018379636108875275,
0.1318645030260086,
0.11616504192352295,
-0.16923639178276062,
0.9756944179534912,
-0.3356750011444092,
0.9144782423973083,
-0.18188147246837616,
0.04481862857937813,
0.15017348527908325,
-0.34106096625328064,
0.44289398193359375,
-0.3897763788700104,
-0.06730470061302185,
0.3899080157279968,
0.15209119021892548,
-0.44693130254745483,
-0.5169453620910645,
0.4425390660762787,
-0.9315853118896484,
-0.34804606437683105,
-0.4051019251346588,
-0.4356042146682739,
-0.13183344900608063,
0.37961360812187195,
0.3693757653236389,
0.14943738281726837,
-0.16505618393421173,
0.3680223822593689,
0.6316238045692444,
-0.3451175391674042,
0.7319934964179993,
0.32052794098854065,
0.01863476075232029,
-0.28542760014533997,
0.7665916085243225,
0.13151021301746368,
0.36070773005485535,
0.5623262524604797,
0.1990436464548111,
-0.3174116611480713,
-0.5345253348350525,
-0.3573344945907593,
0.33462080359458923,
-0.6073729395866394,
-0.10643173009157181,
-0.9248259663581848,
-0.20129922032356262,
-0.5486876964569092,
-0.026103919371962547,
-0.438894122838974,
-0.39051923155784607,
-0.4569113552570343,
-0.14746078848838806,
0.267581969499588,
0.46671515703201294,
0.13412384688854218,
0.21149025857448578,
-0.9037097692489624,
0.18477587401866913,
0.04702943190932274,
0.0735093429684639,
0.016105424612760544,
-0.7992462515830994,
-0.16409124433994293,
0.10100148618221283,
-0.40719324350357056,
-0.6304513216018677,
0.42649292945861816,
0.2418626993894577,
0.3197682201862335,
0.02473774366080761,
0.16521070897579193,
0.6152687072753906,
-0.2716270983219147,
0.9882354736328125,
0.16087301075458527,
-1.016084909439087,
0.27836892008781433,
-0.2391347438097,
0.40930336713790894,
0.5198947787284851,
0.4556821584701538,
-0.6254738569259644,
-0.20661264657974243,
-0.9851364493370056,
-0.7468184232711792,
0.7672584056854248,
0.2502603530883789,
0.11466055363416672,
0.38840216398239136,
0.24657781422138214,
0.038339752703905106,
0.15363314747810364,
-0.9274243712425232,
-0.22745700180530548,
-0.22890976071357727,
-0.3794388473033905,
-0.08167006075382233,
-0.05955037847161293,
0.09537172317504883,
-0.35129407048225403,
0.6387296915054321,
-0.11828857660293579,
0.7501517534255981,
0.29047736525535583,
-0.2729279696941376,
0.17249463498592377,
0.37916144728660583,
0.6725090146064758,
0.48802924156188965,
-0.1738511472940445,
-0.006551116704940796,
0.46026602387428284,
-0.5179046392440796,
-0.02826116979122162,
0.1534966677427292,
-0.32851195335388184,
0.021559106186032295,
0.4544423222541809,
0.9332068562507629,
0.10864968597888947,
-0.3887397050857544,
0.55612713098526,
-0.07222624868154526,
-0.5765635371208191,
-0.2589024603366852,
-0.06664851307868958,
0.11605633050203323,
-0.01679852046072483,
0.234390527009964,
0.24595977365970612,
0.11553435027599335,
-0.48134687542915344,
0.05644678324460983,
0.12267287820577621,
-0.45462003350257874,
-0.453945130109787,
0.79523104429245,
0.32993853092193604,
-0.028866814449429512,
0.5682883858680725,
-0.13150668144226074,
-0.4994325637817383,
0.5365477204322815,
0.5170550346374512,
0.9966089725494385,
-0.025771383196115494,
0.18035851418972015,
0.6491126418113708,
0.40777403116226196,
-0.11470069736242294,
0.03437309339642525,
-0.06962062418460846,
-0.7835012078285217,
-0.5516782402992249,
-0.47581127285957336,
-0.2896089255809784,
0.22634698450565338,
-0.4380210340023041,
0.3400818705558777,
-0.3165622651576996,
-0.01682753674685955,
0.10107312351465225,
0.17690859735012054,
-0.7739149332046509,
0.3261110186576843,
0.014877703040838242,
0.8217339515686035,
-0.7402704954147339,
0.8659939169883728,
0.7321235537528992,
-0.6091023087501526,
-0.925197958946228,
0.15465860068798065,
-0.274452805519104,
-0.6230417490005493,
0.5542054176330566,
0.13959084451198578,
-0.02061847411096096,
0.18507131934165955,
-0.5356993079185486,
-0.8412708044052124,
1.3044716119766235,
0.34314727783203125,
-0.2949640154838562,
-0.3473220467567444,
0.26039987802505493,
0.646639883518219,
-0.2705107629299164,
0.3976442813873291,
0.476343035697937,
0.48415306210517883,
0.21237552165985107,
-1.0236235857009888,
0.32674112915992737,
-0.22694817185401917,
0.09102131426334381,
0.032642289996147156,
-0.8236406445503235,
0.5665578246116638,
-0.34064292907714844,
-0.22843435406684875,
-0.16673316061496735,
0.6717284321784973,
0.036761507391929626,
0.2168656289577484,
0.4616354703903198,
0.7182856202125549,
0.6696544885635376,
-0.10889344662427902,
1.1444499492645264,
-0.3048974573612213,
0.4722042381763458,
0.8121747970581055,
0.1629808396100998,
0.8968386054039001,
0.5090113878250122,
-0.30449023842811584,
0.46455010771751404,
0.6567478179931641,
-0.10943779349327087,
0.5180991291999817,
-0.13183508813381195,
-0.03639981523156166,
-0.09089983999729156,
-0.1637742817401886,
-0.32851845026016235,
0.2504824697971344,
0.23211361467838287,
-0.4102931618690491,
-0.23847953975200653,
0.1459619551897049,
0.28666988015174866,
-0.15293344855308533,
-0.08948588371276855,
0.8235296010971069,
0.26026633381843567,
-0.7443115711212158,
0.7046179175376892,
0.16602902114391327,
0.8724918365478516,
-0.4291449189186096,
0.09483736008405685,
-0.1872769147157669,
0.23329302668571472,
-0.31382688879966736,
-0.6542183756828308,
0.4914357662200928,
0.02911604754626751,
-0.1928981989622116,
-0.6639622449874878,
0.8343881964683533,
-0.4324547350406647,
-0.4037034809589386,
0.32233184576034546,
0.4503342807292938,
0.08713371306657791,
0.060807004570961,
-0.9132286906242371,
-0.09088565409183502,
0.1793891340494156,
-0.2044239640235901,
0.34218305349349976,
0.38540714979171753,
0.06816594302654266,
0.6481355428695679,
0.5762293338775635,
-0.17481543123722076,
0.013268445618450642,
-0.14171522855758667,
0.6467388868331909,
-0.7253069281578064,
-0.3042575716972351,
-0.7163329720497131,
0.6752378940582275,
-0.009559654630720615,
-0.4354285001754761,
0.654302179813385,
0.4224204123020172,
1.0545406341552734,
-0.1367454081773758,
0.9540830254554749,
-0.19135499000549316,
0.5342065095901489,
-0.4100843071937561,
0.5113857388496399,
-0.6811686158180237,
0.18867425620555878,
-0.3432723879814148,
-0.7843440771102905,
-0.27592897415161133,
0.40313202142715454,
-0.3786689341068268,
0.32490983605384827,
1.054276466369629,
0.6073668003082275,
-0.021738233044743538,
-0.14111605286598206,
0.21092981100082397,
0.1789134293794632,
0.3420909345149994,
0.7314891815185547,
0.3544436991214752,
-0.9663944244384766,
0.9508032202720642,
-0.36413678526878357,
0.22657835483551025,
-0.03670170530676842,
-0.7955064177513123,
-0.9170928001403809,
-0.7997239828109741,
-0.384703129529953,
-0.43769609928131104,
0.10487408190965652,
0.7730253338813782,
0.5720482468605042,
-0.6677457094192505,
-0.24492086470127106,
-0.3479767441749573,
0.027259957045316696,
-0.23084741830825806,
-0.20534437894821167,
0.501135528087616,
-0.4739178717136383,
-0.8575961589813232,
0.02604524977505207,
-0.08325622975826263,
0.05420884117484093,
0.0031860757153481245,
-0.03218827396631241,
-0.29614147543907166,
-0.1698804497718811,
0.5995387434959412,
0.1851189136505127,
-0.6206665635108948,
-0.31927114725112915,
0.23777174949645996,
-0.19053398072719574,
0.12314555794000626,
0.46888983249664307,
-0.6392174363136292,
0.18327894806861877,
0.5096734762191772,
0.9009743928909302,
0.8216783404350281,
-0.14421199262142181,
0.5881912708282471,
-0.43341976404190063,
-0.09716244786977768,
0.14017914235591888,
0.10368439555168152,
0.3785291910171509,
-0.21066595613956451,
0.6253120303153992,
0.48346251249313354,
-0.476066529750824,
-0.6628624200820923,
-0.16465799510478973,
-1.1972496509552002,
-0.17727576196193695,
1.2247065305709839,
-0.1462206393480301,
-0.23697815835475922,
0.04073156416416168,
-0.05296238884329796,
0.356975257396698,
-0.44697853922843933,
0.7303861379623413,
0.8321837782859802,
0.09005673229694366,
-0.4469660520553589,
-0.5803154110908508,
0.6624141931533813,
0.571489155292511,
-1.0220979452133179,
-0.21685954928398132,
0.18209651112556458,
0.49174630641937256,
0.11551301926374435,
0.5971419215202332,
-0.08021000772714615,
0.07754309475421906,
-0.178602933883667,
0.28333786129951477,
0.0010566163109615445,
-0.05350605770945549,
-0.3551878035068512,
0.19391891360282898,
-0.176127627491951,
-0.26275479793548584
] |
prajjwal1/bert-small | prajjwal1 | "2021-10-27T18:31:52Z" | 2,592,387 | 13 | transformers | [
"transformers",
"pytorch",
"BERT",
"MNLI",
"NLI",
"transformer",
"pre-training",
"en",
"arxiv:1908.08962",
"arxiv:2110.01518",
"license:mit",
"endpoints_compatible",
"region:us"
] | null | "2022-03-02T23:29:05Z" | ---
language:
- en
license:
- mit
tags:
- BERT
- MNLI
- NLI
- transformer
- pre-training
---
The following model is a Pytorch pre-trained model obtained from converting Tensorflow checkpoint found in the [official Google BERT repository](https://github.com/google-research/bert).
This is one of the smaller pre-trained BERT variants, together with [bert-tiny](https://huggingface.co/prajjwal1/bert-small), [bert-mini]([bert-small](https://huggingface.co/prajjwal1/bert-mini) and [bert-medium](https://huggingface.co/prajjwal1/bert-medium). They were introduced in the study `Well-Read Students Learn Better: On the Importance of Pre-training Compact Models` ([arxiv](https://arxiv.org/abs/1908.08962)), and ported to HF for the study `Generalization in NLI: Ways (Not) To Go Beyond Simple Heuristics` ([arXiv](https://arxiv.org/abs/2110.01518)). These models are supposed to be trained on a downstream task.
If you use the model, please consider citing both the papers:
```
@misc{bhargava2021generalization,
title={Generalization in NLI: Ways (Not) To Go Beyond Simple Heuristics},
author={Prajjwal Bhargava and Aleksandr Drozd and Anna Rogers},
year={2021},
eprint={2110.01518},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@article{DBLP:journals/corr/abs-1908-08962,
author = {Iulia Turc and
Ming{-}Wei Chang and
Kenton Lee and
Kristina Toutanova},
title = {Well-Read Students Learn Better: The Impact of Student Initialization
on Knowledge Distillation},
journal = {CoRR},
volume = {abs/1908.08962},
year = {2019},
url = {http://arxiv.org/abs/1908.08962},
eprinttype = {arXiv},
eprint = {1908.08962},
timestamp = {Thu, 29 Aug 2019 16:32:34 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1908-08962.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
Config of this model:
- `prajjwal1/bert-small` (L=4, H=512) [Model Link](https://huggingface.co/prajjwal1/bert-small)
Other models to check out:
- `prajjwal1/bert-tiny` (L=2, H=128) [Model Link](https://huggingface.co/prajjwal1/bert-tiny)
- `prajjwal1/bert-mini` (L=4, H=256) [Model Link](https://huggingface.co/prajjwal1/bert-mini)
- `prajjwal1/bert-medium` (L=8, H=512) [Model Link](https://huggingface.co/prajjwal1/bert-medium)
Original Implementation and more info can be found in [this Github repository](https://github.com/prajjwal1/generalize_lm_nli).
Twitter: [@prajjwal_1](https://twitter.com/prajjwal_1)
| [
-0.43266937136650085,
-0.569463849067688,
0.46697044372558594,
-0.023636186495423317,
-0.171895831823349,
-0.2951265573501587,
-0.3187333643436432,
-0.4421079158782959,
0.10849983990192413,
0.16958558559417725,
-0.7454162836074829,
-0.33432474732398987,
-0.5199422836303711,
-0.14150385558605194,
-0.35058268904685974,
1.2537533044815063,
0.07513408362865448,
0.068944051861763,
-0.17597191035747528,
-0.2472124695777893,
-0.16788740456104279,
-0.5565845370292664,
-0.5991945862770081,
-0.5098044276237488,
0.7556132674217224,
-0.0215961504727602,
0.4936472773551941,
0.21482793986797333,
0.6355999112129211,
0.27712565660476685,
-0.4028610289096832,
-0.10001381486654282,
-0.5072577595710754,
-0.26321911811828613,
0.05263683199882507,
-0.447979211807251,
-0.583234429359436,
0.10748245567083359,
0.7612109780311584,
0.9571226239204407,
-0.12051220238208771,
0.3722786605358124,
0.2920735776424408,
0.6203272938728333,
-0.5797297358512878,
-0.054551854729652405,
-0.3229117691516876,
-0.21382352709770203,
-0.16611549258232117,
0.2842370867729187,
-0.5635544061660767,
-0.34261825680732727,
0.5108643770217896,
-0.544614851474762,
0.5583679676055908,
-0.013902277685701847,
1.4141952991485596,
0.1563965380191803,
-0.22130820155143738,
-0.12018325924873352,
-0.6506977677345276,
0.9924801588058472,
-0.9714876413345337,
0.5329310894012451,
0.03049909695982933,
0.2689296007156372,
-0.02039247378706932,
-0.9909998774528503,
-0.5909490585327148,
-0.07193595170974731,
-0.4645065665245056,
0.1483929306268692,
-0.38353580236434937,
0.161249577999115,
0.40094849467277527,
0.38841676712036133,
-0.5950574278831482,
0.08210179209709167,
-0.5883998274803162,
-0.26529690623283386,
0.4139237701892853,
-0.01863960176706314,
-0.032019227743148804,
-0.41246533393859863,
-0.34893134236335754,
-0.4505250155925751,
-0.6007140874862671,
0.2541956305503845,
0.5419182777404785,
0.39186543226242065,
-0.41220441460609436,
0.4257197082042694,
-0.0004758508875966072,
0.8547051548957825,
0.14431430399417877,
-0.03328024968504906,
0.4370265007019043,
-0.6702356338500977,
-0.1481560915708542,
-0.20990827679634094,
0.8127428889274597,
0.07922985404729843,
0.10930751264095306,
-0.07522370666265488,
-0.09234567731618881,
-0.40427008271217346,
0.1613958775997162,
-1.0627351999282837,
-0.4195374548435211,
0.17369024455547333,
-0.7245150804519653,
-0.029354875907301903,
0.17728665471076965,
-0.6416907906532288,
-0.058708567172288895,
-0.34151044487953186,
0.5248359441757202,
-0.5372167229652405,
-0.2723768651485443,
-0.14688590168952942,
-0.018022963777184486,
0.42578205466270447,
0.39857906103134155,
-0.6678932309150696,
0.07388915121555328,
0.48053470253944397,
0.9550723433494568,
0.09017085283994675,
-0.2371772825717926,
0.01150372065603733,
0.05253743380308151,
-0.19810760021209717,
0.4196670651435852,
-0.22198475897312164,
-0.1875884085893631,
-0.08133924752473831,
-0.03263646736741066,
-0.16041859984397888,
-0.3571449816226959,
0.691254198551178,
-0.5171558856964111,
0.36118730902671814,
-0.35854822397232056,
-0.5551144480705261,
-0.2653333246707916,
0.18015827238559723,
-0.632279098033905,
1.022484302520752,
0.019309427589178085,
-0.969555139541626,
0.5314653515815735,
-0.6578592658042908,
-0.21807247400283813,
-0.19242170453071594,
0.14208392798900604,
-0.7167000770568848,
-0.009022400714457035,
0.1971753090620041,
0.5256053805351257,
-0.19336995482444763,
0.327985942363739,
-0.4839073717594147,
-0.3555503785610199,
-0.10316437482833862,
-0.08251624554395676,
1.2171409130096436,
0.3063459098339081,
-0.06102297827601433,
0.20784422755241394,
-0.8484939336776733,
0.10895107686519623,
0.18116624653339386,
-0.3895452618598938,
-0.5048791170120239,
-0.1288573145866394,
-0.01177186332643032,
0.02914200909435749,
0.36922910809516907,
-0.41237932443618774,
0.35946208238601685,
-0.37201324105262756,
0.41909512877464294,
0.6431371569633484,
0.0839603990316391,
0.49729329347610474,
-0.539156436920166,
0.09841059893369675,
0.1619483232498169,
0.3302106559276581,
0.03703603893518448,
-0.5144681334495544,
-1.0308763980865479,
-0.5261540412902832,
0.5776174664497375,
0.28352513909339905,
-0.5798343420028687,
0.6033912897109985,
-0.31564685702323914,
-0.7204225063323975,
-0.6199114918708801,
0.20943637192249298,
0.32250431180000305,
0.5003554821014404,
0.45547839999198914,
-0.17131097614765167,
-0.7474242448806763,
-0.8905051946640015,
-0.22164496779441833,
-0.34673237800598145,
-0.2139676809310913,
0.3433743119239807,
0.6961720585823059,
-0.5465300679206848,
1.079933524131775,
-0.399135023355484,
-0.30573034286499023,
-0.3349355161190033,
0.35674339532852173,
0.7077906131744385,
0.8737104535102844,
0.8338378071784973,
-0.5418119430541992,
-0.42960014939308167,
-0.4021831750869751,
-0.5700842142105103,
0.1190737932920456,
-0.20961962640285492,
-0.28991949558258057,
0.1693141758441925,
0.41431480646133423,
-0.6085120439529419,
0.40999528765678406,
0.3076397478580475,
-0.37010127305984497,
0.47220197319984436,
-0.23569011688232422,
-0.09592889249324799,
-1.1552058458328247,
0.3648562729358673,
0.0435778982937336,
-0.044522274285554886,
-0.5648065805435181,
0.14952152967453003,
0.004831378813832998,
0.1251862794160843,
-0.19151930510997772,
0.6788386106491089,
-0.5703933238983154,
0.04876488074660301,
0.13248369097709656,
-0.1501254141330719,
-0.04664980620145798,
0.4924297332763672,
-0.020779168233275414,
0.5435577630996704,
0.30790743231773376,
-0.46360883116722107,
-0.07508690655231476,
0.4552987515926361,
-0.4640388786792755,
0.16838577389717102,
-1.1304619312286377,
0.15032371878623962,
-0.046379588544368744,
0.4297534227371216,
-0.9693530201911926,
-0.24368739128112793,
0.2847338616847992,
-0.41440466046333313,
0.3957904875278473,
-0.3633025586605072,
-0.7290880084037781,
-0.46238967776298523,
-0.2922320067882538,
0.36595624685287476,
0.7739717364311218,
-0.6577872633934021,
0.6769553422927856,
-0.09602824598550797,
-0.023138616234064102,
-0.4881364703178406,
-0.7092792987823486,
-0.44077593088150024,
-0.023292383179068565,
-0.7078512907028198,
0.36129963397979736,
-0.2692348062992096,
-0.05805705487728119,
0.16369034349918365,
-0.018883749842643738,
-0.25879085063934326,
-0.0372924879193306,
0.17367619276046753,
0.5966614484786987,
-0.29933494329452515,
0.14151731133460999,
0.07722505182027817,
0.23349691927433014,
-0.05088263005018234,
-0.06967045366764069,
0.5989788770675659,
-0.3108484447002411,
-0.18078960478305817,
-0.5906089544296265,
0.10690724104642868,
0.4010853171348572,
-0.030800094828009605,
1.1222692728042603,
0.9417902827262878,
-0.37889164686203003,
0.03627178072929382,
-0.6590774059295654,
-0.6018235683441162,
-0.4750920832157135,
0.2007695883512497,
-0.2628529965877533,
-0.7661011815071106,
0.6648941040039062,
0.03921264037489891,
0.22647784650325775,
0.786749541759491,
0.49917614459991455,
-0.2995041310787201,
0.7539343237876892,
0.8070075511932373,
-0.005446732509881258,
0.8300634026527405,
-0.7195866703987122,
0.26929986476898193,
-0.9539947509765625,
-0.20592732727527618,
-0.6149213910102844,
-0.41712164878845215,
-0.6290870308876038,
-0.1979714184999466,
0.28604865074157715,
0.3712451756000519,
-0.5165311098098755,
0.3997809588909149,
-0.596835732460022,
0.16404061019420624,
0.8827347159385681,
0.3097051978111267,
0.05778854712843895,
-0.012283614836633205,
-0.4242609143257141,
-0.036280304193496704,
-1.003421664237976,
-0.3613440990447998,
1.3760985136032104,
0.4215681254863739,
0.6147627830505371,
0.3061254620552063,
1.0719643831253052,
0.026304418221116066,
0.3272310793399811,
-0.6350943446159363,
0.4604395925998688,
-0.05421900004148483,
-1.0918313264846802,
-0.2606581747531891,
-0.6443721055984497,
-1.0489275455474854,
0.08024608343839645,
-0.39421361684799194,
-0.7286332249641418,
0.531566858291626,
0.08945490419864655,
-0.6609489917755127,
0.2089831531047821,
-0.9794890880584717,
0.778529703617096,
0.041480742394924164,
-0.4897262156009674,
-0.14308011531829834,
-0.7168830037117004,
0.3787314295768738,
0.011029340326786041,
0.05373131483793259,
0.150731161236763,
0.23896032571792603,
1.107440710067749,
-0.653441846370697,
0.9373055100440979,
-0.4195104241371155,
0.26644182205200195,
0.5334165096282959,
-0.20104630291461945,
0.6279927492141724,
0.09712730348110199,
-0.04409158229827881,
0.4187958836555481,
0.16509486734867096,
-0.6062755584716797,
-0.2526373267173767,
0.5712445378303528,
-1.2088319063186646,
-0.4757094085216522,
-0.6495797038078308,
-0.6453083753585815,
-0.0940336138010025,
0.445144921541214,
0.4152910113334656,
0.35061928629875183,
0.09261363744735718,
0.5048604607582092,
0.766130805015564,
-0.1422216147184372,
0.5875203013420105,
0.46788567304611206,
-0.11509263515472412,
-0.1259503960609436,
0.6231980919837952,
0.14670920372009277,
0.24624159932136536,
0.13242597877979279,
0.18357554078102112,
-0.27723196148872375,
-0.8065516352653503,
-0.0837494283914566,
0.5985977053642273,
-0.6999062895774841,
-0.033851902931928635,
-0.6459783911705017,
-0.48474574089050293,
-0.5860170125961304,
-0.25949299335479736,
-0.35762161016464233,
-0.21366654336452484,
-0.508449912071228,
0.04654914140701294,
0.31394439935684204,
0.520582377910614,
-0.27300435304641724,
0.4609981179237366,
-0.6641826033592224,
0.0464654378592968,
0.46471473574638367,
0.1987919956445694,
0.14322789013385773,
-0.7681828141212463,
-0.18622790277004242,
0.03571310639381409,
-0.21592548489570618,
-0.5351446270942688,
0.2896234095096588,
0.2866177558898926,
0.8163371086120605,
0.42319032549858093,
0.15571804344654083,
0.6962165236473083,
-0.3110194206237793,
0.7041944861412048,
0.456465482711792,
-0.5845329165458679,
0.5265509486198425,
-0.39408746361732483,
0.2629339098930359,
0.7467789053916931,
0.5218380689620972,
-0.05054594948887825,
-0.05417731776833534,
-0.8527767062187195,
-1.098665475845337,
0.7305155992507935,
0.17859405279159546,
0.11478427052497864,
0.3784097731113434,
0.4369205832481384,
0.10047432780265808,
0.1664716899394989,
-0.871957004070282,
-0.3490568697452545,
-0.17530494928359985,
-0.2883908450603485,
-0.17212148010730743,
-0.5213502049446106,
-0.31257787346839905,
-0.6855617761611938,
0.8152709603309631,
0.00027490517823025584,
0.6489061117172241,
0.32472851872444153,
-0.23032496869564056,
0.18800190091133118,
0.07603204250335693,
0.5073338150978088,
0.6567880511283875,
-0.6983125805854797,
-0.18625634908676147,
-0.00382096110843122,
-0.5500951409339905,
-0.20424845814704895,
0.3448854088783264,
-0.3294694721698761,
0.16492219269275665,
0.6237603425979614,
0.8490752577781677,
0.2492532581090927,
-0.24848589301109314,
0.5402065515518188,
0.051226623356342316,
-0.28102144598960876,
-0.40084466338157654,
0.03340563178062439,
-0.011644488200545311,
0.4167124032974243,
0.39069664478302,
0.2839573919773102,
0.10552318394184113,
-0.4837300777435303,
0.09320152550935745,
0.2576867938041687,
-0.26475396752357483,
-0.30673736333847046,
0.692833662033081,
0.255669504404068,
0.06670799851417542,
0.7890354990959167,
-0.3183394968509674,
-0.4040049612522125,
0.3760083317756653,
0.24671271443367004,
0.7457609176635742,
0.2384856790304184,
0.06464766710996628,
0.9216803908348083,
0.35153067111968994,
-0.126742422580719,
0.0668860599398613,
-0.15417145192623138,
-0.6952977776527405,
-0.2730112373828888,
-0.9041406512260437,
-0.23607461154460907,
0.11338672041893005,
-0.7461130023002625,
0.2963581383228302,
-0.5679996609687805,
-0.3559759259223938,
0.16197988390922546,
0.2622559070587158,
-0.9249223470687866,
0.07019320875406265,
0.02891571633517742,
0.8335615992546082,
-0.7015525102615356,
1.0154938697814941,
0.7989307045936584,
-0.6014965772628784,
-0.9245942234992981,
0.021931353956460953,
-0.1511075645685196,
-0.6239814162254333,
0.7310199737548828,
-0.15320676565170288,
0.27193745970726013,
0.1360131800174713,
-0.5341188907623291,
-0.9212067723274231,
1.333293080329895,
0.24253545701503754,
-0.8386101722717285,
-0.3716438412666321,
-0.17393626272678375,
0.5355823636054993,
-0.0694257989525795,
0.42297810316085815,
0.35488569736480713,
0.38008564710617065,
0.3839605450630188,
-0.7992986440658569,
0.005697302520275116,
-0.20816583931446075,
0.025622235611081123,
0.07778226584196091,
-0.7962916493415833,
1.2838982343673706,
-0.3824872374534607,
0.02429909072816372,
0.27757391333580017,
0.6283387541770935,
0.4242977201938629,
0.17347167432308197,
0.484875351190567,
0.7565458416938782,
0.7822238206863403,
-0.35356605052948,
1.1050885915756226,
-0.19827453792095184,
0.7798529267311096,
1.0960357189178467,
0.2847558557987213,
0.7876809239387512,
0.7174159288406372,
-0.3976622223854065,
0.6368033289909363,
0.8229367733001709,
-0.22112064063549042,
0.6973787546157837,
0.08814987540245056,
0.1302655041217804,
-0.30462944507598877,
0.2623414695262909,
-0.6400567293167114,
0.11081647127866745,
0.11878293752670288,
-0.4381028115749359,
-0.2208559662103653,
-0.2083802968263626,
0.14304766058921814,
-0.3808290362358093,
-0.29977062344551086,
0.603821337223053,
0.040582574903964996,
-0.42774638533592224,
0.7860842943191528,
-0.24475309252738953,
0.9491543173789978,
-0.8055286407470703,
0.20254366099834442,
-0.1488291323184967,
0.4110112488269806,
-0.1170247420668602,
-0.4338547885417938,
0.25044918060302734,
-0.024199528619647026,
-0.4328233003616333,
-0.1944040060043335,
0.795663058757782,
-0.1758929193019867,
-0.6962302327156067,
0.28334999084472656,
0.492366760969162,
0.11821972578763962,
0.22222836315631866,
-0.8786357045173645,
0.06175322085618973,
0.007827832363545895,
-0.5385140776634216,
0.3377167880535126,
0.16732588410377502,
0.17921563982963562,
0.4633076786994934,
0.783806562423706,
-0.04898431897163391,
0.36556151509284973,
-0.05938464775681496,
0.8292076587677002,
-0.36583203077316284,
-0.39307716488838196,
-0.5764158964157104,
0.6898303627967834,
-0.2283492386341095,
-0.6061218976974487,
0.6840372085571289,
0.43830060958862305,
1.0746616125106812,
-0.12324880808591843,
0.6235883831977844,
-0.3604799509048462,
0.6308658123016357,
-0.38818061351776123,
1.0354194641113281,
-0.8153074979782104,
0.15764698386192322,
-0.3212871551513672,
-0.9111682176589966,
-0.15491314232349396,
0.7764226794242859,
-0.568198561668396,
0.4367009997367859,
0.6024136543273926,
0.4987312853336334,
-0.010359111241996288,
-0.2717299461364746,
0.07640164345502853,
0.42622604966163635,
0.28170302510261536,
0.4339275062084198,
0.5730753540992737,
-0.5730582475662231,
0.5508710741996765,
-0.4378971755504608,
-0.1250247210264206,
-0.5332337021827698,
-0.6752667427062988,
-1.148206353187561,
-0.6755096912384033,
-0.4061617851257324,
-0.41879802942276,
0.01703895442187786,
0.819282591342926,
0.9790179133415222,
-1.0373362302780151,
-0.06697918474674225,
-0.16517092287540436,
-0.01700585149228573,
-0.14650459587574005,
-0.21348975598812103,
0.43602821230888367,
-0.26251405477523804,
-0.7017943859100342,
-0.05211328715085983,
-0.4157251715660095,
0.28591400384902954,
-0.09925338625907898,
-0.2513566017150879,
-0.5282673835754395,
0.07752018421888351,
0.356474906206131,
0.2858147919178009,
-0.6602252721786499,
-0.4037213623523712,
-0.06954474002122879,
-0.1749597191810608,
-0.1526872217655182,
0.5311557054519653,
-0.6188962459564209,
0.3155328035354614,
0.5392404198646545,
0.4592815637588501,
0.7304331660270691,
-0.31866779923439026,
0.1789196878671646,
-0.8135223388671875,
0.44618549942970276,
0.28952762484550476,
0.496137797832489,
0.17771534621715546,
-0.10224894434213638,
0.6510251760482788,
0.3905167877674103,
-0.5488024353981018,
-1.1336746215820312,
-0.05327087640762329,
-1.1597306728363037,
-0.17583464086055756,
1.0821641683578491,
-0.4279833137989044,
-0.18486636877059937,
0.32431212067604065,
-0.046445220708847046,
0.38773420453071594,
-0.37060829997062683,
0.7077273726463318,
0.8218902349472046,
-0.01997959427535534,
-0.17376047372817993,
-0.5527202486991882,
0.4147246778011322,
0.38443124294281006,
-0.5958880186080933,
-0.3544195592403412,
0.21821263432502747,
0.3817683160305023,
0.4027414917945862,
0.3337502181529999,
0.09326931089162827,
0.19921858608722687,
-0.026453493162989616,
0.2712588608264923,
-0.12303932756185532,
-0.26778557896614075,
-0.09649723768234253,
-0.04939032718539238,
-0.04600723087787628,
-0.15858064591884613
] |
openai/clip-vit-base-patch16 | openai | "2022-10-04T09:42:28Z" | 2,581,161 | 46 | transformers | [
"transformers",
"pytorch",
"jax",
"clip",
"zero-shot-image-classification",
"vision",
"arxiv:2103.00020",
"arxiv:1908.04913",
"endpoints_compatible",
"has_space",
"region:us"
] | zero-shot-image-classification | "2022-03-02T23:29:05Z" | ---
tags:
- vision
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
candidate_labels: playing music, playing sports
example_title: Cat & Dog
---
# Model Card: CLIP
Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found [here](https://github.com/openai/CLIP/blob/main/model-card.md).
## Model Details
The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within.
### Model Date
January 2021
### Model Type
The base model uses a ViT-B/16 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss.
The original implementation had two variants: one using a ResNet image encoder and the other using a Vision Transformer. This repository has the variant with the Vision Transformer.
### Documents
- [Blog Post](https://openai.com/blog/clip/)
- [CLIP Paper](https://arxiv.org/abs/2103.00020)
### Use with Transformers
```python3
from PIL import Image
import requests
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("openai/clip-vit-base-patch16")
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch16")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=["a photo of a cat", "a photo of a dog"], images=image, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
```
## Model Use
### Intended Use
The model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such models - the CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.
#### Primary intended uses
The primary intended users of these models are AI researchers.
We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.
### Out-of-Scope Use Cases
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
## Data
The model was trained on publicly available image-caption data. This was done through a combination of crawling a handful of websites and using commonly-used pre-existing image datasets such as [YFCC100M](http://projects.dfki.uni-kl.de/yfcc100m/). A large portion of the data comes from our crawling of the internet. This means that the data is more representative of people and societies most connected to the internet which tend to skew towards more developed nations, and younger, male users.
### Data Mission Statement
Our goal with building this dataset was to test out robustness and generalizability in computer vision tasks. As a result, the focus was on gathering large quantities of data from different publicly-available internet data sources. The data was gathered in a mostly non-interventionist manner. However, we only crawled websites that had policies against excessively violent and adult images and allowed us to filter out such content. We do not intend for this dataset to be used as the basis for any commercial or deployed model and will not be releasing the dataset.
## Performance and Limitations
### Performance
We have evaluated the performance of CLIP on a wide range of benchmarks across a variety of computer vision datasets such as OCR to texture recognition to fine-grained classification. The paper describes model performance on the following datasets:
- Food101
- CIFAR10
- CIFAR100
- Birdsnap
- SUN397
- Stanford Cars
- FGVC Aircraft
- VOC2007
- DTD
- Oxford-IIIT Pet dataset
- Caltech101
- Flowers102
- MNIST
- SVHN
- IIIT5K
- Hateful Memes
- SST-2
- UCF101
- Kinetics700
- Country211
- CLEVR Counting
- KITTI Distance
- STL-10
- RareAct
- Flickr30
- MSCOCO
- ImageNet
- ImageNet-A
- ImageNet-R
- ImageNet Sketch
- ObjectNet (ImageNet Overlap)
- Youtube-BB
- ImageNet-Vid
## Limitations
CLIP and our analysis of it have a number of limitations. CLIP currently struggles with respect to certain tasks such as fine grained classification and counting objects. CLIP also poses issues with regards to fairness and bias which we discuss in the paper and briefly in the next section. Additionally, our approach to testing CLIP also has an important limitation- in many cases we have used linear probes to evaluate the performance of CLIP and there is evidence suggesting that linear probes can underestimate model performance.
### Bias and Fairness
We find that the performance of CLIP - and the specific biases it exhibits - can depend significantly on class design and the choices one makes for categories to include and exclude. We tested the risk of certain kinds of denigration with CLIP by classifying images of people from [Fairface](https://arxiv.org/abs/1908.04913) into crime-related and non-human animal categories. We found significant disparities with respect to race and gender. Additionally, we found that these disparities could shift based on how the classes were constructed. (Details captured in the Broader Impacts Section in the paper).
We also tested the performance of CLIP on gender, race and age classification using the Fairface dataset (We default to using race categories as they are constructed in the Fairface dataset.) in order to assess quality of performance across different demographics. We found accuracy >96% across all races for gender classification with ‘Middle Eastern’ having the highest accuracy (98.4%) and ‘White’ having the lowest (96.5%). Additionally, CLIP averaged ~93% for racial classification and ~63% for age classification. Our use of evaluations to test for gender, race and age classification as well as denigration harms is simply to evaluate performance of the model across people and surface potential risks and not to demonstrate an endorsement/enthusiasm for such tasks.
## Feedback
### Where to send questions or comments about the model
Please use [this Google Form](https://forms.gle/Uv7afRH5dvY34ZEs9)
| [
-0.49865058064460754,
-0.5712653994560242,
0.1651592254638672,
-0.02610836550593376,
-0.16207505762577057,
-0.2513534128665924,
0.030952269211411476,
-0.7080349326133728,
0.12376299500465393,
0.3799942135810852,
-0.2780819237232208,
-0.40410417318344116,
-0.629612922668457,
0.11762116104364395,
-0.6190774440765381,
0.7103995680809021,
-0.06505978107452393,
0.06650842726230621,
-0.3062915503978729,
-0.32749560475349426,
-0.5047440528869629,
-0.6807716488838196,
-0.23731623589992523,
0.16138817369937897,
0.07978671789169312,
0.14806750416755676,
0.657921314239502,
0.8395299911499023,
0.7948800325393677,
0.21635937690734863,
-0.3096291124820709,
-0.11465532332658768,
-0.49841734766960144,
-0.6160654425621033,
-0.37672948837280273,
-0.39257141947746277,
-0.38861164450645447,
0.21011416614055634,
0.5186671018600464,
0.36594778299331665,
0.028810175135731697,
0.29081910848617554,
0.07030226290225983,
0.36612480878829956,
-0.9209768772125244,
-0.04669589921832085,
-0.5553969740867615,
0.06415650993585587,
-0.28380951285362244,
0.14105190336704254,
-0.1712731122970581,
-0.1924993097782135,
0.30861830711364746,
-0.5013750195503235,
0.48408788442611694,
-0.058327566832304,
1.3011637926101685,
0.17451165616512299,
-0.16062867641448975,
-0.031027335673570633,
-0.5799372792243958,
0.7392761707305908,
-0.5681632161140442,
0.2363089621067047,
0.23136740922927856,
0.3840251564979553,
0.14715071022510529,
-0.8341999053955078,
-0.6274367570877075,
-0.05365590378642082,
0.29588595032691956,
0.018573999404907227,
-0.22962412238121033,
-0.05882105603814125,
0.4105426073074341,
0.49004215002059937,
-0.15757066011428833,
-0.0643715038895607,
-0.7138795256614685,
-0.21670131385326385,
0.6661442518234253,
0.29506802558898926,
0.3361203074455261,
-0.23445914685726166,
-0.6235164403915405,
-0.46076592803001404,
-0.4486994445323944,
0.5350871682167053,
0.3842925429344177,
0.09430187940597534,
-0.15531501173973083,
0.6364148855209351,
-0.04360475018620491,
0.4283648431301117,
0.008241093717515469,
-0.3426539897918701,
0.34144970774650574,
-0.4700772166252136,
-0.18110184371471405,
-0.2687194049358368,
0.7515064477920532,
0.8266278505325317,
0.1737506091594696,
0.20637370645999908,
-0.08521345257759094,
0.21211181581020355,
0.3446320593357086,
-0.9203134775161743,
-0.15995976328849792,
-0.20097164809703827,
-0.6209362745285034,
-0.368720144033432,
0.28047871589660645,
-0.9118290543556213,
0.08408548682928085,
-0.11411036550998688,
0.7284980416297913,
-0.44708970189094543,
-0.07296577841043472,
0.18929968774318695,
-0.3168220520019531,
0.3217015266418457,
0.32375645637512207,
-0.6737951040267944,
0.38124215602874756,
0.31479230523109436,
1.0902481079101562,
-0.469746857881546,
-0.30866020917892456,
0.05372893065214157,
-0.06350832432508469,
-0.11583728343248367,
0.7081141471862793,
-0.3727876842021942,
-0.4669012725353241,
-0.19397298991680145,
0.4320746064186096,
-0.12268728017807007,
-0.6067065000534058,
0.5713347792625427,
-0.20376665890216827,
0.02515072375535965,
-0.27906954288482666,
-0.37973544001579285,
-0.6191224455833435,
0.31227734684944153,
-0.7043200731277466,
0.8886680006980896,
0.151926651597023,
-0.7726826667785645,
0.3777223825454712,
-0.7027797698974609,
-0.053135063499212265,
-0.12214108556509018,
-0.09874583035707474,
-0.5901069641113281,
-0.28058889508247375,
0.4017271399497986,
0.31809160113334656,
-0.2250986248254776,
0.3625289499759674,
-0.5982235670089722,
-0.49048352241516113,
0.179849773645401,
-0.43148723244667053,
0.8829340934753418,
0.019211718812584877,
-0.3265596032142639,
-0.003437815932556987,
-0.453762024641037,
-0.17159177362918854,
0.34816110134124756,
0.010498126037418842,
-0.15596263110637665,
-0.10611419379711151,
0.19282926619052887,
0.09344908595085144,
-0.04050491005182266,
-0.6787550449371338,
0.1249922439455986,
-0.08527840673923492,
0.530631959438324,
0.6668190956115723,
0.09822724759578705,
0.2737140953540802,
-0.4267406165599823,
0.5180642604827881,
-0.019349081441760063,
0.6514796018600464,
-0.24429951608181,
-0.5161274075508118,
-0.48549938201904297,
-0.45889154076576233,
0.5737290978431702,
0.6440281271934509,
-0.42811837792396545,
0.1590416580438614,
-0.13669726252555847,
-0.3349003493785858,
-0.18446297943592072,
-0.21763865649700165,
0.33969739079475403,
0.6508355736732483,
0.3456067740917206,
-0.9711790084838867,
-0.40125709772109985,
-1.0364494323730469,
0.19089943170547485,
0.06280115991830826,
-0.05083730071783066,
0.684299647808075,
0.8926499485969543,
-0.23464874923229218,
1.0697827339172363,
-0.7404417395591736,
-0.40733975172042847,
-0.13779206573963165,
-0.13152390718460083,
-0.022947868332266808,
0.49294960498809814,
0.939460813999176,
-0.9194398522377014,
-0.25718459486961365,
-0.523777961730957,
-0.7979656457901001,
0.1397799700498581,
0.1985369324684143,
-0.09062669426202774,
0.04346507787704468,
0.21326732635498047,
-0.24384482204914093,
1.0178719758987427,
0.253967821598053,
-0.050159551203250885,
0.7221906781196594,
0.09026943147182465,
0.2833075523376465,
-0.5820261836051941,
0.35894203186035156,
0.16533531248569489,
-0.14944574236869812,
-0.48314693570137024,
0.04843331500887871,
-0.0038375358562916517,
-0.41788238286972046,
-0.9213675856590271,
0.36759307980537415,
-0.14172804355621338,
-0.12400539964437485,
-0.15677206218242645,
-0.18695193529129028,
0.3156842887401581,
0.7086588740348816,
0.1361633986234665,
1.0603214502334595,
0.4944232702255249,
-0.753574013710022,
-0.026780031621456146,
0.5372357368469238,
-0.46568912267684937,
0.5321899056434631,
-0.9392050504684448,
-0.040940091013908386,
-0.05766969174146652,
0.09775496274232864,
-0.5571543574333191,
-0.3318501114845276,
0.30964770913124084,
-0.35535961389541626,
0.20833180844783783,
-0.13302728533744812,
-0.31045910716056824,
-0.5911585092544556,
-0.5387256145477295,
0.7422675490379333,
0.5029054284095764,
-0.4413939416408539,
0.36096444725990295,
0.7072567939758301,
0.18608662486076355,
-0.5268713235855103,
-0.762755811214447,
-0.08487249165773392,
-0.2017769068479538,
-0.7157188057899475,
0.5435415506362915,
-0.0006924701738171279,
0.07693443447351456,
0.13545110821723938,
0.08104955404996872,
-0.3119322955608368,
0.0307463388890028,
0.4541968107223511,
0.5116963386535645,
-0.07479201257228851,
-0.12738001346588135,
-0.2918115258216858,
0.3557187020778656,
-0.07481115311384201,
0.1273891031742096,
0.26531699299812317,
-0.1430908590555191,
-0.3370499908924103,
-0.5009666681289673,
0.3187417685985565,
0.4428563416004181,
-0.26404082775115967,
0.4804902672767639,
0.48098281025886536,
-0.2768183946609497,
0.11203749477863312,
-0.5263925790786743,
-0.034883901476860046,
-0.4379408657550812,
0.48730945587158203,
-0.12414003908634186,
-0.663503110408783,
0.7219024896621704,
0.14498724043369293,
-0.1448323130607605,
0.6187906265258789,
0.3037872612476349,
0.006654519122093916,
0.8380739688873291,
0.9289618134498596,
0.04234965518116951,
0.6322333216667175,
-0.8049924373626709,
-0.014249196276068687,
-0.9977272748947144,
-0.34223756194114685,
-0.2508407235145569,
-0.20839573442935944,
-0.4300093948841095,
-0.55070561170578,
0.5752276182174683,
0.17870214581489563,
-0.09925348311662674,
0.417244017124176,
-0.6522436141967773,
0.4431614279747009,
0.6096994876861572,
0.4445834457874298,
0.010201246477663517,
-0.08793114125728607,
-0.0028985580429434776,
-0.1599731743335724,
-0.6696866154670715,
-0.4954345226287842,
1.101394534111023,
0.6529903411865234,
0.6915232539176941,
-0.21422693133354187,
0.21781031787395477,
0.41577839851379395,
-0.0799814760684967,
-0.7385209202766418,
0.530724823474884,
-0.4452546536922455,
-0.7129862308502197,
-0.17839623987674713,
-0.05552729219198227,
-0.7524664402008057,
0.15297600626945496,
-0.1358712911605835,
-0.7398431301116943,
0.6053654551506042,
0.1339767575263977,
-0.3334108591079712,
0.6628162264823914,
-0.5848615765571594,
0.974712610244751,
-0.2884007692337036,
-0.4322613477706909,
0.07599644362926483,
-0.6412944793701172,
0.5693217515945435,
0.07357918471097946,
0.029555706307291985,
-0.2108977884054184,
0.1024058610200882,
1.0658706426620483,
-0.5741903185844421,
0.9143023490905762,
-0.11686088144779205,
0.4214625656604767,
0.7383953332901001,
-0.17325057089328766,
0.04469003155827522,
-0.2006228119134903,
0.1911841779947281,
0.7022888660430908,
0.2740149199962616,
-0.11641144752502441,
-0.3670791983604431,
0.1413605660200119,
-0.7175400257110596,
-0.39050039649009705,
-0.36505842208862305,
-0.4388388395309448,
0.2189861238002777,
0.2035420686006546,
0.5440646409988403,
0.7520139217376709,
-0.04653353989124298,
0.1585504710674286,
0.6086787581443787,
-0.4887281656265259,
0.37773287296295166,
0.19898433983325958,
-0.2713874578475952,
-0.5167389512062073,
0.8989012837409973,
0.2734140455722809,
0.2094060480594635,
0.0395197719335556,
0.08260869234800339,
-0.22511200606822968,
-0.4852372407913208,
-0.43563851714134216,
0.07092440873384476,
-0.7246183753013611,
-0.42453715205192566,
-0.5415650606155396,
-0.3628115952014923,
-0.43759799003601074,
-0.01659863255918026,
-0.47322016954421997,
-0.3328809142112732,
-0.6238811016082764,
0.198867067694664,
0.17477010190486908,
0.6359145045280457,
-0.10315234214067459,
0.2922790050506592,
-0.6074227094650269,
0.2500160336494446,
0.3774438202381134,
0.5218187570571899,
0.06560817360877991,
-0.68170565366745,
-0.14378654956817627,
-0.001953600440174341,
-0.8687981367111206,
-0.7894023656845093,
0.4420931339263916,
0.3201116919517517,
0.5845668315887451,
0.35248035192489624,
0.08993468433618546,
0.6854575872421265,
-0.4189034700393677,
1.0692415237426758,
0.22353515028953552,
-0.940538227558136,
0.545710027217865,
-0.3037722706794739,
0.21212361752986908,
0.6786156296730042,
0.4831452965736389,
-0.1995745748281479,
-0.1299590766429901,
-0.5424668788909912,
-0.876871645450592,
0.7861928343772888,
0.13716711103916168,
0.04441540688276291,
0.06051434949040413,
0.33069080114364624,
0.023915186524391174,
0.08720619231462479,
-0.6929337382316589,
-0.16128391027450562,
-0.5053537487983704,
0.056084249168634415,
0.28826284408569336,
-0.4225127100944519,
0.030580732971429825,
-0.41860461235046387,
0.40294021368026733,
-0.049734581261873245,
0.5515403151512146,
0.5300273299217224,
-0.176374152302742,
0.13838063180446625,
-0.10281958431005478,
0.6454824805259705,
0.5988636612892151,
-0.3918958306312561,
-0.22711557149887085,
0.2543199360370636,
-0.823677122592926,
0.01356853824108839,
-0.17779788374900818,
-0.5036777257919312,
-0.04358641803264618,
0.3092442750930786,
0.9240567088127136,
0.20390544831752777,
-0.7246308326721191,
0.9888021945953369,
-0.09553028643131256,
-0.5443722009658813,
-0.24623747169971466,
0.07794135063886642,
-0.5405009984970093,
0.12397614866495132,
0.31632715463638306,
0.22452187538146973,
0.4531266987323761,
-0.5062000751495361,
0.387762188911438,
0.4171546399593353,
-0.3457845449447632,
-0.37586021423339844,
0.7524724006652832,
0.14531174302101135,
-0.20254993438720703,
0.4911937713623047,
-0.17426958680152893,
-0.9429816603660583,
0.8039886951446533,
0.3985998034477234,
0.6500188708305359,
-0.010539169423282146,
0.16962787508964539,
0.6590719819068909,
0.1534929871559143,
-0.3323610723018646,
-0.04134730249643326,
0.007366636767983437,
-0.562100887298584,
-0.20824573934078217,
-0.4093282222747803,
-0.5785319209098816,
0.15036717057228088,
-0.9137652516365051,
0.41431596875190735,
-0.5043497681617737,
-0.4984445869922638,
-0.10780028998851776,
-0.265037477016449,
-0.7201062440872192,
0.138581320643425,
0.1518959105014801,
1.2038053274154663,
-0.8273211717605591,
0.4772419035434723,
0.4241931736469269,
-0.5913483500480652,
-0.7958021759986877,
-0.14434628188610077,
-0.10088774561882019,
-0.6278237700462341,
0.6525158286094666,
0.5314286351203918,
-0.009660771116614342,
-0.4570079445838928,
-0.9329941868782043,
-0.9717297554016113,
1.1140129566192627,
0.32259759306907654,
-0.39257991313934326,
-0.0855771005153656,
-0.02363530546426773,
0.33568695187568665,
-0.3270905911922455,
0.37130865454673767,
0.32996582984924316,
-0.021869268268346786,
0.33150696754455566,
-1.1467937231063843,
-0.18615321815013885,
-0.17270848155021667,
0.2598273754119873,
0.01693985052406788,
-0.8300109505653381,
1.0303075313568115,
-0.2707468867301941,
-0.4370797574520111,
0.05393439531326294,
0.4354577660560608,
-0.05714805796742439,
0.36910587549209595,
0.5076779723167419,
0.6869510412216187,
0.415216863155365,
0.05941663309931755,
1.0583980083465576,
-0.061016734689474106,
0.4490269422531128,
0.9174838662147522,
-0.1428179293870926,
0.8697958588600159,
0.2964155375957489,
-0.34724950790405273,
0.36985352635383606,
0.43344828486442566,
-0.6735107898712158,
0.75849449634552,
-0.0031433862168341875,
0.156643345952034,
-0.0378088541328907,
-0.4384450316429138,
-0.28834569454193115,
0.6982858180999756,
0.034392986446619034,
-0.44734540581703186,
-0.06456857174634933,
0.39587488770484924,
-0.24083822965621948,
-0.05612768605351448,
-0.44189634919166565,
0.4393545091152191,
-0.15862153470516205,
-0.3406916856765747,
0.4323708415031433,
0.06711813807487488,
0.9353066682815552,
-0.355979323387146,
-0.15211044251918793,
0.0842944085597992,
0.1885068267583847,
-0.08700987696647644,
-0.9298262596130371,
0.5457403063774109,
0.057480163872241974,
-0.22072793543338776,
0.08666006475687027,
0.7270320653915405,
-0.03033563308417797,
-0.5626731514930725,
0.21150638163089752,
-0.13832911849021912,
0.35002923011779785,
-0.09377168118953705,
-0.6974906325340271,
0.3296242952346802,
0.05848456174135208,
0.03163597360253334,
0.2805052101612091,
-0.019070466980338097,
-0.11158441752195358,
0.6589574217796326,
0.3790707290172577,
-0.04729163646697998,
0.11297664046287537,
-0.33573848009109497,
1.0318584442138672,
-0.5433096289634705,
-0.39965924620628357,
-0.6760923862457275,
0.34839150309562683,
-0.0954408049583435,
-0.33964553475379944,
0.6092662811279297,
0.6082208752632141,
1.105141520500183,
-0.11921865493059158,
0.5534809231758118,
-0.21369047462940216,
0.49874529242515564,
-0.36917123198509216,
0.44069692492485046,
-0.5168394446372986,
-0.031092118471860886,
-0.4258658289909363,
-0.6257525682449341,
-0.18384559452533722,
0.6037213802337646,
-0.395031213760376,
-0.0675135999917984,
0.4901558756828308,
0.7216126918792725,
-0.2443384826183319,
-0.031127898022532463,
0.25657230615615845,
-0.33466848731040955,
0.25262370705604553,
0.5994406342506409,
0.5981101393699646,
-0.7830820083618164,
0.6826847195625305,
-0.684529721736908,
-0.22438591718673706,
-0.1976310759782791,
-0.8227754831314087,
-1.019959568977356,
-0.4968295991420746,
-0.4233049750328064,
-0.13265074789524078,
-0.05696094036102295,
0.5606143474578857,
0.9553507566452026,
-0.7009223699569702,
-0.09338542819023132,
0.32365530729293823,
-0.06826037168502808,
-0.010526307858526707,
-0.24084554612636566,
0.36976659297943115,
0.20573978126049042,
-0.555191695690155,
-0.1856660395860672,
0.1262597292661667,
0.35512447357177734,
-0.17492063343524933,
0.11851398646831512,
-0.1979694366455078,
-0.059207119047641754,
0.4339742660522461,
0.5220571756362915,
-0.6427645683288574,
-0.3149615526199341,
0.1518624722957611,
0.04231880605220795,
0.3391297161579132,
0.6336115598678589,
-0.6302289962768555,
0.4308558702468872,
0.27436429262161255,
0.5384278893470764,
0.6564868688583374,
0.26055967807769775,
0.2027219980955124,
-0.42775142192840576,
0.20875591039657593,
0.21016991138458252,
0.33365362882614136,
0.3503362238407135,
-0.3933943808078766,
0.5843003392219543,
0.48339757323265076,
-0.6346295475959778,
-0.9646136164665222,
-0.03026578016579151,
-1.059255599975586,
-0.19387340545654297,
0.8691788911819458,
-0.40202614665031433,
-0.6711805462837219,
0.14831149578094482,
-0.20432114601135254,
0.17035570740699768,
-0.352061927318573,
0.6436536312103271,
0.3890741169452667,
-0.03593700751662254,
-0.3588389456272125,
-0.586268961429596,
0.1970205157995224,
0.056814007461071014,
-0.5123090147972107,
-0.3871448338031769,
0.36097899079322815,
0.5774446129798889,
0.33395567536354065,
0.473129540681839,
-0.3444545269012451,
0.3846665322780609,
0.042288705706596375,
0.29646316170692444,
-0.3231082260608673,
-0.3870493769645691,
-0.4692867696285248,
0.2923101782798767,
-0.2791169583797455,
-0.6047235131263733
] |
Intel/dpt-large | Intel | "2023-11-13T16:32:34Z" | 2,375,031 | 115 | transformers | [
"transformers",
"pytorch",
"dpt",
"depth-estimation",
"vision",
"arxiv:2103.13413",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | depth-estimation | "2022-03-02T23:29:05Z" | ---
license: apache-2.0
tags:
- vision
- depth-estimation
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
example_title: Tiger
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg
example_title: Teapot
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
example_title: Palace
model-index:
- name: dpt-large
results:
- task:
type: monocular-depth-estimation
name: Monocular Depth Estimation
dataset:
type: MIX-6
name: MIX-6
metrics:
- type: Zero-shot transfer
value: 10.82
name: Zero-shot transfer
config: Zero-shot transfer
verified: false
---
## Model Details: DPT-Large
Dense Prediction Transformer (DPT) model trained on 1.4 million images for monocular depth estimation.
It was introduced in the paper [Vision Transformers for Dense Prediction](https://arxiv.org/abs/2103.13413) by Ranftl et al. (2021) and first released in [this repository](https://github.com/isl-org/DPT).
DPT uses the Vision Transformer (ViT) as backbone and adds a neck + head on top for monocular depth estimation.
![model image](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/dpt_architecture.jpg)
The model card has been written in combination by the Hugging Face team and Intel.
| Model Detail | Description |
| ----------- | ----------- |
| Model Authors - Company | Intel |
| Date | March 22, 2022 |
| Version | 1 |
| Type | Computer Vision - Monocular Depth Estimation |
| Paper or Other Resources | [Vision Transformers for Dense Prediction](https://arxiv.org/abs/2103.13413) and [GitHub Repo](https://github.com/isl-org/DPT) |
| License | Apache 2.0 |
| Questions or Comments | [Community Tab](https://huggingface.co/Intel/dpt-large/discussions) and [Intel Developers Discord](https://discord.gg/rv2Gp55UJQ)|
| Intended Use | Description |
| ----------- | ----------- |
| Primary intended uses | You can use the raw model for zero-shot monocular depth estimation. See the [model hub](https://huggingface.co/models?search=dpt) to look for fine-tuned versions on a task that interests you. |
| Primary intended users | Anyone doing monocular depth estimation |
| Out-of-scope uses | This model in most cases will need to be fine-tuned for your particular task. The model should not be used to intentionally create hostile or alienating environments for people.|
### How to use
Here is how to use this model for zero-shot depth estimation on an image:
```python
from transformers import DPTImageProcessor, DPTForDepthEstimation
import torch
import numpy as np
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = DPTImageProcessor.from_pretrained("Intel/dpt-large")
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
# prepare image for the model
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predicted_depth = outputs.predicted_depth
# interpolate to original size
prediction = torch.nn.functional.interpolate(
predicted_depth.unsqueeze(1),
size=image.size[::-1],
mode="bicubic",
align_corners=False,
)
# visualize the prediction
output = prediction.squeeze().cpu().numpy()
formatted = (output * 255 / np.max(output)).astype("uint8")
depth = Image.fromarray(formatted)
```
For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/master/en/model_doc/dpt).
| Factors | Description |
| ----------- | ----------- |
| Groups | Multiple datasets compiled together |
| Instrumentation | - |
| Environment | Inference completed on Intel Xeon Platinum 8280 CPU @ 2.70GHz with 8 physical cores and an NVIDIA RTX 2080 GPU. |
| Card Prompts | Model deployment on alternate hardware and software will change model performance |
| Metrics | Description |
| ----------- | ----------- |
| Model performance measures | Zero-shot Transfer |
| Decision thresholds | - |
| Approaches to uncertainty and variability | - |
| Training and Evaluation Data | Description |
| ----------- | ----------- |
| Datasets | The dataset is called MIX 6, and contains around 1.4M images. The model was initialized with ImageNet-pretrained weights.|
| Motivation | To build a robust monocular depth prediction network |
| Preprocessing | "We resize the image such that the longer side is 384 pixels and train on random square crops of size 384. ... We perform random horizontal flips for data augmentation." See [Ranftl et al. (2021)](https://arxiv.org/abs/2103.13413) for more details. |
## Quantitative Analyses
| Model | Training set | DIW WHDR | ETH3D AbsRel | Sintel AbsRel | KITTI δ>1.25 | NYU δ>1.25 | TUM δ>1.25 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| DPT - Large | MIX 6 | 10.82 (-13.2%) | 0.089 (-31.2%) | 0.270 (-17.5%) | 8.46 (-64.6%) | 8.32 (-12.9%) | 9.97 (-30.3%) |
| DPT - Hybrid | MIX 6 | 11.06 (-11.2%) | 0.093 (-27.6%) | 0.274 (-16.2%) | 11.56 (-51.6%) | 8.69 (-9.0%) | 10.89 (-23.2%) |
| MiDaS | MIX 6 | 12.95 (+3.9%) | 0.116 (-10.5%) | 0.329 (+0.5%) | 16.08 (-32.7%) | 8.71 (-8.8%) | 12.51 (-12.5%)
| MiDaS [30] | MIX 5 | 12.46 | 0.129 | 0.327 | 23.90 | 9.55 | 14.29 |
| Li [22] | MD [22] | 23.15 | 0.181 | 0.385 | 36.29 | 27.52 | 29.54 |
| Li [21] | MC [21] | 26.52 | 0.183 | 0.405 | 47.94 | 18.57 | 17.71 |
| Wang [40] | WS [40] | 19.09 | 0.205 | 0.390 | 31.92 | 29.57 | 20.18 |
| Xian [45] | RW [45] | 14.59 | 0.186 | 0.422 | 34.08 | 27.00 | 25.02 |
| Casser [5] | CS [8] | 32.80 | 0.235 | 0.422 | 21.15 | 39.58 | 37.18 |
Table 1. Comparison to the state of the art on monocular depth estimation. We evaluate zero-shot cross-dataset transfer according to the
protocol defined in [30]. Relative performance is computed with respect to the original MiDaS model [30]. Lower is better for all metrics. ([Ranftl et al., 2021](https://arxiv.org/abs/2103.13413))
| Ethical Considerations | Description |
| ----------- | ----------- |
| Data | The training data come from multiple image datasets compiled together. |
| Human life | The model is not intended to inform decisions central to human life or flourishing. It is an aggregated set of monocular depth image datasets. |
| Mitigations | No additional risk mitigation strategies were considered during model development. |
| Risks and harms | The extent of the risks involved by using the model remain unknown. |
| Use cases | - |
| Caveats and Recommendations |
| ----------- |
| Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. There are no additional caveats or recommendations for this model. |
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-2103-13413,
author = {Ren{\'{e}} Ranftl and
Alexey Bochkovskiy and
Vladlen Koltun},
title = {Vision Transformers for Dense Prediction},
journal = {CoRR},
volume = {abs/2103.13413},
year = {2021},
url = {https://arxiv.org/abs/2103.13413},
eprinttype = {arXiv},
eprint = {2103.13413},
timestamp = {Wed, 07 Apr 2021 15:31:46 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2103-13413.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
``` | [
-0.7237185835838318,
-0.6006385087966919,
0.17728391289710999,
0.1309063732624054,
-0.5687975287437439,
-0.13780273497104645,
0.1714637130498886,
-0.5124877691268921,
0.4148351848125458,
0.3505004942417145,
-0.6907749772071838,
-0.5057336091995239,
-0.7120600938796997,
-0.1500415802001953,
-0.4213837683200836,
0.7144957184791565,
0.23604455590248108,
0.04759557545185089,
-0.22015276551246643,
-0.06886305660009384,
-0.21252967417240143,
-0.17765113711357117,
-0.48661941289901733,
-0.3347843587398529,
0.4882957339286804,
0.5393804311752319,
0.791595458984375,
0.5713394284248352,
0.6666983366012573,
0.36106204986572266,
-0.18864093720912933,
-0.23042032122612,
-0.48008379340171814,
-0.37894973158836365,
0.1486780047416687,
-0.1022103875875473,
-0.6693845391273499,
-0.07859963178634644,
0.7202558517456055,
0.7713571190834045,
-0.043380506336688995,
0.31599220633506775,
0.03264089673757553,
0.9271438717842102,
-0.45963191986083984,
-0.04527432098984718,
-0.30476412177085876,
0.3877417743206024,
0.023405399173498154,
-0.04545978456735611,
-0.08747833967208862,
0.1102319210767746,
0.8269550800323486,
-0.7014341950416565,
0.34736761450767517,
0.02346688322722912,
0.9639154672622681,
0.49668797850608826,
-0.25985753536224365,
0.2631235122680664,
-0.5015623569488525,
0.7872709631919861,
-0.8038042783737183,
0.32935041189193726,
-0.02904973179101944,
0.44744306802749634,
0.12757880985736847,
-0.5700491666793823,
-0.7007710933685303,
0.0425666943192482,
-0.09196659922599792,
0.44042304158210754,
-0.1819320023059845,
0.21109804511070251,
0.3754004240036011,
0.7204132676124573,
-0.6776963472366333,
0.008457367308437824,
-0.6542184352874756,
-0.040183912962675095,
0.8766509294509888,
0.04809406399726868,
-0.12917841970920563,
-0.3216749131679535,
-1.056686520576477,
-0.5168967843055725,
-0.16587978601455688,
0.4004146456718445,
0.19627779722213745,
0.01772051863372326,
-0.6575374007225037,
0.5948246121406555,
-0.4092380404472351,
0.832203209400177,
0.2821703255176544,
-0.35484495759010315,
0.5552624464035034,
-0.35197898745536804,
-0.6174312233924866,
0.1356736421585083,
0.8062217831611633,
0.4728793203830719,
0.3651598393917084,
0.15652456879615784,
-0.10031222552061081,
0.06383810192346573,
0.017083723098039627,
-0.970245361328125,
-0.17958587408065796,
0.4277492165565491,
-0.22583360970020294,
-0.41632381081581116,
0.27769264578819275,
-0.9592299461364746,
-0.18318094313144684,
-0.22748005390167236,
0.4348888099193573,
-0.4537102282047272,
-0.4207993745803833,
0.6139203310012817,
-0.11545540392398834,
0.4861529767513275,
0.33038777112960815,
-0.5192872881889343,
0.4086298644542694,
0.1756603717803955,
0.9496585726737976,
-0.19137358665466309,
-0.4946790933609009,
0.23727700114250183,
-0.08269013464450836,
-0.16208156943321228,
0.5434196591377258,
0.24446611106395721,
-0.2994379699230194,
-0.39969614148139954,
0.16976992785930634,
0.14573366940021515,
-0.38583996891975403,
0.45345911383628845,
-0.27375704050064087,
0.08372286707162857,
0.03746769577264786,
-0.3007594645023346,
-0.5518112778663635,
0.4749981164932251,
-0.6548891663551331,
0.8650365471839905,
0.2057107388973236,
-0.9481415152549744,
0.6007011532783508,
-0.4177365005016327,
-0.12179862707853317,
-0.043414779007434845,
0.07867200672626495,
-0.7686105370521545,
-0.008601254783570766,
0.39645060896873474,
0.4769842028617859,
-0.23650610446929932,
0.277301162481308,
-0.5093351006507874,
-0.3216257393360138,
-0.02587946131825447,
-0.4475586712360382,
1.1662132740020752,
-0.03973455727100372,
-0.36410143971443176,
0.14095337688922882,
-0.8952201008796692,
-0.19226530194282532,
0.4511272609233856,
0.04748331382870674,
-0.06112344563007355,
-0.4883362054824829,
-0.25322145223617554,
0.34678351879119873,
0.197831392288208,
-0.8489157557487488,
0.14240536093711853,
-0.5241795778274536,
0.03967839106917381,
0.782662034034729,
0.07727943360805511,
0.513042688369751,
-0.17784005403518677,
0.5669202208518982,
0.6069054007530212,
0.5271703004837036,
-0.1470601111650467,
-0.5542880296707153,
-0.7050277590751648,
-0.4528290927410126,
0.12183289974927902,
0.41335633397102356,
-0.6355289816856384,
0.4026672840118408,
-0.4319734573364258,
-0.7814347743988037,
-0.2897287905216217,
-0.24103619158267975,
0.3665720522403717,
0.8952803015708923,
0.5276274681091309,
-0.42088764905929565,
-0.7034383416175842,
-1.045493721961975,
0.36089304089546204,
-0.1200372576713562,
0.147362619638443,
0.18403270840644836,
0.6020116806030273,
-0.012484356760978699,
0.9042673707008362,
-0.6148599982261658,
-0.18913771212100983,
-0.052289046347141266,
-0.12114264070987701,
0.6014853119850159,
0.5479238629341125,
0.6706020832061768,
-0.7211583852767944,
-0.6707154512405396,
-0.24727101624011993,
-1.0272868871688843,
0.5031229257583618,
0.17738701403141022,
-0.12115848809480667,
0.11258972436189651,
-0.0621548593044281,
-0.7477403283119202,
0.8743265867233276,
0.6792618632316589,
-0.4483223855495453,
0.6934982538223267,
-0.06944072991609573,
-0.10634437203407288,
-0.9471025466918945,
0.030025087296962738,
0.35261690616607666,
-0.17965960502624512,
-0.6485325694084167,
-0.19701127707958221,
-0.06371589750051498,
-0.1373365819454193,
-0.6947721242904663,
0.7456203699111938,
-0.49990612268447876,
-0.15326933562755585,
0.16490581631660461,
-0.16741755604743958,
0.10269809514284134,
0.7087509036064148,
0.24512530863285065,
0.45622000098228455,
1.1666498184204102,
-0.6669973731040955,
0.5226725935935974,
0.3980475962162018,
-0.5532059073448181,
0.5246601104736328,
-1.030643105506897,
-0.12981699407100677,
-0.09648460149765015,
0.11800083518028259,
-0.9733638763427734,
-0.21024110913276672,
0.33253079652786255,
-0.6196410059928894,
0.47259828448295593,
-0.33186838030815125,
-0.14863456785678864,
-0.6495975255966187,
-0.3918270766735077,
0.6250516772270203,
0.5091791749000549,
-0.4659377634525299,
0.4106307029724121,
0.40359050035476685,
-0.0031680504325777292,
-0.8909469842910767,
-0.9529008269309998,
-0.11025885492563248,
-0.09390991926193237,
-1.169142246246338,
0.5054988861083984,
-0.07935217767953873,
-0.08246557414531708,
-0.125700905919075,
-0.14596563577651978,
-0.08855230361223221,
-0.3489362895488739,
0.3221098780632019,
0.6403427720069885,
-0.32927536964416504,
-0.21693095564842224,
-0.07640839368104935,
-0.14816218614578247,
-0.09338293969631195,
-0.12502460181713104,
0.3941660225391388,
-0.3155349791049957,
-0.20776759088039398,
-0.4773620367050171,
-0.06788331270217896,
0.5989102125167847,
-0.07654599845409393,
0.6050119400024414,
0.5564262866973877,
-0.3416188657283783,
0.003545626997947693,
-0.5176100134849548,
-0.4964471757411957,
-0.49106308817863464,
0.39948514103889465,
-0.26247742772102356,
-0.39987650513648987,
0.6715413331985474,
0.2477831095457077,
-0.20864775776863098,
0.6261817812919617,
0.29238706827163696,
-0.09117413312196732,
0.8119506239891052,
0.5806758403778076,
0.10687630623579025,
0.38094788789749146,
-0.9621336460113525,
-0.07001594454050064,
-0.7334802150726318,
-0.3514608144760132,
0.19044305384159088,
-0.669711709022522,
-0.42730823159217834,
-0.34396377205848694,
0.7244146466255188,
-0.0472918376326561,
-0.32279399037361145,
0.3658079504966736,
-0.6730479001998901,
0.14791418612003326,
0.6701245307922363,
0.4444512128829956,
0.17729534208774567,
0.3535359501838684,
-0.14886967837810516,
0.033704422414302826,
-0.8589015603065491,
0.029966363683342934,
0.9778372645378113,
0.5476688742637634,
0.8862220048904419,
-0.37972378730773926,
0.5591443181037903,
-0.07586375623941422,
-0.10055159777402878,
-0.65584796667099,
0.6444730162620544,
0.02970157563686371,
-0.9410524368286133,
-0.5319667458534241,
-0.4390171468257904,
-0.8190516829490662,
0.28072789311408997,
-0.20711347460746765,
-0.4844558835029602,
0.8278124332427979,
0.19453059136867523,
-0.6247672438621521,
0.5763324499130249,
-0.6859305500984192,
1.0395911931991577,
-0.3960517644882202,
-0.6012617945671082,
0.1674085259437561,
-1.016169548034668,
0.48068860173225403,
0.14977839589118958,
-0.20080025494098663,
-0.10503870993852615,
0.07336654514074326,
0.5856022834777832,
-0.3874821364879608,
0.7498424649238586,
-0.5130605697631836,
0.19142906367778778,
0.6016862988471985,
-0.05500713735818863,
0.2592950761318207,
0.2113845944404602,
-0.05163705721497536,
0.7674582600593567,
0.2005850374698639,
-0.543994128704071,
-0.24314218759536743,
0.5624266266822815,
-0.9027957916259766,
-0.41531088948249817,
-0.7425497770309448,
-0.8504256010055542,
0.08433704823255539,
0.4141498804092407,
0.4931764006614685,
0.4558306932449341,
-0.06812693923711777,
0.37027785181999207,
0.5880074501037598,
-0.3189529478549957,
0.41127490997314453,
0.239491805434227,
-0.37322089076042175,
-0.41012418270111084,
0.654332160949707,
0.291258305311203,
0.3725742995738983,
0.15665589272975922,
0.3254740536212921,
-0.28585687279701233,
-0.4952005445957184,
-0.564356803894043,
0.3620122969150543,
-0.4956975281238556,
-0.425135999917984,
-0.4060054421424866,
-0.45269039273262024,
-0.5886934399604797,
-0.1702486276626587,
-0.6255240440368652,
-0.5639320611953735,
-0.20125621557235718,
-0.2651308476924896,
0.22681809961795807,
0.4110720157623291,
-0.144613116979599,
0.26779496669769287,
-0.43860137462615967,
0.23164206743240356,
0.32391077280044556,
0.4148055613040924,
-0.16530907154083252,
-0.7819731831550598,
-0.2156674712896347,
0.29659244418144226,
-0.2958980202674866,
-0.6131226420402527,
0.553020179271698,
-0.015540070831775665,
0.1775665581226349,
0.4413759112358093,
-0.03286971151828766,
0.870963990688324,
0.007221005856990814,
0.6481584906578064,
0.5078109502792358,
-0.5518189072608948,
0.37340137362480164,
-0.19735459983348846,
0.6830697059631348,
0.5225428938865662,
0.44948455691337585,
-0.11597908288240433,
0.11342814564704895,
-0.735410213470459,
-0.6752121448516846,
0.921068012714386,
0.09450393170118332,
-0.18060293793678284,
0.44672131538391113,
0.2001405954360962,
0.07131372392177582,
0.29968467354774475,
-0.8999541401863098,
-0.44758448004722595,
-0.5576679110527039,
0.04405609145760536,
-0.175226628780365,
-0.14346855878829956,
0.040052708238363266,
-0.887908399105072,
0.6651685833930969,
0.01331029087305069,
0.3163066506385803,
0.7034905552864075,
0.0950385257601738,
-0.3479238748550415,
-0.3733135163784027,
0.41291236877441406,
0.8053984045982361,
-0.5961861610412598,
-0.034390658140182495,
0.13193686306476593,
-0.5313596725463867,
-0.03124285116791725,
0.2822926342487335,
-0.3525519371032715,
-0.041878841817379,
0.28019002079963684,
0.850197434425354,
0.16809065639972687,
-0.38194701075553894,
0.6920794248580933,
0.09259346127510071,
-0.551335334777832,
-0.5329043865203857,
-0.3490293622016907,
-0.2132342904806137,
0.2258688509464264,
0.37262409925460815,
0.40068840980529785,
0.1452803909778595,
-0.2229747474193573,
0.2282022386789322,
0.4861925542354584,
-0.5733546018600464,
-0.49370771646499634,
0.4282999038696289,
-0.044929295778274536,
0.2359350174665451,
0.6162784695625305,
-0.04141823574900627,
-0.2869044840335846,
0.8710117936134338,
0.21317361295223236,
0.8413606882095337,
-0.37546783685684204,
0.2665546238422394,
0.8995085954666138,
0.3281481862068176,
0.2056073099374771,
0.22105707228183746,
0.19395025074481964,
-0.7762858271598816,
-0.2527009844779968,
-0.7395082712173462,
-0.18498094379901886,
0.1195063665509224,
-0.5108627676963806,
0.514514148235321,
-0.5145537257194519,
-0.07810435444116592,
0.09435021132230759,
0.12793070077896118,
-0.9676341414451599,
0.42457106709480286,
0.3518466055393219,
1.0996054410934448,
-0.4994661509990692,
0.8454231023788452,
0.5467798709869385,
-0.7578723430633545,
-0.5906191468238831,
-0.4187123477458954,
-0.0423457957804203,
-0.9653410315513611,
0.2738493084907532,
0.1296531707048416,
-0.14750555157661438,
0.059466421604156494,
-0.8464352488517761,
-0.9522613883018494,
1.4849833250045776,
0.5503175258636475,
-0.5473587512969971,
-0.33571118116378784,
0.34193864464759827,
0.4171012341976166,
-0.3838653564453125,
0.24047769606113434,
0.22411225736141205,
0.4790107011795044,
0.5320820808410645,
-0.6614317893981934,
-0.08286961913108826,
-0.008020533248782158,
-0.11679158359766006,
-0.009655323810875416,
-0.7137331366539001,
1.14801025390625,
-0.402055948972702,
-0.19208133220672607,
0.03998887166380882,
0.5312522053718567,
0.26029345393180847,
0.41402363777160645,
0.7652279734611511,
0.9132125377655029,
0.1448245793581009,
-0.04895488917827606,
1.2007381916046143,
-0.4678073227405548,
0.4945850968360901,
0.9422101974487305,
0.0707053393125534,
0.3944677710533142,
0.6202148199081421,
-0.33187681436538696,
0.3815659284591675,
0.7453826069831848,
-0.15809257328510284,
0.548975944519043,
-0.12005535513162613,
0.038512278348207474,
-0.04580101743340492,
0.06821735948324203,
-0.5361902117729187,
0.5199165344238281,
0.02592231146991253,
-0.3541451692581177,
-0.05717941373586655,
-0.042471274733543396,
-0.3739602267742157,
-0.5297690629959106,
-0.2898465692996979,
0.5660992860794067,
0.08545247465372086,
-0.585914671421051,
0.7520580291748047,
-0.41042762994766235,
0.649420440196991,
-0.5825955271720886,
-0.04667696729302406,
-0.2968089282512665,
0.41628921031951904,
-0.3019496202468872,
-1.0052180290222168,
0.15627428889274597,
-0.5228261351585388,
-0.08438513427972794,
0.0602487251162529,
0.8110299110412598,
-0.3400630056858063,
-0.8899600505828857,
0.5574391484260559,
0.4547910988330841,
0.11081051081418991,
-0.34666943550109863,
-0.9767122268676758,
-0.08701314777135849,
-0.12085990607738495,
-0.5394543409347534,
0.13383808732032776,
0.3603365123271942,
0.6026067137718201,
0.5818720459938049,
0.4269716441631317,
0.012672768905758858,
0.38508644700050354,
-0.30736568570137024,
1.0925867557525635,
-0.41517946124076843,
-0.2866738736629486,
-0.6146007776260376,
0.9870835542678833,
-0.3127114474773407,
-0.429719477891922,
0.7886182069778442,
0.7044049501419067,
1.135054111480713,
-0.20540858805179596,
0.4698904752731323,
-0.06955592334270477,
0.433229923248291,
-0.14764857292175293,
0.41555118560791016,
-0.8472464680671692,
-0.08725292980670929,
-0.5164985060691833,
-1.2708945274353027,
-0.23486089706420898,
0.408769816160202,
-0.31942635774612427,
0.2044920027256012,
0.46855494379997253,
0.7843665480613708,
-0.6496236324310303,
-0.23126593232154846,
0.6041609644889832,
0.37759625911712646,
-0.1427539587020874,
0.36176690459251404,
0.3840895891189575,
-0.7920977473258972,
0.4923248291015625,
-1.1211587190628052,
-0.4602520167827606,
-0.09059911966323853,
-0.5798974633216858,
-0.6034751534461975,
-0.4360200762748718,
-0.369803249835968,
-0.2316790074110031,
-0.19466955959796906,
0.4593624174594879,
1.1218150854110718,
-0.6964952349662781,
-0.5329742431640625,
-0.08711497485637665,
-0.08695612847805023,
-0.3140794038772583,
-0.21360541880130768,
0.20353947579860687,
0.2739624083042145,
-0.6761916875839233,
0.1796935796737671,
0.44029536843299866,
0.17476125061511993,
-0.684309184551239,
-0.28635308146476746,
-0.7793596982955933,
-0.0425293929874897,
0.5707352757453918,
0.3024134635925293,
-0.7092597484588623,
-0.26519638299942017,
0.1702890247106552,
0.13574983179569244,
0.4034009873867035,
0.20741283893585205,
-0.6868837475776672,
0.8822413682937622,
0.5424762964248657,
0.2332310676574707,
0.9575397372245789,
-0.03447014093399048,
0.13182859122753143,
-0.6711585521697998,
0.5146210789680481,
0.32524481415748596,
0.5633072257041931,
0.4156564772129059,
-0.233064204454422,
0.7337673902511597,
0.3444459140300751,
-0.6503661870956421,
-0.7198952436447144,
0.00039057162939570844,
-1.3527153730392456,
0.007469086442142725,
0.8181776404380798,
-0.22530925273895264,
-0.5322413444519043,
0.3315969705581665,
-0.11321581155061722,
0.3260969817638397,
-0.21709716320037842,
0.5859259963035583,
0.3748648166656494,
0.05383988842368126,
-0.5415874123573303,
-0.4279738962650299,
0.2597339153289795,
0.2828705906867981,
-0.505814790725708,
-0.47723832726478577,
0.326299250125885,
0.33907023072242737,
0.42999914288520813,
0.4003964364528656,
-0.2589443027973175,
0.2550865411758423,
0.26353466510772705,
0.4636012613773346,
-0.17247062921524048,
-0.4980717599391937,
-0.4112602472305298,
-0.001941152848303318,
-0.3835916817188263,
-0.2921549379825592
] |
nlpconnect/vit-gpt2-image-captioning | nlpconnect | "2023-02-27T15:00:09Z" | 2,338,112 | 608 | transformers | [
"transformers",
"pytorch",
"vision-encoder-decoder",
"image-to-text",
"image-captioning",
"doi:10.57967/hf/0222",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | image-to-text | "2022-03-02T23:29:05Z" | ---
tags:
- image-to-text
- image-captioning
license: apache-2.0
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg
example_title: Savanna
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg
example_title: Football Match
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg
example_title: Airport
---
# nlpconnect/vit-gpt2-image-captioning
This is an image captioning model trained by @ydshieh in [flax ](https://github.com/huggingface/transformers/tree/main/examples/flax/image-captioning) this is pytorch version of [this](https://huggingface.co/ydshieh/vit-gpt2-coco-en-ckpts).
# The Illustrated Image Captioning using transformers
![](https://ankur3107.github.io/assets/images/vision-encoder-decoder.png)
* https://ankur3107.github.io/blogs/the-illustrated-image-captioning-using-transformers/
# Sample running code
```python
from transformers import VisionEncoderDecoderModel, ViTImageProcessor, AutoTokenizer
import torch
from PIL import Image
model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
feature_extractor = ViTImageProcessor.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
max_length = 16
num_beams = 4
gen_kwargs = {"max_length": max_length, "num_beams": num_beams}
def predict_step(image_paths):
images = []
for image_path in image_paths:
i_image = Image.open(image_path)
if i_image.mode != "RGB":
i_image = i_image.convert(mode="RGB")
images.append(i_image)
pixel_values = feature_extractor(images=images, return_tensors="pt").pixel_values
pixel_values = pixel_values.to(device)
output_ids = model.generate(pixel_values, **gen_kwargs)
preds = tokenizer.batch_decode(output_ids, skip_special_tokens=True)
preds = [pred.strip() for pred in preds]
return preds
predict_step(['doctor.e16ba4e4.jpg']) # ['a woman in a hospital bed with a woman in a hospital bed']
```
# Sample running code using transformers pipeline
```python
from transformers import pipeline
image_to_text = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")
image_to_text("https://ankur3107.github.io/assets/images/image-captioning-example.png")
# [{'generated_text': 'a soccer game with a player jumping to catch the ball '}]
```
# Contact for any help
* https://huggingface.co/ankur310794
* https://twitter.com/ankur310794
* http://github.com/ankur3107
* https://www.linkedin.com/in/ankur310794 | [
-0.2498638778924942,
-0.4316709339618683,
0.13126741349697113,
0.3771032989025116,
-0.560312032699585,
0.03426176309585571,
-0.0009354806388728321,
-0.3404082655906677,
-0.018504083156585693,
0.40083879232406616,
-0.58589106798172,
-0.2802312970161438,
-0.8293564319610596,
-0.003381190588697791,
-0.4256111979484558,
0.9757816791534424,
-0.2231721132993698,
0.04965871945023537,
-0.18126189708709717,
-0.125701442360878,
-0.48073193430900574,
-0.18497280776500702,
-0.7856507897377014,
-0.3326680362224579,
0.11723391711711884,
0.07579624652862549,
0.7653072476387024,
0.5442202687263489,
0.7791394591331482,
0.3470984995365143,
0.09102293103933334,
0.09733324497938156,
-0.2907331585884094,
-0.23899973928928375,
0.11181677877902985,
-0.4731711149215698,
-0.23250001668930054,
-0.048354990780353546,
0.52243971824646,
0.07077739387750626,
0.07161257416009903,
0.13594554364681244,
-0.022014480084180832,
0.4722256064414978,
-0.3274516463279724,
0.6049439907073975,
-0.48525628447532654,
0.3486860394477844,
0.134006530046463,
-0.3604309856891632,
-0.2848234176635742,
-0.11247903108596802,
0.2709959149360657,
-0.5398254990577698,
0.628477156162262,
0.05457313358783722,
1.5116240978240967,
0.4809867739677429,
-0.09194549918174744,
-0.18722818791866302,
-0.4969765245914459,
0.7332942485809326,
-0.7929890751838684,
-0.08175093680620193,
0.1392975002527237,
0.2642752230167389,
0.20514777302742004,
-1.2252333164215088,
-0.6058902740478516,
-0.13371354341506958,
-0.4783930480480194,
0.5303763151168823,
-0.37369951605796814,
0.01926073431968689,
0.4764265716075897,
0.3412095904350281,
-0.5962043404579163,
-0.11566748470067978,
-0.7226781249046326,
-0.4499737322330475,
0.499808669090271,
0.005158307962119579,
0.42403891682624817,
-0.3862801790237427,
-0.5900295376777649,
-0.3488346338272095,
-0.35436931252479553,
0.047424472868442535,
0.06928323209285736,
-0.16325293481349945,
-0.5910027623176575,
0.7241187691688538,
-0.06464704126119614,
0.5084837675094604,
0.04228244721889496,
-0.023552153259515762,
0.5428614020347595,
-0.14450253546237946,
-0.2355680763721466,
-0.0760059803724289,
1.1548681259155273,
0.699732780456543,
0.4008112847805023,
-0.07576686888933182,
-0.1217149943113327,
0.1459321528673172,
0.09445544332265854,
-1.0491352081298828,
-0.6567947268486023,
0.36524635553359985,
-0.5469033122062683,
-0.42055246233940125,
0.2509714365005493,
-0.9627405405044556,
-0.23268499970436096,
0.04574090614914894,
0.7188729643821716,
-0.4777316451072693,
-0.1461741030216217,
-0.024286599829792976,
-0.2634505033493042,
0.6079699397087097,
0.18624047935009003,
-0.9105430841445923,
0.0458168126642704,
0.29725050926208496,
1.1440964937210083,
0.030911894515156746,
-0.4097735285758972,
-0.30964574217796326,
-0.13789208233356476,
-0.1575133353471756,
0.6590003967285156,
0.11723671853542328,
-0.13360729813575745,
-0.08521664887666702,
0.28972163796424866,
-0.18208636343479156,
-0.3449307978153229,
0.37336671352386475,
-0.28640681505203247,
0.44018641114234924,
0.1502511352300644,
-0.2975226044654846,
-0.2598055601119995,
-0.0004652318311855197,
-0.5618389844894409,
0.8925925493240356,
0.36768701672554016,
-1.0678380727767944,
0.17317557334899902,
-0.803717315196991,
-0.3723723590373993,
0.04715876653790474,
-0.2039860039949417,
-1.0276607275009155,
-0.03795737400650978,
0.47305864095687866,
0.4188578426837921,
-0.1465470790863037,
0.041399743407964706,
0.0827937051653862,
-0.43882641196250916,
0.18374837934970856,
-0.512402355670929,
0.9258572459220886,
0.16364184021949768,
-0.6723738312721252,
0.2653577923774719,
-0.2721804976463318,
0.03130827471613884,
0.5252732634544373,
-0.045432593673467636,
0.4430463910102844,
-0.053490132093429565,
0.10528574883937836,
0.29047510027885437,
0.2545822560787201,
-0.39720168709754944,
0.17629706859588623,
-0.45044124126434326,
0.7848412394523621,
0.601925253868103,
-0.07153259962797165,
0.36609309911727905,
-0.16835719347000122,
0.4749925434589386,
0.0235892403870821,
0.2524142861366272,
-0.23602743446826935,
-0.8437426090240479,
-0.9480180144309998,
-0.30927035212516785,
0.10866370052099228,
0.6730631589889526,
-1.1110763549804688,
0.49944621324539185,
-0.3304518461227417,
-0.4833850860595703,
-0.5070390105247498,
-0.18154169619083405,
0.3208787739276886,
0.5290241241455078,
0.6054190397262573,
-0.523025393486023,
-0.6516971588134766,
-0.8955396413803101,
0.0891743004322052,
-0.21339650452136993,
-0.17692986130714417,
0.3486453890800476,
0.7376697063446045,
-0.2972407042980194,
0.9697167873382568,
-0.534999668598175,
-0.41293615102767944,
-0.2289886176586151,
0.19596265256404877,
0.5225358009338379,
0.6800468564033508,
0.5581628680229187,
-0.743399441242218,
-0.5390354990959167,
-0.16400794684886932,
-0.9200451970100403,
0.017112763598561287,
-0.2760672867298126,
-0.13161922991275787,
0.2699107229709625,
0.30157819390296936,
-0.8421384692192078,
0.649834156036377,
0.49262750148773193,
-0.3950304687023163,
0.7130135297775269,
-0.44293278455734253,
0.08773858845233917,
-1.112131953239441,
0.22315385937690735,
-0.005105092655867338,
-0.2665404975414276,
-0.37246453762054443,
0.11757723242044449,
0.08987480401992798,
-0.0027679111808538437,
-0.6010228991508484,
0.502062201499939,
-0.5455235838890076,
-0.03637760877609253,
-0.237400084733963,
-0.23080314695835114,
-0.02484353445470333,
0.6407107710838318,
0.33165279030799866,
0.751724123954773,
0.9941890239715576,
-0.2097475379705429,
0.8624076843261719,
0.578722357749939,
-0.28212830424308777,
0.17918096482753754,
-0.9251347780227661,
0.14330676198005676,
-0.17980140447616577,
0.3133729100227356,
-1.1551570892333984,
-0.3121562600135803,
0.6563228964805603,
-0.7867907881736755,
0.3860315978527069,
-0.4694710969924927,
-0.5492616295814514,
-0.7682623267173767,
-0.1989508718252182,
0.44587242603302,
0.8472191095352173,
-0.7248525619506836,
0.44603127241134644,
0.014229525811970234,
0.0196083914488554,
-0.6741296052932739,
-0.9799538254737854,
0.16640542447566986,
-0.21622876822948456,
-0.5390143990516663,
0.3919253349304199,
0.18725226819515228,
0.3663538098335266,
0.018465014174580574,
-0.11697452515363693,
-0.17343950271606445,
-0.3184548020362854,
0.28021448850631714,
0.5491970777511597,
-0.10372933745384216,
-0.2098066806793213,
-0.08736950159072876,
-0.41764625906944275,
0.2070876508951187,
-0.31770700216293335,
0.8160846829414368,
-0.4510955810546875,
-0.15737272799015045,
-0.6612627506256104,
0.10636237263679504,
0.45320725440979004,
-0.2437838464975357,
0.6680340766906738,
1.2224866151809692,
-0.3824388384819031,
0.09810788184404373,
-0.298233300447464,
-0.44778168201446533,
-0.5201746225357056,
0.7201530933380127,
-0.15943659842014313,
-0.6379789113998413,
0.5148983597755432,
0.1437053382396698,
-0.07064181566238403,
0.7359485030174255,
0.58124840259552,
-0.32865476608276367,
1.0115249156951904,
0.31892848014831543,
-0.13503453135490417,
0.34472203254699707,
-1.0016757249832153,
0.21982605755329132,
-0.7143649458885193,
-0.18744249641895294,
-0.15323586761951447,
-0.20931203663349152,
-0.5309358835220337,
-0.660108745098114,
0.32853251695632935,
0.2346412092447281,
-0.24305714666843414,
0.5714105367660522,
-1.0095382928848267,
0.34614837169647217,
0.4605939984321594,
0.279020756483078,
-0.1485370248556137,
0.48407086730003357,
-0.09751122444868088,
-0.08726023137569427,
-0.7727792263031006,
-0.3772938847541809,
0.8610655069351196,
0.5410589575767517,
0.6633217930793762,
-0.22874100506305695,
0.4199962615966797,
0.04026515409350395,
0.24122926592826843,
-0.7365218997001648,
0.4714362919330597,
-0.15038253366947174,
-0.5119955539703369,
-0.062188971787691116,
-0.3798648416996002,
-1.0137633085250854,
0.1735949069261551,
-0.21324753761291504,
-0.8878351449966431,
-0.06569880247116089,
0.2994805574417114,
-0.17360538244247437,
0.5850227475166321,
-0.6333523392677307,
1.0427567958831787,
-0.2017238736152649,
-0.3615375757217407,
0.07869444042444229,
-0.9414309859275818,
0.164686918258667,
0.30114462971687317,
-0.16483449935913086,
0.15030840039253235,
0.1898089498281479,
0.8321430683135986,
-0.3455478847026825,
0.7960860133171082,
-0.2611026465892792,
0.21053406596183777,
0.5920886993408203,
-0.13357935845851898,
0.5219373106956482,
0.13333269953727722,
0.32617929577827454,
0.37521281838417053,
-0.025303514674305916,
-0.4615355432033539,
-0.3229745924472809,
0.5443458557128906,
-0.9450953006744385,
-0.35420507192611694,
-0.635776698589325,
-0.4546355605125427,
0.34671154618263245,
0.13121557235717773,
0.9221637845039368,
0.49982425570487976,
0.3719411790370941,
0.18349218368530273,
0.39290452003479004,
-0.410900741815567,
0.7906967401504517,
-0.160741925239563,
-0.010829144157469273,
-0.6072269082069397,
0.9326105713844299,
-0.23557047545909882,
0.1470065861940384,
0.34764787554740906,
0.19886749982833862,
-0.6218773126602173,
-0.49730321764945984,
-0.5946526527404785,
0.3878815770149231,
-0.7309933304786682,
-0.43056172132492065,
-0.5312440991401672,
-0.5136870741844177,
-0.3629246652126312,
-0.09155769646167755,
-0.35752466320991516,
-0.3214647173881531,
-0.457012414932251,
0.024058155715465546,
0.6850029826164246,
0.2509332299232483,
0.0005606581689789891,
0.49485117197036743,
-0.7544559836387634,
0.5418984293937683,
0.26806509494781494,
0.37316152453422546,
-0.10472922772169113,
-0.7107307314872742,
-0.07900839298963547,
-0.06951327621936798,
-0.5270181894302368,
-0.857480525970459,
0.7107305526733398,
0.17752419412136078,
0.4061579704284668,
0.2719287574291229,
-0.18353421986103058,
0.5988454222679138,
-0.39530110359191895,
0.8053618669509888,
0.5071526765823364,
-0.8682358264923096,
0.43155166506767273,
-0.23326021432876587,
0.2788478136062622,
0.19713377952575684,
0.11447932571172714,
-0.5298994183540344,
-0.24700391292572021,
-0.6981996297836304,
-1.1467902660369873,
0.9339007139205933,
0.6357097625732422,
0.270089715719223,
0.2732574939727783,
0.3346526324748993,
-0.16990526020526886,
0.2506487965583801,
-1.096692442893982,
-0.5053825378417969,
-0.6485432982444763,
-0.30933481454849243,
-0.023700684309005737,
-0.11400032788515091,
-0.007539710029959679,
-0.566113293170929,
0.624495804309845,
-0.2331698089838028,
1.0216984748840332,
0.63081294298172,
-0.21826335787773132,
-0.08843377977609634,
-0.2410966455936432,
0.5386083722114563,
0.482487291097641,
-0.20669610798358917,
0.038739632815122604,
0.18017908930778503,
-0.544658362865448,
-0.11559215933084488,
0.2636953890323639,
-0.1616019308567047,
0.17634080350399017,
0.5875881910324097,
1.170753836631775,
-0.3421763479709625,
-0.22765064239501953,
0.6585105061531067,
-0.06270648539066315,
-0.451439768075943,
-0.45918044447898865,
-0.1467391848564148,
0.14099425077438354,
0.1359780877828598,
0.4207627475261688,
0.4782610535621643,
-0.13735583424568176,
-0.16882547736167908,
0.27637726068496704,
0.3633631765842438,
-0.546040952205658,
-0.1297803670167923,
1.0083904266357422,
0.04620852693915367,
-0.21237137913703918,
0.8849878907203674,
-0.16281582415103912,
-0.7401222586631775,
1.0108733177185059,
0.41965216398239136,
0.972287118434906,
0.23203635215759277,
0.28598588705062866,
0.712933361530304,
0.39552605152130127,
-0.04762038215994835,
0.15902133285999298,
0.12849120795726776,
-0.7041227221488953,
-0.4473285675048828,
-0.5246385335922241,
-0.16226772964000702,
0.08349142223596573,
-0.39403867721557617,
0.2909048795700073,
-0.45497652888298035,
-0.1542128622531891,
-0.12474986910820007,
-0.019465094432234764,
-0.8580136895179749,
0.3017181158065796,
0.13686597347259521,
0.6921826004981995,
-0.8427238464355469,
0.8126309514045715,
0.6033895611763,
-0.48692065477371216,
-0.8420218229293823,
-0.17642201483249664,
-0.33465874195098877,
-0.8611453175544739,
0.34638845920562744,
0.5198674201965332,
0.2894459068775177,
0.2876933515071869,
-0.7616739273071289,
-0.5565975308418274,
1.2755658626556396,
0.2004285305738449,
-0.26639583706855774,
0.06630358099937439,
0.2545979917049408,
0.5481773614883423,
-0.3473358750343323,
0.6176967620849609,
0.39606186747550964,
0.5427975058555603,
0.14396893978118896,
-0.7608645558357239,
0.2633362114429474,
-0.2928527295589447,
-0.03180621191859245,
-0.06711672246456146,
-0.6292069554328918,
0.9126359820365906,
-0.5928077697753906,
-0.18783843517303467,
0.5215159058570862,
0.7147651314735413,
0.17968672513961792,
0.10240715742111206,
0.46895718574523926,
0.522471010684967,
0.19241757690906525,
-0.516575813293457,
1.1887058019638062,
-0.18802210688591003,
1.0559501647949219,
0.712962806224823,
0.34688758850097656,
0.47350114583969116,
0.5775764584541321,
-0.20934101939201355,
0.4155685007572174,
0.6523681879043579,
-0.7542341947555542,
0.6040982007980347,
0.17338639497756958,
-0.07046438008546829,
0.11358451098203659,
0.27998724579811096,
-0.45756232738494873,
0.3920453190803528,
0.16464489698410034,
-0.6718289852142334,
-0.1622231900691986,
-0.1584760695695877,
-0.03672372177243233,
-0.28885436058044434,
-0.06230045109987259,
0.4744301438331604,
0.01864316314458847,
-0.512245237827301,
0.8575676083564758,
-0.03162573277950287,
0.8886887431144714,
-0.4557787775993347,
-0.13242986798286438,
0.08114410191774368,
0.1639062613248825,
-0.3506695032119751,
-0.9893702268600464,
0.2887480556964874,
-0.13415585458278656,
0.029952198266983032,
-0.04631297290325165,
0.6282097101211548,
-0.46162259578704834,
-0.6842486262321472,
0.31246089935302734,
0.21720722317695618,
0.34019413590431213,
-0.08943598717451096,
-1.125978708267212,
-0.09774047136306763,
0.22074143588542938,
-0.20816825330257416,
-0.09119320660829544,
-0.03708117455244064,
0.1634245216846466,
0.6004465818405151,
0.5869384407997131,
-0.030966702848672867,
0.1249622032046318,
0.023983756080269814,
0.6990228891372681,
-0.4298306405544281,
-0.37293002009391785,
-0.8999090194702148,
0.7812854051589966,
-0.20843172073364258,
-0.43467190861701965,
0.5987624526023865,
0.6537083983421326,
0.650397539138794,
-0.6078553199768066,
0.7429629564285278,
-0.4403243660926819,
-0.07190532982349396,
-0.388315886259079,
0.9159513115882874,
-0.38956141471862793,
-0.08558344095945358,
-0.3621920943260193,
-0.91776442527771,
-0.394843727350235,
1.0179747343063354,
-0.1617210954427719,
0.0881112813949585,
0.7818779349327087,
1.0166661739349365,
-0.17250636219978333,
-0.2860375642776489,
-0.02161790058016777,
0.24695439636707306,
0.3755808472633362,
0.6825762391090393,
0.608267068862915,
-0.9654238820075989,
0.7870503664016724,
-0.6506677865982056,
-0.14337624609470367,
-0.0010382458567619324,
-0.8554056286811829,
-0.8422424793243408,
-0.5007774233818054,
-0.6132488250732422,
-0.6791937351226807,
-0.12049686908721924,
0.645526111125946,
0.8516331911087036,
-0.9425498247146606,
-0.048108961433172226,
-0.4519168734550476,
-0.09232565015554428,
-0.26961830258369446,
-0.3429296016693115,
0.7321752905845642,
-0.06730677932500839,
-0.8502311706542969,
-0.22959455847740173,
-0.009615913033485413,
0.28322118520736694,
0.06229069456458092,
-0.218950092792511,
-0.04983077570796013,
-0.3438701629638672,
0.3632486164569855,
0.3895716965198517,
-0.7640764713287354,
-0.3041900396347046,
-0.20192855596542358,
-0.05742407217621803,
0.4116862118244171,
0.39870473742485046,
-0.6773169636726379,
0.5134089589118958,
0.5979093313217163,
0.23484644293785095,
0.7954201102256775,
-0.08592542260885239,
0.24707001447677612,
-0.7432287931442261,
0.43521302938461304,
0.1258939802646637,
0.6036539077758789,
0.4829537868499756,
-0.3794252276420593,
0.5606048703193665,
0.49653691053390503,
-0.5173125267028809,
-0.5304948091506958,
-0.055369313806295395,
-1.3108088970184326,
-0.06975217908620834,
1.1194334030151367,
-0.2536226212978363,
-0.19914747774600983,
0.26065656542778015,
-0.623580813407898,
0.5987070202827454,
-0.27891871333122253,
0.7881149649620056,
0.2250998169183731,
0.07175263017416,
-0.496677964925766,
-0.4427594542503357,
0.4562554359436035,
0.31541621685028076,
-0.5882819294929504,
-0.2844488024711609,
0.09934581071138382,
0.4310619831085205,
0.3932455778121948,
0.3914864957332611,
-0.2752288281917572,
0.4340190887451172,
0.033536411821842194,
0.31573280692100525,
-0.22667042911052704,
-0.04405255615711212,
-0.3467194736003876,
-0.059139277786016464,
-0.33142855763435364,
-0.6529840230941772
] |
bert-base-chinese | null | "2023-03-21T17:15:55Z" | 2,265,659 | 630 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"bert",
"fill-mask",
"zh",
"arxiv:1810.04805",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
language: zh
---
# Bert-base-chinese
## Table of Contents
- [Model Details](#model-details)
- [Uses](#uses)
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
- [Training](#training)
- [Evaluation](#evaluation)
- [How to Get Started With the Model](#how-to-get-started-with-the-model)
## Model Details
### Model Description
This model has been pre-trained for Chinese, training and random input masking has been applied independently to word pieces (as in the original BERT paper).
- **Developed by:** HuggingFace team
- **Model Type:** Fill-Mask
- **Language(s):** Chinese
- **License:** [More Information needed]
- **Parent Model:** See the [BERT base uncased model](https://huggingface.co/bert-base-uncased) for more information about the BERT base model.
### Model Sources
- **Paper:** [BERT](https://arxiv.org/abs/1810.04805)
## Uses
#### Direct Use
This model can be used for masked language modeling
## Risks, Limitations and Biases
**CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.**
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
## Training
#### Training Procedure
* **type_vocab_size:** 2
* **vocab_size:** 21128
* **num_hidden_layers:** 12
#### Training Data
[More Information Needed]
## Evaluation
#### Results
[More Information Needed]
## How to Get Started With the Model
```python
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("bert-base-chinese")
model = AutoModelForMaskedLM.from_pretrained("bert-base-chinese")
```
| [
-0.20674894750118256,
-0.7278012037277222,
0.009171775542199612,
0.4384777545928955,
-0.42811697721481323,
-0.23680901527404785,
-0.18656761944293976,
-0.4516254663467407,
0.19607020914554596,
0.5089585185050964,
-0.6043787002563477,
-0.5200222134590149,
-0.8793781399726868,
-0.2150862067937851,
-0.27278968691825867,
1.0687777996063232,
0.0043137758038938046,
0.37786346673965454,
0.26722678542137146,
-0.0650990754365921,
-0.27920034527778625,
-0.8508530259132385,
-0.5210902690887451,
-0.452632874250412,
0.2575884461402893,
-0.053276512771844864,
0.6050042510032654,
0.69110107421875,
0.2253517508506775,
0.3064115643501282,
-0.09755244106054306,
-0.16360588371753693,
-0.2930465042591095,
-0.319774866104126,
0.08980165421962738,
-0.1277044713497162,
-0.5256998538970947,
0.3331754803657532,
0.5985234975814819,
0.845443069934845,
-0.1435125321149826,
0.163360133767128,
0.08581165969371796,
0.44359052181243896,
-0.36371830105781555,
0.3346308767795563,
-0.5997670292854309,
0.444754421710968,
-0.22273747622966766,
0.4341066777706146,
-0.3195737898349762,
-0.31800588965415955,
0.2821793258190155,
-0.4834943115711212,
0.24170458316802979,
-0.11798054724931717,
1.216333270072937,
-0.16095741093158722,
-0.19074100255966187,
-0.30327722430229187,
-0.2571212351322174,
0.7737864255905151,
-0.9192470908164978,
0.4260278344154358,
0.585686445236206,
0.10627704113721848,
0.05303646996617317,
-0.8408047556877136,
-0.7423886060714722,
-0.2733781635761261,
-0.13431400060653687,
0.018945200368762016,
-0.0020484377164393663,
0.14594666659832,
0.29588940739631653,
0.38470613956451416,
-0.616105854511261,
0.04906051233410835,
-0.48509612679481506,
-0.6876128911972046,
0.674013078212738,
-0.15638157725334167,
0.6470123529434204,
-0.4399084150791168,
-0.4817458987236023,
-0.17540141940116882,
-0.40683475136756897,
0.1750319004058838,
0.5348615646362305,
0.38269010186195374,
-0.40015190839767456,
0.5111693143844604,
-0.04724736884236336,
0.5775458812713623,
-0.0008896839572116733,
-0.06703944504261017,
0.5748023390769958,
-0.22502368688583374,
-0.3712994158267975,
-0.10416211187839508,
0.7856348156929016,
0.1208476647734642,
0.2663812041282654,
-0.16616497933864594,
-0.3892712891101837,
-0.1438504457473755,
-0.043086908757686615,
-0.7724443078041077,
-0.5298221707344055,
0.10552773624658585,
-0.7318822145462036,
-0.35038694739341736,
0.14361968636512756,
-0.34317290782928467,
-0.1550610363483429,
-0.07588154077529907,
0.7773059606552124,
-0.5776713490486145,
-0.40968483686447144,
0.1143292561173439,
-0.14715351164340973,
0.3749614357948303,
0.04964001104235649,
-0.7684849500656128,
0.2644188702106476,
0.28776630759239197,
0.6172564029693604,
-0.03855450823903084,
-0.3665908873081207,
-0.12997116148471832,
-0.09385380148887634,
-0.19388329982757568,
0.35561442375183105,
-0.20736418664455414,
-0.31387510895729065,
0.23791030049324036,
0.21196235716342926,
-0.0476812906563282,
-0.2947380542755127,
0.5932474732398987,
-0.35437560081481934,
0.6793158650398254,
-0.33770713210105896,
-0.46445226669311523,
-0.3815806210041046,
0.1282636523246765,
-0.6701932549476624,
1.1351617574691772,
0.21497280895709991,
-0.808003306388855,
0.29806414246559143,
-0.7142990231513977,
-0.6194937825202942,
0.12347657233476639,
-0.046897757798433304,
-0.40970373153686523,
-0.21517865359783173,
0.2496689110994339,
0.41866031289100647,
0.23996980488300323,
0.2803017199039459,
-0.09974327683448792,
-0.3033040463924408,
0.022718600928783417,
-0.30448752641677856,
1.5861594676971436,
0.16700485348701477,
-0.5921466946601868,
0.07051108032464981,
-0.6310422420501709,
-0.040158990770578384,
0.378166526556015,
-0.1356603056192398,
-0.32454800605773926,
-0.25408613681793213,
0.23195970058441162,
0.41962432861328125,
0.5888131856918335,
-0.6937866806983948,
-0.09837993234395981,
-0.4705550968647003,
0.32226064801216125,
0.8847882747650146,
-0.41679322719573975,
0.3103172183036804,
-0.37418726086616516,
0.34228408336639404,
0.2408643662929535,
0.2994425594806671,
-0.06116504594683647,
-0.6558197140693665,
-1.0778454542160034,
-0.25485390424728394,
0.5110417604446411,
0.6566957235336304,
-0.8363025188446045,
0.8904619216918945,
0.15074008703231812,
-0.4919593036174774,
-0.772129476070404,
0.1284409761428833,
0.6129986047744751,
0.5108049511909485,
0.22370542585849762,
-0.6399702429771423,
-0.586595892906189,
-0.9568072557449341,
-0.050764426589012146,
-0.2103678584098816,
-0.05710974708199501,
0.26353633403778076,
0.5024924874305725,
-0.18956446647644043,
0.7158448696136475,
-0.28233015537261963,
-0.44842615723609924,
-0.31972232460975647,
0.2666766345500946,
0.16243863105773926,
0.6688976287841797,
0.6925004124641418,
-0.542008638381958,
-0.5078895092010498,
-0.44143930077552795,
-0.6429320573806763,
-0.23028266429901123,
0.10808449238538742,
-0.27074822783470154,
0.5053231716156006,
0.27742427587509155,
-0.41882601380348206,
0.3724667727947235,
0.7074669599533081,
-0.37220120429992676,
0.51639324426651,
-0.05077842250466347,
-0.3051508665084839,
-1.026413917541504,
0.14575272798538208,
-0.0856519415974617,
-0.0809212327003479,
-0.6552852988243103,
0.18804536759853363,
0.03591670095920563,
-0.11565810441970825,
-0.611687958240509,
0.7773399949073792,
-0.5101484656333923,
0.21535082161426544,
-0.23129837214946747,
-0.013676771894097328,
-0.04267863929271698,
0.8651038408279419,
0.3271127939224243,
0.49080994725227356,
0.592240035533905,
-0.5718886256217957,
0.20360760390758514,
0.2494489848613739,
-0.5878337025642395,
-0.011768699623644352,
-0.7832586169242859,
0.2006191909313202,
-0.05733773484826088,
0.16605345904827118,
-0.9000883102416992,
0.03803306445479393,
0.5530833601951599,
-0.6126761436462402,
0.3540850877761841,
0.1070450097322464,
-0.694311797618866,
-0.3785957396030426,
-0.3541015088558197,
0.314070463180542,
0.6814253330230713,
-0.5002274513244629,
0.5124566555023193,
0.5858616828918457,
-0.07603239268064499,
-0.8789724111557007,
-0.998362123966217,
-0.05208275094628334,
0.11676373332738876,
-0.6777512431144714,
0.40723276138305664,
-0.3163870871067047,
0.09768157452344894,
-0.012144552543759346,
0.20319722592830658,
-0.32448461651802063,
0.10377424955368042,
0.004547566175460815,
0.3181183338165283,
-0.08402366936206818,
-0.02722867764532566,
-0.003963688854128122,
0.13136142492294312,
0.10070503503084183,
-0.1693662703037262,
0.6510337591171265,
-0.08269105106592178,
-0.1631045639514923,
-0.21218623220920563,
0.26641911268234253,
0.00032610524795018137,
-0.15209899842739105,
0.8038309216499329,
1.0202792882919312,
-0.7094411253929138,
-0.23072077333927155,
-0.6058464646339417,
-0.2925589680671692,
-0.49304866790771484,
0.6109849214553833,
-0.1533200740814209,
-0.8099406361579895,
0.7457739114761353,
0.652935266494751,
0.1304606795310974,
0.6251834630966187,
0.7065979242324829,
0.04329437017440796,
1.0253424644470215,
1.0476460456848145,
-0.3425639867782593,
0.5942189693450928,
-0.032032258808612823,
0.27493390440940857,
-0.6671551465988159,
-0.20434580743312836,
-0.3097066581249237,
-0.12098205089569092,
-0.6243894100189209,
-0.3281322419643402,
0.019599437713623047,
-0.11566430330276489,
-0.33389773964881897,
0.4657158851623535,
-0.7363700866699219,
0.20952270925045013,
0.7428128719329834,
0.1359339952468872,
-0.033669814467430115,
0.012143434956669807,
-0.4970903694629669,
-0.1389840841293335,
-0.7332443594932556,
-0.45959511399269104,
0.9271575808525085,
0.7423972487449646,
0.6177350282669067,
-0.03202241659164429,
0.5631868839263916,
0.25170591473579407,
0.2830020487308502,
-0.618115246295929,
0.568060576915741,
-0.3960515260696411,
-1.08025062084198,
-0.41915997862815857,
-0.22571176290512085,
-0.8186615705490112,
0.309054434299469,
-0.09340143203735352,
-0.7079342603683472,
0.10580820590257645,
-0.011497367173433304,
-0.15673896670341492,
0.42267584800720215,
-0.7184193134307861,
0.8727946281433105,
-0.2944338023662567,
0.19026970863342285,
0.2945438325405121,
-0.8572991490364075,
0.6929162740707397,
-0.02008952386677265,
0.16273482143878937,
-0.10081282258033752,
0.24587580561637878,
0.9928287267684937,
-0.3291146457195282,
1.2576327323913574,
-0.2728869915008545,
-0.18818917870521545,
0.19491742551326752,
-0.043253056704998016,
0.16594015061855316,
-0.21997368335723877,
-0.04285862296819687,
0.6809035539627075,
-0.06307628750801086,
-0.4673890471458435,
-0.18422582745552063,
0.3652842342853546,
-1.0854933261871338,
-0.5325564742088318,
-0.6293991208076477,
-0.5734055638313293,
0.15167899429798126,
0.5060924291610718,
0.5038099884986877,
0.17112037539482117,
-0.2133484184741974,
-0.03892700374126434,
0.8024731278419495,
-0.6059223413467407,
0.36377012729644775,
0.6287499666213989,
-0.2236064076423645,
-0.31346872448921204,
0.829608142375946,
0.3572615087032318,
0.05095110461115837,
0.21801283955574036,
0.15660357475280762,
-0.25017446279525757,
-0.3025456666946411,
-0.29043257236480713,
0.30500826239585876,
-0.7403793931007385,
0.14202295243740082,
-0.7114302515983582,
-0.901380181312561,
-0.7997435331344604,
0.17575587332248688,
-0.1962665319442749,
-0.46179690957069397,
-0.23232924938201904,
-0.07007953524589539,
0.015485242940485477,
0.45972102880477905,
-0.29612624645233154,
0.3995162844657898,
-0.6193902492523193,
0.3120614290237427,
0.3240091800689697,
0.4974963665008545,
0.047277383506298065,
-0.8418094515800476,
-0.4129859507083893,
0.1899850219488144,
-0.25468912720680237,
-0.7874299883842468,
0.5155225992202759,
0.049047909677028656,
0.9286062717437744,
0.36783891916275024,
0.20461434125900269,
0.28243353962898254,
-0.5594109892845154,
1.0919809341430664,
0.10563002526760101,
-1.0475468635559082,
0.39737004041671753,
-0.22852039337158203,
0.28052958846092224,
0.27698788046836853,
0.28495484590530396,
-0.592389702796936,
-0.4562731981277466,
-0.7652289867401123,
-0.9092808961868286,
0.8810889720916748,
0.3101910650730133,
0.6064556241035461,
-0.021807299926877022,
0.13764718174934387,
0.13701237738132477,
0.3300504982471466,
-1.424319863319397,
-0.570575475692749,
-0.6271116137504578,
-0.20123088359832764,
0.15109363198280334,
-0.4147683084011078,
-0.16191165149211884,
-0.40042778849601746,
0.9706071615219116,
0.11332926154136658,
0.6766036748886108,
0.17316149175167084,
-0.40748557448387146,
0.0033083013258874416,
-0.08866474777460098,
0.6274675726890564,
0.38246309757232666,
-0.3874038755893707,
0.01497467327862978,
0.10803704708814621,
-0.7826911211013794,
-0.26274698972702026,
0.4163745641708374,
-0.3048986494541168,
0.32275155186653137,
0.3350330889225006,
0.9218453168869019,
-0.14847402274608612,
-0.41431719064712524,
0.7706512212753296,
-0.032315246760845184,
-0.37963730096817017,
-0.47317153215408325,
-0.12202031910419464,
-0.02025175467133522,
-0.058431848883628845,
0.2951642870903015,
-0.3709200620651245,
0.055251188576221466,
-0.458600252866745,
0.30499181151390076,
0.49133580923080444,
-0.48553329706192017,
-0.1961127370595932,
0.6067620515823364,
0.26214325428009033,
-0.2315032184123993,
0.6749664545059204,
-0.22287532687187195,
-0.8894096612930298,
0.7147418856620789,
0.5867713093757629,
1.045741081237793,
-0.29781511425971985,
0.19625034928321838,
0.4445744454860687,
0.7772902846336365,
0.23484821617603302,
0.3088970482349396,
0.009269380941987038,
-1.1083680391311646,
-0.15588894486427307,
-0.5205208659172058,
-0.19294585287570953,
0.4897060990333557,
-0.5109134912490845,
0.17464108765125275,
-0.6757761836051941,
-0.11398578435182571,
-0.16275383532047272,
0.25576677918434143,
-0.6644463539123535,
0.3922780156135559,
0.5062296390533447,
1.0827224254608154,
-0.9345428347587585,
1.121519684791565,
0.6395484209060669,
-0.7194465398788452,
-0.8381633758544922,
0.01973767578601837,
-0.08225864171981812,
-1.298583745956421,
0.8275959491729736,
0.25623801350593567,
0.20709916949272156,
-0.2593655288219452,
-0.8330391645431519,
-0.7542505264282227,
0.7526630163192749,
0.2138967514038086,
-0.17402371764183044,
-0.11587437987327576,
0.08964799344539642,
0.39736735820770264,
-0.4112500548362732,
0.29320764541625977,
0.3322393298149109,
0.37287819385528564,
-0.10189119726419449,
-1.002270221710205,
0.10983101278543472,
-0.4957417845726013,
0.14275269210338593,
-0.35155919194221497,
-0.7270472645759583,
1.1883620023727417,
0.059580132365226746,
-0.155442014336586,
0.1386307030916214,
0.8398383259773254,
0.29241475462913513,
-0.015782885253429413,
0.6293553113937378,
0.40154820680618286,
0.6125392317771912,
-0.04703348129987717,
0.7479705810546875,
-0.4021967649459839,
0.27750399708747864,
0.9982976913452148,
-0.04589008912444115,
0.5222296714782715,
0.13980716466903687,
-0.05566999316215515,
0.7299922108650208,
0.6952970623970032,
-0.36044803261756897,
0.5664435029029846,
0.19135384261608124,
-0.04802251234650612,
-0.028944052755832672,
-0.15532857179641724,
-0.4579620063304901,
0.26689639687538147,
0.2511369287967682,
-0.6199648976325989,
-0.15864329040050507,
-0.13280586898326874,
0.3076339662075043,
-0.06894001364707947,
-0.20021741092205048,
0.5657964944839478,
0.1428978145122528,
-0.46137306094169617,
0.42273256182670593,
0.4021252393722534,
1.0245978832244873,
-0.8860982060432434,
0.08017338067293167,
-0.2473231703042984,
-0.037104010581970215,
0.009606697596609592,
-0.7525818347930908,
0.019250188022851944,
-0.13147439062595367,
-0.19912157952785492,
-0.18128135800361633,
0.816648542881012,
-0.6853328347206116,
-0.679440975189209,
0.3192381262779236,
0.41079849004745483,
0.3040751814842224,
0.22444862127304077,
-1.179490089416504,
-0.030850587412714958,
0.09260048717260361,
-0.26460403203964233,
0.3167077302932739,
0.29970887303352356,
-0.10029219835996628,
0.5076147317886353,
0.5570533871650696,
0.1158212348818779,
0.1743209809064865,
0.27998191118240356,
0.8125059008598328,
-0.535170316696167,
-0.6645078063011169,
-0.6199896335601807,
0.6272934079170227,
-0.14504669606685638,
-0.31066593527793884,
0.7520061731338501,
0.4036063551902771,
1.0530270338058472,
-0.10411718487739563,
1.064644455909729,
-0.1585332751274109,
0.5143951177597046,
-0.44727620482444763,
1.131855845451355,
-0.4748348891735077,
-0.1765618920326233,
-0.5256915092468262,
-0.8477023839950562,
-0.3121786117553711,
1.0685954093933105,
-0.020391160622239113,
0.38575270771980286,
0.4958655536174774,
0.7018402814865112,
0.06872797012329102,
-0.19499340653419495,
0.3581516146659851,
0.3293018043041229,
0.19568900763988495,
0.44282278418540955,
0.42062926292419434,
-0.6820200085639954,
0.4343114197254181,
-0.6408417820930481,
-0.35832586884498596,
-0.06881067901849747,
-0.9941315054893494,
-1.1582273244857788,
-0.6590792536735535,
-0.3372718393802643,
-0.5535193681716919,
0.012809772975742817,
0.8738450407981873,
0.7933921813964844,
-0.9743431806564331,
-0.40001142024993896,
0.3328414559364319,
0.14713343977928162,
-0.12214851379394531,
-0.22514471411705017,
0.6253615617752075,
-0.33877021074295044,
-0.8496522307395935,
-0.1577443927526474,
-0.19484294950962067,
0.28032413125038147,
-0.5205802321434021,
-0.02912748046219349,
-0.3192574977874756,
0.19805894792079926,
0.5919294357299805,
0.30405694246292114,
-0.8896529674530029,
-0.3106703460216522,
0.0482715368270874,
-0.4229835867881775,
-0.21157634258270264,
0.38571542501449585,
-0.48272913694381714,
0.5904269814491272,
0.41154640913009644,
0.41010233759880066,
0.3486417233943939,
-0.34886226058006287,
0.7350849509239197,
-0.8888601064682007,
0.3811068832874298,
0.1201678141951561,
0.5474077463150024,
0.42529600858688354,
-0.39814335107803345,
0.3895292580127716,
0.31480035185813904,
-0.35322919487953186,
-0.8616554141044617,
0.045406773686409,
-0.9767693877220154,
-0.3900766670703888,
1.1796939373016357,
-0.22615663707256317,
-0.1835879683494568,
-0.07192973047494888,
-0.30502450466156006,
0.611857533454895,
-0.21556498110294342,
0.9737292528152466,
1.048903226852417,
0.23151996731758118,
-0.21337293088436127,
-0.3102264106273651,
0.5554131269454956,
0.4259156584739685,
-0.3805609941482544,
-0.1110149621963501,
0.2179722636938095,
0.4210679531097412,
0.11506770551204681,
0.7058522701263428,
-0.3250165283679962,
0.17074905335903168,
-0.11623085290193558,
0.6380960941314697,
-0.11207056045532227,
0.0045293462462723255,
-0.23754127323627472,
-0.11418856680393219,
-0.056230951100587845,
-0.4127943515777588
] |
cmarkea/distilcamembert-base-ner | cmarkea | "2023-08-01T10:05:12Z" | 2,168,725 | 16 | transformers | [
"transformers",
"pytorch",
"tf",
"onnx",
"safetensors",
"camembert",
"token-classification",
"fr",
"dataset:Jean-Baptiste/wikiner_fr",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"region:us"
] | token-classification | "2022-03-02T23:29:05Z" | ---
language: fr
license: mit
datasets:
- Jean-Baptiste/wikiner_fr
widget:
- text: "Boulanger, habitant à Boulanger et travaillant dans le magasin Boulanger situé dans la ville de Boulanger. Boulanger a écrit le livre éponyme Boulanger édité par la maison d'édition Boulanger."
- text: "Quentin Jerome Tarantino naît le 27 mars 1963 à Knoxville, dans le Tennessee. Il est le fils de Connie McHugh, une infirmière, née le 3 septembre 1946, et de Tony Tarantino, acteur et musicien amateur né à New York. Ce dernier est d'origine italienne par son père ; sa mère a des ascendances irlandaises et cherokees. Il est prénommé d'après Quint Asper, le personnage joué par Burt Reynolds dans la série Gunsmoke et Quentin Compson, personnage du roman Le Bruit et la Fureur. Son père quitte le domicile familial avant même sa naissance. En 1965, sa mère déménage à Torrance, dans la banlieue sud de Los Angeles, et se remarie avec Curtis Zastoupil, un pianiste de bar, qui lui fait découvrir le cinéma. Le couple divorce alors que le jeune Quentin a une dizaine d'années."
---
DistilCamemBERT-NER
===================
We present DistilCamemBERT-NER, which is [DistilCamemBERT](https://huggingface.co/cmarkea/distilcamembert-base) fine-tuned for the NER (Named Entity Recognition) task for the French language. The work is inspired by [Jean-Baptiste/camembert-ner](https://huggingface.co/Jean-Baptiste/camembert-ner) based on the [CamemBERT](https://huggingface.co/camembert-base) model. The problem of the modelizations based on CamemBERT is at the scaling moment, for the production phase, for example. Indeed, inference cost can be a technological issue. To counteract this effect, we propose this modelization which **divides the inference time by two** with the same consumption power thanks to [DistilCamemBERT](https://huggingface.co/cmarkea/distilcamembert-base).
Dataset
-------
The dataset used is [wikiner_fr](https://huggingface.co/datasets/Jean-Baptiste/wikiner_fr), which represents ~170k sentences labeled in 5 categories :
* PER: personality ;
* LOC: location ;
* ORG: organization ;
* MISC: miscellaneous entities (movies title, books, etc.) ;
* O: background (Outside entity).
Evaluation results
------------------
| **class** | **precision (%)** | **recall (%)** | **f1 (%)** | **support (#sub-word)** |
| :------------: | :---------------: | :------------: | :--------: | :---------------------: |
| **global** | 98.17 | 98.19 | 98.18 | 378,776 |
| **PER** | 96.78 | 96.87 | 96.82 | 23,754 |
| **LOC** | 94.05 | 93.59 | 93.82 | 27,196 |
| **ORG** | 86.05 | 85.92 | 85.98 | 6,526 |
| **MISC** | 88.78 | 84.69 | 86.69 | 11,891 |
| **O** | 99.26 | 99.47 | 99.37 | 309,409 |
Benchmark
---------
This model performance is compared to 2 reference models (see below) with the metric f1 score. For the mean inference time measure, an AMD Ryzen 5 4500U @ 2.3GHz with 6 cores was used:
| **model** | **time (ms)** | **PER (%)** | **LOC (%)** | **ORG (%)** | **MISC (%)** | **O (%)** |
| :---------------------------------------------------------------------------------------------------------------: | :-----------: | :---------: | :---------: | :---------: | :-----------: | :-------: |
| [cmarkea/distilcamembert-base-ner](https://huggingface.co/cmarkea/distilcamembert-base-ner) | **43.44** | **96.82** | **93.82** | **85.98** | **86.69** | **99.37** |
| [Davlan/bert-base-multilingual-cased-ner-hrl](https://huggingface.co/Davlan/bert-base-multilingual-cased-ner-hrl) | 87.56 | 79.93 | 72.89 | 61.34 | n/a | 96.04 |
| [flair/ner-french](https://huggingface.co/flair/ner-french) | 314.96 | 82.91 | 76.17 | 70.96 | 76.29 | 97.65 |
How to use DistilCamemBERT-NER
------------------------------
```python
from transformers import pipeline
ner = pipeline(
task='ner',
model="cmarkea/distilcamembert-base-ner",
tokenizer="cmarkea/distilcamembert-base-ner",
aggregation_strategy="simple"
)
result = ner(
"Le Crédit Mutuel Arkéa est une banque Française, elle comprend le CMB "
"qui est une banque située en Bretagne et le CMSO qui est une banque "
"qui se situe principalement en Aquitaine. C'est sous la présidence de "
"Louis Lichou, dans les années 1980 que différentes filiales sont créées "
"au sein du CMB et forment les principales filiales du groupe qui "
"existent encore aujourd'hui (Federal Finance, Suravenir, Financo, etc.)."
)
result
[{'entity_group': 'ORG',
'score': 0.9974479,
'word': 'Crédit Mutuel Arkéa',
'start': 3,
'end': 22},
{'entity_group': 'LOC',
'score': 0.9000358,
'word': 'Française',
'start': 38,
'end': 47},
{'entity_group': 'ORG',
'score': 0.9788757,
'word': 'CMB',
'start': 66,
'end': 69},
{'entity_group': 'LOC',
'score': 0.99919766,
'word': 'Bretagne',
'start': 99,
'end': 107},
{'entity_group': 'ORG',
'score': 0.9594884,
'word': 'CMSO',
'start': 114,
'end': 118},
{'entity_group': 'LOC',
'score': 0.99935514,
'word': 'Aquitaine',
'start': 169,
'end': 178},
{'entity_group': 'PER',
'score': 0.99911094,
'word': 'Louis Lichou',
'start': 208,
'end': 220},
{'entity_group': 'ORG',
'score': 0.96226394,
'word': 'CMB',
'start': 291,
'end': 294},
{'entity_group': 'ORG',
'score': 0.9983959,
'word': 'Federal Finance',
'start': 374,
'end': 389},
{'entity_group': 'ORG',
'score': 0.9984454,
'word': 'Suravenir',
'start': 391,
'end': 400},
{'entity_group': 'ORG',
'score': 0.9985084,
'word': 'Financo',
'start': 402,
'end': 409}]
```
### Optimum + ONNX
```python
from optimum.onnxruntime import ORTModelForTokenClassification
from transformers import AutoTokenizer, pipeline
HUB_MODEL = "cmarkea/distilcamembert-base-nli"
tokenizer = AutoTokenizer.from_pretrained(HUB_MODEL)
model = ORTModelForTokenClassification.from_pretrained(HUB_MODEL)
onnx_qa = pipeline("token-classification", model=model, tokenizer=tokenizer)
# Quantized onnx model
quantized_model = ORTModelForTokenClassification.from_pretrained(
HUB_MODEL, file_name="model_quantized.onnx"
)
```
Citation
--------
```bibtex
@inproceedings{delestre:hal-03674695,
TITLE = {{DistilCamemBERT : une distillation du mod{\`e}le fran{\c c}ais CamemBERT}},
AUTHOR = {Delestre, Cyrile and Amar, Abibatou},
URL = {https://hal.archives-ouvertes.fr/hal-03674695},
BOOKTITLE = {{CAp (Conf{\'e}rence sur l'Apprentissage automatique)}},
ADDRESS = {Vannes, France},
YEAR = {2022},
MONTH = Jul,
KEYWORDS = {NLP ; Transformers ; CamemBERT ; Distillation},
PDF = {https://hal.archives-ouvertes.fr/hal-03674695/file/cap2022.pdf},
HAL_ID = {hal-03674695},
HAL_VERSION = {v1},
}
``` | [
-0.566847562789917,
-0.6617075204849243,
0.3628891706466675,
0.2641156315803528,
-0.3110843002796173,
0.007771946024149656,
-0.2815709710121155,
-0.17793188989162445,
0.3815026879310608,
0.32578474283218384,
-0.5707331895828247,
-0.7206076979637146,
-0.8063475489616394,
0.2517969608306885,
-0.10731817036867142,
0.9476328492164612,
0.0321614071726799,
-0.012683717533946037,
0.21890521049499512,
-0.3152505159378052,
-0.13165287673473358,
-0.6144782900810242,
-0.7271477580070496,
-0.22395776212215424,
0.3569629490375519,
0.046505384147167206,
0.5467475056648254,
0.6061220169067383,
0.46169313788414,
0.39135298132896423,
-0.2980256974697113,
0.1991695612668991,
-0.13308311998844147,
-0.08901435136795044,
-0.018559027463197708,
-0.49545302987098694,
-0.7529559135437012,
0.02825787104666233,
0.6364318132400513,
0.7101216316223145,
-0.19204944372177124,
0.2865552008152008,
0.18311810493469238,
0.8058978915214539,
-0.42494308948516846,
0.3999341130256653,
-0.6420891284942627,
-0.015306382440030575,
-0.1999359130859375,
-0.1816582828760147,
-0.16486626863479614,
-0.23143254220485687,
-0.010483285412192345,
-0.6785900592803955,
0.37058329582214355,
0.222641721367836,
1.3669134378433228,
0.48298880457878113,
-0.2453572154045105,
-0.26060032844543457,
-0.539118766784668,
1.1414028406143188,
-1.1447757482528687,
0.4699040651321411,
0.3069722652435303,
0.06749234348535538,
-0.07384199649095535,
-0.8593315482139587,
-0.8413259983062744,
0.07703012228012085,
-0.513186514377594,
0.3875878155231476,
-0.39379215240478516,
-0.13112491369247437,
0.3287053406238556,
0.4754287898540497,
-0.6228762865066528,
0.021464191377162933,
-0.27625083923339844,
-0.10336978733539581,
0.751588761806488,
0.14063461124897003,
0.04073166102170944,
-0.4242425560951233,
-0.4224804937839508,
-0.18911513686180115,
-0.2613736391067505,
0.10955701768398285,
0.25479230284690857,
0.40155330300331116,
-0.27298703789711,
0.6607175469398499,
-0.34261006116867065,
0.7124161720275879,
0.3062293827533722,
-0.18895241618156433,
0.6978635191917419,
-0.4953468143939972,
-0.29358959197998047,
0.11260786652565002,
1.2543883323669434,
0.49355337023735046,
0.08027143776416779,
0.04877740517258644,
-0.27120670676231384,
0.09728297591209412,
-0.18307538330554962,
-0.919906735420227,
-0.3299957513809204,
0.38251203298568726,
-0.4955339729785919,
-0.16334837675094604,
0.18634341657161713,
-1.036567211151123,
0.148409903049469,
-0.2664817273616791,
0.2778402864933014,
-0.4909188151359558,
-0.2443070262670517,
0.015509644523262978,
-0.26888394355773926,
0.1479799747467041,
-0.06813163310289383,
-0.8182618618011475,
0.29491400718688965,
0.45657986402511597,
0.8809124231338501,
0.027974320575594902,
-0.15735404193401337,
-0.411090224981308,
-0.15688030421733856,
-0.10132362693548203,
0.6681799292564392,
-0.27066415548324585,
-0.3479888439178467,
-0.3698866069316864,
0.2116539180278778,
-0.27424514293670654,
-0.530796229839325,
0.6610108613967896,
-0.3637811243534088,
0.3214769959449768,
-0.18081802129745483,
-0.585720419883728,
-0.23689500987529755,
0.31250160932540894,
-0.7661795616149902,
1.219282865524292,
0.31209278106689453,
-1.0236748456954956,
0.5508481860160828,
-0.6943913698196411,
-0.2443685233592987,
-0.06015246361494064,
-0.19005544483661652,
-0.5761063098907471,
-0.09102867543697357,
0.4527660310268402,
0.5338324308395386,
-0.5990256667137146,
0.11803757399320602,
-0.07509700208902359,
0.04070768877863884,
0.11121898144483566,
-0.4067052900791168,
1.181577444076538,
0.3560185730457306,
-0.5732451677322388,
-0.07989366352558136,
-1.0943567752838135,
0.21430997550487518,
0.29220035672187805,
-0.4874477982521057,
-0.27391788363456726,
-0.07757929712533951,
-0.05683853477239609,
0.16096198558807373,
0.18353497982025146,
-0.4118529260158539,
0.04241698607802391,
-0.5276260375976562,
0.6249762177467346,
0.6380083560943604,
0.17390228807926178,
0.3793843686580658,
-0.3745427429676056,
0.4242759644985199,
0.1837104856967926,
0.17000143229961395,
0.08720990270376205,
-0.48752105236053467,
-0.857340395450592,
-0.6622217297554016,
0.647463858127594,
0.7852889895439148,
-0.6334303021430969,
0.8557412028312683,
-0.5513678789138794,
-0.6434608101844788,
-0.5683366060256958,
0.04307403787970543,
0.30732089281082153,
0.6519966125488281,
0.6076912879943848,
-0.14975246787071228,
-0.5792880058288574,
-1.0045130252838135,
-0.12355790287256241,
-0.214109405875206,
0.051411353051662445,
0.26030078530311584,
0.6499220728874207,
-0.1474175751209259,
0.9427747130393982,
-0.7902454137802124,
-0.3012664020061493,
-0.18901574611663818,
0.11270304769277573,
0.910466730594635,
0.5066419243812561,
0.7261393070220947,
-0.928310751914978,
-0.772968053817749,
-0.05330920219421387,
-0.8229227066040039,
-0.026748398318886757,
0.0876956507563591,
-0.0971209779381752,
0.3026367127895355,
0.3876473605632782,
-0.7181827425956726,
0.4007779657840729,
0.507846474647522,
-0.4328967034816742,
0.6475138664245605,
-0.2392188161611557,
0.24568215012550354,
-1.3660203218460083,
0.08164895325899124,
-0.0125817796215415,
-0.04442363977432251,
-0.5140416622161865,
-0.12919822335243225,
-0.03795110806822777,
0.32809656858444214,
-0.5167535543441772,
0.6354172229766846,
-0.7316103577613831,
0.3899923264980316,
0.23854267597198486,
0.1976827085018158,
0.12862159311771393,
0.7703312635421753,
-0.050331950187683105,
0.5656421184539795,
0.5982916951179504,
-0.7091187834739685,
0.45511502027511597,
0.21458344161510468,
-0.4778139889240265,
0.6677064299583435,
-0.6247084736824036,
-0.17203985154628754,
-0.10149002820253372,
0.2285066545009613,
-0.8918760418891907,
-0.0036067042965441942,
0.33915507793426514,
-0.5242330431938171,
0.466859370470047,
-0.23725232481956482,
-0.4895138740539551,
-0.49856820702552795,
-0.2380315661430359,
0.24894069135189056,
0.4235917329788208,
-0.44271549582481384,
0.7872371077537537,
0.26167112588882446,
-0.08155449479818344,
-0.7415047287940979,
-0.8960723876953125,
-0.3169430196285248,
-0.4654594361782074,
-0.6313201785087585,
0.5922985076904297,
-0.06495054811239243,
-0.3171626031398773,
0.24057701230049133,
-0.1243680790066719,
-0.11265579611063004,
0.026996949687600136,
0.06731686741113663,
0.40698134899139404,
-0.21653951704502106,
-0.06285566836595535,
-0.012631313875317574,
-0.13755005598068237,
-0.15445634722709656,
-0.3330240249633789,
0.8236052989959717,
-0.19585253298282623,
-0.09959626197814941,
-0.47904130816459656,
0.2703871428966522,
0.5676125288009644,
-0.38578659296035767,
0.9879606366157532,
0.6639584898948669,
-0.36515122652053833,
-0.04258815944194794,
-0.5485659837722778,
-0.20397357642650604,
-0.44955429434776306,
0.3172498047351837,
-0.5123935341835022,
-0.7569120526313782,
0.6909022331237793,
0.13295447826385498,
0.1927543431520462,
1.1050068140029907,
0.5715736150741577,
-0.07127507030963898,
0.8886722922325134,
0.13362696766853333,
-0.17471322417259216,
0.3141710162162781,
-0.7992992997169495,
0.286946177482605,
-0.8142056465148926,
-0.3071029782295227,
-0.6019653677940369,
-0.40257224440574646,
-0.8633294105529785,
-0.4899972677230835,
0.27352115511894226,
0.30922171473503113,
-0.21933941543102264,
0.5697416067123413,
-0.7791016697883606,
0.06645704060792923,
0.5779346227645874,
0.054549381136894226,
0.292392760515213,
-0.027632417157292366,
-0.4404030442237854,
-0.0891600251197815,
-0.7519665956497192,
-0.4812676012516022,
1.0380913019180298,
0.10596110671758652,
0.5595307350158691,
0.21799470484256744,
0.8290984034538269,
0.20784607529640198,
0.2216644585132599,
-0.7297283411026001,
0.5457034111022949,
-0.11939506232738495,
-0.930128812789917,
-0.3341243863105774,
-0.6456653475761414,
-1.0262056589126587,
0.46612226963043213,
-0.22537925839424133,
-0.8508167862892151,
0.40612128376960754,
0.22296567261219025,
-0.42689305543899536,
0.4765413999557495,
-0.7065181136131287,
0.8411989808082581,
-0.3250950574874878,
-0.2779375910758972,
0.0837155357003212,
-0.6142773032188416,
0.16284769773483276,
-0.07517804205417633,
0.44498711824417114,
-0.311482697725296,
0.04091012850403786,
0.7451986074447632,
-0.7874650359153748,
0.5537877678871155,
-0.143726646900177,
0.09884453564882278,
0.6040947437286377,
-0.14000152051448822,
0.710625946521759,
0.09156618267297745,
-0.207258939743042,
0.3530856966972351,
0.08638203889131546,
-0.4021306037902832,
-0.5530543923377991,
0.7600273489952087,
-0.5489687323570251,
-0.5526552796363831,
-0.7268822193145752,
-0.20515672862529755,
0.08997387439012527,
0.27518028020858765,
0.7020781636238098,
0.4758153557777405,
-0.017603497952222824,
0.2916789948940277,
0.5794739127159119,
-0.18638132512569427,
0.6905599236488342,
0.3273971378803253,
-0.10424453765153885,
-0.530139148235321,
0.821914553642273,
0.2926311790943146,
0.21516838669776917,
0.6205319166183472,
0.09973655641078949,
-0.508788526058197,
-0.5282954573631287,
-0.4070504903793335,
0.33864325284957886,
-0.4947916865348816,
-0.35998690128326416,
-0.9952388405799866,
-0.33777958154678345,
-0.6400643587112427,
0.11805254966020584,
-0.49804574251174927,
-0.6650848388671875,
-0.5079773664474487,
-0.20556923747062683,
0.5243260860443115,
0.19867518544197083,
-0.14557655155658722,
0.23296968638896942,
-0.7745940685272217,
0.20162375271320343,
0.2884187400341034,
0.18247325718402863,
-0.09108419716358185,
-0.6685492396354675,
-0.12507237493991852,
0.0028845977503806353,
-0.40738847851753235,
-0.9701497554779053,
0.6661625504493713,
0.25505077838897705,
0.7005228996276855,
0.35401126742362976,
0.1650252789258957,
0.6372907757759094,
-0.4831675589084625,
0.8575828671455383,
0.28267353773117065,
-0.8614198565483093,
0.5479148626327515,
-0.14186888933181763,
0.26129150390625,
0.554136335849762,
0.6012291312217712,
-0.5105432271957397,
-0.21945667266845703,
-0.8727721571922302,
-1.28419029712677,
0.7333652377128601,
0.5253564715385437,
-0.10338364541530609,
-0.21748261153697968,
0.05114219710230827,
-0.1762070655822754,
0.19332614541053772,
-0.64984530210495,
-0.8394546508789062,
-0.3027385175228119,
-0.35389330983161926,
-0.13527555763721466,
-0.116470105946064,
-0.09823404252529144,
-0.4047992527484894,
1.0219594240188599,
0.08030575513839722,
0.37640342116355896,
0.510699450969696,
-0.06138285622000694,
0.3256143033504486,
0.36226901412010193,
0.3966727554798126,
0.6027811765670776,
-0.37956541776657104,
0.09157682955265045,
0.3951904773712158,
-0.42144206166267395,
0.029313519597053528,
0.39296817779541016,
-0.0930192619562149,
0.2255316823720932,
0.4502558410167694,
0.9327483773231506,
0.07954377681016922,
-0.4883377254009247,
0.3578202426433563,
-0.08973298966884613,
-0.5178304314613342,
-0.4997301697731018,
-0.10401679575443268,
0.13377894461154938,
0.3794732391834259,
0.5253335237503052,
-0.02055197022855282,
0.09472203254699707,
-0.49082720279693604,
0.13027246296405792,
0.3898504078388214,
-0.39988163113594055,
-0.2557148337364197,
0.8828424215316772,
-0.18078669905662537,
-0.20389492809772491,
0.5820324420928955,
-0.431130975484848,
-0.7217603325843811,
0.6762272715568542,
0.24977578222751617,
0.8597543835639954,
-0.13833200931549072,
0.025554606691002846,
0.7861608862876892,
0.39682736992836,
-0.12441220134496689,
0.35844895243644714,
0.18283851444721222,
-0.7477322816848755,
-0.1060185581445694,
-1.0431675910949707,
0.2694552540779114,
0.1002398282289505,
-0.6278672218322754,
0.2150312215089798,
-0.49354198575019836,
-0.6910343170166016,
0.3502066135406494,
0.09954992681741714,
-0.8999593257904053,
0.3933151960372925,
-0.12482040375471115,
0.7461585998535156,
-0.7506405115127563,
0.6674028635025024,
0.7029198408126831,
-0.5338480472564697,
-1.0563907623291016,
-0.1837792843580246,
-0.042110905051231384,
-0.4202945828437805,
0.6577748656272888,
-0.12668390572071075,
0.23519837856292725,
0.0931006371974945,
-0.2815675437450409,
-1.0611103773117065,
1.438955545425415,
0.1549859493970871,
-0.7087299823760986,
-0.10366109758615494,
-0.008948168717324734,
0.6081387400627136,
-0.28185930848121643,
0.4853946566581726,
0.7601550221443176,
0.6622234582901001,
-0.011379358358681202,
-1.0103442668914795,
0.25513675808906555,
-0.38436663150787354,
-0.1011105552315712,
0.3566141128540039,
-1.112779140472412,
1.1295225620269775,
-0.0033198322635143995,
-0.20590068399906158,
-0.19028839468955994,
0.7304161190986633,
0.3506356477737427,
0.27214789390563965,
0.5649001598358154,
0.9759557843208313,
0.7871631979942322,
-0.4446752667427063,
1.0014779567718506,
-0.367397665977478,
0.7848723530769348,
1.1230956315994263,
0.07704030722379684,
0.6787034869194031,
0.4884912073612213,
-0.6275283098220825,
0.5651473999023438,
0.6024447083473206,
-0.22311435639858246,
0.5937644839286804,
0.15245255827903748,
-0.31917789578437805,
-0.11024045199155807,
0.1093108057975769,
-0.4992634356021881,
0.5017053484916687,
0.2465212047100067,
-0.5862300992012024,
0.005149831995368004,
-0.4216172993183136,
0.31159037351608276,
0.023942403495311737,
-0.15293467044830322,
0.5720438361167908,
0.2072811871767044,
-0.6157414317131042,
0.891916811466217,
0.035058777779340744,
0.8086449503898621,
-0.517892599105835,
0.1652955561876297,
-0.18357092142105103,
0.2910137474536896,
-0.3097372055053711,
-0.519760012626648,
0.21421925723552704,
-0.04611547291278839,
-0.46237343549728394,
0.06043384596705437,
0.31811586022377014,
-0.30528032779693604,
-0.926088809967041,
0.4775604009628296,
0.45785361528396606,
0.22282396256923676,
-0.08472534269094467,
-0.9475666284561157,
-0.0983387902379036,
0.1940787136554718,
-0.5490438938140869,
0.026227064430713654,
0.6037453413009644,
0.06444715708494186,
0.5753480792045593,
0.6893287897109985,
0.1888008862733841,
0.3090737462043762,
-0.08157072216272354,
0.9079772233963013,
-0.733694314956665,
-0.31031250953674316,
-1.1124619245529175,
0.636705756187439,
-0.22618405520915985,
-0.41431742906570435,
0.7451870441436768,
0.9039761424064636,
0.8726284503936768,
0.05265941098332405,
0.7926917672157288,
-0.548050045967102,
0.5559037923812866,
-0.5721229314804077,
0.8872352242469788,
-0.8600654006004333,
0.14674562215805054,
-0.3367640972137451,
-1.2470980882644653,
-0.19042925536632538,
0.46638065576553345,
-0.2455700784921646,
0.2268122136592865,
0.8511245846748352,
0.8914581537246704,
-0.08475230634212494,
-0.2657259702682495,
0.062283437699079514,
0.422683984041214,
0.24555321037769318,
0.5095345377922058,
0.32311323285102844,
-0.7443978190422058,
0.6027129292488098,
-0.6209707856178284,
-0.25651517510414124,
-0.20472519099712372,
-0.9002996683120728,
-0.7914947867393494,
-0.6962639093399048,
-0.4447482228279114,
-0.39081063866615295,
-0.2026076316833496,
1.1289403438568115,
0.6194238066673279,
-1.0534552335739136,
-0.08005991578102112,
-0.03409097343683243,
-0.010293815284967422,
-0.43332064151763916,
-0.29818809032440186,
0.6675513386726379,
-0.12641580402851105,
-1.0072823762893677,
0.2716798782348633,
0.04396983981132507,
0.04211292043328285,
0.12519367039203644,
-0.16842742264270782,
-0.6196363568305969,
0.05387521907687187,
0.5398751497268677,
0.10035523027181625,
-0.6986562609672546,
0.03251412510871887,
-0.043949346989393234,
-0.05752371624112129,
0.2585946321487427,
0.3739968538284302,
-0.4416537582874298,
0.34502607583999634,
0.6815401911735535,
0.22326575219631195,
0.7920588254928589,
0.10704918205738068,
0.1626531481742859,
-0.6546818614006042,
0.32493945956230164,
0.26589369773864746,
0.5157309770584106,
0.22387519478797913,
-0.41047757863998413,
0.6981443762779236,
0.5318512320518494,
-0.50388503074646,
-0.7389834523200989,
-0.20335274934768677,
-1.1909363269805908,
-0.31167879700660706,
1.0448100566864014,
-0.2409593164920807,
-0.41914036870002747,
0.17791181802749634,
-0.08470196276903152,
0.5623713135719299,
-0.6638975739479065,
0.5173393487930298,
0.7897765636444092,
-0.01464636530727148,
0.004767825361341238,
-0.631412923336029,
0.39729535579681396,
0.38481032848358154,
-0.5947574377059937,
-0.2335885614156723,
0.3101067841053009,
0.4872201383113861,
0.3716687262058258,
0.6361954212188721,
-0.2482123076915741,
-0.2136995494365692,
0.10548210144042969,
0.15352082252502441,
0.12567399442195892,
0.04443519935011864,
0.00576284434646368,
0.014572205021977425,
-0.21668075025081635,
-0.22016072273254395
] |
t5-base | null | "2023-04-06T13:42:36Z" | 2,122,157 | 381 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"t5",
"text2text-generation",
"summarization",
"translation",
"en",
"fr",
"ro",
"de",
"dataset:c4",
"arxiv:1805.12471",
"arxiv:1708.00055",
"arxiv:1704.05426",
"arxiv:1606.05250",
"arxiv:1808.09121",
"arxiv:1810.12885",
"arxiv:1905.10044",
"arxiv:1910.09700",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | translation | "2022-03-02T23:29:04Z" | ---
language:
- en
- fr
- ro
- de
datasets:
- c4
tags:
- summarization
- translation
license: apache-2.0
---
# Model Card for T5 Base
![model image](https://camo.githubusercontent.com/623b4dea0b653f2ad3f36c71ebfe749a677ac0a1/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f343030362f312a44304a31674e51663876727255704b657944387750412e706e67)
# Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
4. [Training Details](#training-details)
5. [Evaluation](#evaluation)
6. [Environmental Impact](#environmental-impact)
7. [Citation](#citation)
8. [Model Card Authors](#model-card-authors)
9. [How To Get Started With the Model](#how-to-get-started-with-the-model)
# Model Details
## Model Description
The developers of the Text-To-Text Transfer Transformer (T5) [write](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html):
> With T5, we propose reframing all NLP tasks into a unified text-to-text-format where the input and output are always text strings, in contrast to BERT-style models that can only output either a class label or a span of the input. Our text-to-text framework allows us to use the same model, loss function, and hyperparameters on any NLP task.
T5-Base is the checkpoint with 220 million parameters.
- **Developed by:** Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. See [associated paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) and [GitHub repo](https://github.com/google-research/text-to-text-transfer-transformer#released-model-checkpoints)
- **Model type:** Language model
- **Language(s) (NLP):** English, French, Romanian, German
- **License:** Apache 2.0
- **Related Models:** [All T5 Checkpoints](https://huggingface.co/models?search=t5)
- **Resources for more information:**
- [Research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf)
- [Google's T5 Blog Post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html)
- [GitHub Repo](https://github.com/google-research/text-to-text-transfer-transformer)
- [Hugging Face T5 Docs](https://huggingface.co/docs/transformers/model_doc/t5)
# Uses
## Direct Use and Downstream Use
The developers write in a [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) that the model:
> Our text-to-text framework allows us to use the same model, loss function, and hyperparameters on any NLP task, including machine translation, document summarization, question answering, and classification tasks (e.g., sentiment analysis). We can even apply T5 to regression tasks by training it to predict the string representation of a number instead of the number itself.
See the [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) and [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for further details.
## Out-of-Scope Use
More information needed.
# Bias, Risks, and Limitations
More information needed.
## Recommendations
More information needed.
# Training Details
## Training Data
The model is pre-trained on the [Colossal Clean Crawled Corpus (C4)](https://www.tensorflow.org/datasets/catalog/c4), which was developed and released in the context of the same [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) as T5.
The model was pre-trained on a on a **multi-task mixture of unsupervised (1.) and supervised tasks (2.)**.
Thereby, the following datasets were being used for (1.) and (2.):
1. **Datasets used for Unsupervised denoising objective**:
- [C4](https://huggingface.co/datasets/c4)
- [Wiki-DPR](https://huggingface.co/datasets/wiki_dpr)
2. **Datasets used for Supervised text-to-text language modeling objective**
- Sentence acceptability judgment
- CoLA [Warstadt et al., 2018](https://arxiv.org/abs/1805.12471)
- Sentiment analysis
- SST-2 [Socher et al., 2013](https://nlp.stanford.edu/~socherr/EMNLP2013_RNTN.pdf)
- Paraphrasing/sentence similarity
- MRPC [Dolan and Brockett, 2005](https://aclanthology.org/I05-5002)
- STS-B [Ceret al., 2017](https://arxiv.org/abs/1708.00055)
- QQP [Iyer et al., 2017](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs)
- Natural language inference
- MNLI [Williams et al., 2017](https://arxiv.org/abs/1704.05426)
- QNLI [Rajpurkar et al.,2016](https://arxiv.org/abs/1606.05250)
- RTE [Dagan et al., 2005](https://link.springer.com/chapter/10.1007/11736790_9)
- CB [De Marneff et al., 2019](https://semanticsarchive.net/Archive/Tg3ZGI2M/Marneffe.pdf)
- Sentence completion
- COPA [Roemmele et al., 2011](https://www.researchgate.net/publication/221251392_Choice_of_Plausible_Alternatives_An_Evaluation_of_Commonsense_Causal_Reasoning)
- Word sense disambiguation
- WIC [Pilehvar and Camacho-Collados, 2018](https://arxiv.org/abs/1808.09121)
- Question answering
- MultiRC [Khashabi et al., 2018](https://aclanthology.org/N18-1023)
- ReCoRD [Zhang et al., 2018](https://arxiv.org/abs/1810.12885)
- BoolQ [Clark et al., 2019](https://arxiv.org/abs/1905.10044)
## Training Procedure
In their [abstract](https://jmlr.org/papers/volume21/20-074/20-074.pdf), the model developers write:
> In this paper, we explore the landscape of transfer learning techniques for NLP by introducing a unified framework that converts every language problem into a text-to-text format. Our systematic study compares pre-training objectives, architectures, unlabeled datasets, transfer approaches, and other factors on dozens of language understanding tasks.
The framework introduced, the T5 framework, involves a training procedure that brings together the approaches studied in the paper. See the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for further details.
# Evaluation
## Testing Data, Factors & Metrics
The developers evaluated the model on 24 tasks, see the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for full details.
## Results
For full results for T5-Base, see the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf), Table 14.
# Environmental Impact
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** Google Cloud TPU Pods
- **Hours used:** More information needed
- **Cloud Provider:** GCP
- **Compute Region:** More information needed
- **Carbon Emitted:** More information needed
# Citation
**BibTeX:**
```bibtex
@article{2020t5,
author = {Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
journal = {Journal of Machine Learning Research},
year = {2020},
volume = {21},
number = {140},
pages = {1-67},
url = {http://jmlr.org/papers/v21/20-074.html}
}
```
**APA:**
- Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., ... & Liu, P. J. (2020). Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140), 1-67.
# Model Card Authors
This model card was written by the team at Hugging Face.
# How to Get Started with the Model
Use the code below to get started with the model.
<details>
<summary> Click to expand </summary>
```python
from transformers import T5Tokenizer, T5Model
tokenizer = T5Tokenizer.from_pretrained("t5-base")
model = T5Model.from_pretrained("t5-base")
input_ids = tokenizer(
"Studies have been shown that owning a dog is good for you", return_tensors="pt"
).input_ids # Batch size 1
decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids # Batch size 1
# forward pass
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
last_hidden_states = outputs.last_hidden_state
```
See the [Hugging Face T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Model) docs and a [Colab Notebook](https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb) created by the model developers for more examples.
</details>
| [
-0.26632216572761536,
-0.32693615555763245,
0.45666173100471497,
0.14092780649662018,
-0.14788685739040375,
-0.076003298163414,
-0.2406705915927887,
-0.5521968007087708,
-0.33448004722595215,
0.4251326322555542,
-0.4985288381576538,
-0.617554783821106,
-0.7981693744659424,
0.31784331798553467,
-0.517657458782196,
1.0482090711593628,
-0.0854901671409607,
-0.1537584811449051,
-0.11742178350687027,
-0.11909052729606628,
-0.3612477779388428,
-0.5222942233085632,
-0.573062002658844,
-0.34779050946235657,
0.37597760558128357,
0.21027953922748566,
0.26008811593055725,
0.43276146054267883,
0.6396806836128235,
0.23073126375675201,
-0.11306308209896088,
-0.027912624180316925,
-0.45266157388687134,
-0.2618471086025238,
-0.27502167224884033,
-0.3133062720298767,
-0.35237231850624084,
-0.04733588173985481,
0.5331228971481323,
0.7159387469291687,
0.03515135496854782,
0.3408142626285553,
0.12648726999759674,
0.4998473525047302,
-0.617667019367218,
0.14454582333564758,
-0.5655488967895508,
0.09731374680995941,
-0.005838907789438963,
0.031730398535728455,
-0.5845261812210083,
-0.040788497775793076,
0.21599365770816803,
-0.5948256850242615,
0.3252447247505188,
-0.0486171692609787,
1.1854166984558105,
0.3186604082584381,
-0.4713948667049408,
-0.17153160274028778,
-0.7455311417579651,
1.0779194831848145,
-0.7588598728179932,
0.5294010043144226,
0.16068217158317566,
0.12373264133930206,
0.14456793665885925,
-1.0854251384735107,
-0.6548622250556946,
-0.011083364486694336,
-0.19737371802330017,
0.2466171234846115,
-0.287307471036911,
0.034781668335199356,
0.32881733775138855,
0.33954253792762756,
-0.4217597246170044,
-0.06728553771972656,
-0.579056978225708,
-0.11387980729341507,
0.5472491979598999,
-0.03045273944735527,
0.334674596786499,
-0.19389858841896057,
-0.47457146644592285,
-0.29785844683647156,
-0.32891014218330383,
0.09968777745962143,
-0.12064865976572037,
0.2603665590286255,
-0.33649542927742004,
0.2708112895488739,
0.08533813804388046,
0.5767431855201721,
0.2000466138124466,
-0.19454330205917358,
0.4206194579601288,
-0.7423245310783386,
-0.2299530804157257,
-0.34454256296157837,
1.0756934881210327,
0.313017338514328,
0.15230907499790192,
-0.4463833272457123,
-0.041152048856019974,
-0.11259689182043076,
0.3839032053947449,
-0.9409099817276001,
-0.11242209374904633,
0.3125217854976654,
-0.47694361209869385,
-0.47585874795913696,
-0.0360165573656559,
-0.748234748840332,
-0.029748160392045975,
-0.08671706169843674,
0.46270790696144104,
-0.5010647177696228,
-0.23600496351718903,
0.19632847607135773,
-0.29602593183517456,
0.3388274312019348,
0.27186888456344604,
-0.865220308303833,
0.3417622148990631,
0.3081291615962982,
0.7047737240791321,
-0.44561952352523804,
-0.35420316457748413,
-0.12720324099063873,
0.12956544756889343,
-0.11973319202661514,
0.6718598008155823,
-0.39768311381340027,
-0.4413096308708191,
-0.1459682136774063,
0.1548410952091217,
-0.23820756375789642,
-0.2813137471675873,
0.8078888654708862,
-0.275822252035141,
0.7067316174507141,
-0.319580614566803,
-0.5202032327651978,
-0.40425994992256165,
0.17511752247810364,
-0.6115107536315918,
1.175573706626892,
0.015367528423666954,
-0.7716580033302307,
0.2923598289489746,
-0.9210159778594971,
-0.27334049344062805,
-0.2651400864124298,
0.3007761538028717,
-0.5236502289772034,
-0.2613014578819275,
0.29413965344429016,
0.5935932993888855,
-0.3599827289581299,
0.36655423045158386,
-0.26188457012176514,
-0.23919112980365753,
0.08214522153139114,
-0.31738945841789246,
1.0249786376953125,
0.2703099250793457,
-0.5031722187995911,
0.017340119928121567,
-0.7047733068466187,
0.034453053027391434,
-0.014317112043499947,
-0.27844569087028503,
0.02440441958606243,
-0.19096191227436066,
0.24617531895637512,
0.42991089820861816,
0.24259595572948456,
-0.5161643624305725,
0.027133850380778313,
-0.29736435413360596,
0.6213074326515198,
0.45344677567481995,
-0.07638663053512573,
0.5642060041427612,
-0.4711202085018158,
0.3655388057231903,
0.1887931078672409,
0.06420131772756577,
-0.1957014799118042,
-0.3376450836658478,
-0.7885894179344177,
0.029997117817401886,
0.49371427297592163,
0.5564589500427246,
-0.5618415474891663,
0.5748441219329834,
-0.5370683073997498,
-0.6729883551597595,
-0.6094701886177063,
-0.06895030289888382,
0.3642508387565613,
0.6676281094551086,
0.8013883829116821,
-0.10498222708702087,
-0.6096206307411194,
-0.6120502948760986,
-0.3292848467826843,
-0.06227347254753113,
-0.013119406998157501,
0.10034674406051636,
0.6884382367134094,
-0.129340261220932,
0.82972651720047,
-0.27090850472450256,
-0.3434208035469055,
-0.5301001071929932,
0.000652025337330997,
-0.06531494110822678,
0.5791089534759521,
0.6309325098991394,
-0.7316399812698364,
-0.4816359281539917,
-0.17922411859035492,
-0.8341306447982788,
-0.026869291439652443,
-0.14315924048423767,
-0.008828215301036835,
0.41058388352394104,
0.5227203369140625,
-0.5846794247627258,
0.22425313293933868,
0.5917653441429138,
-0.33638960123062134,
0.2975950241088867,
-0.11466797441244125,
-0.002353563206270337,
-1.6071374416351318,
0.5279031991958618,
0.1371062695980072,
-0.20512782037258148,
-0.7562904357910156,
-0.10144533962011337,
0.0581737719476223,
-0.07677654176950455,
-0.5147647857666016,
0.6711266040802002,
-0.4026097357273102,
0.03768027573823929,
-0.02135859616100788,
0.019869253039360046,
0.13868600130081177,
0.6619020700454712,
-0.015413839370012283,
0.764320433139801,
0.2576015591621399,
-0.6961698532104492,
-0.011303957551717758,
0.32708778977394104,
-0.04881174489855766,
0.2989128828048706,
-0.7230740785598755,
0.2790152430534363,
-0.06704200804233551,
0.4696498215198517,
-0.9118814468383789,
0.1535445600748062,
0.33644184470176697,
-0.6843204498291016,
0.3052575886249542,
-0.0016069011762738228,
-0.3777353763580322,
-0.3327605724334717,
-0.2972787320613861,
0.2507489025592804,
0.6614043712615967,
-0.47609931230545044,
0.7112342119216919,
0.13122153282165527,
0.30083131790161133,
-0.7946420311927795,
-0.836097240447998,
0.17376981675624847,
-0.38221827149391174,
-0.5062475204467773,
0.8026584386825562,
-0.13090530037879944,
0.09655064344406128,
0.15277354419231415,
0.01916464976966381,
-0.20839571952819824,
0.1479315161705017,
0.05774421617388725,
0.2035527229309082,
0.026545066386461258,
0.17480218410491943,
-0.11260682344436646,
-0.15832819044589996,
0.0008496663649566472,
-0.46691828966140747,
0.29828670620918274,
-0.17783629894256592,
0.1623488813638687,
-0.6447116732597351,
0.1744113713502884,
0.5845454335212708,
-0.1901300698518753,
0.8043425679206848,
0.9558107256889343,
-0.25446996092796326,
-0.059207573533058167,
-0.46281108260154724,
-0.20816953480243683,
-0.44488725066185,
0.39373964071273804,
-0.43527957797050476,
-0.8428208827972412,
0.422352135181427,
0.04070354253053665,
0.38631173968315125,
0.8663867115974426,
0.34336963295936584,
-0.15359307825565338,
0.7465543746948242,
0.8380892872810364,
-0.044582318514585495,
0.5470297932624817,
-0.46552425622940063,
0.26900678873062134,
-0.8476036787033081,
-0.2735265791416168,
-0.7187062501907349,
-0.25862178206443787,
-0.7625298500061035,
-0.3447907865047455,
0.09653520584106445,
-0.011176803149282932,
-0.34920305013656616,
0.5048182010650635,
-0.5328943729400635,
0.11347316205501556,
0.4151223599910736,
0.084297776222229,
0.3636021018028259,
0.01482501719146967,
-0.069585420191288,
-0.14736881852149963,
-0.8431488275527954,
-0.4750206172466278,
1.2659103870391846,
0.3498467803001404,
0.3700699508190155,
-0.03311049938201904,
0.6343733072280884,
0.23621129989624023,
0.19019931554794312,
-0.7130804657936096,
0.6746776103973389,
-0.38051000237464905,
-0.4924556016921997,
-0.22059591114521027,
-0.3961487412452698,
-1.1125344038009644,
0.29095977544784546,
-0.33345597982406616,
-0.6615230441093445,
0.14375802874565125,
-0.009219993837177753,
-0.20087406039237976,
0.5146607160568237,
-0.8382829427719116,
1.0613681077957153,
-0.08009448647499084,
-0.31716737151145935,
-0.021763876080513,
-0.7011057734489441,
0.20862722396850586,
0.05596187710762024,
0.09770034998655319,
0.10675587505102158,
-0.16241943836212158,
0.9486581087112427,
-0.3150600492954254,
0.8943889737129211,
-0.18997859954833984,
0.03884276747703552,
0.12579765915870667,
-0.33591771125793457,
0.3934394121170044,
-0.4116376042366028,
-0.09471976011991501,
0.4023588299751282,
0.10531171411275864,
-0.4552757143974304,
-0.5230512619018555,
0.4281570613384247,
-0.9520617723464966,
-0.35963115096092224,
-0.3914403021335602,
-0.4741835594177246,
-0.14745084941387177,
0.37359437346458435,
0.36189955472946167,
0.17680968344211578,
-0.16776598989963531,
0.3568298816680908,
0.6418020129203796,
-0.3440033495426178,
0.7124483585357666,
0.3167104125022888,
0.026318643242120743,
-0.3006771504878998,
0.757430911064148,
0.12047554552555084,
0.36943674087524414,
0.565210223197937,
0.15817758440971375,
-0.33277246356010437,
-0.5549455285072327,
-0.36893975734710693,
0.31089654564857483,
-0.613896906375885,
-0.08600134402513504,
-0.9610429406166077,
-0.2181605100631714,
-0.5592992901802063,
-0.029604999348521233,
-0.4178953766822815,
-0.3910894989967346,
-0.45613688230514526,
-0.18990544974803925,
0.2760017216205597,
0.4696559011936188,
0.14554579555988312,
0.18552321195602417,
-0.8973346948623657,
0.1680501252412796,
0.02174786850810051,
0.09791097044944763,
0.013193866237998009,
-0.7863279581069946,
-0.14132249355316162,
0.0958385169506073,
-0.4151670038700104,
-0.6593940258026123,
0.4343026280403137,
0.22277311980724335,
0.35076797008514404,
0.011754984967410564,
0.13850338757038116,
0.62599778175354,
-0.25546735525131226,
0.9861472845077515,
0.15658065676689148,
-1.025848150253296,
0.2672649621963501,
-0.2561568021774292,
0.41108906269073486,
0.5122538805007935,
0.47782981395721436,
-0.6368827819824219,
-0.2155095338821411,
-0.9715169668197632,
-0.7738670706748962,
0.746654748916626,
0.2455197125673294,
0.14020943641662598,
0.3803293704986572,
0.24697472155094147,
0.035721033811569214,
0.15175393223762512,
-0.9247652292251587,
-0.24009940028190613,
-0.28470802307128906,
-0.3634788393974304,
-0.059943802654743195,
-0.0569339282810688,
0.112819142639637,
-0.3298899829387665,
0.6433188915252686,
-0.06886840611696243,
0.7099380493164062,
0.30288878083229065,
-0.2964381277561188,
0.16889600455760956,
0.37806954979896545,
0.6513498425483704,
0.5161528587341309,
-0.19564372301101685,
-0.016533052548766136,
0.4449920058250427,
-0.5230658650398254,
-0.023061392828822136,
0.14935815334320068,
-0.31090009212493896,
0.018531296402215958,
0.47250398993492126,
0.9544939994812012,
0.0894256979227066,
-0.395126074552536,
0.5349370837211609,
-0.034756164997816086,
-0.6124272346496582,
-0.2642405927181244,
-0.05159841477870941,
0.13593041896820068,
-0.031145036220550537,
0.27717676758766174,
0.2392052263021469,
0.12173303216695786,
-0.4834797978401184,
0.06573007255792618,
0.12009204179048538,
-0.4537748396396637,
-0.4622788429260254,
0.788703203201294,
0.3470119833946228,
-0.03155883401632309,
0.5890406966209412,
-0.09966400265693665,
-0.5539885759353638,
0.5588556528091431,
0.5314029455184937,
1.012050747871399,
-0.05586135759949684,
0.1777702271938324,
0.6619986295700073,
0.37580621242523193,
-0.10075715184211731,
0.049805767834186554,
-0.07317830622196198,
-0.7987251281738281,
-0.5665459632873535,
-0.455705463886261,
-0.2963038980960846,
0.23839311301708221,
-0.4429987668991089,
0.31920576095581055,
-0.3158145844936371,
-0.014348683878779411,
0.08380994200706482,
0.14663518965244293,
-0.7333434820175171,
0.32407090067863464,
0.039662331342697144,
0.8276192545890808,
-0.7358443140983582,
0.8207918405532837,
0.7377986907958984,
-0.5944693088531494,
-0.9064239263534546,
0.156697079539299,
-0.30366775393486023,
-0.6148619055747986,
0.5728786587715149,
0.15415899455547333,
-0.028740504756569862,
0.2000647485256195,
-0.5366742610931396,
-0.8477215766906738,
1.3056457042694092,
0.35019975900650024,
-0.27150389552116394,
-0.3465438187122345,
0.27627572417259216,
0.6474244594573975,
-0.2638409435749054,
0.42881476879119873,
0.4623959958553314,
0.4785171449184418,
0.23051464557647705,
-1.025199055671692,
0.31857889890670776,
-0.2708382308483124,
0.08094567805528641,
0.031645599752664566,
-0.7906971573829651,
0.5740121006965637,
-0.33461835980415344,
-0.23577271401882172,
-0.2132255882024765,
0.6672403812408447,
0.057850465178489685,
0.18709097802639008,
0.4787612855434418,
0.7345325946807861,
0.6569856405258179,
-0.0876864567399025,
1.1300139427185059,
-0.3388926386833191,
0.46846678853034973,
0.7809579372406006,
0.12987518310546875,
0.8707815408706665,
0.477020263671875,
-0.29700934886932373,
0.5062687993049622,
0.6410897374153137,
-0.1168430745601654,
0.5021677613258362,
-0.12985797226428986,
-0.06426927447319031,
-0.10801538079977036,
-0.17060239613056183,
-0.3404636085033417,
0.24178136885166168,
0.24244879186153412,
-0.4142838716506958,
-0.272357314825058,
0.11243264377117157,
0.2975088059902191,
-0.1496349722146988,
-0.0574655719101429,
0.8184007406234741,
0.20809713006019592,
-0.7779823541641235,
0.7305293679237366,
0.15141217410564423,
0.8688437342643738,
-0.43174341320991516,
0.06247382611036301,
-0.17933130264282227,
0.20920804142951965,
-0.33205464482307434,
-0.6821008920669556,
0.48577311635017395,
0.04443514347076416,
-0.19960850477218628,
-0.6728764772415161,
0.8170180916786194,
-0.4400012195110321,
-0.3965578079223633,
0.3435761034488678,
0.4505590498447418,
0.09244509786367416,
0.04508243501186371,
-0.9149475693702698,
-0.08734124898910522,
0.19272242486476898,
-0.2203388661146164,
0.3080141544342041,
0.35960298776626587,
0.051914282143116,
0.6659483909606934,
0.5998083353042603,
-0.2002684473991394,
0.025156335905194283,
-0.12914687395095825,
0.6620115041732788,
-0.7309547662734985,
-0.29020991921424866,
-0.7220726013183594,
0.6967376470565796,
-0.010937266983091831,
-0.4413897395133972,
0.6357287764549255,
0.4462352395057678,
1.0448276996612549,
-0.12731045484542847,
1.0103260278701782,
-0.18803715705871582,
0.526603639125824,
-0.38978397846221924,
0.49539831280708313,
-0.6490058302879333,
0.18152648210525513,
-0.3398360013961792,
-0.7857089638710022,
-0.2911204695701599,
0.3956221342086792,
-0.356877863407135,
0.32725030183792114,
1.0337990522384644,
0.6128466725349426,
-0.012738651596009731,
-0.14309364557266235,
0.20135891437530518,
0.1648551970720291,
0.35519832372665405,
0.7315506935119629,
0.3396809995174408,
-0.9579458236694336,
0.943633496761322,
-0.354859858751297,
0.21909679472446442,
-0.01195894181728363,
-0.8035784363746643,
-0.9238926768302917,
-0.8077940940856934,
-0.37748417258262634,
-0.448760986328125,
0.14426951110363007,
0.7726113796234131,
0.5828161835670471,
-0.6794952750205994,
-0.27331432700157166,
-0.3866627812385559,
0.003995634149760008,
-0.21534597873687744,
-0.20489546656608582,
0.49042394757270813,
-0.49202442169189453,
-0.8651844263076782,
0.029380103573203087,
-0.08334967494010925,
0.036397386342287064,
-0.012113609351217747,
-0.02912887930870056,
-0.31302130222320557,
-0.19121123850345612,
0.5923507809638977,
0.17128238081932068,
-0.6198700070381165,
-0.27314087748527527,
0.28916648030281067,
-0.17704151570796967,
0.14895616471767426,
0.4555359482765198,
-0.6557741761207581,
0.2026931494474411,
0.5225856900215149,
0.9092956781387329,
0.811813235282898,
-0.10149737447500229,
0.632530689239502,
-0.4078731834888458,
-0.13434959948062897,
0.13789784908294678,
0.09574826806783676,
0.39678457379341125,
-0.2201305478811264,
0.6260694265365601,
0.4884641766548157,
-0.4603404998779297,
-0.6435984373092651,
-0.1565503627061844,
-1.213282823562622,
-0.1791922003030777,
1.2384226322174072,
-0.1660352200269699,
-0.22353120148181915,
0.006832458078861237,
-0.04610125347971916,
0.38557207584381104,
-0.4590736925601959,
0.7327219843864441,
0.8487242460250854,
0.10196290910243988,
-0.4429906904697418,
-0.5687352418899536,
0.6225379705429077,
0.5869436264038086,
-1.0224323272705078,
-0.20053797960281372,
0.18524138629436493,
0.5138669610023499,
0.11539258807897568,
0.5918672680854797,
-0.10983554273843765,
0.09176577627658844,
-0.19395938515663147,
0.33935827016830444,
-0.02890077605843544,
-0.03596123307943344,
-0.33247777819633484,
0.19238005578517914,
-0.20173513889312744,
-0.26393187046051025
] |
xlm-roberta-large | null | "2023-09-29T13:04:24Z" | 2,117,939 | 224 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"onnx",
"safetensors",
"xlm-roberta",
"fill-mask",
"exbert",
"multilingual",
"af",
"am",
"ar",
"as",
"az",
"be",
"bg",
"bn",
"br",
"bs",
"ca",
"cs",
"cy",
"da",
"de",
"el",
"en",
"eo",
"es",
"et",
"eu",
"fa",
"fi",
"fr",
"fy",
"ga",
"gd",
"gl",
"gu",
"ha",
"he",
"hi",
"hr",
"hu",
"hy",
"id",
"is",
"it",
"ja",
"jv",
"ka",
"kk",
"km",
"kn",
"ko",
"ku",
"ky",
"la",
"lo",
"lt",
"lv",
"mg",
"mk",
"ml",
"mn",
"mr",
"ms",
"my",
"ne",
"nl",
"no",
"om",
"or",
"pa",
"pl",
"ps",
"pt",
"ro",
"ru",
"sa",
"sd",
"si",
"sk",
"sl",
"so",
"sq",
"sr",
"su",
"sv",
"sw",
"ta",
"te",
"th",
"tl",
"tr",
"ug",
"uk",
"ur",
"uz",
"vi",
"xh",
"yi",
"zh",
"arxiv:1911.02116",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:04Z" | ---
tags:
- exbert
language:
- multilingual
- af
- am
- ar
- as
- az
- be
- bg
- bn
- br
- bs
- ca
- cs
- cy
- da
- de
- el
- en
- eo
- es
- et
- eu
- fa
- fi
- fr
- fy
- ga
- gd
- gl
- gu
- ha
- he
- hi
- hr
- hu
- hy
- id
- is
- it
- ja
- jv
- ka
- kk
- km
- kn
- ko
- ku
- ky
- la
- lo
- lt
- lv
- mg
- mk
- ml
- mn
- mr
- ms
- my
- ne
- nl
- no
- om
- or
- pa
- pl
- ps
- pt
- ro
- ru
- sa
- sd
- si
- sk
- sl
- so
- sq
- sr
- su
- sv
- sw
- ta
- te
- th
- tl
- tr
- ug
- uk
- ur
- uz
- vi
- xh
- yi
- zh
license: mit
---
# XLM-RoBERTa (large-sized model)
XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper [Unsupervised Cross-lingual Representation Learning at Scale](https://arxiv.org/abs/1911.02116) by Conneau et al. and first released in [this repository](https://github.com/pytorch/fairseq/tree/master/examples/xlmr).
Disclaimer: The team releasing XLM-RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.
RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.
This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs.
## Intended uses & limitations
You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?search=xlm-roberta) to look for fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation, you should look at models like GPT2.
## Usage
You can use this model directly with a pipeline for masked language modeling:
```python
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='xlm-roberta-large')
>>> unmasker("Hello I'm a <mask> model.")
[{'score': 0.10563907772302628,
'sequence': "Hello I'm a fashion model.",
'token': 54543,
'token_str': 'fashion'},
{'score': 0.08015287667512894,
'sequence': "Hello I'm a new model.",
'token': 3525,
'token_str': 'new'},
{'score': 0.033413201570510864,
'sequence': "Hello I'm a model model.",
'token': 3299,
'token_str': 'model'},
{'score': 0.030217764899134636,
'sequence': "Hello I'm a French model.",
'token': 92265,
'token_str': 'French'},
{'score': 0.026436051353812218,
'sequence': "Hello I'm a sexy model.",
'token': 17473,
'token_str': 'sexy'}]
```
Here is how to use this model to get the features of a given text in PyTorch:
```python
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-large')
model = AutoModelForMaskedLM.from_pretrained("xlm-roberta-large")
# prepare input
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
# forward pass
output = model(**encoded_input)
```
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1911-02116,
author = {Alexis Conneau and
Kartikay Khandelwal and
Naman Goyal and
Vishrav Chaudhary and
Guillaume Wenzek and
Francisco Guzm{\'{a}}n and
Edouard Grave and
Myle Ott and
Luke Zettlemoyer and
Veselin Stoyanov},
title = {Unsupervised Cross-lingual Representation Learning at Scale},
journal = {CoRR},
volume = {abs/1911.02116},
year = {2019},
url = {http://arxiv.org/abs/1911.02116},
eprinttype = {arXiv},
eprint = {1911.02116},
timestamp = {Mon, 11 Nov 2019 18:38:09 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1911-02116.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
<a href="https://huggingface.co/exbert/?model=xlm-roberta-base">
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
</a>
| [
-0.46216970682144165,
-0.76375812292099,
0.2263350635766983,
0.08243540674448013,
-0.199560284614563,
-0.022571859881281853,
-0.4220544397830963,
-0.3971192538738251,
0.20728467404842377,
0.582720160484314,
-0.42982539534568787,
-0.5717678666114807,
-0.7145991921424866,
0.21836577355861664,
-0.42516615986824036,
1.151623249053955,
-0.03416672348976135,
0.05593056231737137,
0.04773459583520889,
-0.19902284443378448,
-0.20308460295200348,
-0.8188029527664185,
-0.4938538670539856,
-0.33068135380744934,
0.428059846162796,
0.12364155799150467,
0.554696798324585,
0.5980485677719116,
0.2253059595823288,
0.42823630571365356,
-0.21344168484210968,
0.16657419502735138,
-0.27982890605926514,
0.00259208376519382,
0.017332062125205994,
-0.5918245911598206,
-0.4723089635372162,
0.21620821952819824,
0.6872223615646362,
0.7122865319252014,
0.12818659842014313,
0.30143389105796814,
0.12024804949760437,
0.3485150635242462,
-0.19177919626235962,
0.3111978769302368,
-0.5347122550010681,
0.17624105513095856,
-0.2220786064863205,
0.09485409408807755,
-0.4378810524940491,
-0.10289984941482544,
0.1517484039068222,
-0.30481240153312683,
0.19469285011291504,
0.1808723658323288,
1.207423448562622,
-0.011963415890932083,
-0.3402855694293976,
-0.1780117303133011,
-0.6086061000823975,
1.081087589263916,
-0.6692907214164734,
0.43631717562675476,
0.22588831186294556,
0.06319400668144226,
0.0668235495686531,
-0.9019208550453186,
-0.5735814571380615,
-0.26730456948280334,
-0.38506951928138733,
0.07943115383386612,
-0.4682176113128662,
-0.24394240975379944,
0.3429153561592102,
0.4150175452232361,
-0.7927350401878357,
0.03173745423555374,
-0.42504432797431946,
-0.22821904718875885,
0.564372718334198,
0.012783579528331757,
0.383891761302948,
-0.485856294631958,
-0.4016217589378357,
-0.4561435282230377,
-0.4825361371040344,
0.11573021113872528,
0.3425710201263428,
0.4110255837440491,
-0.3280276358127594,
0.5295871496200562,
0.10291612148284912,
0.748909056186676,
0.14411120116710663,
0.014667701907455921,
0.5599076151847839,
-0.25279003381729126,
-0.2996794283390045,
-0.21986916661262512,
1.2339409589767456,
-0.050986796617507935,
0.2550632059574127,
-0.08082737773656845,
-0.16392748057842255,
-0.1282581388950348,
0.019691580906510353,
-0.7546631693840027,
-0.2632511556148529,
0.21872130036354065,
-0.5527689456939697,
-0.18560366332530975,
0.1931288093328476,
-0.7113000154495239,
0.12098007649183273,
-0.34227606654167175,
0.6443235278129578,
-0.4784277677536011,
-0.27156519889831543,
-0.10017868876457214,
-0.01859867200255394,
0.04298144951462746,
-0.013963757082819939,
-0.7630177736282349,
0.1586422622203827,
0.3374059498310089,
0.8545370101928711,
-0.07412774115800858,
-0.3102915287017822,
-0.4615839123725891,
-0.25728002190589905,
-0.24002103507518768,
0.45786425471305847,
-0.40381017327308655,
-0.1119469627737999,
-0.09853959083557129,
0.3468625843524933,
-0.1589737981557846,
-0.49863937497138977,
0.38994526863098145,
-0.3517765998840332,
0.4789954721927643,
0.11543790251016617,
-0.33235329389572144,
-0.37920400500297546,
0.12084141373634338,
-0.6586477160453796,
1.207132339477539,
0.25415533781051636,
-0.6754509806632996,
0.20268626511096954,
-0.5700673460960388,
-0.32523486018180847,
-0.18219539523124695,
-0.00778639642521739,
-0.7551856637001038,
-0.05708237737417221,
0.407185822725296,
0.5749704241752625,
-0.3050660490989685,
0.16175207495689392,
-0.1809171587228775,
-0.07724317163228989,
0.4144686758518219,
-0.26698052883148193,
1.1459156274795532,
0.31671053171157837,
-0.4903876483440399,
0.17728497087955475,
-0.8267108201980591,
0.17633157968521118,
0.20604324340820312,
-0.2055913805961609,
-0.24761898815631866,
-0.38749855756759644,
0.3627588152885437,
0.3297451138496399,
0.22412694990634918,
-0.41133779287338257,
0.06975620985031128,
-0.5099167227745056,
0.5639287233352661,
0.5217310190200806,
-0.279559850692749,
0.48195329308509827,
-0.250255823135376,
0.5755394101142883,
0.173654705286026,
0.08592090755701065,
-0.3717154264450073,
-0.5347242951393127,
-0.8294276595115662,
-0.33431217074394226,
0.6642420887947083,
0.5329014658927917,
-0.5396219491958618,
0.6926093101501465,
-0.17869286239147186,
-0.5997818112373352,
-0.6699685454368591,
0.20319359004497528,
0.534464955329895,
0.32011914253234863,
0.4896208345890045,
-0.38745400309562683,
-0.6984231472015381,
-0.7294889092445374,
-0.1408255696296692,
0.056270912289619446,
-0.10209234058856964,
0.3568340539932251,
0.6147171854972839,
-0.29011937975883484,
0.853354811668396,
-0.47134172916412354,
-0.4686161279678345,
-0.5685697793960571,
0.32417306303977966,
0.3778840899467468,
0.5928996801376343,
0.6605358123779297,
-0.7798691391944885,
-0.7399049997329712,
-0.010729629546403885,
-0.6318767666816711,
-0.056520674377679825,
-0.026446552947163582,
-0.094113290309906,
0.5711255073547363,
0.49807974696159363,
-0.6289430260658264,
0.3936619162559509,
0.6307798624038696,
-0.26884472370147705,
0.2838243544101715,
-0.33108747005462646,
-0.03092529997229576,
-1.3124953508377075,
0.17111153900623322,
0.056601665914058685,
-0.3270620107650757,
-0.5983118414878845,
0.03379204869270325,
0.08321711421012878,
-0.19523416459560394,
-0.30871978402137756,
0.6451232433319092,
-0.8045311570167542,
-0.017292005941271782,
-0.08414963632822037,
0.38994792103767395,
0.09826648980379105,
0.6828333735466003,
0.20608483254909515,
0.4081968069076538,
0.6543689370155334,
-0.4356255829334259,
0.3297727704048157,
0.32692357897758484,
-0.36739403009414673,
0.2860289216041565,
-0.637864887714386,
0.13992340862751007,
0.024804703891277313,
0.21721245348453522,
-0.8856784701347351,
0.04759301245212555,
0.274746298789978,
-0.5930065512657166,
0.5215595364570618,
-0.34040409326553345,
-0.5421552658081055,
-0.4726140797138214,
-0.10386788845062256,
0.39676520228385925,
0.7220063209533691,
-0.524045467376709,
0.7147611975669861,
0.428277850151062,
-0.15855176746845245,
-0.5518612861633301,
-0.7828415036201477,
0.13136857748031616,
-0.24658450484275818,
-0.6276808381080627,
0.4630040228366852,
-0.06740034371614456,
0.014655523002147675,
-0.04700024053454399,
0.23067742586135864,
0.08321059495210648,
-0.10739366710186005,
0.23780642449855804,
0.31108084321022034,
-0.19511863589286804,
-0.023603329434990883,
-0.23813363909721375,
-0.2878044843673706,
-0.048013098537921906,
-0.3923201858997345,
0.9239470958709717,
-0.06267017871141434,
-0.07536530494689941,
-0.35256779193878174,
0.39134207367897034,
0.37825608253479004,
-0.5140005946159363,
0.70586758852005,
1.0235079526901245,
-0.31651148200035095,
-0.1792019009590149,
-0.3945668637752533,
-0.19352352619171143,
-0.4256460964679718,
0.5917053818702698,
-0.3540906310081482,
-0.835483968257904,
0.6545119285583496,
0.22797110676765442,
-0.10632312297821045,
0.651052713394165,
0.6732792258262634,
0.15640845894813538,
1.1717787981033325,
0.6878063678741455,
-0.0558629147708416,
0.4987410604953766,
-0.6502472162246704,
0.3660917580127716,
-0.9851017594337463,
-0.29205521941185,
-0.622926652431488,
-0.22500719130039215,
-0.8359477519989014,
-0.5902157425880432,
0.27674600481987,
0.09549655020236969,
-0.1859506070613861,
0.6739366054534912,
-0.5824442505836487,
0.030416376888751984,
0.7831571698188782,
0.15744495391845703,
0.11768179386854172,
0.07301664352416992,
-0.298816442489624,
-0.05642591789364815,
-0.6856436729431152,
-0.3150659203529358,
1.179002046585083,
0.37353622913360596,
0.7128260135650635,
0.004079958889633417,
0.7293033003807068,
-0.06522388011217117,
0.15037009119987488,
-0.6596183180809021,
0.5008370280265808,
-0.269523948431015,
-0.713342547416687,
-0.29912716150283813,
-0.5481398701667786,
-1.1141659021377563,
0.2225693315267563,
-0.33050984144210815,
-0.868517279624939,
0.18535293638706207,
-0.014168260619044304,
-0.2658514678478241,
0.37000638246536255,
-0.5681974291801453,
0.9095842838287354,
-0.29803550243377686,
-0.27688509225845337,
0.023039573803544044,
-0.6772477030754089,
0.192378968000412,
-0.13715128600597382,
0.15052688121795654,
0.16142818331718445,
0.20509541034698486,
0.7983279824256897,
-0.49360793828964233,
0.9175401926040649,
0.03615644946694374,
-0.03246186301112175,
0.22910617291927338,
-0.06891275942325592,
0.45210251212120056,
-0.08367036283016205,
0.11310292780399323,
0.4628884196281433,
-0.07606574892997742,
-0.23522542417049408,
-0.5054565072059631,
0.6497372388839722,
-0.9762791395187378,
-0.6160847544670105,
-0.5956112742424011,
-0.6315864324569702,
0.12204715609550476,
0.29259970784187317,
0.4414072632789612,
0.5826067924499512,
-0.008429450914263725,
0.2576020061969757,
0.5881162285804749,
-0.48492878675460815,
0.5241917371749878,
0.42477667331695557,
-0.42512276768684387,
-0.5029907822608948,
0.7163615226745605,
0.30544158816337585,
0.2049071341753006,
0.6043238639831543,
0.21677307784557343,
-0.4517698585987091,
-0.4647444784641266,
-0.41493502259254456,
0.30161842703819275,
-0.6133511066436768,
-0.2764849066734314,
-1.0343419313430786,
-0.500585675239563,
-0.6838072538375854,
0.0891762301325798,
-0.22724519670009613,
-0.5006440877914429,
-0.3845216631889343,
0.04736052826046944,
0.5500256419181824,
0.7262231707572937,
-0.23855862021446228,
0.20039516687393188,
-0.7162091135978699,
0.2637860178947449,
0.26417580246925354,
0.08185151219367981,
-0.023264041170477867,
-0.9168422818183899,
-0.4051123857498169,
0.08598563820123672,
-0.36672651767730713,
-0.6437820792198181,
0.8483718633651733,
0.15486548840999603,
0.5503410696983337,
0.32435333728790283,
-0.01510616485029459,
0.6849479079246521,
-0.3998658061027527,
0.7403556704521179,
0.2085404247045517,
-0.9804625511169434,
0.5147868394851685,
-0.1011267900466919,
0.2566145956516266,
0.015935905277729034,
0.5005290508270264,
-0.574113130569458,
-0.5044288039207458,
-0.7690684199333191,
-1.0289210081100464,
0.917224109172821,
0.2614992558956146,
0.2870980203151703,
0.01691782847046852,
0.18630056083202362,
0.006045445799827576,
0.09073266386985779,
-1.1596484184265137,
-0.5714565515518188,
-0.3852725028991699,
-0.386836975812912,
-0.330919086933136,
-0.1448264867067337,
-0.04003153741359711,
-0.40570124983787537,
0.6836229562759399,
-0.05066486820578575,
0.45517390966415405,
0.24543461203575134,
-0.4046432077884674,
-0.007740646600723267,
0.09363216161727905,
0.4752035439014435,
0.4491468071937561,
-0.1861584633588791,
0.08626538515090942,
0.1704711765050888,
-0.46460819244384766,
-0.07040107995271683,
0.3903161585330963,
-0.17636166512966156,
0.18389934301376343,
0.3552919328212738,
0.9204491972923279,
0.2837918698787689,
-0.43641170859336853,
0.4922960102558136,
0.13159334659576416,
-0.17602680623531342,
-0.4469011723995209,
0.05044074356555939,
0.08002018928527832,
0.33777543902397156,
0.43457093834877014,
0.008869209326803684,
-0.14339886605739594,
-0.7787731289863586,
0.3270784318447113,
0.5234909057617188,
-0.4471912384033203,
-0.2783539891242981,
0.8296090960502625,
-0.18043310940265656,
-0.35313013195991516,
0.5331185460090637,
-0.12710507214069366,
-0.7544867992401123,
0.6605759859085083,
0.6520488858222961,
0.8819383978843689,
-0.1643914133310318,
0.24433358013629913,
0.6418560147285461,
0.2646298408508301,
0.01861894130706787,
-0.0036539339926093817,
0.09300786256790161,
-0.6909818649291992,
-0.2746152877807617,
-0.7952679395675659,
-0.03342022746801376,
0.23682838678359985,
-0.5893006324768066,
0.34851112961769104,
-0.3392496705055237,
-0.21856507658958435,
0.04805495962500572,
0.23766276240348816,
-0.7510854601860046,
0.29253077507019043,
0.06723875552415848,
0.7194401025772095,
-0.8394389152526855,
0.9038893580436707,
0.691849410533905,
-0.770149827003479,
-1.018401861190796,
-0.25058263540267944,
-0.14156703650951385,
-0.9372833371162415,
0.9212685227394104,
0.16268320381641388,
0.33641791343688965,
0.03805055841803551,
-0.4044390022754669,
-1.0519980192184448,
1.1246910095214844,
0.12938788533210754,
-0.5633071660995483,
0.01046381238847971,
0.3479929268360138,
0.5712459087371826,
-0.6240524649620056,
0.6204158067703247,
0.30979594588279724,
0.47386112809181213,
0.0022093760780990124,
-0.8857557773590088,
0.22349213063716888,
-0.3479143977165222,
0.12209417670965195,
0.12864482402801514,
-0.7940546274185181,
1.2640990018844604,
-0.17682091891765594,
-0.04757457226514816,
0.25864747166633606,
0.5778396725654602,
0.12259694188833237,
-0.010774069465696812,
0.4153512716293335,
0.6758184432983398,
0.627826452255249,
-0.32229548692703247,
0.9302511215209961,
-0.3415607213973999,
0.6288220286369324,
0.9503642320632935,
0.050971753895282745,
0.7831072807312012,
0.23625212907791138,
-0.22766190767288208,
0.7137226462364197,
0.6373232007026672,
-0.3408205509185791,
0.3822116553783417,
0.1253259778022766,
0.08720077574253082,
-0.19969147443771362,
0.21983855962753296,
-0.3313940763473511,
0.5908790230751038,
0.10894585400819778,
-0.6922195553779602,
-0.10641713440418243,
0.15216511487960815,
0.35453251004219055,
-0.037654027342796326,
-0.169669508934021,
0.6050119996070862,
0.26121985912323,
-0.639074444770813,
0.7546814680099487,
0.1124168112874031,
0.6965652704238892,
-0.5908525586128235,
0.07476388663053513,
-0.278262197971344,
0.26334989070892334,
-0.13314779102802277,
-0.6112377643585205,
0.08903025835752487,
0.046765126287937164,
-0.2380300760269165,
-0.2840275466442108,
0.42231056094169617,
-0.7577453851699829,
-0.7676748037338257,
0.4576925039291382,
0.409860759973526,
0.20669138431549072,
-0.03651540353894234,
-0.9365665912628174,
0.07741730660200119,
0.08439776301383972,
-0.4565783739089966,
0.4186559021472931,
0.596895158290863,
-0.06800608336925507,
0.6201466917991638,
0.6978332996368408,
0.11895602941513062,
0.08378636091947556,
0.04923528805375099,
0.7409040331840515,
-0.7921538352966309,
-0.4185281991958618,
-0.7651586532592773,
0.6466087698936462,
-0.07394614815711975,
-0.31482717394828796,
0.888333261013031,
0.6085516214370728,
0.8283287286758423,
-0.09849715977907181,
0.7030324339866638,
-0.2222679853439331,
0.4858133792877197,
-0.5154192447662354,
0.9239704608917236,
-0.7170490622520447,
0.17368710041046143,
-0.37639933824539185,
-0.9520760178565979,
-0.36502355337142944,
0.7756746411323547,
-0.18066366016864777,
0.37866130471229553,
0.7421426773071289,
0.9241712689399719,
-0.12189294397830963,
-0.3879643678665161,
0.35254666209220886,
0.5787737965583801,
0.17296956479549408,
0.5484969019889832,
0.4779183566570282,
-0.7170851826667786,
0.7404295206069946,
-0.3172311782836914,
-0.22210559248924255,
-0.24893315136432648,
-0.8208590149879456,
-1.1233749389648438,
-0.8738235831260681,
-0.41846948862075806,
-0.4801934063434601,
-0.19367529451847076,
0.958083987236023,
0.8305872678756714,
-0.867035448551178,
-0.25403645634651184,
0.054431360214948654,
0.11695419996976852,
-0.21254925429821014,
-0.30540722608566284,
0.6194068789482117,
-0.38575154542922974,
-1.0851585865020752,
0.05750929191708565,
0.09622301906347275,
0.18017332255840302,
-0.3837846517562866,
-0.0245436429977417,
-0.2700139582157135,
0.006214249413460493,
0.5526566505432129,
0.20838820934295654,
-0.6339049935340881,
-0.2487134486436844,
0.05948573350906372,
-0.1104535460472107,
0.2349993884563446,
0.48342570662498474,
-0.8014318943023682,
0.284526526927948,
0.4220154583454132,
0.24268853664398193,
0.7478359937667847,
-0.3309186100959778,
0.5721345543861389,
-0.7024667263031006,
0.30016571283340454,
0.06136461719870567,
0.5478872656822205,
0.41625210642814636,
-0.20559638738632202,
0.3559373915195465,
0.24680566787719727,
-0.5057998895645142,
-0.8588821887969971,
0.05936386063694954,
-1.063008427619934,
-0.28453317284584045,
1.0725053548812866,
-0.35003843903541565,
-0.38521063327789307,
-0.04719023033976555,
-0.17409400641918182,
0.4414811134338379,
-0.18352378904819489,
0.7440600395202637,
0.5171144008636475,
0.12237665802240372,
-0.48190850019454956,
-0.35131752490997314,
0.4785410761833191,
0.2996554374694824,
-0.5831140875816345,
-0.025481073185801506,
0.05551901087164879,
0.4919956922531128,
0.4028628468513489,
0.31733056902885437,
-0.3208397328853607,
-0.055899616330862045,
-0.18556348979473114,
0.24770469963550568,
0.02024678699672222,
-0.1666833460330963,
-0.28890469670295715,
0.1259443610906601,
-0.2494436502456665,
-0.035294417291879654
] |
dbmdz/bert-large-cased-finetuned-conll03-english | dbmdz | "2023-09-06T22:17:56Z" | 2,042,802 | 39 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"bert",
"token-classification",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | token-classification | "2022-03-02T23:29:05Z" | Entry not found | [
-0.3227650225162506,
-0.22568431496620178,
0.862226128578186,
0.43461495637893677,
-0.5282987952232361,
0.7012965679168701,
0.7915717363357544,
0.07618638128042221,
0.7746025919914246,
0.2563219666481018,
-0.7852817177772522,
-0.22573819756507874,
-0.9104480743408203,
0.5715669393539429,
-0.3992334008216858,
0.5791245698928833,
-0.14494505524635315,
-0.10751161724328995,
0.28233757615089417,
-0.2768954336643219,
-0.5409224033355713,
-0.36855220794677734,
-1.1902776956558228,
0.061491113156080246,
0.5316578149795532,
0.7435142397880554,
0.7584060430526733,
0.3652167320251465,
0.6432578563690186,
0.3932291269302368,
-0.23138920962810516,
0.4827055037021637,
-0.04171813279390335,
0.00260411505587399,
-0.3524433970451355,
-0.5516898036003113,
-0.28596609830856323,
0.07584730535745621,
1.0961304903030396,
0.966687798500061,
-0.284663587808609,
0.05330817773938179,
-0.3063621520996094,
0.33088892698287964,
-0.49734312295913696,
0.3054099678993225,
-0.022506045177578926,
0.16318801045417786,
-0.7041513919830322,
-0.5535354018211365,
0.012794834561645985,
-0.7361212968826294,
0.17926570773124695,
-0.690081000328064,
0.8269098401069641,
0.18583157658576965,
1.1533750295639038,
0.14819414913654327,
-0.462487131357193,
-0.8161764144897461,
-0.6538989543914795,
0.5711171627044678,
-0.32703715562820435,
0.39680248498916626,
0.7028235197067261,
-0.048573412001132965,
-0.9820332527160645,
-0.6745741367340088,
-0.46466192603111267,
0.2923962473869324,
0.35402774810791016,
-0.3411678075790405,
-0.17522086203098297,
-0.3058989644050598,
0.15792037546634674,
0.12811517715454102,
-0.4841994643211365,
-0.5543919205665588,
-0.5475160479545593,
-0.3960252106189728,
0.6206658482551575,
0.3482950031757355,
0.2429177463054657,
-0.1888415813446045,
-0.3228583335876465,
0.0880163162946701,
-0.4160851538181305,
0.3402571678161621,
0.6335517168045044,
0.7114017009735107,
-0.5811444520950317,
0.560215950012207,
-0.04927587881684303,
0.7439703941345215,
0.11445561796426773,
-0.27478092908859253,
0.41460567712783813,
-0.14724725484848022,
0.055171746760606766,
0.4226345121860504,
0.31524422764778137,
0.2841312289237976,
-0.3273695111274719,
0.2032228708267212,
-0.3215144872665405,
-0.30496224761009216,
-0.22332167625427246,
-0.29490774869918823,
-0.3592180609703064,
0.5492289066314697,
-0.3314017057418823,
-0.42855486273765564,
1.143175721168518,
-0.4200771450996399,
-0.7302224040031433,
0.33156412839889526,
0.4065209925174713,
-0.0994480773806572,
-0.37146568298339844,
-0.052260834723711014,
-0.8458789587020874,
-0.007907390594482422,
0.7491172552108765,
-0.7198970913887024,
0.3371737599372864,
0.4728063642978668,
0.7417217493057251,
0.19650575518608093,
-0.14034469425678253,
-0.42949390411376953,
0.2971969544887543,
-0.8659994006156921,
0.6320174336433411,
-0.20135220885276794,
-1.0051977634429932,
0.11150479316711426,
0.8971705436706543,
-0.37896400690078735,
-1.2094876766204834,
1.0605159997940063,
-0.6887932419776917,
0.16017857193946838,
-0.676761269569397,
-0.14661237597465515,
-0.07118501514196396,
-0.005096632521599531,
-0.6088156700134277,
0.7567102313041687,
0.587267279624939,
-0.4995276927947998,
0.21429483592510223,
-0.26029831171035767,
-0.39151400327682495,
0.38824859261512756,
-0.07935450226068497,
-0.21858926117420197,
0.713833212852478,
-0.6647079586982727,
-0.26932814717292786,
0.2942774295806885,
0.2368936538696289,
-0.35706108808517456,
-0.7931919097900391,
0.08478113263845444,
-0.05786270648241043,
1.550750494003296,
-0.03868847340345383,
-0.3586106300354004,
-0.679383397102356,
-1.1506240367889404,
-0.07070787996053696,
0.6886883974075317,
-0.9194989204406738,
-0.27839475870132446,
-0.046410128474235535,
-0.26169314980506897,
0.08994917571544647,
0.7390589714050293,
-1.1194051504135132,
0.2832726836204529,
-0.05092663690447807,
-0.22794683277606964,
0.8271058797836304,
0.15387225151062012,
0.24758946895599365,
0.14913396537303925,
0.42958706617355347,
0.527725338935852,
0.11115207523107529,
0.683587908744812,
-0.34720373153686523,
-0.9694353938102722,
0.6154631972312927,
0.25266361236572266,
0.8121447563171387,
-0.49945297837257385,
0.2685093879699707,
0.27025535702705383,
-0.3409680724143982,
-0.5682371854782104,
-0.3102838397026062,
0.09025752544403076,
0.14930562674999237,
0.11142510175704956,
-0.5721710324287415,
-0.6576125025749207,
-0.9689140319824219,
-0.13590654730796814,
-0.4314374029636383,
-0.3571570813655853,
0.21006910502910614,
0.5792906284332275,
-1.1975523233413696,
0.4128875136375427,
-0.7705625891685486,
-0.7038741111755371,
-0.01065548975020647,
-0.19338123500347137,
0.7540656328201294,
0.43240174651145935,
0.5033966898918152,
-0.6397148370742798,
-0.5661987066268921,
-0.22470176219940186,
-1.0333747863769531,
-0.13280506432056427,
0.24819621443748474,
0.3065737783908844,
-0.13423344492912292,
-0.2744963765144348,
-0.48740333318710327,
0.8100387454032898,
0.14789170026779175,
-0.5391897559165955,
0.5220767259597778,
-0.3020317256450653,
0.17224803566932678,
-0.6369150280952454,
-0.06916818022727966,
-0.661676287651062,
-0.0009071884560398757,
-0.3608308732509613,
-0.5737438797950745,
0.14772287011146545,
0.07017494738101959,
-0.16065457463264465,
0.28808408975601196,
-0.909277081489563,
-0.0010852962732315063,
-0.7442210912704468,
0.379071980714798,
0.06394772231578827,
-0.3145078718662262,
-0.017517540603876114,
1.0000386238098145,
0.7784460783004761,
-0.3848048746585846,
0.721744179725647,
0.4440041184425354,
0.19036155939102173,
0.7630521059036255,
-0.18725109100341797,
0.16478213667869568,
-0.5245416760444641,
-0.12161104381084442,
-0.8887597918510437,
-1.0982946157455444,
0.7320570349693298,
-0.6114250421524048,
0.36542922258377075,
-0.4277869760990143,
0.2589159905910492,
-0.6919258832931519,
-0.03885362669825554,
0.4808599352836609,
-0.05936325341463089,
-0.6863942742347717,
0.5232570171356201,
0.45317530632019043,
-0.2019241601228714,
-0.6609031558036804,
-0.530157208442688,
0.39365822076797485,
0.6154114007949829,
-0.16390392184257507,
0.06878514587879181,
0.14941060543060303,
-0.5441926121711731,
-0.040802597999572754,
-0.38691970705986023,
-0.45766758918762207,
0.054224006831645966,
0.13053473830223083,
-0.005750799085944891,
-0.404820054769516,
-0.0868026465177536,
-0.35842007398605347,
-0.4656120240688324,
0.21876516938209534,
0.3011947274208069,
-0.04096309468150139,
-0.42599788308143616,
-0.3619818687438965,
-0.888181209564209,
0.6719610095024109,
0.5370282530784607,
0.05281545966863632,
0.7555549740791321,
0.16819314658641815,
-0.8014987707138062,
-0.13532210886478424,
-0.1760706603527069,
0.2696830928325653,
-0.5588056445121765,
0.13849826157093048,
-0.013484534807503223,
-0.0637492910027504,
0.26297882199287415,
0.25386232137680054,
-0.4300556778907776,
0.9276250004768372,
-0.2615274488925934,
-0.3592521846294403,
0.7960181832313538,
0.5974742770195007,
0.49583131074905396,
0.16503219306468964,
-0.044541798532009125,
0.900709331035614,
-1.1966516971588135,
-0.6563175916671753,
-0.7409549355506897,
-0.15945707261562347,
-0.43510833382606506,
-0.032105933874845505,
0.6254412531852722,
0.2900990843772888,
-0.1333388388156891,
0.4756395220756531,
-0.5243489742279053,
0.3556033670902252,
1.01198410987854,
0.35748639702796936,
0.3435698449611664,
-0.7570229172706604,
-0.2515777349472046,
-0.1402427852153778,
-0.9998157620429993,
-0.2631377875804901,
0.8871029019355774,
0.22752606868743896,
0.844460666179657,
0.5992541313171387,
0.6784542798995972,
0.1367226243019104,
0.2523828148841858,
-0.30590319633483887,
0.3920294940471649,
0.4376082420349121,
-1.0401138067245483,
-0.42758408188819885,
0.021418681368231773,
-0.9703338742256165,
-0.14227519929409027,
-0.03495011106133461,
-0.42617112398147583,
0.7681737542152405,
0.00016589462757110596,
-0.4076709747314453,
0.7732734084129333,
-0.455583393573761,
0.7562873363494873,
-0.4473648965358734,
-0.02663906291127205,
0.4699096083641052,
-0.7070636749267578,
0.4677430987358093,
0.12878790497779846,
0.6205843091011047,
-0.015572631731629372,
-0.04078587517142296,
0.7104941606521606,
-0.9129160046577454,
0.25438642501831055,
-0.6348397135734558,
0.22421300411224365,
0.24246945977210999,
0.51606285572052,
0.5969953536987305,
0.4371243417263031,
0.10119888931512833,
-0.23920902609825134,
0.04115807265043259,
-0.8241125345230103,
-0.210506409406662,
0.697515606880188,
-0.7186890840530396,
-0.6864197850227356,
-1.2355337142944336,
0.14438660442829132,
0.27347055077552795,
0.389305055141449,
0.7959296107292175,
0.571408748626709,
0.1289544403553009,
0.680525004863739,
0.9888588190078735,
-0.0688566341996193,
0.9166924357414246,
0.3224477171897888,
0.09175168722867966,
-0.21944808959960938,
0.7036820650100708,
0.26627904176712036,
-0.24707956612110138,
-0.11939732730388641,
0.20913465321063995,
-0.11069409549236298,
-0.591761589050293,
-0.49990686774253845,
0.3701757788658142,
-0.6731787919998169,
-0.18303893506526947,
-0.6243735551834106,
-0.6043769717216492,
-0.511759340763092,
0.06927360594272614,
-0.7147687673568726,
0.23979046940803528,
-0.7753565907478333,
-0.10574902594089508,
0.04323432594537735,
0.9792009592056274,
-0.589311957359314,
0.5805224180221558,
-1.1218582391738892,
0.19345788657665253,
-0.07949887961149216,
0.7921058535575867,
0.21395787596702576,
-0.7344395518302917,
-0.3975418508052826,
-0.11592631042003632,
-0.3729911744594574,
-1.3576762676239014,
0.21404948830604553,
-0.2454141080379486,
0.23094046115875244,
0.6145404577255249,
0.1397707313299179,
0.5258248448371887,
-0.34326282143592834,
0.7029101848602295,
-0.057017259299755096,
-0.7069286704063416,
0.7934495210647583,
-0.5026894807815552,
0.4963534474372864,
0.9765996932983398,
0.5333835482597351,
-0.7984007596969604,
0.035741209983825684,
-1.041123390197754,
-0.6008695363998413,
0.38426393270492554,
0.11928944289684296,
-0.03601083159446716,
-0.6659559011459351,
-0.054019637405872345,
-0.16143807768821716,
0.6043745279312134,
-1.039069414138794,
-0.7858356237411499,
0.2576698362827301,
0.5277302861213684,
0.0816856250166893,
-0.5653398633003235,
0.20880667865276337,
-0.544416069984436,
1.0657774209976196,
0.45109400153160095,
0.3274499475955963,
0.8406060934066772,
0.46492424607276917,
-0.3823164403438568,
0.09252490103244781,
0.7662695050239563,
0.6666232347488403,
-0.5239797830581665,
-0.2908027470111847,
-0.08827541768550873,
-0.9143403768539429,
0.05927472561597824,
0.11168918758630753,
-0.013455932028591633,
0.9082110524177551,
0.5793083310127258,
0.2539709210395813,
0.4514279365539551,
-0.726460337638855,
0.8859451413154602,
-0.14954176545143127,
-0.12472866475582123,
-1.0677239894866943,
0.1948619782924652,
-0.23984959721565247,
0.5006402134895325,
1.0061326026916504,
0.5250048041343689,
-0.047630298882722855,
-0.8143380880355835,
-0.01473585981875658,
0.6939172148704529,
-0.7091123461723328,
-0.17449834942817688,
0.944853663444519,
0.3847099542617798,
-1.2953051328659058,
1.106776475906372,
-0.5381771326065063,
-0.560332179069519,
0.9121301770210266,
0.522956907749176,
1.1221847534179688,
-0.44204121828079224,
0.0008676342549733818,
0.2662237286567688,
0.41378432512283325,
0.5423170328140259,
1.0869629383087158,
0.431413471698761,
-0.7931063771247864,
0.8826584815979004,
-0.24776044487953186,
-0.40361151099205017,
-0.05347571521997452,
-0.42859897017478943,
0.16892178356647491,
-0.4406192898750305,
-0.10713007301092148,
-0.3444187641143799,
0.28543180227279663,
-0.7072042226791382,
0.42807620763778687,
-0.0838567465543747,
0.8653068542480469,
-0.8553727269172668,
0.47207626700401306,
0.635470449924469,
-0.3337355852127075,
-0.8508191108703613,
-0.26198428869247437,
-0.11448462307453156,
-0.6389466524124146,
0.30214807391166687,
-0.4554102420806885,
0.044398851692676544,
0.09623463451862335,
-0.649151623249054,
-1.1778275966644287,
0.9093633890151978,
-0.639612078666687,
-0.2784462869167328,
0.20464053750038147,
-0.11514760553836823,
0.28811705112457275,
-0.2524643540382385,
0.010661216452717781,
0.41876548528671265,
0.748940110206604,
0.2844654619693756,
-0.7727053761482239,
-0.3694884479045868,
0.0015032943338155746,
-0.44474777579307556,
0.7582978010177612,
-0.6002101898193359,
1.1840779781341553,
-0.5563543438911438,
-0.059654366225004196,
0.44384512305259705,
0.24690914154052734,
0.21076197922229767,
0.6629220843315125,
0.1442081481218338,
0.7282265424728394,
1.07012140750885,
-0.40835219621658325,
0.8811809420585632,
0.26432839035987854,
0.47430819272994995,
0.7238501906394958,
-0.6487724781036377,
0.7513749003410339,
0.31810489296913147,
-0.5682924389839172,
0.9228013753890991,
1.2906063795089722,
-0.15699204802513123,
0.8079374432563782,
0.05136508867144585,
-1.081600546836853,
0.325833261013031,
-0.20724765956401825,
-0.7530064582824707,
0.3150254189968109,
0.19055864214897156,
-0.6920982599258423,
-0.5770308971405029,
-0.24046507477760315,
-0.35662803053855896,
-0.11552901566028595,
-0.7631728649139404,
0.6720563769340515,
-0.016969164833426476,
-0.5103683471679688,
0.18857547640800476,
0.2877499461174011,
0.17368432879447937,
-0.5235732793807983,
-0.02939440682530403,
-0.22823619842529297,
0.2660655975341797,
-0.5670853853225708,
-0.5234526991844177,
0.5724433064460754,
-0.32430219650268555,
-0.5343255400657654,
0.18147465586662292,
0.763587236404419,
-0.16923809051513672,
-0.4515409469604492,
0.32472723722457886,
0.6959525346755981,
0.1665852814912796,
0.4250282347202301,
-0.23511263728141785,
0.24480605125427246,
-0.08044824004173279,
-0.06651552021503448,
0.27714768052101135,
0.3449169099330902,
0.22435641288757324,
0.4450142979621887,
0.43285664916038513,
-0.01808755099773407,
-0.10736498981714249,
-0.382819801568985,
0.4124940037727356,
-0.9542785882949829,
-0.5713282823562622,
-0.6307113766670227,
0.2740660607814789,
-0.02315417304635048,
-1.0836423635482788,
0.4145168364048004,
1.4406683444976807,
1.0359982252120972,
-0.4756383001804352,
1.067226529121399,
-0.21818485856056213,
0.9594791531562805,
0.41483086347579956,
0.5420440435409546,
-0.6030411720275879,
0.03835370019078255,
-0.4364396035671234,
-1.076962947845459,
-0.35716333985328674,
0.4539391100406647,
-0.022899555042386055,
-0.3429867625236511,
0.872571587562561,
0.5887166261672974,
-0.33473607897758484,
-0.11728022992610931,
0.048487238585948944,
-0.029941488057374954,
-0.12433847039937973,
0.5145376324653625,
0.7648399472236633,
-0.9344304800033569,
-0.10680416971445084,
-0.21577754616737366,
-0.6382725834846497,
-0.5047279000282288,
-0.9632009267807007,
-0.12959396839141846,
-0.16037796437740326,
0.035343267023563385,
-0.5662806630134583,
0.00255737011320889,
1.208324909210205,
0.5684957504272461,
-1.1113994121551514,
-0.5303789377212524,
0.3371853232383728,
0.3920421898365021,
-0.1874791383743286,
-0.24202413856983185,
0.2984568774700165,
0.15382249653339386,
-0.5908876657485962,
0.6875665783882141,
0.8089625239372253,
0.208888977766037,
0.19554761052131653,
0.15893013775348663,
-0.8229473829269409,
-0.14913435280323029,
0.17440445721149445,
0.9450570344924927,
-0.939853310585022,
-0.7114843130111694,
-0.03168516233563423,
-0.27094873785972595,
-0.05765746906399727,
0.17102102935314178,
-0.4046344757080078,
0.5180677175521851,
0.34591493010520935,
0.49933457374572754,
0.0561608150601387,
-0.054746925830841064,
0.5409556031227112,
-0.9069057703018188,
0.09425963461399078,
0.4134361147880554,
0.4154115319252014,
-0.4000864028930664,
-0.5910194516181946,
0.6713420748710632,
1.0073972940444946,
-0.6594868898391724,
-0.8743268847465515,
-0.19846712052822113,
-1.0016002655029297,
0.04189709946513176,
0.6762762069702148,
0.5009527802467346,
-0.4806513786315918,
-0.4174500107765198,
-0.5617399215698242,
-0.1254672110080719,
-0.1369970738887787,
0.7621601819992065,
1.179680585861206,
-0.7432094812393188,
0.07975747436285019,
-1.038639783859253,
0.6594986915588379,
-0.2419457733631134,
-0.3457581698894501,
-0.48644304275512695,
0.3832802176475525,
0.35236993432044983,
0.440481036901474,
0.614812433719635,
0.1408471167087555,
0.8338426351547241,
0.3126053214073181,
-0.1702686995267868,
0.2698982357978821,
-0.4559200704097748,
-0.028932858258485794,
-0.057962555438280106,
0.31015971302986145,
-1.0262157917022705
] |
paust/pko-t5-large | paust | "2023-06-28T17:03:42Z" | 2,031,166 | 14 | transformers | [
"transformers",
"pytorch",
"safetensors",
"t5",
"text2text-generation",
"ko",
"arxiv:2105.09680",
"license:cc-by-4.0",
"autotrain_compatible",
"endpoints_compatible",
"text-generation-inference",
"region:us"
] | text2text-generation | "2022-05-16T11:59:52Z" | ---
language: ko
license: cc-by-4.0
---
# pko-t5-large
[Source Code](https://github.com/paust-team/pko-t5)
pko-t5 는 한국어 전용 데이터로 학습한 [t5 v1.1 모델](https://github.com/google-research/text-to-text-transfer-transformer/blob/84f8bcc14b5f2c03de51bd3587609ba8f6bbd1cd/released_checkpoints.md)입니다.
한국어를 tokenize 하기 위해서 sentencepiece 대신 OOV 가 없는 BBPE 를 사용했으며 한국어 데이터 (나무위키, 위키피디아, 모두의말뭉치 등..) 를 T5 의 span corruption task 를 사용해서 unsupervised learning 만 적용하여 학습을 진행했습니다.
pko-t5 를 사용하실 때는 대상 task 에 파인튜닝하여 사용하시기 바랍니다.
## Usage
transformers 의 API 를 사용하여 접근 가능합니다. tokenizer 를 사용할때는 `T5Tokenizer` 가 아니라 `T5TokenizerFast` 를 사용해주십시오. model 은 T5ForConditionalGeneration 를 그대로 활용하시면 됩니다.
### Example
```python
from transformers import T5TokenizerFast, T5ForConditionalGeneration
tokenizer = T5TokenizerFast.from_pretrained('paust/pko-t5-large')
model = T5ForConditionalGeneration.from_pretrained('paust/pko-t5-large')
input_ids = tokenizer(["qa question: 당신의 이름은 무엇인가요?"]).input_ids
labels = tokenizer(["T5 입니다."]).input_ids
outputs = model(input_ids=input_ids, labels=labels)
print(f"loss={outputs.loss} logits={outputs.logits}")
```
## Klue 평가 (dev)
| | Model | ynat (macro F1) | sts (pearsonr/F1) | nli (acc) | ner (entity-level F1) | re (micro F1) | dp (LAS) | mrc (EM/F1) |
|-----|------------------------------------------------------------------|-----------------|-------------------|-----------|-----------------------|---------------|-----------|-------------|
| | Baseline | **87.30** | **93.20/86.13** | **89.50** | 86.06 | 71.06 | 87.93 | **75.26/-** |
| FT | [pko-t5-small](https://huggingface.co/paust/pko-t5-small) (77M) | 86.21 | 77.99/77.01 | 69.20 | 82.60 | 66.46 | 93.15 | 43.81/46.58 |
| FT | [pko-t5-base](https://huggingface.co/paust/pko-t5-base) (250M) | 87.29 | 90.25/83.43 | 79.73 | 87.80 | 67.23 | 97.28 | 61.53/64.74 |
| FT | [pko-t5-large](https://huggingface.co/paust/pko-t5-large) (800M) | 87.12 | 92.05/85.24 | 84.96 | **88.18** | **75.17** | **97.60** | 68.01/71.44 |
| MT | pko-t5-small | 84.54 | 68.50/72/02 | 51.16 | 74.69 | 66.11 | 80.40 | 43.60/46.28 |
| MT | pko-t5-base | 86.89 | 83.96/80.30 | 72.03 | 85.27 | 66.59 | 95.05 | 61.11/63.94 |
| MT | pko-t5-large | 87.57 | 91.93/86.29 | 83.63 | 87.41 | 71.34 | 96.99 | 70.70/73.72 |
- FT: 싱글태스크 파인튜닝 / MT: 멀티태스크 파인튜닝
- [Baseline](https://arxiv.org/abs/2105.09680): KLUE 논문에서 소개된 dev set 에 대한 SOTA 점수
## License
[PAUST](https://paust.io)에서 만든 pko-t5는 [MIT license](https://github.com/paust-team/pko-t5/blob/main/LICENSE) 하에 공개되어 있습니다. | [
-0.603765606880188,
-0.26935088634490967,
0.3677661120891571,
0.5644078850746155,
-0.5082579255104065,
0.14336201548576355,
-0.1466781049966812,
-0.3060792088508606,
0.438251793384552,
0.2744762599468231,
-0.49393483996391296,
-0.76495760679245,
-0.7939327359199524,
0.268401175737381,
0.14831136167049408,
0.9589413404464722,
-0.2407987266778946,
-0.22450374066829681,
0.27603858709335327,
-0.05260748043656349,
-0.6334152817726135,
-0.15526632964611053,
-0.787225604057312,
-0.35947364568710327,
0.07016140222549438,
0.6664536595344543,
0.5592399835586548,
0.38169553875923157,
0.5806335806846619,
0.38284173607826233,
-0.10804716497659683,
-0.028803862631320953,
-0.3066678047180176,
-0.1791449934244156,
0.08495398610830307,
-0.45238617062568665,
-0.7893651127815247,
-0.2163625806570053,
0.7314743399620056,
0.5947465896606445,
0.1315607875585556,
0.21063096821308136,
0.1161535456776619,
0.5460657477378845,
-0.48788273334503174,
0.28878486156463623,
-0.11731933057308197,
0.234073206782341,
-0.22825384140014648,
-0.2327386438846588,
-0.2376289814710617,
-0.4983294904232025,
-0.010719879530370235,
-0.7820239067077637,
0.12075001001358032,
-0.024899274110794067,
1.576108455657959,
0.09960927814245224,
-0.31539613008499146,
-0.01243698038160801,
-0.42606741189956665,
0.99357008934021,
-0.9975597858428955,
0.42318350076675415,
0.5264067053794861,
0.20980165898799896,
-0.044880904257297516,
-0.8999065160751343,
-0.5343946814537048,
0.01715526171028614,
-0.4275781214237213,
0.5431483387947083,
-0.11950552463531494,
-0.15277914702892303,
0.5124157071113586,
0.37839263677597046,
-0.40988191962242126,
-0.018083229660987854,
-0.6809347867965698,
-0.3446962535381317,
0.8743590712547302,
0.10164135694503784,
0.5722690224647522,
-0.424165815114975,
-0.6565299034118652,
-0.08010257035493851,
-0.35474008321762085,
0.31090471148490906,
0.1860116869211197,
-0.07400096207857132,
-0.538916289806366,
0.6753557324409485,
-0.14445632696151733,
0.32829010486602783,
0.474475234746933,
-0.41511285305023193,
0.879351794719696,
-0.6287125945091248,
-0.37870800495147705,
0.006603318732231855,
1.1014528274536133,
0.7440797686576843,
0.13286279141902924,
-0.05903138592839241,
-0.2835424244403839,
-0.21693018078804016,
-0.016988907009363174,
-1.0954257249832153,
-0.4880272150039673,
0.47675734758377075,
-0.6073887944221497,
-0.4390324056148529,
0.39160436391830444,
-1.154515027999878,
0.0779557004570961,
0.018461737781763077,
0.647132158279419,
-0.6884074211120605,
-0.4646185636520386,
-0.12988324463367462,
-0.3047032654285431,
0.49981626868247986,
0.2074221670627594,
-0.6836786866188049,
0.13858427107334137,
0.26078230142593384,
0.7416393160820007,
0.17655014991760254,
-0.2467220425605774,
-0.24807719886302948,
0.21989400684833527,
-0.47386088967323303,
0.5153976082801819,
-0.09634113311767578,
-0.6098520755767822,
-0.2616478204727173,
0.21533071994781494,
-0.22789397835731506,
-0.42229586839675903,
0.8159967064857483,
-0.11765510588884354,
0.21962887048721313,
-0.2968311607837677,
-0.3982526361942291,
-0.11860290169715881,
0.22294917702674866,
-0.5341774821281433,
1.2250432968139648,
0.17382831871509552,
-1.0631736516952515,
0.6251599788665771,
-0.7668493390083313,
-0.15476828813552856,
-0.11298263072967529,
0.26764416694641113,
-1.0311509370803833,
-0.13056080043315887,
0.44416749477386475,
0.5192505121231079,
-0.05212819576263428,
-0.04041929170489311,
-0.31715089082717896,
-0.3229815661907196,
0.15988869965076447,
0.03698965162038803,
1.034581184387207,
0.18950539827346802,
-0.6057094931602478,
0.31652483344078064,
-1.0067603588104248,
0.34721896052360535,
0.2798779010772705,
-0.3901371955871582,
-0.07226809859275818,
-0.3994216024875641,
-0.00410913722589612,
0.4583531618118286,
0.34098440408706665,
-0.5900850892066956,
0.4066409766674042,
-0.5181272029876709,
0.5139572024345398,
0.8834636211395264,
0.2487459033727646,
0.4434047043323517,
-0.43856799602508545,
0.4193195700645447,
0.339476078748703,
0.32903197407722473,
0.08702794462442398,
-0.3861941993236542,
-0.8273202180862427,
-0.5987160205841064,
0.3562179505825043,
0.5592948794364929,
-0.7647388577461243,
0.9065260291099548,
-0.29827016592025757,
-0.5331942439079285,
-0.6472277045249939,
-0.07764244824647903,
0.3123187720775604,
0.41376611590385437,
0.4585365653038025,
-0.1827174723148346,
-0.7898547649383545,
-1.0552762746810913,
-0.11378107219934464,
0.03784448280930519,
-0.022851191461086273,
0.39122042059898376,
0.9264872074127197,
-0.1742682009935379,
0.7961665391921997,
-0.6269820332527161,
-0.4010154902935028,
-0.43025127053260803,
-0.06932398676872253,
0.6131599545478821,
0.716842770576477,
0.8196827173233032,
-0.795574963092804,
-1.000433087348938,
-0.04746531695127487,
-0.8075094819068909,
-0.32221320271492004,
0.10540488362312317,
-0.15220381319522858,
0.3727801442146301,
0.33497074246406555,
-0.8011841177940369,
0.6522747874259949,
0.35130202770233154,
-0.8540589809417725,
0.8894586563110352,
-0.353732168674469,
0.22645549476146698,
-1.5444923639297485,
0.7021632790565491,
-0.2450733631849289,
-0.26261022686958313,
-0.5995274782180786,
-0.1611761599779129,
0.068590447306633,
-0.12828530371189117,
-0.4781649112701416,
0.7145479917526245,
-0.6549851894378662,
-0.0672549307346344,
0.038231514394283295,
0.0905882939696312,
-0.05598853901028633,
0.5622798204421997,
-0.17414039373397827,
0.930635392665863,
0.6471906900405884,
-0.5707871913909912,
0.3644530177116394,
0.296235591173172,
-0.24014855921268463,
0.47061803936958313,
-0.7716907262802124,
0.019087497144937515,
0.0045704226940870285,
0.410886287689209,
-1.1338752508163452,
-0.4567112624645233,
0.6908498406410217,
-0.7541821599006653,
0.45590320229530334,
-0.09760049730539322,
-0.2962363362312317,
-0.7522812485694885,
-0.7411019206047058,
0.32869935035705566,
0.5965095162391663,
-0.4877851903438568,
0.4385959208011627,
0.1362854540348053,
0.022496504709124565,
-0.825023353099823,
-0.5372546911239624,
-0.1021113395690918,
-0.45326822996139526,
-0.7659005522727966,
0.7516252994537354,
0.09245400130748749,
-0.04474020376801491,
0.1330329030752182,
-0.22995568811893463,
-0.14670144021511078,
-0.027704128995537758,
0.27120673656463623,
0.3981598913669586,
-0.20908786356449127,
-0.2219037115573883,
-0.21655374765396118,
-0.4241770803928375,
-0.03128005936741829,
-0.2330763339996338,
0.7865564227104187,
0.03145485743880272,
0.04076607525348663,
-1.0755597352981567,
0.00699892221018672,
0.9399356842041016,
-0.36123913526535034,
1.0359247922897339,
0.864610493183136,
-0.17190876603126526,
-0.1583409309387207,
-0.3963525891304016,
-0.2241756021976471,
-0.46584054827690125,
0.1939726620912552,
-0.8046704530715942,
-0.6282302141189575,
0.9235880374908447,
-0.06557653099298477,
0.04320449382066727,
0.9699236750602722,
0.5209457874298096,
-0.26182547211647034,
1.022146463394165,
0.4819130301475525,
0.00029982911655679345,
0.4637500047683716,
-0.8173542022705078,
0.2849156856536865,
-1.0433374643325806,
-0.5005033612251282,
-0.4325977861881256,
-0.4499068558216095,
-0.60102778673172,
-0.22699162364006042,
0.44011709094047546,
0.39743751287460327,
-0.4195582866668701,
0.36423271894454956,
-0.5860368013381958,
0.19327059388160706,
0.4822330176830292,
0.2014489620923996,
0.01244271919131279,
-0.21580664813518524,
-0.31280022859573364,
-0.07932054996490479,
-0.6788523197174072,
-0.30893680453300476,
1.3004306554794312,
0.48445045948028564,
0.4760954678058624,
0.20850709080696106,
0.8054806590080261,
-0.0064176456071436405,
0.021001717075705528,
-0.7755432724952698,
0.539107620716095,
0.06377503275871277,
-0.6190981268882751,
-0.38482666015625,
-0.40509042143821716,
-1.1519920825958252,
0.35766705870628357,
-0.2656586766242981,
-0.997856616973877,
0.1755206137895584,
0.0938328206539154,
-0.32530972361564636,
0.5471927523612976,
-0.702741265296936,
1.1021511554718018,
0.0024669880513101816,
-0.5362338423728943,
-0.017045946791768074,
-0.7376076579093933,
0.36168912053108215,
0.06519795954227448,
0.14250589907169342,
0.1213834211230278,
-0.09068197011947632,
0.8080245852470398,
-0.8746777772903442,
0.5881158709526062,
-0.38488298654556274,
-0.06287381798028946,
0.4473039507865906,
-0.16793183982372284,
0.6724368929862976,
0.12462235242128372,
-0.014535525813698769,
-0.03243164345622063,
-0.0598890520632267,
-0.7018826007843018,
-0.4076719284057617,
0.6235283613204956,
-1.086427092552185,
-0.5670677423477173,
-0.6617640852928162,
-0.2328348606824875,
0.1426372528076172,
0.43732917308807373,
0.6497814059257507,
0.18286624550819397,
0.07842747867107391,
0.4429903030395508,
0.4999960660934448,
-0.4138201177120209,
0.7894399166107178,
0.1515956073999405,
-0.16347235441207886,
-0.5487707257270813,
0.851006805896759,
0.11168965697288513,
0.29102274775505066,
0.22957120835781097,
0.23883472383022308,
-0.5506722331047058,
-0.4481988549232483,
-0.3516089618206024,
0.4110410213470459,
-0.44821375608444214,
-0.22116005420684814,
-0.4378482699394226,
-0.19466832280158997,
-0.5576521158218384,
-0.17154397070407867,
-0.4572812020778656,
-0.3817017674446106,
-0.10167572647333145,
-0.08589965105056763,
0.1896027773618698,
0.5104890465736389,
-0.17480118572711945,
0.1249876469373703,
-0.8990204334259033,
0.21159932017326355,
0.029143592342734337,
0.4007137715816498,
-0.15643905103206635,
-0.5919377207756042,
0.011884179897606373,
-0.031793273985385895,
-0.4328809976577759,
-1.1619573831558228,
0.5913689732551575,
-0.07740988582372665,
0.40719395875930786,
0.35177236795425415,
0.015638848766684532,
0.6993457674980164,
-0.18965089321136475,
0.8575673699378967,
0.3963293135166168,
-1.1502946615219116,
0.7030461430549622,
-0.45200803875923157,
0.24820667505264282,
0.3705362379550934,
0.2498140186071396,
-0.4633612036705017,
-0.11517070233821869,
-0.969070553779602,
-1.0308070182800293,
1.1003772020339966,
0.4764895439147949,
-0.2784428894519806,
0.4437643587589264,
0.16195619106292725,
-0.2672464847564697,
0.15428337454795837,
-0.7946872711181641,
-0.4536353647708893,
-0.5542846322059631,
-0.11351105570793152,
-0.003827820299193263,
-0.151996910572052,
-0.0021674740128219128,
-0.3242243528366089,
0.8980993628501892,
0.1367638111114502,
0.5734917521476746,
0.43959447741508484,
-0.1019967570900917,
-0.05314387381076813,
0.23252888023853302,
0.797940194606781,
0.8516021966934204,
-0.2923538088798523,
-0.14455504715442657,
0.5251984000205994,
-0.5760716795921326,
0.15052533149719238,
-0.07792095094919205,
-0.2856258451938629,
0.10864052921533585,
0.4966428577899933,
0.9421271681785583,
0.3034450113773346,
-0.16912060976028442,
0.5846971869468689,
0.2070656716823578,
-0.5714179873466492,
-0.46510207653045654,
-0.08877649158239365,
0.13592828810214996,
0.21697673201560974,
0.26637324690818787,
0.001056402106769383,
-0.27273833751678467,
-0.5868769288063049,
0.1535811722278595,
0.21650896966457367,
-0.2349352091550827,
-0.34993666410446167,
0.6470688581466675,
0.17037566006183624,
-0.0878719910979271,
0.588132381439209,
-0.13294671475887299,
-0.8854601383209229,
0.9608438014984131,
0.5424288511276245,
0.7738600969314575,
-0.5420804619789124,
0.06853609532117844,
1.0183097124099731,
0.08227251470088959,
-0.03090979903936386,
0.3907071650028229,
0.15146464109420776,
-0.5287745594978333,
-0.25590577721595764,
-0.6793342232704163,
0.26681971549987793,
0.46647384762763977,
-0.4112204611301422,
0.37156832218170166,
-0.5915364027023315,
-0.36058446764945984,
0.03825812041759491,
0.4000455439090729,
-0.5612261891365051,
0.4673348069190979,
-0.15489166975021362,
0.8495266437530518,
-0.7833631038665771,
0.9124109148979187,
0.9536598324775696,
-0.7089971303939819,
-1.266666293144226,
0.13011591136455536,
-0.19987796247005463,
-0.7353099584579468,
0.9279394745826721,
-0.11531153321266174,
0.2895834445953369,
0.06456730514764786,
-0.41468966007232666,
-0.967616617679596,
1.5545953512191772,
0.050909075886011124,
-0.3675577640533447,
0.030578982084989548,
-0.014374135062098503,
0.48685967922210693,
0.10857793688774109,
0.3780214786529541,
0.36403828859329224,
0.8206831812858582,
0.205674409866333,
-1.3039549589157104,
0.34086430072784424,
-0.2530251741409302,
-0.15991513431072235,
0.5321251153945923,
-1.2937736511230469,
1.169575572013855,
-0.23271557688713074,
-0.039568327367305756,
-0.09485156089067459,
0.5999442934989929,
0.44306445121765137,
0.04409926012158394,
0.3488745093345642,
0.8578522801399231,
0.49790945649147034,
-0.2759932577610016,
0.9558247923851013,
-0.3701636493206024,
0.8533034324645996,
0.45785900950431824,
0.3494110107421875,
0.5470298528671265,
0.44285452365875244,
-0.5134866833686829,
0.3370439410209656,
0.6110323667526245,
-0.4517481327056885,
0.4483201801776886,
0.1456526815891266,
-0.3340352177619934,
-0.14167211949825287,
0.12099099904298782,
-0.5629224181175232,
0.42974719405174255,
0.15283887088298798,
-0.49799326062202454,
-0.020742779597640038,
-0.21647082269191742,
0.3985694646835327,
-0.2244596928358078,
-0.49035826325416565,
0.6618139147758484,
0.09634367376565933,
-0.7704975605010986,
0.6553109884262085,
0.19204193353652954,
0.730847954750061,
-0.5293996930122375,
0.0009042435558512807,
-0.13833166658878326,
0.5456564426422119,
-0.4983341693878174,
-1.0159167051315308,
0.34308061003685,
-0.11522883921861649,
-0.12328841537237167,
-0.15717577934265137,
0.9098063111305237,
-0.28833872079849243,
-0.5289903283119202,
0.3314645290374756,
0.2193557769060135,
0.1916215866804123,
0.39154618978500366,
-0.8573824167251587,
0.035140104591846466,
0.1983945220708847,
-0.4538290202617645,
0.24859942495822906,
0.4506850242614746,
0.00670563755556941,
0.6619528532028198,
0.6143826246261597,
0.17129333317279816,
0.20697161555290222,
-0.20778518915176392,
0.8065051436424255,
-0.5536683797836304,
-0.6656832695007324,
-1.0285255908966064,
0.8162037134170532,
-0.32889705896377563,
-0.6141394972801208,
0.871006190776825,
0.8027340769767761,
0.7328107357025146,
-0.3123317360877991,
0.9513620734214783,
-0.44346508383750916,
0.32964617013931274,
-0.5242285132408142,
0.9489655494689941,
-0.7147724628448486,
-0.20638462901115417,
-0.4127812385559082,
-0.9723209738731384,
-0.23260638117790222,
0.9359227418899536,
-0.45989692211151123,
0.2610609233379364,
0.8114489912986755,
0.5871047377586365,
-0.1561882495880127,
-0.2098333239555359,
0.020476331934332848,
0.585533857345581,
0.37561243772506714,
1.036258578300476,
0.42590832710266113,
-0.7562949061393738,
0.595933735370636,
-0.561133086681366,
-0.0037966908421367407,
-0.3821389973163605,
-0.6020188927650452,
-1.095255970954895,
-0.466105580329895,
-0.3030449450016022,
-0.5366345047950745,
-0.11239083856344223,
1.024776577949524,
0.6419607400894165,
-0.7981690168380737,
-0.16848725080490112,
-0.1312023550271988,
0.031179029494524002,
-0.22932663559913635,
-0.2904869318008423,
0.8173911571502686,
-0.3427061140537262,
-1.0197380781173706,
0.001241800026036799,
0.012661727145314217,
0.23764334619045258,
0.21039901673793793,
-0.2465747445821762,
-0.30197224020957947,
-0.25024867057800293,
0.47542744874954224,
0.3667573034763336,
-0.6714715957641602,
-0.4470686614513397,
-0.15686844289302826,
-0.1803349256515503,
0.263619601726532,
0.3142804503440857,
-0.37314373254776,
0.1675487756729126,
0.859420120716095,
0.13869351148605347,
0.7789762616157532,
0.18129535019397736,
0.47488850355148315,
-0.6211983561515808,
0.2553219199180603,
0.21026384830474854,
0.24618975818157196,
0.05424076318740845,
-0.17737342417240143,
0.7287150025367737,
0.6334617137908936,
-0.4642275869846344,
-0.8827871680259705,
-0.18592332303524017,
-1.0654480457305908,
-0.39223748445510864,
0.9569811820983887,
-0.2448761910200119,
-0.34282857179641724,
0.054250240325927734,
-0.5924699902534485,
0.5254802107810974,
-0.5411846041679382,
0.6878765821456909,
0.9244098663330078,
-0.03639518842101097,
-0.2958991825580597,
-0.6035898327827454,
0.8128409385681152,
0.5229549407958984,
-0.9264717698097229,
-0.35695594549179077,
0.12346569448709488,
0.546710193157196,
0.3371813893318176,
0.7835476398468018,
-0.21579158306121826,
0.28033170104026794,
0.08572700619697571,
0.22691203653812408,
-0.10664170235395432,
-0.032595276832580566,
-0.012266315519809723,
0.3218315541744232,
-0.24683600664138794,
-0.5708441138267517
] |
CompVis/stable-diffusion-safety-checker | CompVis | "2022-11-25T17:21:38Z" | 2,017,585 | 80 | transformers | [
"transformers",
"pytorch",
"clip",
"arxiv:2103.00020",
"arxiv:1910.09700",
"endpoints_compatible",
"has_space",
"region:us"
] | null | "2022-08-22T10:22:34Z" | ---
tags:
- clip
---
# Model Card for stable-diffusion-safety-checker
# Model Details
## Model Description
More information needed
- **Developed by:** More information needed
- **Shared by [Optional]:** CompVis
- **Model type:** Image Identification
- **Language(s) (NLP):** More information needed
- **License:** More information needed
- **Parent Model:** [CLIP](https://huggingface.co/openai/clip-vit-large-patch14)
- **Resources for more information:**
- [CLIP Paper](https://arxiv.org/abs/2103.00020)
- [Stable Diffusion Model Card](https://github.com/CompVis/stable-diffusion/blob/main/Stable_Diffusion_v1_Model_Card.md)
# Uses
## Direct Use
This model can be used for identifying NSFW image
The CLIP model devlopers note in their [model card](https://huggingface.co/openai/clip-vit-large-patch14) :
>The primary intended users of these models are AI researchers.
We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.
## Downstream Use [Optional]
More information needed.
## Out-of-Scope Use
The model is not intended to be used with transformers but with diffusers. This model should also not be used to intentionally create hostile or alienating environments for people.
# Bias, Risks, and Limitations
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
The CLIP model devlopers note in their [model card](https://huggingface.co/openai/clip-vit-large-patch14) :
> We find that the performance of CLIP - and the specific biases it exhibits - can depend significantly on class design and the choices one makes for categories to include and exclude. We tested the risk of certain kinds of denigration with CLIP by classifying images of people from Fairface into crime-related and non-human animal categories. We found significant disparities with respect to race and gender. Additionally, we found that these disparities could shift based on how the classes were constructed.
> We also tested the performance of CLIP on gender, race and age classification using the Fairface dataset (We default to using race categories as they are constructed in the Fairface dataset.) in order to assess quality of performance across different demographics. We found accuracy >96% across all races for gender classification with ‘Middle Eastern’ having the highest accuracy (98.4%) and ‘White’ having the lowest (96.5%). Additionally, CLIP averaged ~93% for racial classification and ~63% for age classification
## Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
# Training Details
## Training Data
More information needed
## Training Procedure
### Preprocessing
More information needed
### Speeds, Sizes, Times
More information needed
# Evaluation
## Testing Data, Factors & Metrics
### Testing Data
More information needed
### Factors
More information needed
### Metrics
More information needed
## Results
More information needed
# Model Examination
More information needed
# Environmental Impact
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** More information needed
- **Hours used:** More information needed
- **Cloud Provider:** More information needed
- **Compute Region:** More information needed
- **Carbon Emitted:** More information needed
# Technical Specifications [optional]
## Model Architecture and Objective
The CLIP model devlopers note in their [model card](https://huggingface.co/openai/clip-vit-large-patch14) :
> The base model uses a ViT-L/14 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss.
## Compute Infrastructure
More information needed
### Hardware
More information needed
### Software
More information needed.
# Citation
**BibTeX:**
More information needed
**APA:**
More information needed
# Glossary [optional]
More information needed
# More Information [optional]
More information needed
# Model Card Authors [optional]
CompVis in collaboration with Ezi Ozoani and the Hugging Face team
# Model Card Contact
More information needed
# How to Get Started with the Model
Use the code below to get started with the model.
<details>
<summary> Click to expand </summary>
```python
from transformers import AutoProcessor, SafetyChecker
processor = AutoProcessor.from_pretrained("CompVis/stable-diffusion-safety-checker")
safety_checker = SafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
```
</details>
| [
-0.4237004220485687,
-0.7081676125526428,
0.2338799089193344,
0.1043306291103363,
-0.16376177966594696,
-0.2435457408428192,
0.017312999814748764,
-0.5261197686195374,
0.04899721220135689,
0.37794390320777893,
-0.33831489086151123,
-0.531202495098114,
-0.798128604888916,
-0.07126156985759735,
-0.5008341073989868,
0.8493975400924683,
-0.002885054098442197,
0.029619349166750908,
-0.1399451643228531,
-0.13168038427829742,
-0.41656169295310974,
-0.4732111096382141,
-0.6942120790481567,
-0.14429208636283875,
0.1779072880744934,
-0.003933496307581663,
0.7311445474624634,
0.7421109676361084,
0.5784202814102173,
0.33387866616249084,
-0.4379834532737732,
-0.2457299828529358,
-0.5481390357017517,
-0.41589483618736267,
-0.2716241478919983,
-0.2997795045375824,
-0.5501013398170471,
0.16755631566047668,
0.6239367723464966,
0.3747161030769348,
-0.21700748801231384,
0.2438373565673828,
0.08077391982078552,
0.40413013100624084,
-0.8147240281105042,
0.046003419905900955,
-0.4916797876358032,
0.1318867802619934,
-0.21885088086128235,
0.20343156158924103,
-0.2725794017314911,
-0.2197836935520172,
0.06339162588119507,
-0.4745499789714813,
0.3098830580711365,
-0.10508261620998383,
1.1709678173065186,
0.3542647063732147,
-0.20000237226486206,
-0.0475979819893837,
-0.5897012948989868,
0.6461459994316101,
-0.5898791551589966,
0.4049544036388397,
0.19960151612758636,
0.2040509283542633,
0.04033508524298668,
-0.7550630569458008,
-0.6509613990783691,
0.07323396950960159,
0.10663654655218124,
0.1501608043909073,
-0.251019150018692,
-0.0407506488263607,
0.46856120228767395,
0.346222460269928,
-0.2975485026836395,
0.040151335299015045,
-0.49273988604545593,
-0.3572998642921448,
0.6656542420387268,
0.22840501368045807,
0.3546656668186188,
-0.20202739536762238,
-0.5866214632987976,
-0.3452001214027405,
-0.3669697940349579,
0.35961464047431946,
0.4004393517971039,
-0.0355367437005043,
-0.4658041000366211,
0.5135264992713928,
-0.029790405184030533,
0.37922340631484985,
0.08912616968154907,
-0.3131589889526367,
0.4409145712852478,
-0.38678085803985596,
-0.2727218568325043,
-0.15742895007133484,
0.9407443404197693,
0.6133215427398682,
0.013810420408844948,
0.2601568400859833,
-0.14508843421936035,
0.17412318289279938,
0.14635737240314484,
-1.112478256225586,
-0.3594304025173187,
-0.0008177585550583899,
-0.6826562881469727,
-0.5014613270759583,
0.08109551668167114,
-1.0421348810195923,
-0.0007592535112053156,
-0.06871367245912552,
0.5668498873710632,
-0.32865044474601746,
-0.4464593529701233,
0.11837568879127502,
-0.2941240072250366,
0.18831083178520203,
0.3561943471431732,
-0.6684624552726746,
0.3492222726345062,
0.3396822512149811,
1.0042638778686523,
-0.4497283101081848,
-0.10869570821523666,
0.010510451160371304,
0.04108899459242821,
0.012469769455492496,
0.6190496683120728,
-0.48384779691696167,
-0.5010049343109131,
-0.10934772342443466,
0.40627601742744446,
-0.00018055312102660537,
-0.3644607663154602,
0.6870395541191101,
-0.2991575002670288,
0.2587824761867523,
-0.10588265210390091,
-0.40181997418403625,
-0.39260387420654297,
0.19479483366012573,
-0.7060276865959167,
1.094230055809021,
0.08796079456806183,
-1.0065648555755615,
0.2405085265636444,
-0.7007349729537964,
-0.02012203447520733,
-0.11848149448633194,
-0.0430586114525795,
-0.8107717037200928,
-0.46205928921699524,
0.18122559785842896,
0.3107500672340393,
-0.1096874475479126,
0.37580981850624084,
-0.5211222767829895,
-0.2480299472808838,
0.055985357612371445,
-0.4293123781681061,
1.152739405632019,
0.2067720890045166,
-0.42336776852607727,
0.1103430688381195,
-0.5995402336120605,
-0.21783459186553955,
0.30056294798851013,
-0.09969471395015717,
-0.17481663823127747,
-0.19896559417247772,
0.31148001551628113,
0.29315516352653503,
0.1477869749069214,
-0.5923774838447571,
-0.13223125040531158,
0.029543085023760796,
0.44065922498703003,
0.8243805170059204,
0.02837221696972847,
0.35610270500183105,
-0.2635469138622284,
0.49696192145347595,
0.051881689578294754,
0.5345758199691772,
0.0020057857036590576,
-0.6084355115890503,
-0.7345422506332397,
-0.368838369846344,
0.4558629095554352,
0.6829251646995544,
-0.38497427105903625,
0.5049917101860046,
-0.0036671070847660303,
-0.614622950553894,
-0.21615518629550934,
-0.0961746796965599,
0.4046782851219177,
0.6322374939918518,
0.31037893891334534,
-0.5709860324859619,
-0.41095104813575745,
-0.8642466068267822,
0.18856047093868256,
-0.025904091075062752,
0.11581676453351974,
0.3185499310493469,
0.8144248127937317,
-0.4101881980895996,
0.8673690557479858,
-0.6043910980224609,
-0.29220959544181824,
0.03958742693066597,
-0.08059436082839966,
-0.01719888299703598,
0.6432969570159912,
0.7748342752456665,
-0.8609106540679932,
-0.252680242061615,
-0.43715745210647583,
-0.7940366268157959,
0.06591252982616425,
0.15426883101463318,
-0.2987636625766754,
0.15968090295791626,
0.45405104756355286,
-0.48594072461128235,
0.7159773111343384,
0.522564172744751,
-0.35427969694137573,
0.5656145215034485,
-0.11386321485042572,
0.09290869534015656,
-0.8459711670875549,
0.3521749675273895,
0.20792745053768158,
-0.32774388790130615,
-0.4583108723163605,
0.008306764997541904,
0.001395249622873962,
-0.26145240664482117,
-0.759651780128479,
0.6077998280525208,
-0.21257168054580688,
0.18882565200328827,
-0.30351313948631287,
-0.08474844694137573,
0.050449520349502563,
0.6085792183876038,
0.2752852141857147,
0.8908049464225769,
0.5363309383392334,
-0.6950551271438599,
-0.13400447368621826,
0.4229140281677246,
-0.31069812178611755,
0.47628459334373474,
-0.7792802453041077,
0.06719063222408295,
-0.1744835376739502,
0.2348298281431198,
-0.5700256824493408,
-0.24030143022537231,
0.3335794508457184,
-0.3378627896308899,
0.3436509966850281,
-0.11862742155790329,
-0.335832417011261,
-0.4811142683029175,
-0.26536470651626587,
0.5571523904800415,
0.6919043660163879,
-0.4210665822029114,
0.403715044260025,
0.7892350554466248,
-0.02250135876238346,
-0.631314754486084,
-0.621330738067627,
-0.18200267851352692,
-0.26600635051727295,
-0.6993149518966675,
0.5629429221153259,
-0.0935729444026947,
-0.07476475089788437,
0.010588218457996845,
0.1323567032814026,
-0.2577367424964905,
0.11231111735105515,
0.4701492190361023,
0.39175692200660706,
0.10005272179841995,
-0.02323804795742035,
-0.0383363738656044,
-0.07878471165895462,
0.07519654184579849,
0.19350069761276245,
0.3195900321006775,
-0.12476637959480286,
-0.10109502822160721,
-0.577318549156189,
0.3166135251522064,
0.4760902523994446,
-0.16609731316566467,
0.7715018391609192,
0.7588477730751038,
-0.5333878397941589,
0.017000967636704445,
-0.5007205605506897,
-0.12729905545711517,
-0.49532708525657654,
0.41050955653190613,
-0.17501579225063324,
-0.7427382469177246,
0.729562520980835,
0.07905716449022293,
-0.20318357646465302,
0.7865599989891052,
0.5680745840072632,
-0.030985532328486443,
0.9871288537979126,
0.9372955560684204,
-0.004506018944084644,
0.6736019849777222,
-0.5515381693840027,
0.0016941854264587164,
-0.7652711868286133,
-0.44014713168144226,
-0.4981371760368347,
-0.055938445031642914,
-0.4867454171180725,
-0.44620567560195923,
0.3132261037826538,
0.1878727376461029,
-0.4699801206588745,
0.3284454345703125,
-0.7490925192832947,
0.361276239156723,
0.4162883758544922,
0.26747092604637146,
0.007308966014534235,
-0.15285435318946838,
0.014623589813709259,
-0.09326884895563126,
-0.558872640132904,
-0.5729619860649109,
0.812324047088623,
0.8127772212028503,
0.7962617874145508,
0.0009087686776183546,
0.44102776050567627,
0.4014330506324768,
0.1937929093837738,
-0.4147666096687317,
0.5058876872062683,
-0.2654062807559967,
-0.688950777053833,
-0.19568884372711182,
-0.2489590048789978,
-0.7708666920661926,
0.15606896579265594,
-0.3301016390323639,
-0.6529970765113831,
0.5747974514961243,
0.1833619475364685,
-0.21890583634376526,
0.5115137100219727,
-0.603641152381897,
1.1469751596450806,
-0.22676362097263336,
-0.40415695309638977,
-0.01760459505021572,
-0.6341081261634827,
0.5526659488677979,
0.022843830287456512,
0.20730088651180267,
-0.2587188482284546,
0.04047206789255142,
0.9920167326927185,
-0.5986570119857788,
0.9199901819229126,
-0.34688761830329895,
0.13153181970119476,
0.4634975790977478,
-0.1962832361459732,
0.3447549641132355,
-0.043772727251052856,
-0.11308217793703079,
0.6335448026657104,
0.1351182907819748,
-0.17538683116436005,
-0.22849151492118835,
0.437147855758667,
-0.8294083476066589,
-0.32619136571884155,
-0.5004631876945496,
-0.27554306387901306,
0.3445347547531128,
0.317425012588501,
0.5645430684089661,
0.26950493454933167,
-0.19234977662563324,
-0.008816873654723167,
0.7800275087356567,
-0.37654945254325867,
0.3928172290325165,
0.2732408940792084,
-0.16294026374816895,
-0.5566471219062805,
0.759112536907196,
0.05907902866601944,
0.2824486792087555,
0.07036088407039642,
0.1325617879629135,
-0.2980782091617584,
-0.4124741554260254,
-0.36633116006851196,
0.13565030694007874,
-0.7217594385147095,
-0.370501846075058,
-0.8489640355110168,
-0.4674145579338074,
-0.42388251423835754,
0.03267054259777069,
-0.45317575335502625,
-0.26992127299308777,
-0.583061695098877,
-0.0017393240705132484,
0.3883928656578064,
0.4783459007740021,
-0.15961600840091705,
0.35162821412086487,
-0.5423965454101562,
0.3078403174877167,
0.3198229670524597,
0.5209937691688538,
0.007745701819658279,
-0.5485172271728516,
-0.09643367677927017,
0.05245427042245865,
-0.6994891166687012,
-0.9383679032325745,
0.38765785098075867,
0.19386433064937592,
0.6254182457923889,
0.3821343779563904,
0.10099854320287704,
0.4751013517379761,
-0.45776984095573425,
0.9347467422485352,
0.3607076406478882,
-0.9798478484153748,
0.5518136620521545,
-0.31787508726119995,
0.11524301022291183,
0.6481940746307373,
0.374204158782959,
-0.2642458379268646,
-0.3328080475330353,
-0.6172139644622803,
-0.7401310801506042,
0.7387597560882568,
0.36427053809165955,
0.021516285836696625,
-0.04520710930228233,
0.3923175036907196,
-0.03098754771053791,
-0.04472752660512924,
-0.9666444063186646,
-0.41095641255378723,
-0.41493460536003113,
-0.10452353954315186,
0.1790265142917633,
-0.33669397234916687,
-0.026658300310373306,
-0.3650989830493927,
0.6984140276908875,
0.01074136234819889,
0.6228689551353455,
0.38389334082603455,
-0.0899810940027237,
0.022154362872242928,
0.04095016047358513,
0.6172578930854797,
0.21107564866542816,
-0.44941025972366333,
-0.0544847697019577,
0.23648995161056519,
-0.7465606927871704,
0.17197482287883759,
0.02933446504175663,
-0.4879680275917053,
0.006273477338254452,
0.050572045147418976,
0.8999834656715393,
-0.0463254489004612,
-0.4782530665397644,
0.8909899592399597,
-0.11862809211015701,
-0.3500884175300598,
-0.373627632856369,
0.18301892280578613,
-0.1233447939157486,
0.1400611847639084,
0.02642107382416725,
0.3696992099285126,
0.40380534529685974,
-0.43373677134513855,
0.20077408850193024,
0.5347671508789062,
-0.4973139762878418,
-0.18599970638751984,
1.0149732828140259,
0.37649068236351013,
-0.3669792413711548,
0.40813788771629333,
-0.2660462558269501,
-0.699026346206665,
0.803094744682312,
0.4707188010215759,
0.8262594938278198,
-0.1929931789636612,
0.11897013336420059,
0.7435076236724854,
0.30033692717552185,
-0.3190290927886963,
0.030976489186286926,
0.07108674943447113,
-0.6304088830947876,
-0.26828476786613464,
-0.4923936724662781,
-0.37362581491470337,
0.08333049714565277,
-0.7568991184234619,
0.5260909795761108,
-0.5533887147903442,
-0.49393704533576965,
-0.03325056657195091,
-0.2446378916501999,
-0.8060951232910156,
0.26525115966796875,
0.23324157297611237,
1.1568816900253296,
-1.002073049545288,
0.7743527889251709,
0.3683181703090668,
-0.5623036026954651,
-0.6196156740188599,
-0.1898924559354782,
-0.0794372409582138,
-0.48829934000968933,
0.5723947882652283,
0.40015920996665955,
-0.1021430492401123,
-0.3634856939315796,
-0.7398806214332581,
-0.878158450126648,
1.1525368690490723,
0.4017281234264374,
-0.5685784220695496,
0.021115122362971306,
-0.17880016565322876,
0.4575962424278259,
-0.39047423005104065,
0.48000583052635193,
0.4052255153656006,
0.2594355642795563,
0.08632492274045944,
-0.9695670008659363,
0.1176084578037262,
-0.36336418986320496,
0.1460801064968109,
0.08081044256687164,
-0.9710781574249268,
0.8568646907806396,
-0.2569993734359741,
-0.3426121473312378,
0.02615656517446041,
0.6065117716789246,
0.17833392322063446,
0.3870711028575897,
0.6102527976036072,
0.7302200794219971,
0.672760009765625,
0.02732769213616848,
0.9641698002815247,
-0.2002687156200409,
0.5176283121109009,
0.9946638345718384,
-0.06527755409479141,
0.8785094022750854,
0.246211439371109,
-0.27343329787254333,
0.5926064848899841,
0.5859078168869019,
-0.37996360659599304,
0.7022874355316162,
-0.13132156431674957,
-0.008208428509533405,
-0.2033321112394333,
-0.15519055724143982,
-0.521761953830719,
0.32430770993232727,
0.21623747050762177,
-0.5882206559181213,
0.024880291894078255,
0.14246803522109985,
-0.06652700155973434,
-0.06444425135850906,
-0.27265313267707825,
0.596136212348938,
-0.10425209999084473,
-0.373422235250473,
0.33541056513786316,
0.1797720193862915,
0.9436308741569519,
-0.36248713731765747,
-0.13272340595722198,
0.14740824699401855,
0.2110351026058197,
-0.1738765835762024,
-0.9298707842826843,
0.3978594243526459,
0.030485285446047783,
-0.32592734694480896,
-0.03885680064558983,
0.7333457469940186,
-0.3584210276603699,
-0.6673746705055237,
0.3913651704788208,
-0.05866605415940285,
0.23187366127967834,
0.1216309666633606,
-0.931862473487854,
0.2948944568634033,
0.09522536396980286,
-0.014539355412125587,
0.12297844886779785,
-0.04063034802675247,
-0.02384459413588047,
0.6523118019104004,
0.42930150032043457,
-0.1046440601348877,
0.06419249624013901,
-0.1703394651412964,
0.8223540186882019,
-0.5329094529151917,
-0.5357558131217957,
-0.677024781703949,
0.5924286842346191,
-0.32239827513694763,
-0.3078973591327667,
0.5927517414093018,
0.6336966156959534,
0.8549322485923767,
-0.05792229250073433,
0.7236829400062561,
-0.053082019090652466,
0.4137312173843384,
-0.41838958859443665,
0.7174952626228333,
-0.4982790946960449,
-0.0209366325289011,
-0.5360459089279175,
-0.8594211339950562,
-0.11835100501775742,
0.7903589010238647,
-0.14267288148403168,
0.08371948450803757,
0.44106215238571167,
0.8038042783737183,
-0.1416407823562622,
0.016862930729985237,
0.09788047522306442,
0.009335452690720558,
0.362155944108963,
0.40057557821273804,
0.4844793677330017,
-0.7395299673080444,
0.5081325769424438,
-0.5782144665718079,
-0.30475637316703796,
-0.11074771732091904,
-0.9190183877944946,
-1.0212749242782593,
-0.405627965927124,
-0.7731857299804688,
-0.51712965965271,
-0.06519374251365662,
0.5675045251846313,
0.9154220223426819,
-0.7101646065711975,
-0.003992416430264711,
0.01261132676154375,
0.09128434211015701,
-0.0491768941283226,
-0.23278619349002838,
0.45387277007102966,
0.15043193101882935,
-0.6451454758644104,
-0.2278338521718979,
0.1260060966014862,
0.355823814868927,
-0.30692538619041443,
-0.1996963918209076,
-0.08339014649391174,
-0.01791255548596382,
0.44673067331314087,
0.36557263135910034,
-0.6833818554878235,
-0.245920792222023,
-0.1271565556526184,
-0.1798829883337021,
0.11815986782312393,
0.43623682856559753,
-0.49039462208747864,
0.3933013081550598,
0.45328018069267273,
0.3615639805793762,
0.7645905017852783,
-0.045691460371017456,
0.27748778462409973,
-0.3242563307285309,
0.33547696471214294,
0.04808926209807396,
0.5527855157852173,
0.33099743723869324,
-0.5303038358688354,
0.5594702363014221,
0.38205793499946594,
-0.7283454537391663,
-0.8422220945358276,
0.007081565447151661,
-1.193153738975525,
-0.1545586735010147,
1.0958583354949951,
-0.19529426097869873,
-0.5469986796379089,
0.02026601880788803,
-0.32214391231536865,
0.22239407896995544,
-0.4516817331314087,
0.6006541848182678,
0.4939243197441101,
0.10255042463541031,
-0.45743927359580994,
-0.3991183936595917,
0.4741249084472656,
0.026303043588995934,
-0.7592895030975342,
-0.252858966588974,
0.39452680945396423,
0.6765764355659485,
0.31678199768066406,
0.6481106877326965,
-0.3419829308986664,
0.33485713601112366,
0.12803915143013,
0.45173904299736023,
-0.0542653426527977,
-0.23741470277309418,
-0.4644987881183624,
0.1874273121356964,
-0.28479239344596863,
-0.3407939076423645
] |
timm/resnet18.a1_in1k | timm | "2023-04-05T18:03:00Z" | 1,995,085 | 4 | timm | [
"timm",
"pytorch",
"safetensors",
"image-classification",
"arxiv:2110.00476",
"arxiv:1512.03385",
"license:apache-2.0",
"region:us"
] | image-classification | "2023-04-05T18:02:50Z" | ---
tags:
- image-classification
- timm
library_tag: timm
license: apache-2.0
---
# Model card for resnet18.a1_in1k
A ResNet-B image classification model.
This model features:
* ReLU activations
* single layer 7x7 convolution with pooling
* 1x1 convolution shortcut downsample
Trained on ImageNet-1k in `timm` using recipe template described below.
Recipe details:
* ResNet Strikes Back `A1` recipe
* LAMB optimizer with BCE loss
* Cosine LR schedule with warmup
## Model Details
- **Model Type:** Image classification / feature backbone
- **Model Stats:**
- Params (M): 11.7
- GMACs: 1.8
- Activations (M): 2.5
- Image size: train = 224 x 224, test = 288 x 288
- **Papers:**
- ResNet strikes back: An improved training procedure in timm: https://arxiv.org/abs/2110.00476
- Deep Residual Learning for Image Recognition: https://arxiv.org/abs/1512.03385
- **Original:** https://github.com/huggingface/pytorch-image-models
## Model Usage
### Image Classification
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model('resnet18.a1_in1k', pretrained=True)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
```
### Feature Map Extraction
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'resnet18.a1_in1k',
pretrained=True,
features_only=True,
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
for o in output:
# print shape of each feature map in output
# e.g.:
# torch.Size([1, 64, 112, 112])
# torch.Size([1, 64, 56, 56])
# torch.Size([1, 128, 28, 28])
# torch.Size([1, 256, 14, 14])
# torch.Size([1, 512, 7, 7])
print(o.shape)
```
### Image Embeddings
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'resnet18.a1_in1k',
pretrained=True,
num_classes=0, # remove classifier nn.Linear
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
# or equivalently (without needing to set num_classes=0)
output = model.forward_features(transforms(img).unsqueeze(0))
# output is unpooled, a (1, 512, 7, 7) shaped tensor
output = model.forward_head(output, pre_logits=True)
# output is a (1, num_features) shaped tensor
```
## Model Comparison
Explore the dataset and runtime metrics of this model in timm [model results](https://github.com/huggingface/pytorch-image-models/tree/main/results).
|model |img_size|top1 |top5 |param_count|gmacs|macts|img/sec|
|------------------------------------------|--------|-----|-----|-----------|-----|-----|-------|
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k_288](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k_288)|320 |86.72|98.17|93.6 |35.2 |69.7 |451 |
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k_288](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k_288)|288 |86.51|98.08|93.6 |28.5 |56.4 |560 |
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k)|288 |86.49|98.03|93.6 |28.5 |56.4 |557 |
|[seresnextaa101d_32x8d.sw_in12k_ft_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.sw_in12k_ft_in1k)|224 |85.96|97.82|93.6 |17.2 |34.2 |923 |
|[resnext101_32x32d.fb_wsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x32d.fb_wsl_ig1b_ft_in1k)|224 |85.11|97.44|468.5 |87.3 |91.1 |254 |
|[resnetrs420.tf_in1k](https://huggingface.co/timm/resnetrs420.tf_in1k)|416 |85.0 |97.12|191.9 |108.4|213.8|134 |
|[ecaresnet269d.ra2_in1k](https://huggingface.co/timm/ecaresnet269d.ra2_in1k)|352 |84.96|97.22|102.1 |50.2 |101.2|291 |
|[ecaresnet269d.ra2_in1k](https://huggingface.co/timm/ecaresnet269d.ra2_in1k)|320 |84.73|97.18|102.1 |41.5 |83.7 |353 |
|[resnetrs350.tf_in1k](https://huggingface.co/timm/resnetrs350.tf_in1k)|384 |84.71|96.99|164.0 |77.6 |154.7|183 |
|[seresnextaa101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.ah_in1k)|288 |84.57|97.08|93.6 |28.5 |56.4 |557 |
|[resnetrs200.tf_in1k](https://huggingface.co/timm/resnetrs200.tf_in1k)|320 |84.45|97.08|93.2 |31.5 |67.8 |446 |
|[resnetrs270.tf_in1k](https://huggingface.co/timm/resnetrs270.tf_in1k)|352 |84.43|96.97|129.9 |51.1 |105.5|280 |
|[seresnext101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101d_32x8d.ah_in1k)|288 |84.36|96.92|93.6 |27.6 |53.0 |595 |
|[seresnet152d.ra2_in1k](https://huggingface.co/timm/seresnet152d.ra2_in1k)|320 |84.35|97.04|66.8 |24.1 |47.7 |610 |
|[resnetrs350.tf_in1k](https://huggingface.co/timm/resnetrs350.tf_in1k)|288 |84.3 |96.94|164.0 |43.7 |87.1 |333 |
|[resnext101_32x8d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x8d.fb_swsl_ig1b_ft_in1k)|224 |84.28|97.17|88.8 |16.5 |31.2 |1100 |
|[resnetrs420.tf_in1k](https://huggingface.co/timm/resnetrs420.tf_in1k)|320 |84.24|96.86|191.9 |64.2 |126.6|228 |
|[seresnext101_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101_32x8d.ah_in1k)|288 |84.19|96.87|93.6 |27.2 |51.6 |613 |
|[resnext101_32x16d.fb_wsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x16d.fb_wsl_ig1b_ft_in1k)|224 |84.18|97.19|194.0 |36.3 |51.2 |581 |
|[resnetaa101d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa101d.sw_in12k_ft_in1k)|288 |84.11|97.11|44.6 |15.1 |29.0 |1144 |
|[resnet200d.ra2_in1k](https://huggingface.co/timm/resnet200d.ra2_in1k)|320 |83.97|96.82|64.7 |31.2 |67.3 |518 |
|[resnetrs200.tf_in1k](https://huggingface.co/timm/resnetrs200.tf_in1k)|256 |83.87|96.75|93.2 |20.2 |43.4 |692 |
|[seresnextaa101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnextaa101d_32x8d.ah_in1k)|224 |83.86|96.65|93.6 |17.2 |34.2 |923 |
|[resnetrs152.tf_in1k](https://huggingface.co/timm/resnetrs152.tf_in1k)|320 |83.72|96.61|86.6 |24.3 |48.1 |617 |
|[seresnet152d.ra2_in1k](https://huggingface.co/timm/seresnet152d.ra2_in1k)|256 |83.69|96.78|66.8 |15.4 |30.6 |943 |
|[seresnext101d_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101d_32x8d.ah_in1k)|224 |83.68|96.61|93.6 |16.7 |32.0 |986 |
|[resnet152d.ra2_in1k](https://huggingface.co/timm/resnet152d.ra2_in1k)|320 |83.67|96.74|60.2 |24.1 |47.7 |706 |
|[resnetrs270.tf_in1k](https://huggingface.co/timm/resnetrs270.tf_in1k)|256 |83.59|96.61|129.9 |27.1 |55.8 |526 |
|[seresnext101_32x8d.ah_in1k](https://huggingface.co/timm/seresnext101_32x8d.ah_in1k)|224 |83.58|96.4 |93.6 |16.5 |31.2 |1013 |
|[resnetaa101d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa101d.sw_in12k_ft_in1k)|224 |83.54|96.83|44.6 |9.1 |17.6 |1864 |
|[resnet152.a1h_in1k](https://huggingface.co/timm/resnet152.a1h_in1k)|288 |83.46|96.54|60.2 |19.1 |37.3 |904 |
|[resnext101_32x16d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x16d.fb_swsl_ig1b_ft_in1k)|224 |83.35|96.85|194.0 |36.3 |51.2 |582 |
|[resnet200d.ra2_in1k](https://huggingface.co/timm/resnet200d.ra2_in1k)|256 |83.23|96.53|64.7 |20.0 |43.1 |809 |
|[resnext101_32x4d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x4d.fb_swsl_ig1b_ft_in1k)|224 |83.22|96.75|44.2 |8.0 |21.2 |1814 |
|[resnext101_64x4d.c1_in1k](https://huggingface.co/timm/resnext101_64x4d.c1_in1k)|288 |83.16|96.38|83.5 |25.7 |51.6 |590 |
|[resnet152d.ra2_in1k](https://huggingface.co/timm/resnet152d.ra2_in1k)|256 |83.14|96.38|60.2 |15.4 |30.5 |1096 |
|[resnet101d.ra2_in1k](https://huggingface.co/timm/resnet101d.ra2_in1k)|320 |83.02|96.45|44.6 |16.5 |34.8 |992 |
|[ecaresnet101d.miil_in1k](https://huggingface.co/timm/ecaresnet101d.miil_in1k)|288 |82.98|96.54|44.6 |13.4 |28.2 |1077 |
|[resnext101_64x4d.tv_in1k](https://huggingface.co/timm/resnext101_64x4d.tv_in1k)|224 |82.98|96.25|83.5 |15.5 |31.2 |989 |
|[resnetrs152.tf_in1k](https://huggingface.co/timm/resnetrs152.tf_in1k)|256 |82.86|96.28|86.6 |15.6 |30.8 |951 |
|[resnext101_32x8d.tv2_in1k](https://huggingface.co/timm/resnext101_32x8d.tv2_in1k)|224 |82.83|96.22|88.8 |16.5 |31.2 |1099 |
|[resnet152.a1h_in1k](https://huggingface.co/timm/resnet152.a1h_in1k)|224 |82.8 |96.13|60.2 |11.6 |22.6 |1486 |
|[resnet101.a1h_in1k](https://huggingface.co/timm/resnet101.a1h_in1k)|288 |82.8 |96.32|44.6 |13.0 |26.8 |1291 |
|[resnet152.a1_in1k](https://huggingface.co/timm/resnet152.a1_in1k)|288 |82.74|95.71|60.2 |19.1 |37.3 |905 |
|[resnext101_32x8d.fb_wsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext101_32x8d.fb_wsl_ig1b_ft_in1k)|224 |82.69|96.63|88.8 |16.5 |31.2 |1100 |
|[resnet152.a2_in1k](https://huggingface.co/timm/resnet152.a2_in1k)|288 |82.62|95.75|60.2 |19.1 |37.3 |904 |
|[resnetaa50d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa50d.sw_in12k_ft_in1k)|288 |82.61|96.49|25.6 |8.9 |20.6 |1729 |
|[resnet61q.ra2_in1k](https://huggingface.co/timm/resnet61q.ra2_in1k)|288 |82.53|96.13|36.8 |9.9 |21.5 |1773 |
|[wide_resnet101_2.tv2_in1k](https://huggingface.co/timm/wide_resnet101_2.tv2_in1k)|224 |82.5 |96.02|126.9 |22.8 |21.2 |1078 |
|[resnext101_64x4d.c1_in1k](https://huggingface.co/timm/resnext101_64x4d.c1_in1k)|224 |82.46|95.92|83.5 |15.5 |31.2 |987 |
|[resnet51q.ra2_in1k](https://huggingface.co/timm/resnet51q.ra2_in1k)|288 |82.36|96.18|35.7 |8.1 |20.9 |1964 |
|[ecaresnet50t.ra2_in1k](https://huggingface.co/timm/ecaresnet50t.ra2_in1k)|320 |82.35|96.14|25.6 |8.8 |24.1 |1386 |
|[resnet101.a1_in1k](https://huggingface.co/timm/resnet101.a1_in1k)|288 |82.31|95.63|44.6 |13.0 |26.8 |1291 |
|[resnetrs101.tf_in1k](https://huggingface.co/timm/resnetrs101.tf_in1k)|288 |82.29|96.01|63.6 |13.6 |28.5 |1078 |
|[resnet152.tv2_in1k](https://huggingface.co/timm/resnet152.tv2_in1k)|224 |82.29|96.0 |60.2 |11.6 |22.6 |1484 |
|[wide_resnet50_2.racm_in1k](https://huggingface.co/timm/wide_resnet50_2.racm_in1k)|288 |82.27|96.06|68.9 |18.9 |23.8 |1176 |
|[resnet101d.ra2_in1k](https://huggingface.co/timm/resnet101d.ra2_in1k)|256 |82.26|96.07|44.6 |10.6 |22.2 |1542 |
|[resnet101.a2_in1k](https://huggingface.co/timm/resnet101.a2_in1k)|288 |82.24|95.73|44.6 |13.0 |26.8 |1290 |
|[seresnext50_32x4d.racm_in1k](https://huggingface.co/timm/seresnext50_32x4d.racm_in1k)|288 |82.2 |96.14|27.6 |7.0 |23.8 |1547 |
|[ecaresnet101d.miil_in1k](https://huggingface.co/timm/ecaresnet101d.miil_in1k)|224 |82.18|96.05|44.6 |8.1 |17.1 |1771 |
|[resnext50_32x4d.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnext50_32x4d.fb_swsl_ig1b_ft_in1k)|224 |82.17|96.22|25.0 |4.3 |14.4 |2943 |
|[ecaresnet50t.a1_in1k](https://huggingface.co/timm/ecaresnet50t.a1_in1k)|288 |82.12|95.65|25.6 |7.1 |19.6 |1704 |
|[resnext50_32x4d.a1h_in1k](https://huggingface.co/timm/resnext50_32x4d.a1h_in1k)|288 |82.03|95.94|25.0 |7.0 |23.8 |1745 |
|[ecaresnet101d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet101d_pruned.miil_in1k)|288 |82.0 |96.15|24.9 |5.8 |12.7 |1787 |
|[resnet61q.ra2_in1k](https://huggingface.co/timm/resnet61q.ra2_in1k)|256 |81.99|95.85|36.8 |7.8 |17.0 |2230 |
|[resnext101_32x8d.tv2_in1k](https://huggingface.co/timm/resnext101_32x8d.tv2_in1k)|176 |81.98|95.72|88.8 |10.3 |19.4 |1768 |
|[resnet152.a1_in1k](https://huggingface.co/timm/resnet152.a1_in1k)|224 |81.97|95.24|60.2 |11.6 |22.6 |1486 |
|[resnet101.a1h_in1k](https://huggingface.co/timm/resnet101.a1h_in1k)|224 |81.93|95.75|44.6 |7.8 |16.2 |2122 |
|[resnet101.tv2_in1k](https://huggingface.co/timm/resnet101.tv2_in1k)|224 |81.9 |95.77|44.6 |7.8 |16.2 |2118 |
|[resnext101_32x16d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext101_32x16d.fb_ssl_yfcc100m_ft_in1k)|224 |81.84|96.1 |194.0 |36.3 |51.2 |583 |
|[resnet51q.ra2_in1k](https://huggingface.co/timm/resnet51q.ra2_in1k)|256 |81.78|95.94|35.7 |6.4 |16.6 |2471 |
|[resnet152.a2_in1k](https://huggingface.co/timm/resnet152.a2_in1k)|224 |81.77|95.22|60.2 |11.6 |22.6 |1485 |
|[resnetaa50d.sw_in12k_ft_in1k](https://huggingface.co/timm/resnetaa50d.sw_in12k_ft_in1k)|224 |81.74|96.06|25.6 |5.4 |12.4 |2813 |
|[ecaresnet50t.a2_in1k](https://huggingface.co/timm/ecaresnet50t.a2_in1k)|288 |81.65|95.54|25.6 |7.1 |19.6 |1703 |
|[ecaresnet50d.miil_in1k](https://huggingface.co/timm/ecaresnet50d.miil_in1k)|288 |81.64|95.88|25.6 |7.2 |19.7 |1694 |
|[resnext101_32x8d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext101_32x8d.fb_ssl_yfcc100m_ft_in1k)|224 |81.62|96.04|88.8 |16.5 |31.2 |1101 |
|[wide_resnet50_2.tv2_in1k](https://huggingface.co/timm/wide_resnet50_2.tv2_in1k)|224 |81.61|95.76|68.9 |11.4 |14.4 |1930 |
|[resnetaa50.a1h_in1k](https://huggingface.co/timm/resnetaa50.a1h_in1k)|288 |81.61|95.83|25.6 |8.5 |19.2 |1868 |
|[resnet101.a1_in1k](https://huggingface.co/timm/resnet101.a1_in1k)|224 |81.5 |95.16|44.6 |7.8 |16.2 |2125 |
|[resnext50_32x4d.a1_in1k](https://huggingface.co/timm/resnext50_32x4d.a1_in1k)|288 |81.48|95.16|25.0 |7.0 |23.8 |1745 |
|[gcresnet50t.ra2_in1k](https://huggingface.co/timm/gcresnet50t.ra2_in1k)|288 |81.47|95.71|25.9 |6.9 |18.6 |2071 |
|[wide_resnet50_2.racm_in1k](https://huggingface.co/timm/wide_resnet50_2.racm_in1k)|224 |81.45|95.53|68.9 |11.4 |14.4 |1929 |
|[resnet50d.a1_in1k](https://huggingface.co/timm/resnet50d.a1_in1k)|288 |81.44|95.22|25.6 |7.2 |19.7 |1908 |
|[ecaresnet50t.ra2_in1k](https://huggingface.co/timm/ecaresnet50t.ra2_in1k)|256 |81.44|95.67|25.6 |5.6 |15.4 |2168 |
|[ecaresnetlight.miil_in1k](https://huggingface.co/timm/ecaresnetlight.miil_in1k)|288 |81.4 |95.82|30.2 |6.8 |13.9 |2132 |
|[resnet50d.ra2_in1k](https://huggingface.co/timm/resnet50d.ra2_in1k)|288 |81.37|95.74|25.6 |7.2 |19.7 |1910 |
|[resnet101.a2_in1k](https://huggingface.co/timm/resnet101.a2_in1k)|224 |81.32|95.19|44.6 |7.8 |16.2 |2125 |
|[seresnet50.ra2_in1k](https://huggingface.co/timm/seresnet50.ra2_in1k)|288 |81.3 |95.65|28.1 |6.8 |18.4 |1803 |
|[resnext50_32x4d.a2_in1k](https://huggingface.co/timm/resnext50_32x4d.a2_in1k)|288 |81.3 |95.11|25.0 |7.0 |23.8 |1746 |
|[seresnext50_32x4d.racm_in1k](https://huggingface.co/timm/seresnext50_32x4d.racm_in1k)|224 |81.27|95.62|27.6 |4.3 |14.4 |2591 |
|[ecaresnet50t.a1_in1k](https://huggingface.co/timm/ecaresnet50t.a1_in1k)|224 |81.26|95.16|25.6 |4.3 |11.8 |2823 |
|[gcresnext50ts.ch_in1k](https://huggingface.co/timm/gcresnext50ts.ch_in1k)|288 |81.23|95.54|15.7 |4.8 |19.6 |2117 |
|[senet154.gluon_in1k](https://huggingface.co/timm/senet154.gluon_in1k)|224 |81.23|95.35|115.1 |20.8 |38.7 |545 |
|[resnet50.a1_in1k](https://huggingface.co/timm/resnet50.a1_in1k)|288 |81.22|95.11|25.6 |6.8 |18.4 |2089 |
|[resnet50_gn.a1h_in1k](https://huggingface.co/timm/resnet50_gn.a1h_in1k)|288 |81.22|95.63|25.6 |6.8 |18.4 |676 |
|[resnet50d.a2_in1k](https://huggingface.co/timm/resnet50d.a2_in1k)|288 |81.18|95.09|25.6 |7.2 |19.7 |1908 |
|[resnet50.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnet50.fb_swsl_ig1b_ft_in1k)|224 |81.18|95.98|25.6 |4.1 |11.1 |3455 |
|[resnext50_32x4d.tv2_in1k](https://huggingface.co/timm/resnext50_32x4d.tv2_in1k)|224 |81.17|95.34|25.0 |4.3 |14.4 |2933 |
|[resnext50_32x4d.a1h_in1k](https://huggingface.co/timm/resnext50_32x4d.a1h_in1k)|224 |81.1 |95.33|25.0 |4.3 |14.4 |2934 |
|[seresnet50.a2_in1k](https://huggingface.co/timm/seresnet50.a2_in1k)|288 |81.1 |95.23|28.1 |6.8 |18.4 |1801 |
|[seresnet50.a1_in1k](https://huggingface.co/timm/seresnet50.a1_in1k)|288 |81.1 |95.12|28.1 |6.8 |18.4 |1799 |
|[resnet152s.gluon_in1k](https://huggingface.co/timm/resnet152s.gluon_in1k)|224 |81.02|95.41|60.3 |12.9 |25.0 |1347 |
|[resnet50.d_in1k](https://huggingface.co/timm/resnet50.d_in1k)|288 |80.97|95.44|25.6 |6.8 |18.4 |2085 |
|[gcresnet50t.ra2_in1k](https://huggingface.co/timm/gcresnet50t.ra2_in1k)|256 |80.94|95.45|25.9 |5.4 |14.7 |2571 |
|[resnext101_32x4d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext101_32x4d.fb_ssl_yfcc100m_ft_in1k)|224 |80.93|95.73|44.2 |8.0 |21.2 |1814 |
|[resnet50.c1_in1k](https://huggingface.co/timm/resnet50.c1_in1k)|288 |80.91|95.55|25.6 |6.8 |18.4 |2084 |
|[seresnext101_32x4d.gluon_in1k](https://huggingface.co/timm/seresnext101_32x4d.gluon_in1k)|224 |80.9 |95.31|49.0 |8.0 |21.3 |1585 |
|[seresnext101_64x4d.gluon_in1k](https://huggingface.co/timm/seresnext101_64x4d.gluon_in1k)|224 |80.9 |95.3 |88.2 |15.5 |31.2 |918 |
|[resnet50.c2_in1k](https://huggingface.co/timm/resnet50.c2_in1k)|288 |80.86|95.52|25.6 |6.8 |18.4 |2085 |
|[resnet50.tv2_in1k](https://huggingface.co/timm/resnet50.tv2_in1k)|224 |80.85|95.43|25.6 |4.1 |11.1 |3450 |
|[ecaresnet50t.a2_in1k](https://huggingface.co/timm/ecaresnet50t.a2_in1k)|224 |80.84|95.02|25.6 |4.3 |11.8 |2821 |
|[ecaresnet101d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet101d_pruned.miil_in1k)|224 |80.79|95.62|24.9 |3.5 |7.7 |2961 |
|[seresnet33ts.ra2_in1k](https://huggingface.co/timm/seresnet33ts.ra2_in1k)|288 |80.79|95.36|19.8 |6.0 |14.8 |2506 |
|[ecaresnet50d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet50d_pruned.miil_in1k)|288 |80.79|95.58|19.9 |4.2 |10.6 |2349 |
|[resnet50.a2_in1k](https://huggingface.co/timm/resnet50.a2_in1k)|288 |80.78|94.99|25.6 |6.8 |18.4 |2088 |
|[resnet50.b1k_in1k](https://huggingface.co/timm/resnet50.b1k_in1k)|288 |80.71|95.43|25.6 |6.8 |18.4 |2087 |
|[resnext50_32x4d.ra_in1k](https://huggingface.co/timm/resnext50_32x4d.ra_in1k)|288 |80.7 |95.39|25.0 |7.0 |23.8 |1749 |
|[resnetrs101.tf_in1k](https://huggingface.co/timm/resnetrs101.tf_in1k)|192 |80.69|95.24|63.6 |6.0 |12.7 |2270 |
|[resnet50d.a1_in1k](https://huggingface.co/timm/resnet50d.a1_in1k)|224 |80.68|94.71|25.6 |4.4 |11.9 |3162 |
|[eca_resnet33ts.ra2_in1k](https://huggingface.co/timm/eca_resnet33ts.ra2_in1k)|288 |80.68|95.36|19.7 |6.0 |14.8 |2637 |
|[resnet50.a1h_in1k](https://huggingface.co/timm/resnet50.a1h_in1k)|224 |80.67|95.3 |25.6 |4.1 |11.1 |3452 |
|[resnext50d_32x4d.bt_in1k](https://huggingface.co/timm/resnext50d_32x4d.bt_in1k)|288 |80.67|95.42|25.0 |7.4 |25.1 |1626 |
|[resnetaa50.a1h_in1k](https://huggingface.co/timm/resnetaa50.a1h_in1k)|224 |80.63|95.21|25.6 |5.2 |11.6 |3034 |
|[ecaresnet50d.miil_in1k](https://huggingface.co/timm/ecaresnet50d.miil_in1k)|224 |80.61|95.32|25.6 |4.4 |11.9 |2813 |
|[resnext101_64x4d.gluon_in1k](https://huggingface.co/timm/resnext101_64x4d.gluon_in1k)|224 |80.61|94.99|83.5 |15.5 |31.2 |989 |
|[gcresnet33ts.ra2_in1k](https://huggingface.co/timm/gcresnet33ts.ra2_in1k)|288 |80.6 |95.31|19.9 |6.0 |14.8 |2578 |
|[gcresnext50ts.ch_in1k](https://huggingface.co/timm/gcresnext50ts.ch_in1k)|256 |80.57|95.17|15.7 |3.8 |15.5 |2710 |
|[resnet152.a3_in1k](https://huggingface.co/timm/resnet152.a3_in1k)|224 |80.56|95.0 |60.2 |11.6 |22.6 |1483 |
|[resnet50d.ra2_in1k](https://huggingface.co/timm/resnet50d.ra2_in1k)|224 |80.53|95.16|25.6 |4.4 |11.9 |3164 |
|[resnext50_32x4d.a1_in1k](https://huggingface.co/timm/resnext50_32x4d.a1_in1k)|224 |80.53|94.46|25.0 |4.3 |14.4 |2930 |
|[wide_resnet101_2.tv2_in1k](https://huggingface.co/timm/wide_resnet101_2.tv2_in1k)|176 |80.48|94.98|126.9 |14.3 |13.2 |1719 |
|[resnet152d.gluon_in1k](https://huggingface.co/timm/resnet152d.gluon_in1k)|224 |80.47|95.2 |60.2 |11.8 |23.4 |1428 |
|[resnet50.b2k_in1k](https://huggingface.co/timm/resnet50.b2k_in1k)|288 |80.45|95.32|25.6 |6.8 |18.4 |2086 |
|[ecaresnetlight.miil_in1k](https://huggingface.co/timm/ecaresnetlight.miil_in1k)|224 |80.45|95.24|30.2 |4.1 |8.4 |3530 |
|[resnext50_32x4d.a2_in1k](https://huggingface.co/timm/resnext50_32x4d.a2_in1k)|224 |80.45|94.63|25.0 |4.3 |14.4 |2936 |
|[wide_resnet50_2.tv2_in1k](https://huggingface.co/timm/wide_resnet50_2.tv2_in1k)|176 |80.43|95.09|68.9 |7.3 |9.0 |3015 |
|[resnet101d.gluon_in1k](https://huggingface.co/timm/resnet101d.gluon_in1k)|224 |80.42|95.01|44.6 |8.1 |17.0 |2007 |
|[resnet50.a1_in1k](https://huggingface.co/timm/resnet50.a1_in1k)|224 |80.38|94.6 |25.6 |4.1 |11.1 |3461 |
|[seresnet33ts.ra2_in1k](https://huggingface.co/timm/seresnet33ts.ra2_in1k)|256 |80.36|95.1 |19.8 |4.8 |11.7 |3267 |
|[resnext101_32x4d.gluon_in1k](https://huggingface.co/timm/resnext101_32x4d.gluon_in1k)|224 |80.34|94.93|44.2 |8.0 |21.2 |1814 |
|[resnext50_32x4d.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnext50_32x4d.fb_ssl_yfcc100m_ft_in1k)|224 |80.32|95.4 |25.0 |4.3 |14.4 |2941 |
|[resnet101s.gluon_in1k](https://huggingface.co/timm/resnet101s.gluon_in1k)|224 |80.28|95.16|44.7 |9.2 |18.6 |1851 |
|[seresnet50.ra2_in1k](https://huggingface.co/timm/seresnet50.ra2_in1k)|224 |80.26|95.08|28.1 |4.1 |11.1 |2972 |
|[resnetblur50.bt_in1k](https://huggingface.co/timm/resnetblur50.bt_in1k)|288 |80.24|95.24|25.6 |8.5 |19.9 |1523 |
|[resnet50d.a2_in1k](https://huggingface.co/timm/resnet50d.a2_in1k)|224 |80.22|94.63|25.6 |4.4 |11.9 |3162 |
|[resnet152.tv2_in1k](https://huggingface.co/timm/resnet152.tv2_in1k)|176 |80.2 |94.64|60.2 |7.2 |14.0 |2346 |
|[seresnet50.a2_in1k](https://huggingface.co/timm/seresnet50.a2_in1k)|224 |80.08|94.74|28.1 |4.1 |11.1 |2969 |
|[eca_resnet33ts.ra2_in1k](https://huggingface.co/timm/eca_resnet33ts.ra2_in1k)|256 |80.08|94.97|19.7 |4.8 |11.7 |3284 |
|[gcresnet33ts.ra2_in1k](https://huggingface.co/timm/gcresnet33ts.ra2_in1k)|256 |80.06|94.99|19.9 |4.8 |11.7 |3216 |
|[resnet50_gn.a1h_in1k](https://huggingface.co/timm/resnet50_gn.a1h_in1k)|224 |80.06|94.95|25.6 |4.1 |11.1 |1109 |
|[seresnet50.a1_in1k](https://huggingface.co/timm/seresnet50.a1_in1k)|224 |80.02|94.71|28.1 |4.1 |11.1 |2962 |
|[resnet50.ram_in1k](https://huggingface.co/timm/resnet50.ram_in1k)|288 |79.97|95.05|25.6 |6.8 |18.4 |2086 |
|[resnet152c.gluon_in1k](https://huggingface.co/timm/resnet152c.gluon_in1k)|224 |79.92|94.84|60.2 |11.8 |23.4 |1455 |
|[seresnext50_32x4d.gluon_in1k](https://huggingface.co/timm/seresnext50_32x4d.gluon_in1k)|224 |79.91|94.82|27.6 |4.3 |14.4 |2591 |
|[resnet50.d_in1k](https://huggingface.co/timm/resnet50.d_in1k)|224 |79.91|94.67|25.6 |4.1 |11.1 |3456 |
|[resnet101.tv2_in1k](https://huggingface.co/timm/resnet101.tv2_in1k)|176 |79.9 |94.6 |44.6 |4.9 |10.1 |3341 |
|[resnetrs50.tf_in1k](https://huggingface.co/timm/resnetrs50.tf_in1k)|224 |79.89|94.97|35.7 |4.5 |12.1 |2774 |
|[resnet50.c2_in1k](https://huggingface.co/timm/resnet50.c2_in1k)|224 |79.88|94.87|25.6 |4.1 |11.1 |3455 |
|[ecaresnet26t.ra2_in1k](https://huggingface.co/timm/ecaresnet26t.ra2_in1k)|320 |79.86|95.07|16.0 |5.2 |16.4 |2168 |
|[resnet50.a2_in1k](https://huggingface.co/timm/resnet50.a2_in1k)|224 |79.85|94.56|25.6 |4.1 |11.1 |3460 |
|[resnet50.ra_in1k](https://huggingface.co/timm/resnet50.ra_in1k)|288 |79.83|94.97|25.6 |6.8 |18.4 |2087 |
|[resnet101.a3_in1k](https://huggingface.co/timm/resnet101.a3_in1k)|224 |79.82|94.62|44.6 |7.8 |16.2 |2114 |
|[resnext50_32x4d.ra_in1k](https://huggingface.co/timm/resnext50_32x4d.ra_in1k)|224 |79.76|94.6 |25.0 |4.3 |14.4 |2943 |
|[resnet50.c1_in1k](https://huggingface.co/timm/resnet50.c1_in1k)|224 |79.74|94.95|25.6 |4.1 |11.1 |3455 |
|[ecaresnet50d_pruned.miil_in1k](https://huggingface.co/timm/ecaresnet50d_pruned.miil_in1k)|224 |79.74|94.87|19.9 |2.5 |6.4 |3929 |
|[resnet33ts.ra2_in1k](https://huggingface.co/timm/resnet33ts.ra2_in1k)|288 |79.71|94.83|19.7 |6.0 |14.8 |2710 |
|[resnet152.gluon_in1k](https://huggingface.co/timm/resnet152.gluon_in1k)|224 |79.68|94.74|60.2 |11.6 |22.6 |1486 |
|[resnext50d_32x4d.bt_in1k](https://huggingface.co/timm/resnext50d_32x4d.bt_in1k)|224 |79.67|94.87|25.0 |4.5 |15.2 |2729 |
|[resnet50.bt_in1k](https://huggingface.co/timm/resnet50.bt_in1k)|288 |79.63|94.91|25.6 |6.8 |18.4 |2086 |
|[ecaresnet50t.a3_in1k](https://huggingface.co/timm/ecaresnet50t.a3_in1k)|224 |79.56|94.72|25.6 |4.3 |11.8 |2805 |
|[resnet101c.gluon_in1k](https://huggingface.co/timm/resnet101c.gluon_in1k)|224 |79.53|94.58|44.6 |8.1 |17.0 |2062 |
|[resnet50.b1k_in1k](https://huggingface.co/timm/resnet50.b1k_in1k)|224 |79.52|94.61|25.6 |4.1 |11.1 |3459 |
|[resnet50.tv2_in1k](https://huggingface.co/timm/resnet50.tv2_in1k)|176 |79.42|94.64|25.6 |2.6 |6.9 |5397 |
|[resnet32ts.ra2_in1k](https://huggingface.co/timm/resnet32ts.ra2_in1k)|288 |79.4 |94.66|18.0 |5.9 |14.6 |2752 |
|[resnet50.b2k_in1k](https://huggingface.co/timm/resnet50.b2k_in1k)|224 |79.38|94.57|25.6 |4.1 |11.1 |3459 |
|[resnext50_32x4d.tv2_in1k](https://huggingface.co/timm/resnext50_32x4d.tv2_in1k)|176 |79.37|94.3 |25.0 |2.7 |9.0 |4577 |
|[resnext50_32x4d.gluon_in1k](https://huggingface.co/timm/resnext50_32x4d.gluon_in1k)|224 |79.36|94.43|25.0 |4.3 |14.4 |2942 |
|[resnext101_32x8d.tv_in1k](https://huggingface.co/timm/resnext101_32x8d.tv_in1k)|224 |79.31|94.52|88.8 |16.5 |31.2 |1100 |
|[resnet101.gluon_in1k](https://huggingface.co/timm/resnet101.gluon_in1k)|224 |79.31|94.53|44.6 |7.8 |16.2 |2125 |
|[resnetblur50.bt_in1k](https://huggingface.co/timm/resnetblur50.bt_in1k)|224 |79.31|94.63|25.6 |5.2 |12.0 |2524 |
|[resnet50.a1h_in1k](https://huggingface.co/timm/resnet50.a1h_in1k)|176 |79.27|94.49|25.6 |2.6 |6.9 |5404 |
|[resnext50_32x4d.a3_in1k](https://huggingface.co/timm/resnext50_32x4d.a3_in1k)|224 |79.25|94.31|25.0 |4.3 |14.4 |2931 |
|[resnet50.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnet50.fb_ssl_yfcc100m_ft_in1k)|224 |79.22|94.84|25.6 |4.1 |11.1 |3451 |
|[resnet33ts.ra2_in1k](https://huggingface.co/timm/resnet33ts.ra2_in1k)|256 |79.21|94.56|19.7 |4.8 |11.7 |3392 |
|[resnet50d.gluon_in1k](https://huggingface.co/timm/resnet50d.gluon_in1k)|224 |79.07|94.48|25.6 |4.4 |11.9 |3162 |
|[resnet50.ram_in1k](https://huggingface.co/timm/resnet50.ram_in1k)|224 |79.03|94.38|25.6 |4.1 |11.1 |3453 |
|[resnet50.am_in1k](https://huggingface.co/timm/resnet50.am_in1k)|224 |79.01|94.39|25.6 |4.1 |11.1 |3461 |
|[resnet32ts.ra2_in1k](https://huggingface.co/timm/resnet32ts.ra2_in1k)|256 |79.01|94.37|18.0 |4.6 |11.6 |3440 |
|[ecaresnet26t.ra2_in1k](https://huggingface.co/timm/ecaresnet26t.ra2_in1k)|256 |78.9 |94.54|16.0 |3.4 |10.5 |3421 |
|[resnet152.a3_in1k](https://huggingface.co/timm/resnet152.a3_in1k)|160 |78.89|94.11|60.2 |5.9 |11.5 |2745 |
|[wide_resnet101_2.tv_in1k](https://huggingface.co/timm/wide_resnet101_2.tv_in1k)|224 |78.84|94.28|126.9 |22.8 |21.2 |1079 |
|[seresnext26d_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26d_32x4d.bt_in1k)|288 |78.83|94.24|16.8 |4.5 |16.8 |2251 |
|[resnet50.ra_in1k](https://huggingface.co/timm/resnet50.ra_in1k)|224 |78.81|94.32|25.6 |4.1 |11.1 |3454 |
|[seresnext26t_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26t_32x4d.bt_in1k)|288 |78.74|94.33|16.8 |4.5 |16.7 |2264 |
|[resnet50s.gluon_in1k](https://huggingface.co/timm/resnet50s.gluon_in1k)|224 |78.72|94.23|25.7 |5.5 |13.5 |2796 |
|[resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k)|224 |78.71|94.24|25.6 |4.4 |11.9 |3154 |
|[wide_resnet50_2.tv_in1k](https://huggingface.co/timm/wide_resnet50_2.tv_in1k)|224 |78.47|94.09|68.9 |11.4 |14.4 |1934 |
|[resnet50.bt_in1k](https://huggingface.co/timm/resnet50.bt_in1k)|224 |78.46|94.27|25.6 |4.1 |11.1 |3454 |
|[resnet34d.ra2_in1k](https://huggingface.co/timm/resnet34d.ra2_in1k)|288 |78.43|94.35|21.8 |6.5 |7.5 |3291 |
|[gcresnext26ts.ch_in1k](https://huggingface.co/timm/gcresnext26ts.ch_in1k)|288 |78.42|94.04|10.5 |3.1 |13.3 |3226 |
|[resnet26t.ra2_in1k](https://huggingface.co/timm/resnet26t.ra2_in1k)|320 |78.33|94.13|16.0 |5.2 |16.4 |2391 |
|[resnet152.tv_in1k](https://huggingface.co/timm/resnet152.tv_in1k)|224 |78.32|94.04|60.2 |11.6 |22.6 |1487 |
|[seresnext26ts.ch_in1k](https://huggingface.co/timm/seresnext26ts.ch_in1k)|288 |78.28|94.1 |10.4 |3.1 |13.3 |3062 |
|[bat_resnext26ts.ch_in1k](https://huggingface.co/timm/bat_resnext26ts.ch_in1k)|256 |78.25|94.1 |10.7 |2.5 |12.5 |3393 |
|[resnet50.a3_in1k](https://huggingface.co/timm/resnet50.a3_in1k)|224 |78.06|93.78|25.6 |4.1 |11.1 |3450 |
|[resnet50c.gluon_in1k](https://huggingface.co/timm/resnet50c.gluon_in1k)|224 |78.0 |93.99|25.6 |4.4 |11.9 |3286 |
|[eca_resnext26ts.ch_in1k](https://huggingface.co/timm/eca_resnext26ts.ch_in1k)|288 |78.0 |93.91|10.3 |3.1 |13.3 |3297 |
|[seresnext26t_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26t_32x4d.bt_in1k)|224 |77.98|93.75|16.8 |2.7 |10.1 |3841 |
|[resnet34.a1_in1k](https://huggingface.co/timm/resnet34.a1_in1k)|288 |77.92|93.77|21.8 |6.1 |6.2 |3609 |
|[resnet101.a3_in1k](https://huggingface.co/timm/resnet101.a3_in1k)|160 |77.88|93.71|44.6 |4.0 |8.3 |3926 |
|[resnet26t.ra2_in1k](https://huggingface.co/timm/resnet26t.ra2_in1k)|256 |77.87|93.84|16.0 |3.4 |10.5 |3772 |
|[seresnext26ts.ch_in1k](https://huggingface.co/timm/seresnext26ts.ch_in1k)|256 |77.86|93.79|10.4 |2.4 |10.5 |4263 |
|[resnetrs50.tf_in1k](https://huggingface.co/timm/resnetrs50.tf_in1k)|160 |77.82|93.81|35.7 |2.3 |6.2 |5238 |
|[gcresnext26ts.ch_in1k](https://huggingface.co/timm/gcresnext26ts.ch_in1k)|256 |77.81|93.82|10.5 |2.4 |10.5 |4183 |
|[ecaresnet50t.a3_in1k](https://huggingface.co/timm/ecaresnet50t.a3_in1k)|160 |77.79|93.6 |25.6 |2.2 |6.0 |5329 |
|[resnext50_32x4d.a3_in1k](https://huggingface.co/timm/resnext50_32x4d.a3_in1k)|160 |77.73|93.32|25.0 |2.2 |7.4 |5576 |
|[resnext50_32x4d.tv_in1k](https://huggingface.co/timm/resnext50_32x4d.tv_in1k)|224 |77.61|93.7 |25.0 |4.3 |14.4 |2944 |
|[seresnext26d_32x4d.bt_in1k](https://huggingface.co/timm/seresnext26d_32x4d.bt_in1k)|224 |77.59|93.61|16.8 |2.7 |10.2 |3807 |
|[resnet50.gluon_in1k](https://huggingface.co/timm/resnet50.gluon_in1k)|224 |77.58|93.72|25.6 |4.1 |11.1 |3455 |
|[eca_resnext26ts.ch_in1k](https://huggingface.co/timm/eca_resnext26ts.ch_in1k)|256 |77.44|93.56|10.3 |2.4 |10.5 |4284 |
|[resnet26d.bt_in1k](https://huggingface.co/timm/resnet26d.bt_in1k)|288 |77.41|93.63|16.0 |4.3 |13.5 |2907 |
|[resnet101.tv_in1k](https://huggingface.co/timm/resnet101.tv_in1k)|224 |77.38|93.54|44.6 |7.8 |16.2 |2125 |
|[resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k)|160 |77.22|93.27|25.6 |2.2 |6.1 |5982 |
|[resnext26ts.ra2_in1k](https://huggingface.co/timm/resnext26ts.ra2_in1k)|288 |77.17|93.47|10.3 |3.1 |13.3 |3392 |
|[resnet34.a2_in1k](https://huggingface.co/timm/resnet34.a2_in1k)|288 |77.15|93.27|21.8 |6.1 |6.2 |3615 |
|[resnet34d.ra2_in1k](https://huggingface.co/timm/resnet34d.ra2_in1k)|224 |77.1 |93.37|21.8 |3.9 |4.5 |5436 |
|[seresnet50.a3_in1k](https://huggingface.co/timm/seresnet50.a3_in1k)|224 |77.02|93.07|28.1 |4.1 |11.1 |2952 |
|[resnext26ts.ra2_in1k](https://huggingface.co/timm/resnext26ts.ra2_in1k)|256 |76.78|93.13|10.3 |2.4 |10.5 |4410 |
|[resnet26d.bt_in1k](https://huggingface.co/timm/resnet26d.bt_in1k)|224 |76.7 |93.17|16.0 |2.6 |8.2 |4859 |
|[resnet34.bt_in1k](https://huggingface.co/timm/resnet34.bt_in1k)|288 |76.5 |93.35|21.8 |6.1 |6.2 |3617 |
|[resnet34.a1_in1k](https://huggingface.co/timm/resnet34.a1_in1k)|224 |76.42|92.87|21.8 |3.7 |3.7 |5984 |
|[resnet26.bt_in1k](https://huggingface.co/timm/resnet26.bt_in1k)|288 |76.35|93.18|16.0 |3.9 |12.2 |3331 |
|[resnet50.tv_in1k](https://huggingface.co/timm/resnet50.tv_in1k)|224 |76.13|92.86|25.6 |4.1 |11.1 |3457 |
|[resnet50.a3_in1k](https://huggingface.co/timm/resnet50.a3_in1k)|160 |75.96|92.5 |25.6 |2.1 |5.7 |6490 |
|[resnet34.a2_in1k](https://huggingface.co/timm/resnet34.a2_in1k)|224 |75.52|92.44|21.8 |3.7 |3.7 |5991 |
|[resnet26.bt_in1k](https://huggingface.co/timm/resnet26.bt_in1k)|224 |75.3 |92.58|16.0 |2.4 |7.4 |5583 |
|[resnet34.bt_in1k](https://huggingface.co/timm/resnet34.bt_in1k)|224 |75.16|92.18|21.8 |3.7 |3.7 |5994 |
|[seresnet50.a3_in1k](https://huggingface.co/timm/seresnet50.a3_in1k)|160 |75.1 |92.08|28.1 |2.1 |5.7 |5513 |
|[resnet34.gluon_in1k](https://huggingface.co/timm/resnet34.gluon_in1k)|224 |74.57|91.98|21.8 |3.7 |3.7 |5984 |
|[resnet18d.ra2_in1k](https://huggingface.co/timm/resnet18d.ra2_in1k)|288 |73.81|91.83|11.7 |3.4 |5.4 |5196 |
|[resnet34.tv_in1k](https://huggingface.co/timm/resnet34.tv_in1k)|224 |73.32|91.42|21.8 |3.7 |3.7 |5979 |
|[resnet18.fb_swsl_ig1b_ft_in1k](https://huggingface.co/timm/resnet18.fb_swsl_ig1b_ft_in1k)|224 |73.28|91.73|11.7 |1.8 |2.5 |10213 |
|[resnet18.a1_in1k](https://huggingface.co/timm/resnet18.a1_in1k)|288 |73.16|91.03|11.7 |3.0 |4.1 |6050 |
|[resnet34.a3_in1k](https://huggingface.co/timm/resnet34.a3_in1k)|224 |72.98|91.11|21.8 |3.7 |3.7 |5967 |
|[resnet18.fb_ssl_yfcc100m_ft_in1k](https://huggingface.co/timm/resnet18.fb_ssl_yfcc100m_ft_in1k)|224 |72.6 |91.42|11.7 |1.8 |2.5 |10213 |
|[resnet18.a2_in1k](https://huggingface.co/timm/resnet18.a2_in1k)|288 |72.37|90.59|11.7 |3.0 |4.1 |6051 |
|[resnet14t.c3_in1k](https://huggingface.co/timm/resnet14t.c3_in1k)|224 |72.26|90.31|10.1 |1.7 |5.8 |7026 |
|[resnet18d.ra2_in1k](https://huggingface.co/timm/resnet18d.ra2_in1k)|224 |72.26|90.68|11.7 |2.1 |3.3 |8707 |
|[resnet18.a1_in1k](https://huggingface.co/timm/resnet18.a1_in1k)|224 |71.49|90.07|11.7 |1.8 |2.5 |10187 |
|[resnet14t.c3_in1k](https://huggingface.co/timm/resnet14t.c3_in1k)|176 |71.31|89.69|10.1 |1.1 |3.6 |10970 |
|[resnet18.gluon_in1k](https://huggingface.co/timm/resnet18.gluon_in1k)|224 |70.84|89.76|11.7 |1.8 |2.5 |10210 |
|[resnet18.a2_in1k](https://huggingface.co/timm/resnet18.a2_in1k)|224 |70.64|89.47|11.7 |1.8 |2.5 |10194 |
|[resnet34.a3_in1k](https://huggingface.co/timm/resnet34.a3_in1k)|160 |70.56|89.52|21.8 |1.9 |1.9 |10737 |
|[resnet18.tv_in1k](https://huggingface.co/timm/resnet18.tv_in1k)|224 |69.76|89.07|11.7 |1.8 |2.5 |10205 |
|[resnet10t.c3_in1k](https://huggingface.co/timm/resnet10t.c3_in1k)|224 |68.34|88.03|5.4 |1.1 |2.4 |13079 |
|[resnet18.a3_in1k](https://huggingface.co/timm/resnet18.a3_in1k)|224 |68.25|88.17|11.7 |1.8 |2.5 |10167 |
|[resnet10t.c3_in1k](https://huggingface.co/timm/resnet10t.c3_in1k)|176 |66.71|86.96|5.4 |0.7 |1.5 |20327 |
|[resnet18.a3_in1k](https://huggingface.co/timm/resnet18.a3_in1k)|160 |65.66|86.26|11.7 |0.9 |1.3 |18229 |
## Citation
```bibtex
@inproceedings{wightman2021resnet,
title={ResNet strikes back: An improved training procedure in timm},
author={Wightman, Ross and Touvron, Hugo and Jegou, Herve},
booktitle={NeurIPS 2021 Workshop on ImageNet: Past, Present, and Future}
}
```
```bibtex
@misc{rw2019timm,
author = {Ross Wightman},
title = {PyTorch Image Models},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
doi = {10.5281/zenodo.4414861},
howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
}
```
```bibtex
@article{He2015,
author = {Kaiming He and Xiangyu Zhang and Shaoqing Ren and Jian Sun},
title = {Deep Residual Learning for Image Recognition},
journal = {arXiv preprint arXiv:1512.03385},
year = {2015}
}
```
| [
-0.8981196284294128,
-0.23639924824237823,
0.025744814425706863,
0.39163604378700256,
-0.4302903115749359,
-0.12407177686691284,
-0.1384650319814682,
-0.4113723039627075,
1.1844819784164429,
0.3047533333301544,
-0.6795831918716431,
-0.5426521301269531,
-0.6238150000572205,
0.002730466891080141,
0.3282986283302307,
0.8858218193054199,
0.005001775920391083,
-0.08803049474954605,
0.2341979593038559,
-0.24796366691589355,
-0.04437219351530075,
-0.32902583479881287,
-1.0942552089691162,
-0.1823350191116333,
0.441879540681839,
0.1707313358783722,
0.6772477030754089,
0.6374769806861877,
0.4104631245136261,
0.6164969801902771,
-0.2542136013507843,
0.30708935856819153,
-0.06702080368995667,
-0.129934623837471,
0.6379124522209167,
-0.4013347029685974,
-0.9416898488998413,
-0.026684358716011047,
0.7442166209220886,
0.6227455735206604,
0.07408710569143295,
0.35227975249290466,
0.3754357695579529,
0.6292455196380615,
0.04525809362530708,
-0.05515889823436737,
0.0032743208575993776,
0.14712709188461304,
-0.31022268533706665,
0.06498871743679047,
-0.0734231173992157,
-0.7083045840263367,
0.1565185934305191,
-0.639276385307312,
-0.06641342490911484,
0.008505910634994507,
1.3766261339187622,
-0.12185221910476685,
-0.23011869192123413,
0.09800445288419724,
0.13938303291797638,
0.7905960083007812,
-0.8622215986251831,
0.35814014077186584,
0.5699759125709534,
0.006692828144878149,
-0.1940881460905075,
-0.6708905696868896,
-0.5104036927223206,
0.13160961866378784,
-0.44189831614494324,
0.31676018238067627,
-0.2986587584018707,
-0.22947119176387787,
0.3837599456310272,
0.34590333700180054,
-0.4534776210784912,
-0.10982468724250793,
-0.36876198649406433,
-0.0995691567659378,
0.7286205887794495,
0.09174752235412598,
0.7160402536392212,
-0.3597109615802765,
-0.5157444477081299,
-0.12269670516252518,
-0.1677122861146927,
0.4648035168647766,
0.281572550535202,
0.16770455241203308,
-1.1154470443725586,
0.4207930862903595,
0.13887782394886017,
0.25094863772392273,
0.37991049885749817,
-0.14565394818782806,
0.851347029209137,
-0.11173257231712341,
-0.5219915509223938,
-0.5169769525527954,
1.1200751066207886,
0.6589267253875732,
0.26748281717300415,
-0.08560850471258163,
-0.06975778937339783,
-0.20988671481609344,
-0.3810356557369232,
-0.9646105766296387,
-0.03290160000324249,
0.2532780170440674,
-0.5717998147010803,
-0.2602510154247284,
0.3322550654411316,
-0.9232776761054993,
-0.05711348354816437,
-0.10738266259431839,
0.06502728909254074,
-0.7633854150772095,
-0.4463830888271332,
0.004097647499293089,
-0.22833162546157837,
0.5357682704925537,
0.2299974262714386,
-0.3328990936279297,
0.4513378441333771,
0.1036762148141861,
0.8987698554992676,
0.2859565019607544,
-0.06971737742424011,
-0.2198411524295807,
-0.003444753587245941,
-0.3718435764312744,
0.3615722060203552,
0.15988042950630188,
-0.166221022605896,
-0.3542046844959259,
0.437286376953125,
-0.28179121017456055,
-0.24002103507518768,
0.616366982460022,
0.27760717272758484,
0.1788601577281952,
-0.2901468575000763,
-0.24487759172916412,
-0.23425331711769104,
0.37838250398635864,
-0.595379114151001,
1.0437676906585693,
0.3899034261703491,
-1.1468795537948608,
0.15613673627376556,
-0.5332489013671875,
-0.013148868456482887,
-0.29937994480133057,
0.07372132688760757,
-0.9126442670822144,
0.02184225246310234,
0.21671384572982788,
0.7006466388702393,
-0.23291772603988647,
-0.17267172038555145,
-0.34448370337486267,
0.05312128737568855,
0.4146726727485657,
0.16442182660102844,
0.9514588713645935,
0.32217520475387573,
-0.46710339188575745,
-0.21441659331321716,
-0.7437882423400879,
0.4299201965332031,
0.4536294639110565,
-0.018235623836517334,
-0.04786666855216026,
-0.8126717209815979,
0.04274404048919678,
0.6038033366203308,
0.2603355050086975,
-0.7292824983596802,
0.2568972408771515,
-0.19068855047225952,
0.3563328981399536,
0.6535768508911133,
0.058997221291065216,
0.181246817111969,
-0.7252439856529236,
0.6244255900382996,
-0.01066218875348568,
0.2913985252380371,
0.0006424686871469021,
-0.4297933578491211,
-0.7644168138504028,
-0.7499945759773254,
0.23732659220695496,
0.4358566999435425,
-0.41607001423835754,
0.8876230716705322,
0.13866838812828064,
-0.6277525424957275,
-0.6526124477386475,
0.0709504634141922,
0.593267560005188,
0.26763206720352173,
0.11096130311489105,
-0.3678400218486786,
-0.7766625881195068,
-0.997472882270813,
-0.3476824462413788,
0.11197738349437714,
-0.027299651876091957,
0.68506920337677,
0.44794511795043945,
-0.21492832899093628,
0.5174338817596436,
-0.3697589337825775,
-0.2264036238193512,
-0.16060660779476166,
-0.10144723951816559,
0.4498305320739746,
0.8174017667770386,
1.0491929054260254,
-0.7405824661254883,
-0.9381324052810669,
0.14686398208141327,
-1.1167603731155396,
-0.06629122048616409,
-0.035093821585178375,
-0.2762435972690582,
0.4479919970035553,
0.25520870089530945,
-0.8751446604728699,
0.7873728275299072,
0.3826652765274048,
-0.8272679448127747,
0.4613257646560669,
-0.346976101398468,
0.5866143107414246,
-1.1157854795455933,
0.2673757076263428,
0.3033115565776825,
-0.2533297836780548,
-0.585618257522583,
0.07982812821865082,
-0.11083812266588211,
0.12354880571365356,
-0.569977879524231,
0.801459550857544,
-0.7089560031890869,
-0.02091602422297001,
0.158494770526886,
0.04599350318312645,
-0.003504685591906309,
0.4462767243385315,
-0.057543039321899414,
0.6074989438056946,
0.892581582069397,
-0.16806721687316895,
0.3290709853172302,
0.43332210183143616,
0.05859456956386566,
0.7732251882553101,
-0.62848961353302,
0.12524522840976715,
0.03227832913398743,
0.4576551020145416,
-1.0208582878112793,
-0.3997643291950226,
0.5705311298370361,
-0.8421291708946228,
0.6805053353309631,
-0.273944616317749,
-0.28551849722862244,
-0.8380728960037231,
-0.9067164063453674,
0.254525750875473,
0.667688250541687,
-0.6068347096443176,
0.38574227690696716,
0.20676441490650177,
-0.03153988718986511,
-0.4901925325393677,
-0.7395769357681274,
0.10266827791929245,
-0.44967809319496155,
-0.8442971110343933,
0.4672005772590637,
0.3259506821632385,
-0.19635815918445587,
0.08971130102872849,
-0.13750150799751282,
-0.15398988127708435,
-0.20621491968631744,
0.6030037999153137,
0.33364158868789673,
-0.31837499141693115,
-0.4308483898639679,
-0.4102099537849426,
-0.29231494665145874,
-0.0617905855178833,
-0.11337220668792725,
0.5140583515167236,
-0.47120946645736694,
0.09281764179468155,
-1.493296504020691,
0.11772677302360535,
0.8977219462394714,
-0.032575175166130066,
1.012694239616394,
0.8007901906967163,
-0.4956050515174866,
0.19135329127311707,
-0.4612996578216553,
-0.24007746577262878,
-0.5329486131668091,
-0.24621853232383728,
-0.7035936713218689,
-0.5885027050971985,
0.9543591737747192,
0.09055353701114655,
-0.1193360984325409,
0.8015308976173401,
0.13650664687156677,
-0.2483397275209427,
0.8443856239318848,
0.47136634588241577,
-0.031192198395729065,
0.5936565399169922,
-0.8541198372840881,
0.10726526379585266,
-0.852400541305542,
-0.7670303583145142,
-0.2592994272708893,
-0.5922472476959229,
-0.6185045838356018,
-0.33685439825057983,
0.2386692464351654,
0.3795270025730133,
-0.279115229845047,
0.6183307766914368,
-0.578468382358551,
0.02399051934480667,
0.35623544454574585,
0.5511378049850464,
-0.22521093487739563,
-0.12188270688056946,
-0.11662404984235764,
-0.3634481728076935,
-0.529539167881012,
-0.36405396461486816,
0.7792868614196777,
0.6391475200653076,
0.4295269250869751,
0.09710606187582016,
0.6313365697860718,
0.056465692818164825,
0.18141047656536102,
-0.32196658849716187,
0.7088116407394409,
0.059071026742458344,
-0.454824298620224,
-0.3503522276878357,
-0.4308719038963318,
-1.1034373044967651,
0.1518922597169876,
-0.4617425799369812,
-0.8790749907493591,
-0.1844990849494934,
-0.06147180125117302,
-0.3633580505847931,
0.7734383344650269,
-0.6142816543579102,
0.6478190422058105,
-0.07611243426799774,
-0.5533915162086487,
-0.032046929001808167,
-0.8262662887573242,
0.06443477421998978,
0.3825467824935913,
0.05346262827515602,
0.005853648297488689,
-0.05588516220450401,
0.8168224096298218,
-0.8559076189994812,
0.6234521865844727,
-0.35084789991378784,
0.1366804838180542,
0.4065313935279846,
-0.028091851621866226,
0.39457282423973083,
-0.0068670096807181835,
-0.21354059875011444,
-0.09304644167423248,
0.11227989941835403,
-0.8407799005508423,
-0.34622910618782043,
0.6796202063560486,
-0.7580646872520447,
-0.3932023346424103,
-0.6666393280029297,
-0.2688785493373871,
0.10239488631486893,
0.03966442123055458,
0.4914834201335907,
0.6791441440582275,
-0.008288417011499405,
0.2410903424024582,
0.5294150114059448,
-0.4410076439380646,
0.5213069915771484,
-0.12203316390514374,
-0.002784207696095109,
-0.5769292116165161,
0.7235998511314392,
0.07504484802484512,
-0.016129622235894203,
-0.003653752151876688,
0.03405391797423363,
-0.42423027753829956,
-0.2423401176929474,
-0.310647577047348,
0.7468202114105225,
-0.16824375092983246,
-0.31801488995552063,
-0.6422563195228577,
-0.36746472120285034,
-0.58197021484375,
-0.4312768876552582,
-0.4567640721797943,
-0.3701047897338867,
-0.3220093548297882,
0.02189001254737377,
0.7473918199539185,
0.8978643417358398,
-0.3758670687675476,
0.4086945950984955,
-0.5300147533416748,
0.3033212125301361,
0.0658758357167244,
0.5704731941223145,
-0.33703017234802246,
-0.7167003154754639,
0.05142631754279137,
-0.028648266568779945,
-0.09072180837392807,
-0.8518983125686646,
0.6742653250694275,
0.011015255935490131,
0.37746483087539673,
0.40942323207855225,
-0.22079932689666748,
0.7473940253257751,
-0.023743607103824615,
0.4839899241924286,
0.6228306889533997,
-0.7248979806900024,
0.3630446195602417,
-0.4580971300601959,
0.011157815344631672,
0.30545520782470703,
0.20917266607284546,
-0.40589067339897156,
-0.3439725935459137,
-0.9248522520065308,
-0.43117383122444153,
0.75725257396698,
0.10129428654909134,
-0.02878502756357193,
-0.03653379902243614,
0.7403995394706726,
-0.07392449676990509,
0.04663152992725372,
-0.5339727401733398,
-0.9097549319267273,
-0.10287759453058243,
-0.16368551552295685,
0.06981746852397919,
-0.03873557224869728,
0.042359329760074615,
-0.6939833760261536,
0.6871678829193115,
0.07888314127922058,
0.5080601572990417,
0.173885777592659,
0.07283676415681839,
0.04716796055436134,
-0.3138907849788666,
0.6110928654670715,
0.3744960129261017,
-0.19546721875667572,
-0.13183987140655518,
0.3749276399612427,
-0.5107197761535645,
0.09209606796503067,
0.2201709896326065,
-0.013349343091249466,
0.07313404977321625,
0.10417988151311874,
0.5337062478065491,
0.3590318560600281,
-0.061159081757068634,
0.5133367776870728,
-0.25523725152015686,
-0.5570762157440186,
-0.22326132655143738,
-0.21704687178134918,
0.2661171555519104,
0.42954882979393005,
0.32439741492271423,
0.0678800493478775,
-0.3980029821395874,
-0.3807588815689087,
0.5440414547920227,
0.7331005930900574,
-0.41080957651138306,
-0.4201483428478241,
0.5947152972221375,
-0.032119229435920715,
-0.2527807354927063,
0.41359785199165344,
-0.10929949581623077,
-0.6996177434921265,
1.049818515777588,
0.36012110114097595,
0.6308844089508057,
-0.5032284259796143,
0.09347666800022125,
0.8774594068527222,
0.002398513024672866,
0.20533862709999084,
0.35054129362106323,
0.4866337478160858,
-0.3380420506000519,
-0.07596635818481445,
-0.5481858253479004,
0.18252098560333252,
0.5280614495277405,
-0.44106441736221313,
0.2963525056838989,
-0.7519422173500061,
-0.3577921688556671,
0.09439737349748611,
0.5101138949394226,
-0.6636602282524109,
0.3559759855270386,
-0.03860805183649063,
1.096783995628357,
-0.8380752801895142,
0.8350582122802734,
0.9313400983810425,
-0.575441837310791,
-0.8808602094650269,
-0.015455268323421478,
0.14557713270187378,
-0.887370228767395,
0.455831378698349,
0.09867114573717117,
0.02632719650864601,
-0.01719558611512184,
-0.5126078724861145,
-0.6868504881858826,
1.3840806484222412,
0.4082138240337372,
-0.030058478936553,
0.271638423204422,
-0.44616174697875977,
0.3937167525291443,
-0.18161596357822418,
0.5937689542770386,
0.38576436042785645,
0.5337830781936646,
0.15640562772750854,
-0.8834035992622375,
0.3774702548980713,
-0.43902504444122314,
-0.1273939609527588,
0.3276169002056122,
-1.3250290155410767,
0.8992744088172913,
-0.22495341300964355,
-0.026597194373607635,
0.2432004064321518,
0.6580321192741394,
0.3222595751285553,
-0.036259546875953674,
0.25143057107925415,
0.9404284954071045,
0.4976699948310852,
-0.2461259514093399,
1.0844022035598755,
-0.22409972548484802,
0.5416725277900696,
0.21899695694446564,
0.5743004083633423,
0.3716391921043396,
0.4096124768257141,
-0.5759440660476685,
0.2644856572151184,
0.8587945699691772,
-0.03801156207919121,
0.12164770811796188,
0.2925975024700165,
-0.4008632004261017,
-0.203777477145195,
-0.23592109978199005,
-0.6951818466186523,
0.23359380662441254,
0.11027462780475616,
-0.14747823774814606,
-0.14389614760875702,
-0.0511898472905159,
0.25848397612571716,
0.3047747313976288,
-0.25445809960365295,
0.5406177639961243,
0.09082335978746414,
-0.39862561225891113,
0.46819257736206055,
-0.011830704286694527,
1.0870369672775269,
-0.35805147886276245,
0.16764967143535614,
-0.36464837193489075,
0.2914513945579529,
-0.253435879945755,
-1.1081091165542603,
0.3510347902774811,
-0.08751161396503448,
0.0890669897198677,
-0.24430708587169647,
0.6777279376983643,
-0.3454456329345703,
-0.35891130566596985,
0.4008863568305969,
0.3936518132686615,
0.5237830877304077,
0.3083857297897339,
-1.1566795110702515,
0.2835460603237152,
0.08829157799482346,
-0.6362128853797913,
0.44567304849624634,
0.5119702219963074,
0.3832404315471649,
0.7594445943832397,
0.3265221118927002,
0.30416733026504517,
0.20254868268966675,
-0.3639872670173645,
0.7600719928741455,
-0.6397817134857178,
-0.4569470286369324,
-0.8439031839370728,
0.5384029746055603,
-0.4233762323856354,
-0.549767255783081,
0.7582329511642456,
0.5734158158302307,
0.3854632079601288,
0.026097359135746956,
0.6824579238891602,
-0.5385488271713257,
0.5084443092346191,
-0.26873287558555603,
0.7697679996490479,
-0.6842005848884583,
-0.2582157254219055,
-0.19817094504833221,
-0.6093766689300537,
-0.41826286911964417,
0.8641615509986877,
-0.1416793018579483,
0.2588038742542267,
0.2934311032295227,
0.6874650716781616,
0.06343468278646469,
-0.1279638260602951,
-0.004105322062969208,
0.1643710434436798,
-0.13504058122634888,
0.8848661780357361,
0.530146062374115,
-0.7861621379852295,
0.043396562337875366,
-0.4970967173576355,
-0.27997922897338867,
-0.38035327196121216,
-0.7724741697311401,
-1.19044029712677,
-0.6888434290885925,
-0.5434798002243042,
-0.7039529085159302,
-0.25117918848991394,
1.2397842407226562,
0.8297020196914673,
-0.6121001243591309,
-0.14153753221035004,
0.13707537949085236,
0.08436047285795212,
-0.1521371752023697,
-0.2196597158908844,
0.5279927849769592,
0.09710288792848587,
-1.000101089477539,
-0.40060678124427795,
0.13647416234016418,
0.6243788599967957,
0.4023135006427765,
-0.5074282288551331,
-0.25590187311172485,
-0.05202841758728027,
0.32499614357948303,
0.8683024048805237,
-0.8105241060256958,
-0.2912015914916992,
0.0209296103566885,
-0.49625900387763977,
0.15079563856124878,
0.29828959703445435,
-0.43878304958343506,
-0.12201473116874695,
0.5143147110939026,
0.41853538155555725,
0.743308424949646,
0.08885052800178528,
0.17071442306041718,
-0.4635564684867859,
0.5683144927024841,
-0.005070357117801905,
0.34974297881126404,
0.2438650131225586,
-0.3027612566947937,
0.7860116958618164,
0.5432239770889282,
-0.4061613380908966,
-1.040819764137268,
-0.17027728259563446,
-1.3250598907470703,
-0.04554235190153122,
0.6647186279296875,
-0.06567145884037018,
-0.44531628489494324,
0.4330689013004303,
-0.4578621983528137,
0.5327719449996948,
-0.22585581243038177,
0.2542327046394348,
0.24480636417865753,
-0.3573455512523651,
-0.36524027585983276,
-0.5763633251190186,
0.623661458492279,
0.3681727349758148,
-0.7005155086517334,
-0.4150581657886505,
-0.010559534654021263,
0.3112409710884094,
0.18941861391067505,
0.7651651501655579,
-0.40079164505004883,
0.12300821393728256,
-0.1053629070520401,
0.24374772608280182,
-0.034522876143455505,
0.15156584978103638,
-0.31411829590797424,
-0.1704077422618866,
-0.2249865084886551,
-0.6500895023345947
] |
nlptown/bert-base-multilingual-uncased-sentiment | nlptown | "2023-07-27T18:14:29Z" | 1,963,455 | 208 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"bert",
"text-classification",
"en",
"nl",
"de",
"fr",
"it",
"es",
"license:mit",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:05Z" | ---
language:
- en
- nl
- de
- fr
- it
- es
license: mit
---
# bert-base-multilingual-uncased-sentiment
This is a bert-base-multilingual-uncased model finetuned for sentiment analysis on product reviews in six languages: English, Dutch, German, French, Spanish, and Italian. It predicts the sentiment of the review as a number of stars (between 1 and 5).
This model is intended for direct use as a sentiment analysis model for product reviews in any of the six languages above or for further finetuning on related sentiment analysis tasks.
## Training data
Here is the number of product reviews we used for finetuning the model:
| Language | Number of reviews |
| -------- | ----------------- |
| English | 150k |
| Dutch | 80k |
| German | 137k |
| French | 140k |
| Italian | 72k |
| Spanish | 50k |
## Accuracy
The fine-tuned model obtained the following accuracy on 5,000 held-out product reviews in each of the languages:
- Accuracy (exact) is the exact match for the number of stars.
- Accuracy (off-by-1) is the percentage of reviews where the number of stars the model predicts differs by a maximum of 1 from the number given by the human reviewer.
| Language | Accuracy (exact) | Accuracy (off-by-1) |
| -------- | ---------------------- | ------------------- |
| English | 67% | 95%
| Dutch | 57% | 93%
| German | 61% | 94%
| French | 59% | 94%
| Italian | 59% | 95%
| Spanish | 58% | 95%
## Contact
If you found this model useful, you can buy me a coffee at https://www.buymeacoffee.com/yvespeirsman.
In addition to this model, [NLP Town](http://nlp.town) offers custom models for many languages and NLP tasks.
Feel free to contact me for questions, feedback and/or requests for similar models. | [
-0.6470620036125183,
-0.5991786122322083,
0.24653929471969604,
0.8643379211425781,
-0.3933452367782593,
-0.11885306239128113,
-0.41678205132484436,
-0.7027345895767212,
0.436942994594574,
0.5373976826667786,
-0.748100996017456,
-0.8639733791351318,
-0.6168043613433838,
0.04462071880698204,
0.011694313026964664,
1.405747413635254,
0.19852879643440247,
0.8854458332061768,
0.034383971244096756,
-0.1719294637441635,
-0.23869885504245758,
-0.9886682033538818,
-0.46019673347473145,
-0.47825321555137634,
0.6002874374389648,
0.2451161891222,
0.7442206144332886,
-0.3628603219985962,
0.5345395803451538,
0.22090934216976166,
-0.16201607882976532,
-0.08713395893573761,
-0.20586510002613068,
-0.08433264493942261,
0.053175222128629684,
-0.32754865288734436,
-0.6279469728469849,
-0.1856221854686737,
0.279157429933548,
0.9685375690460205,
0.12253525108098984,
0.12415114790201187,
0.115069679915905,
0.8338910937309265,
-0.29978182911872864,
0.4978199303150177,
-0.3902711868286133,
0.12827076017856598,
0.32923781871795654,
0.4140133559703827,
-0.5272098183631897,
-0.5126449465751648,
0.2476460188627243,
-0.29233044385910034,
0.13356955349445343,
-0.2558528482913971,
1.0629743337631226,
-0.2341243028640747,
-0.30775609612464905,
-0.5600669980049133,
-0.7986826300621033,
1.0983566045761108,
-1.0453754663467407,
0.4711540639400482,
0.2576230764389038,
0.2705155909061432,
-0.020750682801008224,
-0.2822776734828949,
-0.6398862600326538,
-0.3046736717224121,
-0.2238406240940094,
0.38758137822151184,
-0.13490447402000427,
-0.009563781321048737,
-0.022732902318239212,
0.4293011724948883,
-0.4054081439971924,
-0.1646224558353424,
-0.40199363231658936,
0.053809959441423416,
0.8911760449409485,
-0.24699991941452026,
-0.010449239984154701,
-0.43271300196647644,
-0.6058449149131775,
-0.26804250478744507,
-0.45467042922973633,
0.3781336545944214,
0.5671551823616028,
0.5752611756324768,
-0.1996254324913025,
0.5015076994895935,
-0.2715211510658264,
0.6468734741210938,
-0.13443130254745483,
0.054943155497312546,
0.6952732801437378,
-0.21766355633735657,
-0.45099490880966187,
-0.0948544591665268,
1.1425540447235107,
0.5771543383598328,
0.5154485702514648,
0.06648131459951401,
-0.6357157230377197,
0.1865420937538147,
0.04139425978064537,
-0.6834477782249451,
-0.22414445877075195,
0.35944223403930664,
-0.6631009578704834,
-0.32151442766189575,
0.1578996181488037,
-0.5337932705879211,
-0.12780718505382538,
-0.09961563348770142,
0.4895649552345276,
-0.46032246947288513,
-0.32459089159965515,
0.44804561138153076,
-0.0013831304386258125,
0.142197385430336,
0.16445353627204895,
-0.9380166530609131,
0.39065462350845337,
0.285452663898468,
0.48038601875305176,
-0.023574940860271454,
-0.2087743580341339,
0.3224417269229889,
-0.3826475739479065,
-0.4369432330131531,
0.8073781132698059,
-0.3796219825744629,
-0.681797444820404,
0.3803631067276001,
0.2184351235628128,
0.13757063448429108,
-0.26584818959236145,
0.8968210220336914,
-0.6053401231765747,
0.5127071738243103,
-0.5905848741531372,
-0.437961608171463,
-0.8057817816734314,
0.4908381700515747,
-0.8287712335586548,
1.157739520072937,
0.0290958434343338,
-0.5977783799171448,
0.356970876455307,
-0.7694653868675232,
-0.49878793954849243,
-0.24426667392253876,
0.11397358030080795,
-0.3862895667552948,
0.3168356120586395,
0.41664090752601624,
0.547950029373169,
-0.022867608815431595,
0.23448120057582855,
-0.25745344161987305,
-0.054625216871500015,
0.1678522229194641,
-0.3701786696910858,
1.2308112382888794,
0.40238308906555176,
-0.20534715056419373,
0.19505499303340912,
-0.9301866292953491,
0.1855839639902115,
0.0857921913266182,
-0.5599995255470276,
-0.20983843505382538,
-0.04723561182618141,
0.6325626969337463,
0.39806485176086426,
0.5665674805641174,
-0.9237017035484314,
0.054492879658937454,
-0.6936482787132263,
0.15831071138381958,
0.38909098505973816,
0.07165028899908066,
0.36011993885040283,
-0.3200119435787201,
0.49267134070396423,
0.18788671493530273,
0.38552919030189514,
0.03637316823005676,
-0.7386712431907654,
-1.1383553743362427,
-0.12966454029083252,
0.5483344793319702,
0.6480392813682556,
-0.5312316417694092,
0.9386876225471497,
-0.15118682384490967,
-0.5321667194366455,
-0.6748942732810974,
0.026087399572134018,
0.4564633369445801,
0.3563733696937561,
0.30421167612075806,
-0.47644561529159546,
-0.5181723833084106,
-1.3254543542861938,
0.04886181652545929,
-0.24479269981384277,
0.02146957814693451,
0.2744292914867401,
0.5471277832984924,
-0.5092173218727112,
0.7549295425415039,
-0.22063028812408447,
-0.5229794383049011,
-0.5457293391227722,
0.14566048979759216,
0.89565110206604,
0.42869704961776733,
1.0377315282821655,
-0.576911985874176,
-0.8426640033721924,
0.1651608794927597,
-0.7662986516952515,
0.10977164655923843,
0.037892770022153854,
-0.008937167935073376,
0.6063010096549988,
-0.05569327995181084,
-0.7529861330986023,
0.2424502968788147,
0.6858265995979309,
-0.13048429787158966,
0.4812839925289154,
-0.33027392625808716,
0.16775301098823547,
-1.3298991918563843,
-0.141470804810524,
0.033892884850502014,
-0.03874896839261055,
-0.5172947645187378,
0.11944977939128876,
0.07338915020227432,
-0.036502379924058914,
-0.5359729528427124,
0.539951503276825,
-0.43714478611946106,
0.0074845110066235065,
-0.017172938212752342,
-0.3267972767353058,
0.2875625193119049,
0.9238063097000122,
0.3245932459831238,
0.34326809644699097,
0.5555829405784607,
-0.3492216467857361,
0.3610849380493164,
0.38183897733688354,
-0.9411980509757996,
0.3709586262702942,
-0.851405143737793,
-0.14605994522571564,
-0.06364033371210098,
0.10901044309139252,
-1.3232574462890625,
-0.009501139633357525,
-0.019852787256240845,
-0.7111402750015259,
0.1527998149394989,
0.053375087678432465,
-0.8053549528121948,
-0.40259850025177,
-0.2223547101020813,
-0.09333155304193497,
0.4312158226966858,
-0.5847924947738647,
0.637162983417511,
0.2769082188606262,
-0.3237764537334442,
-0.8006380200386047,
-1.0168657302856445,
-0.1452595740556717,
0.10474564880132675,
-0.8117085099220276,
0.09647762030363083,
-0.3128327429294586,
-0.20371048152446747,
-0.12188881635665894,
0.0909024029970169,
-0.24056315422058105,
-0.24852965772151947,
0.09179086983203888,
0.40135458111763,
-0.09849093109369278,
0.18488891422748566,
-0.04862167686223984,
0.08122153580188751,
0.12725919485092163,
-0.053938500583171844,
0.7584783434867859,
-0.4592260718345642,
-0.022065013647079468,
-0.2803066670894623,
0.7165966033935547,
0.7652679681777954,
-0.08906266838312149,
0.6745982766151428,
0.6184281706809998,
-0.5475756525993347,
-0.17238333821296692,
-0.6466342210769653,
-0.22973334789276123,
-0.41735661029815674,
0.555704653263092,
-0.6045638918876648,
-0.5265589356422424,
1.0198744535446167,
0.5986315608024597,
0.30801212787628174,
0.7132222056388855,
0.8973628878593445,
-0.40539032220840454,
1.4678903818130493,
0.9158380627632141,
-0.42471843957901,
0.3374359607696533,
-0.34150829911231995,
0.4155418872833252,
-0.3418766260147095,
-0.4370608627796173,
-0.4813562333583832,
-0.4722043573856354,
-0.5815646052360535,
-0.016914522275328636,
0.3446945250034332,
0.07459569722414017,
-0.44938546419143677,
0.3040491044521332,
-0.5312597155570984,
0.3569546341896057,
0.8722119927406311,
0.212066650390625,
0.3006848990917206,
0.41039174795150757,
-0.5519779920578003,
-0.24920211732387543,
-0.6798399090766907,
-0.5884066820144653,
0.9636522531509399,
0.5651366710662842,
0.8605926632881165,
0.2153913974761963,
0.5901400446891785,
0.33202382922172546,
0.06955698132514954,
-0.9741988182067871,
0.5366818904876709,
-0.4485635459423065,
-1.034400463104248,
-0.06874015182256699,
-0.08247627317905426,
-0.7029679417610168,
0.17216923832893372,
-0.46525537967681885,
-0.4630497395992279,
0.38828814029693604,
-0.05903564766049385,
-0.4447177052497864,
0.3122667968273163,
-0.9874400496482849,
0.8963762521743774,
-0.6651146411895752,
-0.07281430065631866,
-0.20237207412719727,
-0.5904003977775574,
0.23658888041973114,
0.02041086181998253,
0.42622116208076477,
-0.2349439263343811,
0.45702409744262695,
0.7118779420852661,
-0.4193461537361145,
1.1958253383636475,
-0.186196431517601,
-0.22406251728534698,
0.19505877792835236,
0.23527857661247253,
0.35955849289894104,
0.16202408075332642,
-0.08950382471084595,
0.5954645276069641,
0.013597281649708748,
-0.35939502716064453,
-0.31547075510025024,
0.998254120349884,
-1.202874779701233,
-0.37329959869384766,
-0.6085990071296692,
-0.6076908707618713,
-0.5014257431030273,
0.43719449639320374,
0.5629754066467285,
0.09372065216302872,
-0.33114466071128845,
0.20550476014614105,
0.5788550972938538,
-0.4076068103313446,
0.594305157661438,
0.7259887456893921,
-0.3870598077774048,
-0.5421578884124756,
0.7736798524856567,
-0.017937880009412766,
0.08754170686006546,
0.432126522064209,
0.14017100632190704,
-0.5903478264808655,
-0.33225423097610474,
-0.4242497384548187,
0.17346620559692383,
-0.9189007878303528,
-0.14783857762813568,
-0.8308055996894836,
-0.23719941079616547,
-0.375441312789917,
-0.11403941363096237,
-0.5317011475563049,
-0.6734558343887329,
-0.0456666424870491,
-0.2466336339712143,
0.43237024545669556,
1.0373872518539429,
0.05462079495191574,
0.5039669871330261,
-0.7824234366416931,
-0.08160596340894699,
0.21704702079296112,
0.5910553932189941,
-0.17280487716197968,
-0.4918382465839386,
-0.2990712523460388,
0.13167107105255127,
-0.10424377769231796,
-1.0454617738723755,
0.8770228624343872,
0.03114025481045246,
0.4358116388320923,
0.47893252968788147,
-0.025820402428507805,
0.5489166975021362,
-0.5475658178329468,
1.0367417335510254,
0.4905543327331543,
-0.8306854367256165,
0.39804360270500183,
-0.4770309329032898,
0.28602293133735657,
0.5969985127449036,
0.6189542412757874,
-0.5332185626029968,
-0.23231758177280426,
-0.6261646151542664,
-0.9114999175071716,
0.47669732570648193,
0.0158761627972126,
0.597296953201294,
-0.15014420449733734,
-0.2352861613035202,
0.2926945090293884,
0.5263639092445374,
-1.4158046245574951,
-0.27330633997917175,
-0.3657579720020294,
-0.09761413931846619,
-0.16555362939834595,
-0.6455271244049072,
-0.13127467036247253,
-0.3660212755203247,
1.0858702659606934,
0.13315220177173615,
0.41655197739601135,
0.02072419971227646,
0.03151664882898331,
-0.11316855996847153,
0.3866424262523651,
0.5254215598106384,
0.5444085001945496,
-0.6565696001052856,
-0.2539392113685608,
0.12641921639442444,
-0.23912453651428223,
-0.29116013646125793,
0.05147148668766022,
-0.20689275860786438,
0.5677571296691895,
0.2802361845970154,
0.8965418934822083,
0.24755433201789856,
-0.4900052547454834,
0.5022267699241638,
-0.07775764912366867,
-0.3683008551597595,
-0.7703244686126709,
-0.4210006296634674,
0.05433383584022522,
0.2009275257587433,
0.2648337483406067,
0.22253598272800446,
0.11361700296401978,
-0.5108739137649536,
0.11317192763090134,
0.6947848200798035,
-0.7846404314041138,
-0.36955907940864563,
0.5163039565086365,
0.4622128903865814,
-0.07514884322881699,
0.666524350643158,
-0.11178580671548843,
-0.6837800145149231,
0.5490090250968933,
0.4183073937892914,
1.0541421175003052,
-0.07049836963415146,
0.2922672927379608,
0.6223341226577759,
0.5749889612197876,
0.016357842832803726,
0.790657103061676,
0.24691042304039001,
-1.0327569246292114,
-0.31167200207710266,
-1.0325298309326172,
-0.41322046518325806,
0.19034765660762787,
-0.7688859105110168,
0.2649218440055847,
-0.486592561006546,
-0.38510143756866455,
0.16225722432136536,
0.15967944264411926,
-0.5505422353744507,
0.5349200963973999,
0.27593129873275757,
1.1448665857315063,
-1.0800329446792603,
1.1165918111801147,
0.835823655128479,
-0.6904309391975403,
-0.6605414748191833,
-0.47656187415122986,
-0.33579686284065247,
-0.8529537320137024,
0.750501275062561,
0.1309271901845932,
-0.05399176850914955,
-0.40051910281181335,
-0.44617533683776855,
-0.756362795829773,
0.43893662095069885,
0.08653908222913742,
-0.7046196460723877,
0.1703919768333435,
0.08570889383554459,
0.8776946663856506,
-0.6759896874427795,
0.26971057057380676,
0.41757112741470337,
0.35250112414360046,
0.008580949157476425,
-0.9346354007720947,
-0.5628253817558289,
-0.6126663088798523,
0.021760743111371994,
-0.1449318677186966,
-0.6722071170806885,
1.0718061923980713,
-0.16339920461177826,
0.20966026186943054,
0.1315813511610031,
0.4922567903995514,
0.12373555451631546,
-0.22948820888996124,
0.48419487476348877,
0.6633328795433044,
0.5017953515052795,
-0.2386537492275238,
1.1870094537734985,
-0.6721064448356628,
0.6962215900421143,
1.0064787864685059,
-0.3145125210285187,
1.1097849607467651,
0.36130034923553467,
-0.3015689551830292,
0.876223623752594,
0.8964340686798096,
-0.25072649121284485,
0.6330201029777527,
-0.16632266342639923,
-0.2974434494972229,
-0.33700770139694214,
-0.0766008198261261,
-0.3322942852973938,
0.2549531161785126,
0.31182241439819336,
-0.617158055305481,
-0.16153089702129364,
-0.07056646794080734,
0.12088505178689957,
-0.07911266386508942,
-0.40505078434944153,
0.6541551947593689,
-0.03959612548351288,
-0.6872955560684204,
0.6467708349227905,
0.24797573685646057,
0.7922770977020264,
-0.9096939563751221,
0.14004963636398315,
-0.31729570031166077,
0.406389445066452,
-0.2611503601074219,
-1.0417048931121826,
0.2189430296421051,
-0.07061710208654404,
-0.6350811123847961,
-0.3810591697692871,
0.40451154112815857,
-0.5508087873458862,
-1.2991735935211182,
0.5528044104576111,
0.6300695538520813,
0.10246724635362625,
0.05020371451973915,
-1.0478665828704834,
0.04306846112012863,
0.4085983335971832,
-0.4739300012588501,
-0.034774553030729294,
0.16788500547409058,
-0.13817569613456726,
0.4926811754703522,
0.6266551613807678,
0.1916702389717102,
-0.015822188928723335,
0.5177470445632935,
0.5981220602989197,
-0.6467230319976807,
-0.7536240220069885,
-0.5836003422737122,
0.6452047228813171,
-0.025033436715602875,
-0.378909170627594,
0.8510615229606628,
0.7110663652420044,
1.0450496673583984,
-0.7633154392242432,
1.1428916454315186,
0.022650960832834244,
0.730159342288971,
-0.2239404320716858,
0.9945324659347534,
-0.536729633808136,
0.18431369960308075,
-0.2350260466337204,
-1.1242091655731201,
-0.5061501860618591,
1.0050958395004272,
-0.31569164991378784,
0.24367846548557281,
0.5863880515098572,
0.7210918664932251,
0.18573124706745148,
-0.005112253129482269,
0.48893898725509644,
0.4541807174682617,
-0.013096164911985397,
0.5092552900314331,
0.572013258934021,
-0.48380160331726074,
0.48391929268836975,
-0.5439291000366211,
-0.17510470747947693,
0.04916081205010414,
-0.802852988243103,
-1.2943660020828247,
-0.3928866684436798,
-0.1759060025215149,
-0.4870235025882721,
-0.10811691731214523,
0.9427906274795532,
0.6942410469055176,
-1.529328465461731,
-0.6431605219841003,
0.15347564220428467,
-0.09099195152521133,
-0.17823860049247742,
-0.23367910087108612,
0.32267001271247864,
-0.6474159359931946,
-1.1558494567871094,
0.18802689015865326,
-0.0012342046247795224,
0.03603844344615936,
-0.4684407114982605,
0.01885884627699852,
-0.16165898740291595,
0.2902226150035858,
0.8429040908813477,
0.0024514493998140097,
-0.8754950761795044,
-0.14950381219387054,
0.27862244844436646,
-0.18162421882152557,
0.19873201847076416,
0.477251261472702,
-0.4334157705307007,
0.783816397190094,
0.5931790471076965,
0.2078852653503418,
0.3693562150001526,
-0.3483709692955017,
0.7303767204284668,
-1.0704045295715332,
0.3939294219017029,
0.40303754806518555,
0.7614547610282898,
0.36757221817970276,
-0.25906699895858765,
0.3252759873867035,
0.018407288938760757,
-0.48278480768203735,
-0.5706055164337158,
0.2882714867591858,
-1.213290810585022,
-0.4149806797504425,
1.2595402002334595,
-0.006224870681762695,
-0.1600160002708435,
0.09080617874860764,
-0.280724436044693,
-0.2287144660949707,
-0.6374999284744263,
1.0282912254333496,
1.1675441265106201,
-0.1563418209552765,
0.007713874336332083,
-0.5830863118171692,
0.5004996657371521,
0.5577695965766907,
-0.34081172943115234,
-0.22093889117240906,
0.6227596402168274,
0.29706743359565735,
0.39346402883529663,
0.39819708466529846,
-0.29277095198631287,
0.37039604783058167,
-0.3215956389904022,
0.8032838106155396,
0.38487258553504944,
-0.32812318205833435,
-0.3472156822681427,
0.11345446854829788,
0.09125465154647827,
-0.37526676058769226
] |
facebook/contriever | facebook | "2022-01-19T17:23:28Z" | 1,930,363 | 33 | transformers | [
"transformers",
"pytorch",
"bert",
"arxiv:2112.09118",
"endpoints_compatible",
"has_space",
"region:us"
] | null | "2022-03-02T23:29:05Z" | This model has been trained without supervision following the approach described in [Towards Unsupervised Dense Information Retrieval with Contrastive Learning](https://arxiv.org/abs/2112.09118). The associated GitHub repository is available here https://github.com/facebookresearch/contriever.
## Usage (HuggingFace Transformers)
Using the model directly available in HuggingFace transformers requires to add a mean pooling operation to obtain a sentence embedding.
```python
import torch
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained('facebook/contriever')
model = AutoModel.from_pretrained('facebook/contriever')
sentences = [
"Where was Marie Curie born?",
"Maria Sklodowska, later known as Marie Curie, was born on November 7, 1867.",
"Born in Paris on 15 May 1859, Pierre Curie was the son of Eugène Curie, a doctor of French Catholic origin from Alsace."
]
# Apply tokenizer
inputs = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
outputs = model(**inputs)
# Mean pooling
def mean_pooling(token_embeddings, mask):
token_embeddings = token_embeddings.masked_fill(~mask[..., None].bool(), 0.)
sentence_embeddings = token_embeddings.sum(dim=1) / mask.sum(dim=1)[..., None]
return sentence_embeddings
embeddings = mean_pooling(outputs[0], inputs['attention_mask'])
``` | [
-0.13535311818122864,
-0.6261586546897888,
0.32140347361564636,
0.36873579025268555,
-0.250387042760849,
-0.426110178232193,
-0.2917504608631134,
-0.13200199604034424,
0.36264675855636597,
0.4799898564815521,
-0.6685725450515747,
-0.4890047013759613,
-0.6281148791313171,
-0.20057979226112366,
-0.5080196857452393,
1.0179147720336914,
-0.002797694643959403,
0.11977304518222809,
-0.2541219890117645,
-0.1995704472064972,
0.18092766404151917,
-0.3990345001220703,
-0.5861448645591736,
-0.3563709259033203,
0.13760656118392944,
0.3248036801815033,
0.5901304483413696,
0.43398231267929077,
0.3585597276687622,
0.4649132788181305,
-0.021809136494994164,
0.2349846065044403,
-0.6713118553161621,
-0.2841775715351105,
-0.25866377353668213,
-0.1762513816356659,
0.12767915427684784,
0.22286607325077057,
0.5196881294250488,
0.7413010001182556,
-0.17024052143096924,
0.02715817093849182,
0.4114494323730469,
0.6713147163391113,
-0.5560393929481506,
0.2800169289112091,
-0.46459218859672546,
0.042371347546577454,
0.1469699740409851,
0.05935875326395035,
-0.5893779397010803,
-0.23500406742095947,
0.1491021364927292,
-0.5453540682792664,
0.5528080463409424,
-0.11823449283838272,
1.1554806232452393,
0.3144848346710205,
-0.5954608917236328,
-0.1822894960641861,
-0.3001491129398346,
0.824967086315155,
-0.4934127628803253,
0.4044545888900757,
0.4001844525337219,
0.0031488665845245123,
-0.09042440354824066,
-0.9693277478218079,
-0.629840612411499,
-0.20853248238563538,
-0.4812900125980377,
0.09784146398305893,
-0.29303503036499023,
0.15011447668075562,
0.34807372093200684,
0.5035502314567566,
-0.6800122261047363,
-0.1695789396762848,
-0.5653143525123596,
-0.25807449221611023,
0.7129163146018982,
-0.14326973259449005,
-0.016155395656824112,
-0.46272343397140503,
-0.6161907315254211,
-0.1518574059009552,
-0.006356904283165932,
0.29929274320602417,
0.15003962814807892,
0.41560378670692444,
-0.5466774106025696,
0.7292052507400513,
-0.44176873564720154,
0.4186013638973236,
0.3420284688472748,
0.3068056106567383,
0.7323958277702332,
-0.20924624800682068,
-0.2499784529209137,
-0.1606789529323578,
1.0522657632827759,
0.5390487909317017,
0.6332823038101196,
-0.18041126430034637,
-0.1548783928155899,
0.2459731251001358,
0.26937901973724365,
-0.9874538779258728,
-0.7133278250694275,
0.09008747339248657,
-0.580518901348114,
-0.3777640163898468,
0.4513348639011383,
-0.5657671689987183,
-0.09754551947116852,
-0.22430849075317383,
0.5425419807434082,
-0.408549964427948,
-0.22011961042881012,
0.11589590460062027,
-0.08425784856081009,
0.11556932330131531,
-0.0948169082403183,
-0.9698062539100647,
0.3490707576274872,
0.25574132800102234,
0.8188359141349792,
-0.0069211493246257305,
-0.11953754723072052,
-0.7099974155426025,
-0.03375166282057762,
-0.033610180020332336,
0.5780032873153687,
-0.5638954639434814,
-0.2553267180919647,
0.22207240760326385,
0.3752630650997162,
-0.2684662640094757,
-0.5008134841918945,
0.5590364336967468,
-0.38431695103645325,
0.32925817370414734,
-0.038663849234580994,
-0.8046209216117859,
-0.16626031696796417,
0.2031691074371338,
-0.5228445529937744,
1.2144720554351807,
0.5332095623016357,
-1.1162197589874268,
0.06956762075424194,
-0.4754011929035187,
-0.28245455026626587,
-0.14909768104553223,
-0.223580002784729,
-0.6428032517433167,
-0.07786858826875687,
0.3962756395339966,
0.7501879930496216,
0.3563837707042694,
0.4008732736110687,
-0.5910940170288086,
-0.42348793148994446,
0.11070516705513,
0.007101533934473991,
1.1365653276443481,
0.04903314262628555,
-0.3277795910835266,
0.18236173689365387,
-0.8053423166275024,
-0.1198820099234581,
0.15851999819278717,
-0.15411491692066193,
-0.26595887541770935,
-0.4475284814834595,
0.4958832561969757,
0.29670771956443787,
0.25787439942359924,
-0.7774362564086914,
0.22597599029541016,
-0.3952661156654358,
0.5106210708618164,
0.5968572497367859,
0.14764073491096497,
0.6300358176231384,
-0.2962443232536316,
0.20750711858272552,
0.3370060920715332,
0.26756057143211365,
-0.05216480791568756,
-0.20082388818264008,
-0.825482964515686,
-0.20930399000644684,
-0.05692556872963905,
0.4357451796531677,
-0.8592453002929688,
0.43068039417266846,
0.09206327050924301,
-0.5672938823699951,
-0.5272154211997986,
0.42849037051200867,
0.3951035439968109,
0.7846531271934509,
0.7311116456985474,
-0.16089992225170135,
-0.6692813038825989,
-0.9554294347763062,
-0.011788414791226387,
-0.13594385981559753,
0.031105853617191315,
0.31981003284454346,
0.63047194480896,
-0.5542153716087341,
0.698691725730896,
-0.6557353138923645,
-0.31863778829574585,
0.0020214244723320007,
0.016101302579045296,
0.4318716824054718,
0.9771958589553833,
0.5796563625335693,
-0.9718424677848816,
-0.36956414580345154,
-0.31763944029808044,
-0.9754180312156677,
0.1370639055967331,
0.04354556277394295,
-0.391002357006073,
0.0999089851975441,
0.8221613168716431,
-0.9359389543533325,
0.5843905806541443,
0.3881521224975586,
-0.4399152994155884,
0.5784110426902771,
-0.10645830631256104,
-0.22504208981990814,
-1.306746006011963,
0.09018506854772568,
0.3736661374568939,
-0.3306497037410736,
-0.46667104959487915,
0.04219481348991394,
0.3364222049713135,
0.08031152933835983,
-0.4294767677783966,
0.6472396850585938,
-0.3710126578807831,
0.30786746740341187,
-0.20829902589321136,
0.20684067904949188,
0.1430368423461914,
0.519264280796051,
-0.005229178350418806,
0.3557833433151245,
0.7387017607688904,
-0.8471710085868835,
0.5331817865371704,
0.6806755065917969,
-0.2398918867111206,
0.4771842062473297,
-0.657318651676178,
-0.11931618303060532,
-0.19635064899921417,
0.20668292045593262,
-1.1098328828811646,
-0.25158873200416565,
0.3548206090927124,
-0.6379916071891785,
0.3074529767036438,
-0.05331774428486824,
-0.5921863317489624,
-0.5992050170898438,
-0.3478893041610718,
0.33008432388305664,
0.4011785089969635,
-0.7803873419761658,
0.6849972009658813,
0.24575412273406982,
0.1301996260881424,
-0.6737762689590454,
-0.9011473059654236,
-0.5024885535240173,
-0.18558374047279358,
-0.693341851234436,
0.5449269413948059,
-0.0645570456981659,
-0.016838857904076576,
0.20397916436195374,
0.0026206900365650654,
-0.17755095660686493,
-0.041609760373830795,
0.11322423070669174,
0.2798788547515869,
-0.03212215378880501,
0.2759716510772705,
0.132088303565979,
-0.08092938363552094,
0.14299431443214417,
-0.11922525614500046,
0.4478180706501007,
-0.12438277155160904,
-0.05909765511751175,
-0.5580798983573914,
0.17428916692733765,
-0.05085432156920433,
-0.21870934963226318,
0.8021623492240906,
1.1300971508026123,
-0.5342855453491211,
-0.28527647256851196,
-0.7571567893028259,
-0.4647984802722931,
-0.5754252076148987,
0.35961002111434937,
-0.10544572025537491,
-1.1885672807693481,
0.7479181289672852,
0.15857833623886108,
0.003697919426485896,
0.5518808960914612,
0.3309273421764374,
-0.16257958114147186,
0.719808042049408,
1.0543737411499023,
-0.03977026417851448,
0.6838583946228027,
-0.4772370755672455,
-0.1021355614066124,
-0.7304288148880005,
-0.38942405581474304,
-0.13893088698387146,
-0.1909898817539215,
-0.9081525802612305,
-0.2537776827812195,
0.0598430372774601,
0.04848078265786171,
-0.5986912250518799,
0.41442617774009705,
-0.7271413803100586,
0.23217351734638214,
0.6661645770072937,
0.6448579430580139,
0.05144340172410011,
0.03723897784948349,
-0.16454149782657623,
0.1191948652267456,
-0.6248300075531006,
-0.16572202742099762,
0.9064929485321045,
0.14003074169158936,
0.8979799747467041,
-0.2327294945716858,
0.8189185857772827,
-0.015204239636659622,
0.30000874400138855,
-0.5144709944725037,
0.39609795808792114,
-0.31683528423309326,
-0.5302150845527649,
-0.09764869511127472,
-0.7195687890052795,
-1.042393684387207,
0.27753347158432007,
-0.1653958410024643,
-0.865973174571991,
0.3642028570175171,
0.0992022454738617,
-0.399429053068161,
0.12042953073978424,
-0.7978511452674866,
1.0664002895355225,
0.1505591720342636,
-0.419054239988327,
-0.05594008043408394,
-0.947220504283905,
0.38475409150123596,
0.20585058629512787,
0.05545203760266304,
0.1702798455953598,
0.14586421847343445,
0.8825902342796326,
-0.17301104962825775,
0.9588767886161804,
-0.3986913561820984,
0.3632020354270935,
0.2627931833267212,
-0.052819449454545975,
0.2623101770877838,
0.05113350972533226,
-0.1351989358663559,
-0.1515800654888153,
0.011070974171161652,
-0.7343248128890991,
-0.4396824240684509,
0.8440696001052856,
-0.8847120404243469,
-0.38140669465065,
-0.3503020703792572,
-0.6781815886497498,
-0.07250913232564926,
0.3005949854850769,
0.32404276728630066,
0.4605099558830261,
-0.13171997666358948,
0.2910936772823334,
0.6614577174186707,
-0.1588732898235321,
0.5854267477989197,
0.2713869512081146,
-0.33317774534225464,
-0.3028236925601959,
0.5105137228965759,
0.06589910387992859,
-0.0412609800696373,
0.31382694840431213,
0.18379369378089905,
-0.4517941176891327,
0.0485597588121891,
-0.020726118236780167,
0.791618824005127,
-0.7509556412696838,
-0.18741855025291443,
-1.0492521524429321,
-0.4297521114349365,
-0.6870995759963989,
-0.17782826721668243,
-0.34202131628990173,
-0.2445591688156128,
-0.5967699289321899,
-0.3853486478328705,
0.397663950920105,
0.5358472466468811,
-0.16859421133995056,
0.5561512112617493,
-0.6227266788482666,
0.32977667450904846,
0.038249120116233826,
0.25584855675697327,
-0.0467570424079895,
-0.8691316246986389,
-0.3945178985595703,
-0.11012616753578186,
-0.4795752763748169,
-0.6585883498191833,
0.39314737915992737,
0.23226583003997803,
0.6679695844650269,
0.689080536365509,
0.3128400146961212,
0.6416948437690735,
-0.2588827610015869,
0.48092904686927795,
0.07113977521657944,
-0.8238470554351807,
0.46509411931037903,
-0.20650224387645721,
0.17885634303092957,
0.714658260345459,
0.6146727204322815,
-0.2590315341949463,
-0.29460790753364563,
-0.9784969091415405,
-0.8859658241271973,
0.7185352444648743,
0.3099128007888794,
0.5272527933120728,
-0.2421853095293045,
0.5716378688812256,
-0.11260412633419037,
0.23636506497859955,
-1.1927530765533447,
-0.32911768555641174,
-0.2746192514896393,
-0.5354418158531189,
-0.17037124931812286,
-0.21886217594146729,
-0.011851944029331207,
-0.4321536421775818,
0.9597747921943665,
-0.13871295750141144,
0.2507200837135315,
0.43581438064575195,
-0.28007543087005615,
-0.0186808742582798,
-0.28393423557281494,
0.024402432143688202,
0.45684146881103516,
-0.2413451075553894,
0.1912298947572708,
-0.08761043846607208,
-0.15687865018844604,
-0.20653030276298523,
0.6906777620315552,
-0.10500683635473251,
0.30285489559173584,
0.31875836849212646,
0.6121907234191895,
0.46259310841560364,
-0.45691826939582825,
0.9214771389961243,
-0.02657555416226387,
-0.2947562336921692,
-0.5375082492828369,
-0.13480567932128906,
0.22309930622577667,
0.6509279012680054,
0.32070887088775635,
-0.12802094221115112,
0.1822788417339325,
-0.3129231631755829,
0.6775140166282654,
0.5143619775772095,
-0.5743197798728943,
-0.17314130067825317,
0.7623953223228455,
-0.1247754618525505,
0.1583520770072937,
1.0000348091125488,
-0.15959149599075317,
-0.4428580105304718,
0.41948920488357544,
0.4193871021270752,
0.7259892225265503,
-0.4736275374889374,
0.35312420129776,
0.6966809630393982,
0.23388898372650146,
-0.15987643599510193,
0.2571483254432678,
-0.19916392862796783,
-0.8590604662895203,
-0.2094999998807907,
-0.7189839482307434,
-0.1901586651802063,
0.042363863438367844,
-1.0066252946853638,
0.3056645393371582,
-0.28831052780151367,
-0.11038680374622345,
0.06882797926664352,
0.05043214187026024,
-0.8278398513793945,
0.3717053532600403,
-0.03464198857545853,
0.8705892562866211,
-1.1637952327728271,
0.7145663499832153,
0.7307113409042358,
-0.6781491637229919,
-1.0261234045028687,
-0.12863996624946594,
-0.3541010320186615,
-0.838204026222229,
0.4425871670246124,
0.878213107585907,
0.26723232865333557,
0.20316147804260254,
-0.894469678401947,
-0.7463314533233643,
0.9640877842903137,
0.4546854794025421,
-0.5187510251998901,
-0.17862387001514435,
-0.2546214759349823,
0.48978403210639954,
-0.36803528666496277,
0.23077349364757538,
0.2699660062789917,
0.08290864527225494,
0.11779449135065079,
-0.6210870146751404,
0.20741814374923706,
-0.6137480139732361,
-0.07372075319290161,
-0.2742046117782593,
-0.804366409778595,
0.9836996793746948,
-0.25102338194847107,
-0.19859492778778076,
0.16626152396202087,
1.0281169414520264,
0.301763117313385,
0.4349459111690521,
0.47829484939575195,
0.778308629989624,
0.7307570576667786,
-0.015185841359198093,
1.0350372791290283,
-0.3641985356807709,
0.8849392533302307,
1.0059406757354736,
0.11674723774194717,
0.6836191415786743,
0.615921676158905,
-0.06650777161121368,
0.711129367351532,
0.761475145816803,
-0.24712558090686798,
0.6696746349334717,
0.11326894909143448,
-0.17343786358833313,
-0.2778656780719757,
-0.1816205382347107,
-0.2298554629087448,
0.16293178498744965,
0.12493862956762314,
-0.7150159478187561,
-0.3088081181049347,
0.18115901947021484,
0.22560624778270721,
0.29284921288490295,
-0.23807384073734283,
0.6423181891441345,
0.3707035779953003,
-0.5117393732070923,
0.5447134971618652,
-0.08730095624923706,
0.8005331754684448,
-0.45899906754493713,
0.12215571850538254,
-0.20664656162261963,
0.4704301655292511,
-0.47262364625930786,
-0.7117326855659485,
0.2860967218875885,
-0.14879833161830902,
-0.15538372099399567,
0.0551067553460598,
0.5436149835586548,
-0.8266368508338928,
-0.8206852674484253,
0.5975477695465088,
0.4081730246543884,
0.18090768158435822,
-0.22775420546531677,
-0.8538196086883545,
-0.1290554255247116,
0.04278593137860298,
-0.4952051043510437,
0.1581253856420517,
0.5158595442771912,
0.036720942705869675,
0.6961231827735901,
0.5868027806282043,
-0.39867517352104187,
-0.020386377349495888,
0.24354931712150574,
1.4024490118026733,
-0.5357106328010559,
-0.6889601945877075,
-1.108379602432251,
0.6290661692619324,
-0.04636892303824425,
-0.08944481611251831,
0.8555040955543518,
0.7056562304496765,
1.208304762840271,
0.02023499459028244,
0.47310566902160645,
0.03987164422869682,
0.36926552653312683,
-0.3911493420600891,
0.5799819827079773,
-0.6273248195648193,
-0.4250933825969696,
-0.5391272306442261,
-1.0592106580734253,
-0.289033979177475,
1.0895476341247559,
-0.2685021460056305,
0.35972294211387634,
0.6529375910758972,
0.9408169388771057,
-0.3373871147632599,
-0.08481552451848984,
-0.006426180247217417,
0.33059176802635193,
0.1694820076227188,
0.3409632742404938,
0.4370289444923401,
-0.5623814463615417,
0.5668884515762329,
-0.7239097952842712,
-0.3317757844924927,
-0.15242508053779602,
-0.6710477471351624,
-1.203715443611145,
-0.5925785899162292,
-0.4003221392631531,
-0.6702500581741333,
-0.06545615941286087,
1.071260929107666,
0.7661038041114807,
-0.846082866191864,
-0.009333529509603977,
-0.1426219642162323,
-0.23146674036979675,
-0.18864160776138306,
-0.3148438036441803,
0.6837924718856812,
-0.34230920672416687,
-0.7295251488685608,
0.030605999752879143,
-0.2660960257053375,
0.08625718951225281,
-0.10366643220186234,
0.10079725831747055,
-0.4974587857723236,
-0.10090566426515579,
0.3962801396846771,
-0.09434445202350616,
-0.46292126178741455,
-0.28412380814552307,
-0.14511379599571228,
-0.2731302082538605,
0.08735217899084091,
0.18724092841148376,
-0.6602454781532288,
0.49810099601745605,
0.16280409693717957,
0.697891891002655,
1.1278623342514038,
0.37089237570762634,
0.02394264191389084,
-0.9675323367118835,
0.3345189094543457,
0.10892296582460403,
0.5301964282989502,
0.8019158244132996,
-0.6138593554496765,
0.6361117959022522,
0.4521442651748657,
-0.6337913870811462,
-0.6541235446929932,
0.11614582687616348,
-1.3809916973114014,
0.05710779130458832,
1.1593879461288452,
-0.32539045810699463,
-0.31352201104164124,
0.15136225521564484,
-0.17994080483913422,
0.7600257992744446,
-0.5530946254730225,
0.8241161108016968,
0.5367773175239563,
-0.10917723923921585,
-0.3898099958896637,
-0.33689558506011963,
0.20567770302295685,
0.40254417061805725,
-0.29589447379112244,
-0.0734049454331398,
0.3039657473564148,
0.3969019651412964,
0.10149246454238892,
0.6903737187385559,
-0.16499833762645721,
0.12835152447223663,
-0.12103275209665298,
0.18602868914604187,
-0.19461378455162048,
0.09561900049448013,
-0.2014005333185196,
-0.03288911283016205,
-0.48613500595092773,
-0.19505611062049866
] |
YituTech/conv-bert-base | YituTech | "2021-02-24T11:26:14Z" | 1,875,685 | 5 | transformers | [
"transformers",
"pytorch",
"tf",
"convbert",
"feature-extraction",
"endpoints_compatible",
"has_space",
"region:us"
] | feature-extraction | "2022-03-02T23:29:05Z" | Entry not found | [
-0.3227650225162506,
-0.22568431496620178,
0.862226128578186,
0.43461495637893677,
-0.5282987952232361,
0.7012965679168701,
0.7915717363357544,
0.07618638128042221,
0.7746025919914246,
0.2563219666481018,
-0.7852817177772522,
-0.22573819756507874,
-0.9104480743408203,
0.5715669393539429,
-0.3992334008216858,
0.5791245698928833,
-0.14494505524635315,
-0.10751161724328995,
0.28233757615089417,
-0.2768954336643219,
-0.5409224033355713,
-0.36855220794677734,
-1.1902776956558228,
0.061491113156080246,
0.5316578149795532,
0.7435142397880554,
0.7584060430526733,
0.3652167320251465,
0.6432578563690186,
0.3932291269302368,
-0.23138920962810516,
0.4827055037021637,
-0.04171813279390335,
0.00260411505587399,
-0.3524433970451355,
-0.5516898036003113,
-0.28596609830856323,
0.07584730535745621,
1.0961304903030396,
0.966687798500061,
-0.284663587808609,
0.05330817773938179,
-0.3063621520996094,
0.33088892698287964,
-0.49734312295913696,
0.3054099678993225,
-0.022506045177578926,
0.16318801045417786,
-0.7041513919830322,
-0.5535354018211365,
0.012794834561645985,
-0.7361212968826294,
0.17926570773124695,
-0.690081000328064,
0.8269098401069641,
0.18583157658576965,
1.1533750295639038,
0.14819414913654327,
-0.462487131357193,
-0.8161764144897461,
-0.6538989543914795,
0.5711171627044678,
-0.32703715562820435,
0.39680248498916626,
0.7028235197067261,
-0.048573412001132965,
-0.9820332527160645,
-0.6745741367340088,
-0.46466192603111267,
0.2923962473869324,
0.35402774810791016,
-0.3411678075790405,
-0.17522086203098297,
-0.3058989644050598,
0.15792037546634674,
0.12811517715454102,
-0.4841994643211365,
-0.5543919205665588,
-0.5475160479545593,
-0.3960252106189728,
0.6206658482551575,
0.3482950031757355,
0.2429177463054657,
-0.1888415813446045,
-0.3228583335876465,
0.0880163162946701,
-0.4160851538181305,
0.3402571678161621,
0.6335517168045044,
0.7114017009735107,
-0.5811444520950317,
0.560215950012207,
-0.04927587881684303,
0.7439703941345215,
0.11445561796426773,
-0.27478092908859253,
0.41460567712783813,
-0.14724725484848022,
0.055171746760606766,
0.4226345121860504,
0.31524422764778137,
0.2841312289237976,
-0.3273695111274719,
0.2032228708267212,
-0.3215144872665405,
-0.30496224761009216,
-0.22332167625427246,
-0.29490774869918823,
-0.3592180609703064,
0.5492289066314697,
-0.3314017057418823,
-0.42855486273765564,
1.143175721168518,
-0.4200771450996399,
-0.7302224040031433,
0.33156412839889526,
0.4065209925174713,
-0.0994480773806572,
-0.37146568298339844,
-0.052260834723711014,
-0.8458789587020874,
-0.007907390594482422,
0.7491172552108765,
-0.7198970913887024,
0.3371737599372864,
0.4728063642978668,
0.7417217493057251,
0.19650575518608093,
-0.14034469425678253,
-0.42949390411376953,
0.2971969544887543,
-0.8659994006156921,
0.6320174336433411,
-0.20135220885276794,
-1.0051977634429932,
0.11150479316711426,
0.8971705436706543,
-0.37896400690078735,
-1.2094876766204834,
1.0605159997940063,
-0.6887932419776917,
0.16017857193946838,
-0.676761269569397,
-0.14661237597465515,
-0.07118501514196396,
-0.005096632521599531,
-0.6088156700134277,
0.7567102313041687,
0.587267279624939,
-0.4995276927947998,
0.21429483592510223,
-0.26029831171035767,
-0.39151400327682495,
0.38824859261512756,
-0.07935450226068497,
-0.21858926117420197,
0.713833212852478,
-0.6647079586982727,
-0.26932814717292786,
0.2942774295806885,
0.2368936538696289,
-0.35706108808517456,
-0.7931919097900391,
0.08478113263845444,
-0.05786270648241043,
1.550750494003296,
-0.03868847340345383,
-0.3586106300354004,
-0.679383397102356,
-1.1506240367889404,
-0.07070787996053696,
0.6886883974075317,
-0.9194989204406738,
-0.27839475870132446,
-0.046410128474235535,
-0.26169314980506897,
0.08994917571544647,
0.7390589714050293,
-1.1194051504135132,
0.2832726836204529,
-0.05092663690447807,
-0.22794683277606964,
0.8271058797836304,
0.15387225151062012,
0.24758946895599365,
0.14913396537303925,
0.42958706617355347,
0.527725338935852,
0.11115207523107529,
0.683587908744812,
-0.34720373153686523,
-0.9694353938102722,
0.6154631972312927,
0.25266361236572266,
0.8121447563171387,
-0.49945297837257385,
0.2685093879699707,
0.27025535702705383,
-0.3409680724143982,
-0.5682371854782104,
-0.3102838397026062,
0.09025752544403076,
0.14930562674999237,
0.11142510175704956,
-0.5721710324287415,
-0.6576125025749207,
-0.9689140319824219,
-0.13590654730796814,
-0.4314374029636383,
-0.3571570813655853,
0.21006910502910614,
0.5792906284332275,
-1.1975523233413696,
0.4128875136375427,
-0.7705625891685486,
-0.7038741111755371,
-0.01065548975020647,
-0.19338123500347137,
0.7540656328201294,
0.43240174651145935,
0.5033966898918152,
-0.6397148370742798,
-0.5661987066268921,
-0.22470176219940186,
-1.0333747863769531,
-0.13280506432056427,
0.24819621443748474,
0.3065737783908844,
-0.13423344492912292,
-0.2744963765144348,
-0.48740333318710327,
0.8100387454032898,
0.14789170026779175,
-0.5391897559165955,
0.5220767259597778,
-0.3020317256450653,
0.17224803566932678,
-0.6369150280952454,
-0.06916818022727966,
-0.661676287651062,
-0.0009071884560398757,
-0.3608308732509613,
-0.5737438797950745,
0.14772287011146545,
0.07017494738101959,
-0.16065457463264465,
0.28808408975601196,
-0.909277081489563,
-0.0010852962732315063,
-0.7442210912704468,
0.379071980714798,
0.06394772231578827,
-0.3145078718662262,
-0.017517540603876114,
1.0000386238098145,
0.7784460783004761,
-0.3848048746585846,
0.721744179725647,
0.4440041184425354,
0.19036155939102173,
0.7630521059036255,
-0.18725109100341797,
0.16478213667869568,
-0.5245416760444641,
-0.12161104381084442,
-0.8887597918510437,
-1.0982946157455444,
0.7320570349693298,
-0.6114250421524048,
0.36542922258377075,
-0.4277869760990143,
0.2589159905910492,
-0.6919258832931519,
-0.03885362669825554,
0.4808599352836609,
-0.05936325341463089,
-0.6863942742347717,
0.5232570171356201,
0.45317530632019043,
-0.2019241601228714,
-0.6609031558036804,
-0.530157208442688,
0.39365822076797485,
0.6154114007949829,
-0.16390392184257507,
0.06878514587879181,
0.14941060543060303,
-0.5441926121711731,
-0.040802597999572754,
-0.38691970705986023,
-0.45766758918762207,
0.054224006831645966,
0.13053473830223083,
-0.005750799085944891,
-0.404820054769516,
-0.0868026465177536,
-0.35842007398605347,
-0.4656120240688324,
0.21876516938209534,
0.3011947274208069,
-0.04096309468150139,
-0.42599788308143616,
-0.3619818687438965,
-0.888181209564209,
0.6719610095024109,
0.5370282530784607,
0.05281545966863632,
0.7555549740791321,
0.16819314658641815,
-0.8014987707138062,
-0.13532210886478424,
-0.1760706603527069,
0.2696830928325653,
-0.5588056445121765,
0.13849826157093048,
-0.013484534807503223,
-0.0637492910027504,
0.26297882199287415,
0.25386232137680054,
-0.4300556778907776,
0.9276250004768372,
-0.2615274488925934,
-0.3592521846294403,
0.7960181832313538,
0.5974742770195007,
0.49583131074905396,
0.16503219306468964,
-0.044541798532009125,
0.900709331035614,
-1.1966516971588135,
-0.6563175916671753,
-0.7409549355506897,
-0.15945707261562347,
-0.43510833382606506,
-0.032105933874845505,
0.6254412531852722,
0.2900990843772888,
-0.1333388388156891,
0.4756395220756531,
-0.5243489742279053,
0.3556033670902252,
1.01198410987854,
0.35748639702796936,
0.3435698449611664,
-0.7570229172706604,
-0.2515777349472046,
-0.1402427852153778,
-0.9998157620429993,
-0.2631377875804901,
0.8871029019355774,
0.22752606868743896,
0.844460666179657,
0.5992541313171387,
0.6784542798995972,
0.1367226243019104,
0.2523828148841858,
-0.30590319633483887,
0.3920294940471649,
0.4376082420349121,
-1.0401138067245483,
-0.42758408188819885,
0.021418681368231773,
-0.9703338742256165,
-0.14227519929409027,
-0.03495011106133461,
-0.42617112398147583,
0.7681737542152405,
0.00016589462757110596,
-0.4076709747314453,
0.7732734084129333,
-0.455583393573761,
0.7562873363494873,
-0.4473648965358734,
-0.02663906291127205,
0.4699096083641052,
-0.7070636749267578,
0.4677430987358093,
0.12878790497779846,
0.6205843091011047,
-0.015572631731629372,
-0.04078587517142296,
0.7104941606521606,
-0.9129160046577454,
0.25438642501831055,
-0.6348397135734558,
0.22421300411224365,
0.24246945977210999,
0.51606285572052,
0.5969953536987305,
0.4371243417263031,
0.10119888931512833,
-0.23920902609825134,
0.04115807265043259,
-0.8241125345230103,
-0.210506409406662,
0.697515606880188,
-0.7186890840530396,
-0.6864197850227356,
-1.2355337142944336,
0.14438660442829132,
0.27347055077552795,
0.389305055141449,
0.7959296107292175,
0.571408748626709,
0.1289544403553009,
0.680525004863739,
0.9888588190078735,
-0.0688566341996193,
0.9166924357414246,
0.3224477171897888,
0.09175168722867966,
-0.21944808959960938,
0.7036820650100708,
0.26627904176712036,
-0.24707956612110138,
-0.11939732730388641,
0.20913465321063995,
-0.11069409549236298,
-0.591761589050293,
-0.49990686774253845,
0.3701757788658142,
-0.6731787919998169,
-0.18303893506526947,
-0.6243735551834106,
-0.6043769717216492,
-0.511759340763092,
0.06927360594272614,
-0.7147687673568726,
0.23979046940803528,
-0.7753565907478333,
-0.10574902594089508,
0.04323432594537735,
0.9792009592056274,
-0.589311957359314,
0.5805224180221558,
-1.1218582391738892,
0.19345788657665253,
-0.07949887961149216,
0.7921058535575867,
0.21395787596702576,
-0.7344395518302917,
-0.3975418508052826,
-0.11592631042003632,
-0.3729911744594574,
-1.3576762676239014,
0.21404948830604553,
-0.2454141080379486,
0.23094046115875244,
0.6145404577255249,
0.1397707313299179,
0.5258248448371887,
-0.34326282143592834,
0.7029101848602295,
-0.057017259299755096,
-0.7069286704063416,
0.7934495210647583,
-0.5026894807815552,
0.4963534474372864,
0.9765996932983398,
0.5333835482597351,
-0.7984007596969604,
0.035741209983825684,
-1.041123390197754,
-0.6008695363998413,
0.38426393270492554,
0.11928944289684296,
-0.03601083159446716,
-0.6659559011459351,
-0.054019637405872345,
-0.16143807768821716,
0.6043745279312134,
-1.039069414138794,
-0.7858356237411499,
0.2576698362827301,
0.5277302861213684,
0.0816856250166893,
-0.5653398633003235,
0.20880667865276337,
-0.544416069984436,
1.0657774209976196,
0.45109400153160095,
0.3274499475955963,
0.8406060934066772,
0.46492424607276917,
-0.3823164403438568,
0.09252490103244781,
0.7662695050239563,
0.6666232347488403,
-0.5239797830581665,
-0.2908027470111847,
-0.08827541768550873,
-0.9143403768539429,
0.05927472561597824,
0.11168918758630753,
-0.013455932028591633,
0.9082110524177551,
0.5793083310127258,
0.2539709210395813,
0.4514279365539551,
-0.726460337638855,
0.8859451413154602,
-0.14954176545143127,
-0.12472866475582123,
-1.0677239894866943,
0.1948619782924652,
-0.23984959721565247,
0.5006402134895325,
1.0061326026916504,
0.5250048041343689,
-0.047630298882722855,
-0.8143380880355835,
-0.01473585981875658,
0.6939172148704529,
-0.7091123461723328,
-0.17449834942817688,
0.944853663444519,
0.3847099542617798,
-1.2953051328659058,
1.106776475906372,
-0.5381771326065063,
-0.560332179069519,
0.9121301770210266,
0.522956907749176,
1.1221847534179688,
-0.44204121828079224,
0.0008676342549733818,
0.2662237286567688,
0.41378432512283325,
0.5423170328140259,
1.0869629383087158,
0.431413471698761,
-0.7931063771247864,
0.8826584815979004,
-0.24776044487953186,
-0.40361151099205017,
-0.05347571521997452,
-0.42859897017478943,
0.16892178356647491,
-0.4406192898750305,
-0.10713007301092148,
-0.3444187641143799,
0.28543180227279663,
-0.7072042226791382,
0.42807620763778687,
-0.0838567465543747,
0.8653068542480469,
-0.8553727269172668,
0.47207626700401306,
0.635470449924469,
-0.3337355852127075,
-0.8508191108703613,
-0.26198428869247437,
-0.11448462307453156,
-0.6389466524124146,
0.30214807391166687,
-0.4554102420806885,
0.044398851692676544,
0.09623463451862335,
-0.649151623249054,
-1.1778275966644287,
0.9093633890151978,
-0.639612078666687,
-0.2784462869167328,
0.20464053750038147,
-0.11514760553836823,
0.28811705112457275,
-0.2524643540382385,
0.010661216452717781,
0.41876548528671265,
0.748940110206604,
0.2844654619693756,
-0.7727053761482239,
-0.3694884479045868,
0.0015032943338155746,
-0.44474777579307556,
0.7582978010177612,
-0.6002101898193359,
1.1840779781341553,
-0.5563543438911438,
-0.059654366225004196,
0.44384512305259705,
0.24690914154052734,
0.21076197922229767,
0.6629220843315125,
0.1442081481218338,
0.7282265424728394,
1.07012140750885,
-0.40835219621658325,
0.8811809420585632,
0.26432839035987854,
0.47430819272994995,
0.7238501906394958,
-0.6487724781036377,
0.7513749003410339,
0.31810489296913147,
-0.5682924389839172,
0.9228013753890991,
1.2906063795089722,
-0.15699204802513123,
0.8079374432563782,
0.05136508867144585,
-1.081600546836853,
0.325833261013031,
-0.20724765956401825,
-0.7530064582824707,
0.3150254189968109,
0.19055864214897156,
-0.6920982599258423,
-0.5770308971405029,
-0.24046507477760315,
-0.35662803053855896,
-0.11552901566028595,
-0.7631728649139404,
0.6720563769340515,
-0.016969164833426476,
-0.5103683471679688,
0.18857547640800476,
0.2877499461174011,
0.17368432879447937,
-0.5235732793807983,
-0.02939440682530403,
-0.22823619842529297,
0.2660655975341797,
-0.5670853853225708,
-0.5234526991844177,
0.5724433064460754,
-0.32430219650268555,
-0.5343255400657654,
0.18147465586662292,
0.763587236404419,
-0.16923809051513672,
-0.4515409469604492,
0.32472723722457886,
0.6959525346755981,
0.1665852814912796,
0.4250282347202301,
-0.23511263728141785,
0.24480605125427246,
-0.08044824004173279,
-0.06651552021503448,
0.27714768052101135,
0.3449169099330902,
0.22435641288757324,
0.4450142979621887,
0.43285664916038513,
-0.01808755099773407,
-0.10736498981714249,
-0.382819801568985,
0.4124940037727356,
-0.9542785882949829,
-0.5713282823562622,
-0.6307113766670227,
0.2740660607814789,
-0.02315417304635048,
-1.0836423635482788,
0.4145168364048004,
1.4406683444976807,
1.0359982252120972,
-0.4756383001804352,
1.067226529121399,
-0.21818485856056213,
0.9594791531562805,
0.41483086347579956,
0.5420440435409546,
-0.6030411720275879,
0.03835370019078255,
-0.4364396035671234,
-1.076962947845459,
-0.35716333985328674,
0.4539391100406647,
-0.022899555042386055,
-0.3429867625236511,
0.872571587562561,
0.5887166261672974,
-0.33473607897758484,
-0.11728022992610931,
0.048487238585948944,
-0.029941488057374954,
-0.12433847039937973,
0.5145376324653625,
0.7648399472236633,
-0.9344304800033569,
-0.10680416971445084,
-0.21577754616737366,
-0.6382725834846497,
-0.5047279000282288,
-0.9632009267807007,
-0.12959396839141846,
-0.16037796437740326,
0.035343267023563385,
-0.5662806630134583,
0.00255737011320889,
1.208324909210205,
0.5684957504272461,
-1.1113994121551514,
-0.5303789377212524,
0.3371853232383728,
0.3920421898365021,
-0.1874791383743286,
-0.24202413856983185,
0.2984568774700165,
0.15382249653339386,
-0.5908876657485962,
0.6875665783882141,
0.8089625239372253,
0.208888977766037,
0.19554761052131653,
0.15893013775348663,
-0.8229473829269409,
-0.14913435280323029,
0.17440445721149445,
0.9450570344924927,
-0.939853310585022,
-0.7114843130111694,
-0.03168516233563423,
-0.27094873785972595,
-0.05765746906399727,
0.17102102935314178,
-0.4046344757080078,
0.5180677175521851,
0.34591493010520935,
0.49933457374572754,
0.0561608150601387,
-0.054746925830841064,
0.5409556031227112,
-0.9069057703018188,
0.09425963461399078,
0.4134361147880554,
0.4154115319252014,
-0.4000864028930664,
-0.5910194516181946,
0.6713420748710632,
1.0073972940444946,
-0.6594868898391724,
-0.8743268847465515,
-0.19846712052822113,
-1.0016002655029297,
0.04189709946513176,
0.6762762069702148,
0.5009527802467346,
-0.4806513786315918,
-0.4174500107765198,
-0.5617399215698242,
-0.1254672110080719,
-0.1369970738887787,
0.7621601819992065,
1.179680585861206,
-0.7432094812393188,
0.07975747436285019,
-1.038639783859253,
0.6594986915588379,
-0.2419457733631134,
-0.3457581698894501,
-0.48644304275512695,
0.3832802176475525,
0.35236993432044983,
0.440481036901474,
0.614812433719635,
0.1408471167087555,
0.8338426351547241,
0.3126053214073181,
-0.1702686995267868,
0.2698982357978821,
-0.4559200704097748,
-0.028932858258485794,
-0.057962555438280106,
0.31015971302986145,
-1.0262157917022705
] |
google/fnet-base | google | "2021-10-31T07:33:21Z" | 1,855,293 | 13 | transformers | [
"transformers",
"pytorch",
"rust",
"fnet",
"pretraining",
"en",
"dataset:c4",
"arxiv:2105.03824",
"license:apache-2.0",
"endpoints_compatible",
"region:us"
] | null | "2022-03-02T23:29:05Z" | ---
language: en
tags:
- fnet
license: apache-2.0
datasets:
- c4
---
# FNet base model
Pretrained model on English language using a masked language modeling (MLM) and next sentence prediction (NSP) objective. It was
introduced in [this paper](https://arxiv.org/abs/2105.03824) and first released in [this repository](https://github.com/google-research/google-research/tree/master/f_net).
This model is cased: it makes a difference between english and English. The model achieves 0.58 accuracy on MLM objective and 0.80 on NSP objective.
Disclaimer: This model card has been written by [gchhablani](https://huggingface.co/gchhablani).
## Model description
FNet is a transformers model with attention replaced with fourier transforms. Hence, the inputs do not contain an `attention_mask`. It is pretrained on a large corpus of
English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling
them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and
labels from those texts. More precisely, it was pretrained with two objectives:
- Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run
the entire masked sentence through the model and has to predict the masked words. This is different from traditional
recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like
GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the
sentence.
- Next sentence prediction (NSP): the models concatenates two masked sentences as inputs during pretraining. Sometimes
they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to
predict if the two sentences were following each other or not.
This way, the model learns an inner representation of the English language that can then be used to extract features
useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard
classifier using the features produced by the FNet model as inputs.
## Intended uses & limitations
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=fnet) to look for
fine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
generation you should look at model like GPT2.
## Training data
The FNet model was pretrained on [C4](https://huggingface.co/datasets/c4), a cleaned version of the Common Crawl dataset.
## Training procedure
### Preprocessing
The texts are lowercased and tokenized using SentencePiece and a vocabulary size of 32,000. The inputs of the model are
then of the form:
```
[CLS] Sentence A [SEP] Sentence B [SEP]
```
With probability 0.5, sentence A and sentence B correspond to two consecutive sentences in the original corpus and in
the other cases, it's another random sentence in the corpus. Note that what is considered a sentence here is a
consecutive span of text usually longer than a single sentence. The only constrain is that the result with the two
"sentences" has a combined length of less than 512 tokens.
The details of the masking procedure for each sentence are the following:
- 15% of the tokens are masked.
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
- In the 10% remaining cases, the masked tokens are left as is.
### Pretraining
FNet-base was trained on 4 cloud TPUs in Pod configuration (16 TPU chips total) for one million steps with a batch size
of 256. The sequence length was limited to 512 tokens. The optimizer
used is Adam with a learning rate of 1e-4, \\(\beta_{1} = 0.9\\) and \\(\beta_{2} = 0.999\\), a weight decay of 0.01,
learning rate warmup for 10,000 steps and linear decay of the learning rate after.
## Evaluation results
FNet-base was fine-tuned and evaluated on the validation data of the [GLUE benchamrk](https://huggingface.co/datasets/glue). The results of the official model (written in Flax) can be seen in Table 1 on page 7 of [the official paper](https://arxiv.org/abs/2105.03824).
For comparison, this model (ported to PyTorch) was fine-tuned and evaluated using the [official Hugging Face GLUE evaluation scripts](https://github.com/huggingface/transformers/tree/master/examples/pytorch/text-classification#glue-tasks) alongside [bert-base-cased](https://hf.co/models/bert-base-cased) for comparison.
The training was done on a single 16GB NVIDIA Tesla V100 GPU. For MRPC/WNLI, the models were trained for 5 epochs, while for other tasks, the models were trained for 3 epochs. A sequence length of 512 was used with batch size 16 and learning rate 2e-5.
The following table summarizes the results for [fnet-base](https://huggingface.co/google/fnet-base) (called *FNet (PyTorch) - Reproduced*) and [bert-base-cased](https://hf.co/models/bert-base-cased) (called *Bert (PyTorch) - Reproduced*) in terms of **fine-tuning** speed. The format is *hour:min:seconds*. **Note** that the authors compared **pre-traning** speed in [the official paper](https://arxiv.org/abs/2105.03824) instead.
| Task/Model | FNet-base (PyTorch) |Bert-base (PyTorch)|
|:----:|:-----------:|:----:|
| MNLI-(m/mm) | [06:40:55](https://huggingface.co/gchhablani/fnet-base-finetuned-mnli) | [09:52:33](https://huggingface.co/gchhablani/bert-base-cased-finetuned-mnli)|
| QQP | [06:21:16](https://huggingface.co/gchhablani/fnet-base-finetuned-qqp) | [09:25:01](https://huggingface.co/gchhablani/bert-base-cased-finetuned-qqp) |
| QNLI | [01:48:22](https://huggingface.co/gchhablani/fnet-base-finetuned-qnli) | [02:40:22](https://huggingface.co/gchhablani/bert-base-cased-finetuned-qnli)|
| SST-2 | [01:09:27](https://huggingface.co/gchhablani/fnet-base-finetuned-sst2) | [01:42:17](https://huggingface.co/gchhablani/bert-base-cased-finetuned-sst2)|
| CoLA | [00:09:47](https://huggingface.co/gchhablani/fnet-base-finetuned-cola) | [00:14:20](https://huggingface.co/gchhablani/bert-base-cased-finetuned-cola)|
| STS-B | [00:07:09](https://huggingface.co/gchhablani/fnet-base-finetuned-stsb) | [00:10:24](https://huggingface.co/gchhablani/bert-base-cased-finetuned-stsb)|
| MRPC | [00:07:48](https://huggingface.co/gchhablani/fnet-base-finetuned-mrpc) | [00:11:12](https://huggingface.co/gchhablani/bert-base-cased-finetuned-mrpc)|
| RTE | [00:03:24](https://huggingface.co/gchhablani/fnet-base-finetuned-rte) | [00:04:51](https://huggingface.co/gchhablani/bert-base-cased-finetuned-rte)|
| WNLI | [00:02:37](https://huggingface.co/gchhablani/fnet-base-finetuned-wnli) | [00:03:23](https://huggingface.co/gchhablani/bert-base-cased-finetuned-wnli)|
| SUM | 16:30:45 | 24:23:56 |
On average the PyTorch version of FNet-base requires *ca.* 32% less time for GLUE fine-tuning on GPU.
The following table summarizes the results for [fnet-base](https://huggingface.co/google/fnet-base) (called *FNet (PyTorch) - Reproduced*) and [bert-base-cased](https://hf.co/models/bert-base-cased) (called *Bert (PyTorch) - Reproduced*) in terms of performance and compares it to the reported performance of the official FNet-base model (called *FNet (Flax) - Official*). Note that the training hyperparameters of the reproduced models were not the same as the official model, so the performance may differ significantly for some tasks (for example: CoLA).
| Task/Model | Metric | FNet-base (PyTorch) | Bert-base (PyTorch) | FNet-Base (Flax - official) |
|:----:|:-----------:|:----:|:-----------:|:----:|
| MNLI-(m/mm) | Accuracy or Match/Mismatch | [76.75](https://huggingface.co/gchhablani/fnet-base-finetuned-mnli) | [84.10](https://huggingface.co/gchhablani/bert-base-cased-finetuned-mnli) | 72/73 |
| QQP | mean(Accuracy,F1) | [86.5](https://huggingface.co/gchhablani/fnet-base-finetuned-qqp) | [89.26](https://huggingface.co/gchhablani/bert-base-cased-finetuned-qqp) | 83 |
| QNLI | Accuracy | [84.39](https://huggingface.co/gchhablani/fnet-base-finetuned-qnli) | [90.99](https://huggingface.co/gchhablani/bert-base-cased-finetuned-qnli) | 80 |
| SST-2 | Accuracy | [89.45](https://huggingface.co/gchhablani/fnet-base-finetuned-sst2) | [92.32](https://huggingface.co/gchhablani/bert-base-cased-finetuned-sst2) | 95 |
| CoLA | Matthews corr or Accuracy | [35.94](https://huggingface.co/gchhablani/fnet-base-finetuned-cola) | [59.57](https://huggingface.co/gchhablani/bert-base-cased-finetuned-cola) | 69 |
| STS-B | Spearman corr. | [82.19](https://huggingface.co/gchhablani/fnet-base-finetuned-stsb) | [88.98](https://huggingface.co/gchhablani/bert-base-cased-finetuned-stsb) | 79 |
| MRPC | mean(F1/Accuracy) | [81.15](https://huggingface.co/gchhablani/fnet-base-finetuned-mrpc) | [88.15](https://huggingface.co/gchhablani/bert-base-cased-finetuned-mrpc) | 76 |
| RTE | Accuracy | [62.82](https://huggingface.co/gchhablani/fnet-base-finetuned-rte) | [67.15](https://huggingface.co/gchhablani/bert-base-cased-finetuned-rte) | 63 |
| WNLI | Accuracy | [54.93](https://huggingface.co/gchhablani/fnet-base-finetuned-wnli) | [46.48](https://huggingface.co/gchhablani/bert-base-cased-finetuned-wnli) | - |
| Avg | - | 72.7 | 78.6 | 76.7 |
We can see that FNet-base achieves around 93% of BERT-base's performance on average.
For more details, please refer to the checkpoints linked with the scores. On overview of all fine-tuned checkpoints of the following table can be accessed [here](https://huggingface.co/models?other=fnet-bert-base-comparison).
### How to use
You can use this model directly with a pipeline for masked language modeling:
**Note: The mask filling pipeline doesn't work exactly as the original model performs masking after converting to tokens. In masking pipeline an additional space is added after the [MASK].**
```python
>>> from transformers import FNetForMaskedLM, FNetTokenizer, pipeline
>>> tokenizer = FNetTokenizer.from_pretrained("google/fnet-base")
>>> model = FNetForMaskedLM.from_pretrained("google/fnet-base")
>>> unmasker = pipeline('fill-mask', model=model, tokenizer=tokenizer)
>>> unmasker("Hello I'm a [MASK] model.")
[
{"sequence": "hello i'm a new model.", "score": 0.12073223292827606, "token": 351, "token_str": "new"},
{"sequence": "hello i'm a first model.", "score": 0.08501081168651581, "token": 478, "token_str": "first"},
{"sequence": "hello i'm a next model.", "score": 0.060546260327100754, "token": 1037, "token_str": "next"},
{"sequence": "hello i'm a last model.", "score": 0.038265593349933624, "token": 813, "token_str": "last"},
{"sequence": "hello i'm a sister model.", "score": 0.033868927508592606, "token": 6232, "token_str": "sister"},
]
```
Here is how to use this model to get the features of a given text in PyTorch:
**Note: You must specify the maximum sequence length to be 512 and truncate/pad to the same length because the original model has no attention mask and considers all the hidden states during forward pass.**
```python
from transformers import FNetTokenizer, FNetModel
tokenizer = FNetTokenizer.from_pretrained("google/fnet-base")
model = FNetModel.from_pretrained("google/fnet-base")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt', padding='max_length', truncation=True, max_length=512)
output = model(**encoded_input)
```
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-2105-03824,
author = {James Lee{-}Thorp and
Joshua Ainslie and
Ilya Eckstein and
Santiago Onta{\~{n}}{\'{o}}n},
title = {FNet: Mixing Tokens with Fourier Transforms},
journal = {CoRR},
volume = {abs/2105.03824},
year = {2021},
url = {https://arxiv.org/abs/2105.03824},
archivePrefix = {arXiv},
eprint = {2105.03824},
timestamp = {Fri, 14 May 2021 12:13:30 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2105-03824.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
## Contributions
Thanks to [@gchhablani](https://huggingface.co/gchhablani) for adding this model. | [
-0.4886886179447174,
-0.8374145030975342,
-0.0520111545920372,
0.29622378945350647,
-0.33859559893608093,
-0.1567678600549698,
-0.3271211087703705,
-0.6824376583099365,
0.5576075911521912,
0.1503290981054306,
-0.6475221514701843,
-0.23556941747665405,
-0.5770143270492554,
-0.01530788466334343,
-0.2914707064628601,
1.0832164287567139,
0.032631438225507736,
-0.10207677632570267,
-0.032513801008462906,
-0.004751109518110752,
-0.21441544592380524,
-0.6085760593414307,
-0.6218158006668091,
-0.3326878845691681,
0.5934875011444092,
0.2770805358886719,
0.6488622426986694,
0.47037601470947266,
0.5170661807060242,
0.38486719131469727,
-0.24657203257083893,
-0.055988941341638565,
-0.43334996700286865,
-0.3273164629936218,
0.18601137399673462,
-0.33849626779556274,
-0.6943992972373962,
0.25539281964302063,
0.5586424469947815,
0.5846755504608154,
0.006505274213850498,
0.19163008034229279,
0.21292096376419067,
0.7162883281707764,
-0.35117989778518677,
0.031212450936436653,
-0.40844571590423584,
0.30546969175338745,
-0.19317245483398438,
0.10512746870517731,
-0.395045667886734,
-0.20259405672550201,
0.37039709091186523,
-0.5042604804039001,
0.29022446274757385,
0.13293901085853577,
1.2276867628097534,
0.024493813514709473,
-0.19638362526893616,
-0.08887257426977158,
-0.21464988589286804,
0.7146717309951782,
-0.7084394693374634,
0.43956995010375977,
0.42605629563331604,
0.11337953060865402,
-0.07026055455207825,
-0.8562789559364319,
-0.4567957818508148,
-0.3438127338886261,
-0.19925281405448914,
0.1314346045255661,
-0.32293227314949036,
0.207584410905838,
0.4952211081981659,
0.600993275642395,
-0.6952733397483826,
0.04379570856690407,
-0.4116438031196594,
-0.3794209063053131,
0.7501009702682495,
-0.08363741636276245,
0.24480968713760376,
-0.25562748312950134,
-0.3995330333709717,
-0.1587066650390625,
-0.3542984127998352,
0.17785143852233887,
0.5497497320175171,
0.21532833576202393,
-0.3597429394721985,
0.5052254796028137,
-0.24543778598308563,
0.7604944109916687,
0.2271813154220581,
-0.052123844623565674,
0.5699049830436707,
-0.27914372086524963,
-0.4682091474533081,
-0.12201294302940369,
0.9387457370758057,
0.3028971552848816,
0.4546221196651459,
-0.23568302392959595,
-0.042702607810497284,
-0.04765663295984268,
0.190861776471138,
-0.9839345812797546,
-0.36011144518852234,
0.14478853344917297,
-0.7415437698364258,
-0.2776336967945099,
0.08956802636384964,
-0.43706315755844116,
0.19833135604858398,
-0.28250381350517273,
0.33944451808929443,
-0.601360023021698,
-0.31785669922828674,
0.04645242542028427,
-0.23095585405826569,
0.1357591301202774,
0.23727795481681824,
-0.6797652244567871,
0.20318631827831268,
0.6250183582305908,
1.031579852104187,
-0.0892464891076088,
-0.23447127640247345,
-0.33226728439331055,
-0.5235068798065186,
-0.1428140550851822,
0.29573163390159607,
0.0417209267616272,
0.05235205963253975,
-0.2071942687034607,
0.2599647045135498,
-0.292385458946228,
-0.15547576546669006,
0.33286401629447937,
-0.2678880989551544,
0.31366047263145447,
-0.20697960257530212,
-0.5576258897781372,
-0.2758006453514099,
0.1448446661233902,
-0.5742196440696716,
0.8993534445762634,
0.25800201296806335,
-0.8664830327033997,
0.3152981102466583,
-0.6391226649284363,
-0.3939027786254883,
-0.1880735605955124,
0.2681080102920532,
-0.4330179691314697,
0.02159564197063446,
-0.02429511584341526,
0.76496821641922,
-0.09189873933792114,
0.2287578582763672,
-0.2629110813140869,
-0.4167943000793457,
0.2386234849691391,
-0.2820320129394531,
0.9064918756484985,
0.35808268189430237,
-0.5728484392166138,
-0.06870803982019424,
-0.6456185579299927,
0.1321967989206314,
0.09578686952590942,
-0.18484647572040558,
0.0630674883723259,
-0.26895445585250854,
0.1867140382528305,
0.49429985880851746,
0.17428970336914062,
-0.7175903916358948,
0.18767310678958893,
-0.7590330839157104,
0.5905123949050903,
0.6335383653640747,
-0.2569577991962433,
0.3774019181728363,
-0.5481461882591248,
0.40363427996635437,
0.042299337685108185,
0.18779262900352478,
0.007387643214315176,
-0.7544253468513489,
-0.7732797861099243,
-0.21447454392910004,
0.570134699344635,
0.5607253909111023,
-0.5594905614852905,
0.47620508074760437,
-0.21378986537456512,
-0.5739902853965759,
-0.579304575920105,
0.1362229585647583,
0.6432194709777832,
0.323309063911438,
0.4523436427116394,
-0.39981356263160706,
-0.5694562792778015,
-0.9640353918075562,
-0.08711055666208267,
-0.007195559795945883,
-0.011434203013777733,
0.4263044595718384,
0.6085143089294434,
-0.014840954914689064,
0.6336510181427002,
-0.42264577746391296,
-0.24064384400844574,
-0.1459217369556427,
0.1804513782262802,
0.36976417899131775,
0.6016417741775513,
0.7694244384765625,
-0.7726080417633057,
-0.5704471468925476,
-0.012543602846562862,
-0.7269423007965088,
0.16224399209022522,
-0.025024039670825005,
-0.08569653332233429,
0.6197825074195862,
0.45767614245414734,
-0.6444776058197021,
0.5926463007926941,
0.6141026616096497,
-0.3838965892791748,
0.41321486234664917,
-0.11357556283473969,
0.015765292569994926,
-1.0644642114639282,
0.29122599959373474,
0.01853572018444538,
-0.22144515812397003,
-0.6561918258666992,
0.09282027184963226,
-0.24321205914020538,
0.07094641774892807,
-0.6516088247299194,
0.5897513628005981,
-0.5790643095970154,
-0.05452440306544304,
-0.09097445756196976,
-0.011154457926750183,
-0.24462765455245972,
0.6805837750434875,
0.11578118801116943,
0.7366364002227783,
0.3820970356464386,
-0.23613743484020233,
0.23588383197784424,
0.3782041370868683,
-0.24045313894748688,
0.1522018164396286,
-0.7250177264213562,
0.2143709361553192,
0.10074613988399506,
0.31588566303253174,
-0.9213184714317322,
-0.16439031064510345,
0.35396599769592285,
-0.8168425559997559,
0.41432705521583557,
-0.035792507231235504,
-0.39561548829078674,
-0.6283458471298218,
-0.3179874122142792,
0.1743161827325821,
0.5924165844917297,
-0.34170031547546387,
0.38781315088272095,
0.18678253889083862,
0.12016338855028152,
-0.8007485866546631,
-0.877155601978302,
0.004685221239924431,
-0.10701613128185272,
-0.882961094379425,
0.5436844229698181,
-0.0833478569984436,
0.10498029738664627,
-0.006621695123612881,
-0.09073193371295929,
-0.170828714966774,
0.1682075709104538,
0.46441447734832764,
0.027832606807351112,
-0.5131070613861084,
-0.14314301311969757,
-0.2290923297405243,
0.010298698209226131,
0.026723381131887436,
-0.28444206714630127,
0.657242476940155,
-0.39501601457595825,
0.10041528940200806,
-0.6542914509773254,
0.38424432277679443,
0.3122609257698059,
0.02341044694185257,
0.8375029563903809,
0.9594471454620361,
-0.3864426910877228,
0.06648925691843033,
-0.5595424771308899,
-0.2937079668045044,
-0.49557730555534363,
0.05463169887661934,
-0.46255654096603394,
-1.0358593463897705,
0.4575943350791931,
0.44055789709091187,
-0.02489861659705639,
0.6404061913490295,
0.3487482964992523,
-0.21267227828502655,
0.8109302520751953,
0.4407390058040619,
-0.29928597807884216,
0.6599988341331482,
-0.5071840286254883,
0.10174635052680969,
-0.6407759785652161,
-0.18727561831474304,
-0.25198569893836975,
-0.5732072591781616,
-0.7715365290641785,
-0.3169589638710022,
0.07254631072282791,
0.3486817479133606,
-0.2203960120677948,
0.5308341979980469,
-0.5890998244285583,
0.033585917204618454,
0.7091209292411804,
0.421921044588089,
-0.29327717423439026,
0.09837551414966583,
-0.2637630105018616,
-0.06304691731929779,
-0.9086260795593262,
-0.1582731455564499,
1.0014408826828003,
0.5373644232749939,
0.2200440764427185,
-0.018525436520576477,
0.5664622783660889,
0.2208430916070938,
0.28964534401893616,
-0.56134033203125,
0.6296368837356567,
-0.3951798677444458,
-0.6377336382865906,
-0.17855589091777802,
-0.4082154631614685,
-0.9889368414878845,
0.05026225373148918,
-0.4846496880054474,
-0.9422902464866638,
-0.027905115857720375,
0.19823405146598816,
-0.16218940913677216,
0.32066017389297485,
-0.7654178142547607,
0.8579909801483154,
-0.07922138273715973,
-0.43499454855918884,
-0.026244932785630226,
-1.010267734527588,
0.3174659311771393,
0.19206471741199493,
-0.15295588970184326,
0.024015503004193306,
0.2677462697029114,
0.844158411026001,
-0.702774703502655,
0.7000738978385925,
-0.3204408884048462,
0.28270840644836426,
0.39024806022644043,
-0.24002867937088013,
0.18005496263504028,
-0.15022945404052734,
0.1012732982635498,
0.38972049951553345,
-0.13225433230400085,
-0.48317980766296387,
-0.31558799743652344,
0.5203140377998352,
-0.7479178309440613,
-0.3678472340106964,
-0.47180789709091187,
-0.32845377922058105,
-0.05517108365893364,
0.010759358294308186,
0.6011664271354675,
0.5016666054725647,
-0.043429117649793625,
0.4768657982349396,
0.5340846180915833,
-0.16984203457832336,
0.576076865196228,
0.012583927251398563,
0.017664777114987373,
-0.3581918776035309,
0.7187106013298035,
0.125252366065979,
0.19488047063350677,
0.5114360451698303,
0.20982562005519867,
-0.28551140427589417,
-0.4912167191505432,
-0.25244951248168945,
0.3378695845603943,
-0.24974943697452545,
-0.37673285603523254,
-0.9022561311721802,
-0.530990719795227,
-0.5039278268814087,
-0.196366548538208,
-0.23587706685066223,
-0.524070680141449,
-0.4039081633090973,
-0.0560881644487381,
0.6538987159729004,
0.41093066334724426,
-0.18052029609680176,
0.42576271295547485,
-0.727786660194397,
0.20555219054222107,
0.12134843319654465,
0.3060383200645447,
-0.05470087751746178,
-0.5711807608604431,
-0.17414239048957825,
0.2730914056301117,
-0.23250390589237213,
-0.6936424374580383,
0.25490033626556396,
0.3480253517627716,
0.548297107219696,
0.24823838472366333,
-0.28761544823646545,
0.5434744358062744,
-0.3732730448246002,
0.8954683542251587,
0.3389388918876648,
-0.8775110244750977,
0.5039564967155457,
-0.46075230836868286,
0.19714218378067017,
0.3969097435474396,
0.4848734736442566,
-0.35719937086105347,
-0.2903274893760681,
-0.8455473780632019,
-0.8545534014701843,
0.7173990607261658,
0.34895646572113037,
0.02918008528649807,
0.04179367795586586,
0.4824756681919098,
-0.18883484601974487,
0.3072414696216583,
-0.666412353515625,
-0.43174880743026733,
-0.3332603871822357,
-0.10830417275428772,
-0.3439022898674011,
-0.27727869153022766,
0.29906395077705383,
-0.5400673151016235,
0.6593314409255981,
-0.055126845836639404,
0.8766433596611023,
0.3320120871067047,
-0.28950104117393494,
0.19675904512405396,
-0.1260671317577362,
0.915574312210083,
0.31404685974121094,
-0.4096723198890686,
-0.31394246220588684,
0.14050330221652985,
-0.8053930997848511,
-0.06458835303783417,
0.32413163781166077,
-0.04493236914277077,
0.15951353311538696,
0.5154693126678467,
1.1020509004592896,
0.20921017229557037,
-0.2660372257232666,
0.7064672708511353,
-0.008824717253446579,
-0.5189579129219055,
-0.14370593428611755,
0.0660582035779953,
0.12359349429607391,
0.23160973191261292,
0.150926411151886,
0.12065140902996063,
0.019056277349591255,
-0.49310997128486633,
0.6221433877944946,
0.28661686182022095,
-0.43502098321914673,
-0.3263101875782013,
0.7117127776145935,
0.09657278656959534,
-0.23232825100421906,
0.6611343026161194,
-0.16301365196704865,
-0.6662104725837708,
0.6953613758087158,
0.3884565234184265,
0.8292454481124878,
-0.36486807465553284,
0.28269320726394653,
0.5061337947845459,
0.23121632635593414,
-0.0012754576746374369,
0.3258335292339325,
0.052656836807727814,
-0.7107596397399902,
-0.444659024477005,
-0.7035599946975708,
-0.07478353381156921,
0.2845185697078705,
-0.569940447807312,
0.030675560235977173,
-0.5155157446861267,
-0.27738848328590393,
0.23424457013607025,
0.3495018780231476,
-0.7749204635620117,
0.460866242647171,
0.05604974552989006,
1.2290302515029907,
-0.806992769241333,
0.8473480343818665,
0.6387666463851929,
-0.27929624915122986,
-0.8694862723350525,
-0.21934960782527924,
-0.04009325057268143,
-0.6665284037590027,
0.663299560546875,
0.266755074262619,
0.12655504047870636,
-0.08023744076490402,
-0.4033249616622925,
-0.5530930757522583,
1.0796698331832886,
0.2064972072839737,
-0.47933945059776306,
-0.18675169348716736,
0.06579791009426117,
0.6692983508110046,
-0.4214203655719757,
0.4125511050224304,
0.46828049421310425,
0.2921558916568756,
0.014858572743833065,
-1.017641305923462,
0.1341458410024643,
-0.5672357082366943,
-0.05923743173480034,
0.1899925321340561,
-0.827744722366333,
1.103913426399231,
0.07959401607513428,
0.07359824329614639,
0.09967393428087234,
0.7028418183326721,
0.02510073594748974,
0.19676780700683594,
0.5172889828681946,
0.6607701778411865,
0.46874043345451355,
-0.32863160967826843,
1.1181795597076416,
-0.18039925396442413,
0.3661386966705322,
0.7087308168411255,
0.3491966724395752,
0.8866689205169678,
0.36202263832092285,
-0.1848866492509842,
0.3059196174144745,
0.7494086623191833,
-0.001996171660721302,
0.42284858226776123,
0.3641450107097626,
0.07066253572702408,
-0.04021250456571579,
-0.009730145335197449,
-0.44668087363243103,
0.5743271708488464,
0.25311368703842163,
-0.445229709148407,
0.04682603105902672,
0.19616419076919556,
0.2744646966457367,
-0.18774153292179108,
-0.21522898972034454,
0.6416357159614563,
0.12766771018505096,
-0.7017830014228821,
0.7334586381912231,
-0.09458017349243164,
0.9803674221038818,
-0.4524850845336914,
0.20106424391269684,
-0.25640568137168884,
0.17337863147258759,
-0.15099599957466125,
-0.6550624370574951,
0.4753838777542114,
-0.17342299222946167,
-0.2461625635623932,
-0.4044744670391083,
0.7870998978614807,
-0.3259037733078003,
-0.3520638942718506,
0.3645052909851074,
0.3735817074775696,
0.31706756353378296,
-0.21166934072971344,
-1.0272059440612793,
0.058242931962013245,
0.16871055960655212,
-0.4280078411102295,
0.39229723811149597,
0.07290452718734741,
0.02410394698381424,
0.540984570980072,
0.6305872201919556,
0.04218723252415657,
0.11827298998832703,
-0.2694534361362457,
0.7064325213432312,
-0.5380234718322754,
-0.46188876032829285,
-0.5387780070304871,
0.5320725440979004,
-0.23439228534698486,
-0.6069140434265137,
0.6078979969024658,
0.5106245279312134,
0.7734972834587097,
-0.08611799776554108,
0.38291388750076294,
-0.2951503098011017,
0.419319748878479,
-0.7639207243919373,
0.6962721347808838,
-0.7714872360229492,
-0.30810546875,
-0.5058733820915222,
-0.762176513671875,
-0.21084190905094147,
0.8528629541397095,
-0.07919639348983765,
0.09780941903591156,
0.6146776676177979,
0.6511061787605286,
-0.20172558724880219,
0.08097213506698608,
0.07795436680316925,
0.19799216091632843,
-0.04266302287578583,
0.791670560836792,
0.5704078674316406,
-0.7778916954994202,
0.2979586720466614,
-0.5032892823219299,
-0.044114481657743454,
-0.4813600778579712,
-1.0161612033843994,
-1.101164698600769,
-0.8674398064613342,
-0.45381975173950195,
-0.48651978373527527,
0.03850555419921875,
0.8812128901481628,
0.917496919631958,
-0.7592670917510986,
-0.13873246312141418,
-0.0656944289803505,
-0.08061783015727997,
-0.2672713100910187,
-0.2670188248157501,
0.40301910042762756,
-0.07644255459308624,
-0.5646554231643677,
0.14193148910999298,
-0.07927840203046799,
0.14579449594020844,
0.13166014850139618,
-0.03541596233844757,
-0.595706582069397,
-0.09835509955883026,
0.5850308537483215,
0.2830953896045685,
-0.6267836093902588,
-0.48001471161842346,
0.2922718822956085,
-0.13115592300891876,
0.11536730825901031,
0.5587838292121887,
-0.48343560099601746,
0.09189659357070923,
0.6634845733642578,
0.481947124004364,
0.9004188776016235,
0.0778813585639,
0.41771361231803894,
-0.8119737505912781,
0.4263211786746979,
0.12605762481689453,
0.3404487371444702,
0.2133532017469406,
-0.43377456068992615,
0.6869206428527832,
0.3987118899822235,
-0.5397599339485168,
-0.7676838040351868,
-0.06608859449625015,
-1.157772183418274,
-0.1190885677933693,
1.059500813484192,
-0.3299815058708191,
-0.32537075877189636,
0.2877189517021179,
-0.1449040025472641,
0.34972628951072693,
-0.2072378545999527,
0.3940754234790802,
0.6895450949668884,
-0.018723521381616592,
-0.18356351554393768,
-0.6496060490608215,
0.6591489911079407,
0.45496082305908203,
-0.4987454116344452,
-0.4067203104496002,
0.34007444977760315,
0.3930684030056,
0.30811598896980286,
0.7542964220046997,
0.17364653944969177,
0.1915200799703598,
-0.027649998664855957,
-0.091436967253685,
-0.2167077660560608,
-0.32938918471336365,
-0.2608014941215515,
0.11084070056676865,
-0.4553816616535187,
-0.5016396045684814
] |
openai/clip-vit-large-patch14-336 | openai | "2022-10-04T09:41:39Z" | 1,841,237 | 66 | transformers | [
"transformers",
"pytorch",
"tf",
"clip",
"zero-shot-image-classification",
"generated_from_keras_callback",
"endpoints_compatible",
"has_space",
"region:us"
] | zero-shot-image-classification | "2022-04-22T14:57:43Z" | ---
tags:
- generated_from_keras_callback
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
candidate_labels: playing music, playing sports
example_title: Cat & Dog
model-index:
- name: clip-vit-large-patch14-336
results: []
---
<!-- This model card has been generated automatically according to the information Keras had access to. You should
probably proofread and complete it, then remove this comment. -->
# clip-vit-large-patch14-336
This model was trained from scratch on an unknown dataset.
It achieves the following results on the evaluation set:
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- optimizer: None
- training_precision: float32
### Training results
### Framework versions
- Transformers 4.21.3
- TensorFlow 2.8.2
- Tokenizers 0.12.1
| [
-0.5086750388145447,
-0.5448575615882874,
0.43512871861457825,
0.0329984575510025,
-0.5834593176841736,
-0.41330331563949585,
0.0019670112524181604,
-0.31098926067352295,
0.1490759551525116,
0.4989697337150574,
-0.6617173552513123,
-0.4851478934288025,
-0.8483626246452332,
-0.23916728794574738,
-0.43113064765930176,
1.0777547359466553,
0.2024850696325302,
0.46292126178741455,
-0.17964643239974976,
-0.08372318744659424,
-0.46605873107910156,
-0.6319332718849182,
-0.9749789834022522,
-0.6273288726806641,
0.4324544370174408,
0.17233042418956757,
0.689662754535675,
1.1342765092849731,
0.7464509606361389,
0.39076465368270874,
-0.2518552839756012,
-0.24088287353515625,
-0.5455307364463806,
-0.58294278383255,
-0.12077860534191132,
-0.4522298276424408,
-0.6642246246337891,
0.05312278866767883,
0.8657711744308472,
0.33962351083755493,
-0.2510058879852295,
0.5020017623901367,
-0.1140521764755249,
0.24004167318344116,
-0.6113488078117371,
0.19553567469120026,
-0.6185851693153381,
0.5737866163253784,
-0.16385804116725922,
-0.13740450143814087,
-0.23058517277240753,
-0.1745639592409134,
0.05260045826435089,
-0.6147608160972595,
0.5273250937461853,
-0.20427413284778595,
1.2193207740783691,
0.2874630093574524,
-0.07548397779464722,
-0.006972202565521002,
-0.8428708910942078,
0.5502256751060486,
-0.7433384656906128,
0.2141042947769165,
0.3998308777809143,
0.668708324432373,
0.10061699897050858,
-1.0656055212020874,
-0.4431252181529999,
-0.07561524957418442,
0.26291829347610474,
0.10997723042964935,
-0.3300859034061432,
-0.10689252614974976,
0.6532251238822937,
0.5290732383728027,
-0.03794742748141289,
0.35930734872817993,
-0.8260144591331482,
-0.23794974386692047,
0.6625521779060364,
0.4999777674674988,
-0.2701282501220703,
-0.2763545513153076,
-0.5085153579711914,
-0.500145435333252,
-0.2788882851600647,
0.0015237589832395315,
0.7037696838378906,
0.15983088314533234,
-0.23124444484710693,
0.8753301501274109,
-0.14034663140773773,
0.5290855765342712,
0.030497759580612183,
0.11992795765399933,
0.4580172598361969,
0.1787429004907608,
-0.6041083335876465,
-0.024715865030884743,
0.8995606899261475,
0.5694435238838196,
0.08842571824789047,
0.10423566401004791,
-0.47474589943885803,
-0.18097342550754547,
0.49065980315208435,
-0.7052965760231018,
-0.2962782680988312,
-0.008703147992491722,
-0.7816603779792786,
-1.0206798315048218,
0.07265667617321014,
-0.8192513585090637,
-0.13824638724327087,
-0.4529779553413391,
0.7859371304512024,
-0.10507737845182419,
-0.18889203667640686,
0.09486936032772064,
-0.30093398690223694,
0.1685199737548828,
0.10313969850540161,
-0.48550039529800415,
0.23935626447200775,
0.5698755383491516,
0.3768802285194397,
0.08583870530128479,
-0.2692813575267792,
-0.13027982413768768,
-0.08948619663715363,
-0.2771705985069275,
0.5255585312843323,
-0.31690552830696106,
-0.4920024871826172,
-0.19959111511707306,
0.36309924721717834,
0.05481318011879921,
-0.4209349453449249,
0.9604800939559937,
-0.3349466025829315,
0.21311482787132263,
-0.43396201729774475,
-0.678830623626709,
-0.37433940172195435,
0.22251573204994202,
-0.8295095562934875,
0.9969725012779236,
-0.11100858449935913,
-0.7119357585906982,
0.4817255139350891,
-0.8675838708877563,
-0.07927849143743515,
0.1318126767873764,
0.05604369193315506,
-0.794959545135498,
0.2523052394390106,
0.008686737157404423,
0.5387055277824402,
-0.28242018818855286,
0.07113535702228546,
-0.39101919531822205,
-0.49840816855430603,
-0.0868925154209137,
-0.6198868751525879,
0.5507225394248962,
0.2553299069404602,
-0.428818017244339,
0.08751996606588364,
-1.160631537437439,
0.21537140011787415,
0.46897032856941223,
-0.3944258689880371,
0.10730797052383423,
-0.3339826464653015,
0.3909482955932617,
0.14815743267536163,
0.32195329666137695,
-0.7891520857810974,
0.08941241353750229,
-0.1882241666316986,
0.30557477474212646,
0.8751252889633179,
0.1705605536699295,
-0.14299896359443665,
-0.25740930438041687,
0.27563998103141785,
0.2621747851371765,
0.2831217348575592,
0.12331575900316238,
-0.44427964091300964,
-0.9107585549354553,
-0.10086280107498169,
0.5097325444221497,
0.19735561311244965,
-0.08442655950784683,
0.6529126763343811,
0.02785450592637062,
-0.9705946445465088,
-0.33584675192832947,
0.030027450993657112,
0.3882334232330322,
0.5235051512718201,
0.20867571234703064,
-0.1742367148399353,
-0.5435911417007446,
-1.176342248916626,
0.25564268231391907,
0.083403579890728,
0.17338505387306213,
0.3005121052265167,
0.6553774476051331,
-0.24791793525218964,
0.5643434524536133,
-0.7478195428848267,
0.025590207427740097,
-0.018382640555500984,
0.046894822269678116,
0.3031303882598877,
0.852152943611145,
0.35929059982299805,
-0.5036229491233826,
0.19514715671539307,
-0.18712560832500458,
-0.6911994218826294,
0.42000991106033325,
-0.05488795042037964,
-0.4075331687927246,
-0.3226154148578644,
0.5194600224494934,
-0.6087009906768799,
0.6757404208183289,
0.15803521871566772,
-0.14382626116275787,
0.562747597694397,
-0.6161914467811584,
-0.20370887219905853,
-1.1392227411270142,
0.4538699984550476,
0.15815351903438568,
-0.008836191147565842,
-0.18793170154094696,
0.15134434401988983,
0.060549039393663406,
-0.4183977246284485,
-0.4207478165626526,
0.5156109929084778,
0.061428867280483246,
-0.03901540860533714,
-0.3259360194206238,
-0.43993934988975525,
0.05515771731734276,
0.6867007613182068,
0.3278769552707672,
0.3140605390071869,
0.38139352202415466,
-0.7373005747795105,
0.5541205406188965,
0.4218476116657257,
-0.4254072904586792,
0.4903024733066559,
-1.0387039184570312,
0.29036426544189453,
-0.29307976365089417,
-0.263277143239975,
-0.6627707481384277,
-0.37370625138282776,
0.492263525724411,
-0.19665135443210602,
0.1788751184940338,
-0.10766848176717758,
-0.3991948962211609,
-0.6263365149497986,
0.08758897334337234,
0.4194960594177246,
0.6188150644302368,
-0.7567632794380188,
0.3947538435459137,
0.22477960586547852,
0.4955822229385376,
-0.5214264392852783,
-0.7167128920555115,
-0.34530407190322876,
-0.21714451909065247,
-0.1061830148100853,
0.07450610399246216,
-0.1273828148841858,
0.04305563494563103,
0.06172642484307289,
0.2678765654563904,
-0.31622442603111267,
-0.08786777406930923,
0.44917163252830505,
0.3176755905151367,
-0.257874995470047,
0.0782962515950203,
0.02480892464518547,
-0.09646376967430115,
0.282014399766922,
0.14056652784347534,
0.4545280635356903,
-0.1547146886587143,
-0.6267505884170532,
-0.5751075148582458,
-0.18056462705135345,
0.6440643668174744,
-0.16253431141376495,
0.478176087141037,
0.7952607870101929,
-0.6154921650886536,
0.07838251441717148,
-0.5230050086975098,
0.018307620659470558,
-0.41568413376808167,
0.7151153683662415,
-0.4358910918235779,
-0.09710416942834854,
0.6807062029838562,
0.19376415014266968,
0.17061570286750793,
0.9797971844673157,
0.6010866165161133,
0.0015411218628287315,
1.045337438583374,
0.3466914892196655,
0.03652895987033844,
0.1746102124452591,
-0.5846968293190002,
-0.13893471658229828,
-0.7229766845703125,
-0.6086402535438538,
-0.42248812317848206,
-0.335846483707428,
-0.5930717587471008,
-0.04395199194550514,
0.24654796719551086,
0.1402071863412857,
-0.3076094388961792,
0.5817423462867737,
-0.6342791318893433,
0.42905786633491516,
0.7619937658309937,
0.6111085414886475,
-0.1553901582956314,
0.07289785146713257,
-0.32425859570503235,
0.05599629133939743,
-0.7948683500289917,
-0.18924076855182648,
1.361807107925415,
0.7818066477775574,
0.394281804561615,
-0.47358453273773193,
0.4919690191745758,
0.29593947529792786,
-0.0016929865814745426,
-0.4857214689254761,
0.5647633671760559,
0.1453884392976761,
-0.731895387172699,
-0.24645277857780457,
-0.2665323317050934,
-0.9039393067359924,
0.060728903859853745,
-0.48614558577537537,
-0.23231671750545502,
0.16791176795959473,
0.10625520348548889,
-0.37923315167427063,
0.5632489919662476,
-0.5227451324462891,
1.0631322860717773,
-0.053195808082818985,
-0.17507395148277283,
-0.3350827991962433,
-0.27715614438056946,
0.3297196626663208,
-0.12822896242141724,
-0.319512277841568,
0.034147508442401886,
0.2970947027206421,
0.9767066836357117,
-0.7136614918708801,
0.6640031337738037,
-0.4930172860622406,
0.271358460187912,
0.4571404755115509,
-0.32752588391304016,
0.5106372833251953,
-0.005625217221677303,
-0.09937490522861481,
0.2194317877292633,
-0.037054598331451416,
-0.5351222157478333,
-0.2703152000904083,
0.6157957315444946,
-1.0404852628707886,
-0.1517253816127777,
-0.19964995980262756,
-0.4991619288921356,
0.10495113581418991,
0.17409560084342957,
0.696953296661377,
0.8427202701568604,
-0.3062259554862976,
0.17593589425086975,
0.5051283836364746,
-0.08339083194732666,
0.6414067149162292,
0.22936490178108215,
0.07752304524183273,
-0.6470503807067871,
0.7438200116157532,
-0.06136717274785042,
0.03491879254579544,
-0.18134598433971405,
0.24006199836730957,
-0.38862547278404236,
-0.32008954882621765,
-0.48284170031547546,
0.154022678732872,
-0.9518967866897583,
-0.25505390763282776,
-0.23423829674720764,
-0.6040846705436707,
-0.2202296108007431,
0.18385255336761475,
-0.49960586428642273,
-0.3614181578159332,
-0.2912926971912384,
-0.2979406714439392,
0.18614327907562256,
0.9911091327667236,
-0.1957191377878189,
0.6794515252113342,
-0.7941370010375977,
0.03555000573396683,
0.3824129104614258,
0.5364068150520325,
0.3333648145198822,
-0.6286859512329102,
-0.5042049884796143,
0.09744823724031448,
-0.3731677532196045,
-0.36202767491340637,
0.11961079388856888,
-0.12502452731132507,
0.8390831351280212,
0.6765146255493164,
-0.4601977467536926,
0.7580115795135498,
-0.3159235119819641,
0.7548692226409912,
0.2044793665409088,
-0.5399823188781738,
0.22685286402702332,
-0.2222428172826767,
0.5641618967056274,
0.4693528413772583,
0.43729326128959656,
0.03201022744178772,
-0.0386233925819397,
-1.3251036405563354,
-0.46156635880470276,
0.6017991304397583,
0.2923148572444916,
0.35651054978370667,
-0.07473770529031754,
0.5056774020195007,
0.05553017556667328,
0.3095676898956299,
-0.768859326839447,
-0.5250536203384399,
-0.2078164517879486,
0.01230846531689167,
-0.0334281362593174,
-0.5407117605209351,
-0.009584493935108185,
-0.6422797441482544,
0.9868787527084351,
0.3717818260192871,
0.5282268524169922,
0.08654644340276718,
0.1821935772895813,
-0.27384084463119507,
-0.26078400015830994,
0.6735491156578064,
0.6767409443855286,
-0.3420136272907257,
-0.187896266579628,
0.22008751332759857,
-0.5791665315628052,
-0.1645810604095459,
0.12113359570503235,
-0.09491214156150818,
0.15603245794773102,
0.22244885563850403,
1.0657169818878174,
0.23081077635288239,
-0.24017715454101562,
0.5177573561668396,
-0.05831654742360115,
-0.336842805147171,
-0.42069390416145325,
0.14967761933803558,
-0.12368573993444443,
0.12859171628952026,
-0.010079488158226013,
0.6897864937782288,
0.024810411036014557,
-0.07344336807727814,
0.33995378017425537,
0.2675286531448364,
-0.5365257263183594,
-0.27839139103889465,
0.8067939281463623,
-0.019278107210993767,
-0.3839387595653534,
0.7480863332748413,
-0.006323737557977438,
-0.32050377130508423,
0.8269882798194885,
0.43620234727859497,
0.9094855785369873,
-0.26633939146995544,
0.0637643113732338,
0.8729544281959534,
-0.006434254348278046,
-0.19675952196121216,
0.30660295486450195,
-0.13026289641857147,
-0.7135844230651855,
-0.2438753992319107,
-0.7045451998710632,
-0.2848663032054901,
0.7137077450752258,
-1.11654794216156,
0.8270387053489685,
-0.7431391477584839,
-0.3267287015914917,
0.3474442660808563,
-0.09344223141670227,
-1.0401421785354614,
0.7144308686256409,
0.24023602902889252,
1.1302727460861206,
-1.030942678451538,
0.7111573815345764,
0.5449807643890381,
-0.45197197794914246,
-0.7402037978172302,
-0.36229559779167175,
-0.537610650062561,
-1.026478886604309,
0.5889877676963806,
-0.007253299467265606,
0.413756787776947,
0.18468883633613586,
-0.5571298599243164,
-0.7700794339179993,
0.8719464540481567,
0.1601501703262329,
-0.44968098402023315,
-0.06912906467914581,
0.3916870057582855,
0.5244197249412537,
-0.20039458572864532,
0.553097128868103,
0.24846316874027252,
0.3740765154361725,
0.24238479137420654,
-0.8228340148925781,
-0.1942259818315506,
-0.39042410254478455,
0.060428403317928314,
0.054203469306230545,
-0.5524506568908691,
0.7314351201057434,
0.15194913744926453,
0.530665397644043,
0.22429607808589935,
0.5348696112632751,
0.21469250321388245,
0.032744571566581726,
0.5510937571525574,
1.0686994791030884,
0.6366462111473083,
0.20037181675434113,
1.0591723918914795,
-0.3577929139137268,
0.47292110323905945,
1.1711992025375366,
0.12688292562961578,
0.6188101172447205,
0.29355913400650024,
-0.11450395733118057,
0.2069869041442871,
0.777254045009613,
-0.8418808579444885,
0.5303811430931091,
0.1672964245080948,
0.10241944342851639,
-0.41943609714508057,
0.16889572143554688,
-0.4705061912536621,
0.6341209411621094,
-0.07779891043901443,
-0.9951303005218506,
-0.4172002673149109,
-0.0812840685248375,
-0.143730029463768,
-0.242529034614563,
-0.662740170955658,
0.48568636178970337,
-0.30440208315849304,
-0.41666126251220703,
0.42197680473327637,
0.3363698720932007,
0.13067340850830078,
-0.5163845419883728,
-0.27489975094795227,
0.25751250982284546,
0.2850569188594818,
-0.08990666270256042,
-0.5930851101875305,
0.2497260570526123,
-0.10744254291057587,
-0.300082802772522,
0.17563514411449432,
0.6252317428588867,
-0.08846038579940796,
-1.0578995943069458,
-0.1282390058040619,
0.1608884483575821,
0.5035956501960754,
-0.03824770823121071,
-0.9369456768035889,
-0.06612046808004379,
-0.0313013531267643,
-0.38675475120544434,
0.01876709796488285,
0.2814445197582245,
0.07343278080224991,
0.4741344749927521,
0.5778146386146545,
-0.024342956021428108,
0.14841271936893463,
0.02230359986424446,
0.8160294890403748,
-0.49873098731040955,
-0.6554892063140869,
-0.8438851237297058,
0.5707187056541443,
-0.21143126487731934,
-0.8240442872047424,
0.6483242511749268,
1.1424800157546997,
0.8243002891540527,
-0.36097756028175354,
0.5450677871704102,
0.016661064699292183,
0.398876428604126,
-0.48797276616096497,
0.6726224422454834,
-0.2913239598274231,
-0.12665019929409027,
-0.274333119392395,
-1.0275764465332031,
0.2280062437057495,
0.4606491029262543,
-0.16351623833179474,
0.0744829922914505,
0.36145251989364624,
0.6266018152236938,
-0.36689096689224243,
0.20965911448001862,
0.4209952652454376,
-0.03164369612932205,
-0.1534120738506317,
0.22931240499019623,
0.48216283321380615,
-0.9801490902900696,
0.48965615034103394,
-0.7070652842521667,
0.21046099066734314,
0.05157426744699478,
-0.8403885960578918,
-1.047008752822876,
-0.5345906019210815,
-0.4893041253089905,
-0.41758906841278076,
-0.18511691689491272,
0.92174232006073,
0.8999685645103455,
-0.6807988286018372,
-0.23149825632572174,
-0.17071425914764404,
-0.27681079506874084,
0.0050222622230648994,
-0.1589810997247696,
0.5896880626678467,
-0.0025481467600911856,
-0.7365587949752808,
0.08810409903526306,
-0.47056320309638977,
0.36785438656806946,
-0.27202653884887695,
-0.09458691626787186,
0.09734281897544861,
-0.18643425405025482,
-0.0034159652423113585,
0.058482103049755096,
-0.3555077910423279,
-0.42732927203178406,
-0.29350197315216064,
0.02056916244328022,
0.3921107351779938,
0.41624361276626587,
-0.6033398509025574,
0.43320050835609436,
0.24079063534736633,
0.4663856029510498,
0.9083066582679749,
0.017522601410746574,
0.5966761708259583,
-0.5748452544212341,
0.35292553901672363,
-0.036834537982940674,
0.4355907738208771,
0.004599512089043856,
-0.6577224135398865,
0.39249318838119507,
0.3609448969364166,
-0.45062255859375,
-0.884117066860199,
-0.2593717873096466,
-0.7941492795944214,
0.15542955696582794,
1.0057408809661865,
-0.011814204975962639,
-0.5598291158676147,
0.6038968563079834,
-0.09801734238862991,
0.4210120737552643,
-0.024139197543263435,
0.44064366817474365,
0.6620487570762634,
0.19160841405391693,
0.03509427607059479,
-0.473116010427475,
0.33996716141700745,
0.290094792842865,
-0.4976978898048401,
-0.3890300989151001,
0.13822291791439056,
0.6108255982398987,
0.05929404869675636,
0.03300439193844795,
-0.3464238941669464,
0.4494561553001404,
0.2078821063041687,
0.5121523141860962,
-0.6547632813453674,
-0.2060750275850296,
-0.5231077671051025,
0.2532774806022644,
0.01928979903459549,
-0.6916981935501099
] |
google/vit-base-patch16-224 | google | "2023-09-05T15:27:12Z" | 1,828,301 | 384 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"vit",
"image-classification",
"vision",
"dataset:imagenet-1k",
"dataset:imagenet-21k",
"arxiv:2010.11929",
"arxiv:2006.03677",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | image-classification | "2022-03-02T23:29:05Z" | ---
license: apache-2.0
tags:
- vision
- image-classification
datasets:
- imagenet-1k
- imagenet-21k
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
example_title: Tiger
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg
example_title: Teapot
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
example_title: Palace
---
# Vision Transformer (base-sized model)
Vision Transformer (ViT) model pre-trained on ImageNet-21k (14 million images, 21,843 classes) at resolution 224x224, and fine-tuned on ImageNet 2012 (1 million images, 1,000 classes) at resolution 224x224. It was introduced in the paper [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929) by Dosovitskiy et al. and first released in [this repository](https://github.com/google-research/vision_transformer). However, the weights were converted from the [timm repository](https://github.com/rwightman/pytorch-image-models) by Ross Wightman, who already converted the weights from JAX to PyTorch. Credits go to him.
Disclaimer: The team releasing ViT did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
The Vision Transformer (ViT) is a transformer encoder model (BERT-like) pretrained on a large collection of images in a supervised fashion, namely ImageNet-21k, at a resolution of 224x224 pixels. Next, the model was fine-tuned on ImageNet (also referred to as ILSVRC2012), a dataset comprising 1 million images and 1,000 classes, also at resolution 224x224.
Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which are linearly embedded. One also adds a [CLS] token to the beginning of a sequence to use it for classification tasks. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder.
By pre-training the model, it learns an inner representation of images that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled images for instance, you can train a standard classifier by placing a linear layer on top of the pre-trained encoder. One typically places a linear layer on top of the [CLS] token, as the last hidden state of this token can be seen as a representation of an entire image.
## Intended uses & limitations
You can use the raw model for image classification. See the [model hub](https://huggingface.co/models?search=google/vit) to look for
fine-tuned versions on a task that interests you.
### How to use
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
```python
from transformers import ViTImageProcessor, ViTForImageClassification
from PIL import Image
import requests
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
processor = ViTImageProcessor.from_pretrained('google/vit-base-patch16-224')
model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])
```
For more code examples, we refer to the [documentation](https://huggingface.co/transformers/model_doc/vit.html#).
## Training data
The ViT model was pretrained on [ImageNet-21k](http://www.image-net.org/), a dataset consisting of 14 million images and 21k classes, and fine-tuned on [ImageNet](http://www.image-net.org/challenges/LSVRC/2012/), a dataset consisting of 1 million images and 1k classes.
## Training procedure
### Preprocessing
The exact details of preprocessing of images during training/validation can be found [here](https://github.com/google-research/vision_transformer/blob/master/vit_jax/input_pipeline.py).
Images are resized/rescaled to the same resolution (224x224) and normalized across the RGB channels with mean (0.5, 0.5, 0.5) and standard deviation (0.5, 0.5, 0.5).
### Pretraining
The model was trained on TPUv3 hardware (8 cores). All model variants are trained with a batch size of 4096 and learning rate warmup of 10k steps. For ImageNet, the authors found it beneficial to additionally apply gradient clipping at global norm 1. Training resolution is 224.
## Evaluation results
For evaluation results on several image classification benchmarks, we refer to tables 2 and 5 of the original paper. Note that for fine-tuning, the best results are obtained with a higher resolution (384x384). Of course, increasing the model size will result in better performance.
### BibTeX entry and citation info
```bibtex
@misc{wu2020visual,
title={Visual Transformers: Token-based Image Representation and Processing for Computer Vision},
author={Bichen Wu and Chenfeng Xu and Xiaoliang Dai and Alvin Wan and Peizhao Zhang and Zhicheng Yan and Masayoshi Tomizuka and Joseph Gonzalez and Kurt Keutzer and Peter Vajda},
year={2020},
eprint={2006.03677},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
```
```bibtex
@inproceedings{deng2009imagenet,
title={Imagenet: A large-scale hierarchical image database},
author={Deng, Jia and Dong, Wei and Socher, Richard and Li, Li-Jia and Li, Kai and Fei-Fei, Li},
booktitle={2009 IEEE conference on computer vision and pattern recognition},
pages={248--255},
year={2009},
organization={Ieee}
}
``` | [
-0.597277045249939,
-0.1520426720380783,
-0.014423793181777,
-0.0765932947397232,
-0.3712384104728699,
-0.15664531290531158,
-0.05828433111310005,
-0.5923717617988586,
0.15120747685432434,
0.47804486751556396,
-0.3025684654712677,
-0.24577678740024567,
-0.7233230471611023,
-0.06686804443597794,
-0.5159278512001038,
0.8451738357543945,
-0.036270689219236374,
0.03575624153017998,
-0.2840932309627533,
-0.16281922161579132,
-0.3539738059043884,
-0.4238843321800232,
-0.6240894198417664,
-0.26326459646224976,
0.4892829954624176,
0.19676890969276428,
0.5704330801963806,
0.7846063375473022,
0.7858961820602417,
0.4326176345348358,
-0.037763576954603195,
0.016995910555124283,
-0.3724842369556427,
-0.37876859307289124,
-0.005233305972069502,
-0.5477784872055054,
-0.3186933100223541,
0.20447558164596558,
0.5972182750701904,
0.34771883487701416,
0.21759659051895142,
0.3625776767730713,
0.11347178369760513,
0.4347272515296936,
-0.6019956469535828,
0.2574822008609772,
-0.5096601247787476,
0.38416555523872375,
-0.07339739054441452,
-0.17178355157375336,
-0.5189316868782043,
-0.12568868696689606,
0.23542633652687073,
-0.47832927107810974,
0.5010817646980286,
0.0004260024579707533,
1.3413819074630737,
0.2339968979358673,
-0.2972702383995056,
0.21004065871238708,
-0.6968101859092712,
0.7528380751609802,
-0.2800857126712799,
0.3999191224575043,
0.0992349162697792,
0.5341296195983887,
0.21269986033439636,
-1.1053677797317505,
-0.5161098837852478,
-0.04340659826993942,
-0.06493580341339111,
0.1782972663640976,
-0.26276662945747375,
0.16752880811691284,
0.555182695388794,
0.5605371594429016,
-0.3566737174987793,
0.1086592748761177,
-0.6466169953346252,
-0.2818031907081604,
0.5175709128379822,
-0.017372021451592445,
0.1303480714559555,
-0.03812335431575775,
-0.6624742746353149,
-0.4695698022842407,
-0.36705294251441956,
0.1913449466228485,
0.08140038698911667,
0.041963737457990646,
-0.13354362547397614,
0.5231553912162781,
0.11056969314813614,
0.600822925567627,
0.31776905059814453,
-0.13271376490592957,
0.47202807664871216,
-0.2357233613729477,
-0.3484591543674469,
-0.07588650286197662,
0.8200229406356812,
0.4417722523212433,
0.3328351378440857,
-0.003951855935156345,
-0.3051081597805023,
0.1778993457555771,
0.5562677979469299,
-0.9765860438346863,
-0.13472412526607513,
-0.12036041170358658,
-0.6411721706390381,
-0.422640323638916,
0.25417959690093994,
-0.5497763156890869,
-0.15225619077682495,
-0.4281232953071594,
0.6746099591255188,
-0.17423054575920105,
-0.15212509036064148,
-0.11239204555749893,
-0.04880928993225098,
0.6486641764640808,
0.4014740288257599,
-0.5916914343833923,
0.30952802300453186,
0.27070334553718567,
0.9294129014015198,
-0.13211460411548615,
-0.22216561436653137,
-0.07037261873483658,
-0.338467001914978,
-0.39063477516174316,
0.6236248016357422,
-0.10088738799095154,
-0.1531600058078766,
-0.04654937982559204,
0.40323197841644287,
-0.07862415909767151,
-0.5073132514953613,
0.3900286853313446,
-0.5911527872085571,
0.07380548119544983,
-0.06131000071763992,
-0.24633097648620605,
-0.2290860265493393,
0.22218087315559387,
-0.659225583076477,
1.008980631828308,
0.18566495180130005,
-0.8044370412826538,
0.40774357318878174,
-0.45204341411590576,
-0.09604740887880325,
0.1360851377248764,
-0.021381057798862457,
-0.6589395403862,
0.0018904106691479683,
0.23436233401298523,
0.5450025200843811,
-0.19196458160877228,
0.03265435993671417,
-0.1430673748254776,
-0.5388927459716797,
0.18702057003974915,
-0.3789222538471222,
0.8164068460464478,
0.18826502561569214,
-0.3489130139350891,
0.19250331819057465,
-0.6169781684875488,
-0.030354425311088562,
0.2508782148361206,
-0.17717424035072327,
0.04246901720762253,
-0.3481450378894806,
0.16478097438812256,
0.3472437560558319,
0.22803182899951935,
-0.7153181433677673,
0.24721069633960724,
-0.12063552439212799,
0.43692225217819214,
0.7739527225494385,
-0.20886996388435364,
0.5030604600906372,
-0.24290408194065094,
0.42447128891944885,
0.2044597566127777,
0.5499085783958435,
-0.34883782267570496,
-0.6200693249702454,
-1.0513666868209839,
-0.1622297763824463,
0.3750405013561249,
0.4225651025772095,
-0.7462562322616577,
0.4864119589328766,
-0.47508254647254944,
-0.5927801728248596,
-0.3682447671890259,
-0.188612163066864,
0.28203168511390686,
0.4810091257095337,
0.5124123692512512,
-0.5618225336074829,
-0.6635217666625977,
-0.9307892918586731,
0.1830115020275116,
0.016184182837605476,
-0.05448814854025841,
0.19537712633609772,
0.7466778755187988,
-0.3133930563926697,
0.9029688835144043,
-0.3463151156902313,
-0.30748310685157776,
-0.0441213995218277,
-0.056932754814624786,
0.29480159282684326,
0.6107618808746338,
0.5177167057991028,
-0.8409785628318787,
-0.36695992946624756,
0.009407974779605865,
-0.7534644603729248,
0.29864025115966797,
-0.05647158995270729,
-0.25916191935539246,
0.005557451397180557,
0.48754099011421204,
-0.4636967182159424,
0.8300437331199646,
0.33830440044403076,
-0.09411470592021942,
0.46579769253730774,
-0.0321040078997612,
0.017570650205016136,
-1.0613847970962524,
-0.004592146258801222,
0.22298409044742584,
-0.3376644253730774,
-0.4887225925922394,
0.1686239391565323,
0.18825258314609528,
-0.16437728703022003,
-0.5696589946746826,
0.28904467821121216,
-0.39739957451820374,
-0.154964417219162,
-0.1813097894191742,
-0.38197392225265503,
0.023772353306412697,
0.6300390362739563,
0.060439061373472214,
0.5463804602622986,
0.6866257786750793,
-0.5724089741706848,
0.6171485185623169,
0.25791552662849426,
-0.4763568639755249,
0.4116787612438202,
-0.7959027886390686,
0.1899799406528473,
-0.12550172209739685,
0.3177650272846222,
-0.7775920629501343,
-0.17746230959892273,
0.16019809246063232,
-0.4139479100704193,
0.5574459433555603,
-0.31826552748680115,
-0.3601808547973633,
-0.7619966268539429,
-0.20371004939079285,
0.5565873384475708,
0.7334065437316895,
-0.7638722658157349,
0.6193190813064575,
0.22133512794971466,
0.5254335403442383,
-0.7378929853439331,
-1.002267837524414,
0.016940901055932045,
-0.1170441210269928,
-0.511176347732544,
0.5316565036773682,
0.09889307618141174,
0.2488345354795456,
0.16901247203350067,
0.015987232327461243,
-0.013908161781728268,
-0.24386392533779144,
0.5239035487174988,
0.41656845808029175,
-0.32330986857414246,
0.020137688145041466,
-0.434542179107666,
-0.1935897022485733,
-0.005467574577778578,
-0.538303792476654,
0.46583524346351624,
-0.4606013596057892,
-0.33781516551971436,
-0.557528555393219,
-0.07908575981855392,
0.6642492413520813,
-0.24179311096668243,
0.6682022213935852,
0.9277297258377075,
-0.516948401927948,
0.007867657579481602,
-0.47537311911582947,
-0.1339755654335022,
-0.49023666977882385,
0.34431636333465576,
-0.2931725084781647,
-0.5622316598892212,
0.6317200660705566,
0.06701792031526566,
-0.061964455991983414,
0.6484106183052063,
0.33811354637145996,
-0.1159735694527626,
0.801270604133606,
0.6109315156936646,
0.039272308349609375,
0.7254219651222229,
-0.846108078956604,
0.10357736796140671,
-0.8211858868598938,
-0.40854862332344055,
-0.24889539182186127,
-0.5343810319900513,
-0.6315856575965881,
-0.5332633256912231,
0.2986007630825043,
0.04822405055165291,
-0.3859557807445526,
0.596488893032074,
-0.7591946721076965,
0.38928982615470886,
0.7635260820388794,
0.5778331160545349,
-0.11963891237974167,
0.224369615316391,
-0.0986267477273941,
0.09106113761663437,
-0.5798490047454834,
-0.1815127581357956,
0.9790135622024536,
0.5476888418197632,
0.645243227481842,
-0.2201920747756958,
0.4682759642601013,
0.014234696514904499,
0.1781737208366394,
-0.9491332769393921,
0.6221482157707214,
-0.21371179819107056,
-0.4755876958370209,
-0.09037715941667557,
-0.2649787366390228,
-0.9926751255989075,
0.07174330204725266,
-0.35570067167282104,
-0.5819740891456604,
0.5053258538246155,
0.1922730952501297,
-0.10194887220859528,
0.6172683238983154,
-0.613494336605072,
0.8407226204872131,
-0.1728169471025467,
-0.2831377387046814,
0.09133163094520569,
-0.717300534248352,
0.17582662403583527,
-0.0018201112980023026,
-0.19733354449272156,
0.2626185417175293,
0.2677760720252991,
0.8218115568161011,
-0.690204918384552,
0.9056508541107178,
-0.21647487580776215,
0.32426875829696655,
0.5150299668312073,
-0.3468875586986542,
0.2438141107559204,
-0.31067055463790894,
0.2804291844367981,
0.464739054441452,
-0.09831469506025314,
-0.473439484834671,
-0.545752763748169,
0.36824777722358704,
-0.9584413766860962,
-0.4076705574989319,
-0.3855791687965393,
-0.23498201370239258,
0.1791168451309204,
0.2678382694721222,
0.8166806101799011,
0.7166953682899475,
0.17411021888256073,
0.5950929522514343,
0.6509207487106323,
-0.3565191924571991,
0.4340675175189972,
-0.22158588469028473,
-0.2211877703666687,
-0.20063908398151398,
0.8588287830352783,
0.3653223514556885,
0.18493559956550598,
0.41639742255210876,
0.20390889048576355,
-0.21885846555233002,
-0.44142892956733704,
-0.32703322172164917,
0.03808765113353729,
-0.8222503662109375,
-0.4967156648635864,
-0.48048752546310425,
-0.7029094099998474,
-0.3127862513065338,
-0.13929827511310577,
-0.48283642530441284,
-0.21072329580783844,
-0.39680910110473633,
-0.08490229398012161,
0.37227341532707214,
0.6785733103752136,
0.010045666247606277,
0.5488793253898621,
-0.5663508772850037,
0.08647647500038147,
0.546337902545929,
0.4633670449256897,
0.11250415444374084,
-0.739540696144104,
-0.3968481719493866,
-0.03819428011775017,
-0.3450200855731964,
-0.5270506143569946,
0.35751593112945557,
0.2417496144771576,
0.5034874081611633,
0.6367830038070679,
-0.21020737290382385,
0.8388180136680603,
-0.4061225950717926,
0.765078604221344,
0.4965280592441559,
-0.6805588006973267,
0.5074657201766968,
-0.06573060154914856,
0.2635444104671478,
0.17288516461849213,
0.3849666118621826,
-0.25573450326919556,
0.10133635997772217,
-0.7819651365280151,
-0.6936651468276978,
0.6607013940811157,
0.1010732352733612,
0.1744307577610016,
0.26391541957855225,
0.4075210392475128,
-0.16615857183933258,
-0.05682055279612541,
-0.8185978531837463,
-0.24315045773983002,
-0.6753007173538208,
-0.10229897499084473,
-0.08597074449062347,
-0.16885991394519806,
0.07323944568634033,
-0.6573284864425659,
0.39842212200164795,
-0.0781371146440506,
0.8297455906867981,
0.11865975707769394,
-0.21175584197044373,
-0.06903798878192902,
-0.3184084892272949,
0.27967801690101624,
0.3578621745109558,
-0.21327240765094757,
0.1502683311700821,
0.15371254086494446,
-0.853757917881012,
0.00833144597709179,
-0.12798000872135162,
-0.08053115010261536,
-0.08084260672330856,
0.5469856858253479,
1.1556426286697388,
0.06515869498252869,
-0.11466439068317413,
0.8262296319007874,
-0.14196646213531494,
-0.3943382203578949,
-0.4865696430206299,
0.07180886715650558,
-0.3184526860713959,
0.23907111585140228,
0.4183083176612854,
0.5639247894287109,
0.02196488156914711,
-0.2998485565185547,
0.253925085067749,
0.21373224258422852,
-0.5191848874092102,
-0.36199751496315,
0.6358499526977539,
-0.04373268783092499,
-0.06222764775156975,
0.856952965259552,
-0.009605104103684425,
-0.6623711585998535,
0.8961690068244934,
0.441468209028244,
0.8152020573616028,
-0.1393221616744995,
0.10617796331644058,
0.7143290638923645,
0.3145638406276703,
-0.20880933105945587,
-0.03885414078831673,
-0.018635539337992668,
-0.9813898801803589,
-0.3801478147506714,
-0.5813897848129272,
-0.06788447499275208,
0.21814662218093872,
-0.7934630513191223,
0.4251182973384857,
-0.541628360748291,
-0.3785434067249298,
0.09920910745859146,
-0.05737852677702904,
-1.1559544801712036,
0.3762870728969574,
0.31087008118629456,
0.8758984208106995,
-0.7383579015731812,
0.7557298541069031,
0.7575539946556091,
-0.5286052227020264,
-0.9183845520019531,
-0.3435952961444855,
-0.22381211817264557,
-0.8799736499786377,
0.7448990345001221,
0.4800138771533966,
0.055574629455804825,
0.08643568307161331,
-0.8873155117034912,
-0.7929728627204895,
1.2053335905075073,
0.16739748418331146,
-0.351292222738266,
-0.0418328121304512,
0.09228034317493439,
0.4532930850982666,
-0.39588290452957153,
0.47030410170555115,
0.0550011470913887,
0.2427438646554947,
0.39986804127693176,
-0.7467821836471558,
-0.08647087216377258,
-0.42004501819610596,
0.2907475233078003,
0.03325062245130539,
-0.5821532607078552,
0.9674320816993713,
-0.19117505848407745,
-0.1904153823852539,
0.007250999566167593,
0.5300273299217224,
-0.1786002814769745,
-0.05936453863978386,
0.7484794855117798,
0.6876810789108276,
0.4148021936416626,
-0.34086063504219055,
1.024067759513855,
0.0019297086400911212,
0.42342984676361084,
0.5724635720252991,
0.3376378118991852,
0.5959246158599854,
0.2956470847129822,
-0.2558321952819824,
0.4615585505962372,
0.9142829179763794,
-0.5142374038696289,
0.4697243869304657,
0.0942775160074234,
0.06509208679199219,
-0.22410708665847778,
-0.07787743955850601,
-0.4241243302822113,
0.6021826267242432,
0.35311225056648254,
-0.6126627922058105,
0.08208826184272766,
0.36112502217292786,
-0.400592178106308,
-0.4379481077194214,
-0.584468424320221,
0.5217338800430298,
0.014454961754381657,
-0.426115483045578,
0.672785758972168,
-0.198684424161911,
0.7020965218544006,
-0.31875520944595337,
-0.07358207553625107,
-0.11018358916044235,
0.34202271699905396,
-0.3891544044017792,
-0.78388512134552,
0.09559217840433121,
-0.1907263696193695,
-0.11006997525691986,
-0.18137165904045105,
0.8034703731536865,
-0.13330630958080292,
-0.5493819713592529,
0.20983673632144928,
0.023983685299754143,
0.3119693994522095,
-0.027984080836176872,
-0.6547746062278748,
-0.037414394319057465,
-0.0765603706240654,
-0.3213168978691101,
0.2405404895544052,
0.31066644191741943,
-0.13193227350711823,
0.5293764472007751,
0.6036012172698975,
-0.053336720913648605,
0.3460617661476135,
-0.01894776150584221,
0.9712061882019043,
-0.46171918511390686,
-0.40780335664749146,
-0.468691885471344,
0.5913691520690918,
-0.14813661575317383,
-0.3266627788543701,
0.4968917965888977,
0.3857649266719818,
1.0995796918869019,
-0.3306768834590912,
0.49331310391426086,
-0.05193135887384415,
0.0037634701002389193,
-0.3193664252758026,
0.40534377098083496,
-0.6061016321182251,
-0.1411050707101822,
-0.2992370128631592,
-0.9780187606811523,
-0.41981884837150574,
0.8227851390838623,
-0.15231217443943024,
0.2084246277809143,
0.48633259534835815,
0.6901942491531372,
-0.23833227157592773,
-0.11003195494413376,
0.367087721824646,
0.15706586837768555,
0.09718126803636551,
0.3904021382331848,
0.7749071717262268,
-0.7917724251747131,
0.5423337817192078,
-0.5389112830162048,
-0.22979097068309784,
-0.2689741551876068,
-0.6808258891105652,
-0.8809593915939331,
-0.7184915542602539,
-0.4037652611732483,
-0.49545660614967346,
-0.23030877113342285,
0.6888536214828491,
1.0745588541030884,
-0.8028270602226257,
-0.022324228659272194,
-0.14129985868930817,
-0.24952295422554016,
-0.2806483209133148,
-0.19063057005405426,
0.42784935235977173,
-0.0293223075568676,
-0.7153753638267517,
-0.1791348159313202,
-0.0018866610480472445,
0.22350527346134186,
-0.2840104103088379,
-0.055887047201395035,
-0.05037694424390793,
-0.32105812430381775,
0.6353921890258789,
0.2783999741077423,
-0.5490331053733826,
-0.4797930121421814,
0.05236208066344261,
-0.08064743131399155,
0.32561764121055603,
0.6404179930686951,
-0.8235357403755188,
0.49930641055107117,
0.49185067415237427,
0.5399999618530273,
0.8762879371643066,
-0.08623117953538895,
0.1461324691772461,
-0.719794511795044,
0.3516731262207031,
0.12283947318792343,
0.565597414970398,
0.24409779906272888,
-0.34491536021232605,
0.539810061454773,
0.37375587224960327,
-0.5754293203353882,
-0.685127317905426,
0.06393048167228699,
-1.2214003801345825,
-0.04981605336070061,
0.8875476717948914,
-0.2969682812690735,
-0.44873130321502686,
0.16036488115787506,
-0.1276620477437973,
0.497640997171402,
-0.03579764440655708,
0.3206885755062103,
0.299789160490036,
0.09798066318035126,
-0.5675382614135742,
-0.4109879434108734,
0.2418655902147293,
-0.09340004622936249,
-0.4449264705181122,
-0.5631086826324463,
0.06914138048887253,
0.2076377123594284,
0.5108545422554016,
0.23982305824756622,
-0.33351561427116394,
0.1447252482175827,
0.17400509119033813,
0.4400104582309723,
-0.11017998307943344,
-0.42369598150253296,
-0.26121872663497925,
0.06106248125433922,
-0.2453094720840454,
-0.6550934314727783
] |
nvidia/speakerverification_en_titanet_large | nvidia | "2023-11-14T16:58:18Z" | 1,790,918 | 37 | nemo | [
"nemo",
"speaker",
"speech",
"audio",
"speaker-verification",
"speaker-recognition",
"speaker-diarization",
"titanet",
"NeMo",
"pytorch",
"en",
"dataset:VOXCELEB-1",
"dataset:VOXCELEB-2",
"dataset:FISHER",
"dataset:switchboard",
"dataset:librispeech_asr",
"dataset:SRE",
"license:cc-by-4.0",
"model-index",
"has_space",
"region:us"
] | null | "2022-07-15T00:26:00Z" | ---
language:
- en
library_name: nemo
datasets:
- VOXCELEB-1
- VOXCELEB-2
- FISHER
- switchboard
- librispeech_asr
- SRE
thumbnail: null
tags:
- speaker
- speech
- audio
- speaker-verification
- speaker-recognition
- speaker-diarization
- titanet
- NeMo
- pytorch
license: cc-by-4.0
widget:
- src: https://huggingface.co/nvidia/speakerverification_en_titanet_large/resolve/main/an255-fash-b.wav
example_title: Speech sample 1
- src: https://huggingface.co/nvidia/speakerverification_en_titanet_large/resolve/main/cen7-fash-b.wav
example_title: Speech sample 2
model-index:
- name: speakerverification_en_titanet_large
results:
- task:
name: Speaker Verification
type: speaker-verification
dataset:
name: voxceleb1
type: voxceleb1-O
config: clean
split: test
args:
language: en
metrics:
- name: Test EER
type: eer
value: 0.66
- task:
type: Speaker Diarization
name: speaker-diarization
dataset:
name: ami-mixheadset
type: ami_diarization
config: oracle-vad-known-number-of-speakers
split: test
args:
language: en
metrics:
- name: Test DER
type: der
value: 1.73
- task:
type: Speaker Diarization
name: speaker-diarization
dataset:
name: ami-lapel
type: ami_diarization
config: oracle-vad-known-number-of-speakers
split: test
args:
language: en
metrics:
- name: Test DER
type: der
value: 2.03
- task:
type: Speaker Diarization
name: speaker-diarization
dataset:
name: ch109
type: callhome_diarization
config: oracle-vad-known-number-of-speakers
split: test
args:
language: en
metrics:
- name: Test DER
type: der
value: 1.19
- task:
type: Speaker Diarization
name: speaker-diarization
dataset:
name: nist-sre-2000
type: nist-sre_diarization
config: oracle-vad-known-number-of-speakers
split: test
args:
language: en
metrics:
- name: Test DER
type: der
value: 6.73
---
# NVIDIA TitaNet-Large (en-US)
<style>
img {
display: inline;
}
</style>
| [![Model architecture](https://img.shields.io/badge/Model_Arch-TitaNet--Large-lightgrey#model-badge)](#model-architecture)
| [![Model size](https://img.shields.io/badge/Params-23M-lightgrey#model-badge)](#model-architecture)
| [![Language](https://img.shields.io/badge/Language-en--US-lightgrey#model-badge)](#datasets)
This model extracts speaker embeddings from given speech, which is the backbone for speaker verification and diarization tasks.
It is a "large" version of TitaNet (around 23M parameters) models.
See the [model architecture](#model-architecture) section and [NeMo documentation](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/asr/speaker_recognition/models.html#titanet) for complete architecture details.
## NVIDIA NeMo: Training
To train, fine-tune or play with the model you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo). We recommend you install it after you've installed the latest Pytorch version.
```
pip install nemo_toolkit['all']
```
## How to Use this Model
The model is available for use in the NeMo toolkit [3] and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
### Automatically instantiate the model
```python
import nemo.collections.asr as nemo_asr
speaker_model = nemo_asr.models.EncDecSpeakerLabelModel.from_pretrained("nvidia/speakerverification_en_titanet_large")
```
### Embedding Extraction
Using
```python
emb = speaker_model.get_embedding("an255-fash-b.wav")
```
### Verifying two utterances (Speaker Verification)
Now to check if two audio files are from the same speaker or not, simply do:
```python
speaker_model.verify_speakers("an255-fash-b.wav","cen7-fash-b.wav")
```
### Extracting Embeddings for more audio files
To extract embeddings from a bunch of audio files:
Write audio files to a `manifest.json` file with lines as in format:
```json
{"audio_filepath": "<absolute path to dataset>/audio_file.wav", "duration": "duration of file in sec", "label": "speaker_id"}
```
Then running following script will extract embeddings and writes to current working directory:
```shell
python <NeMo_root>/examples/speaker_tasks/recognition/extract_speaker_embeddings.py --manifest=manifest.json
```
### Input
This model accepts 16000 KHz Mono-channel Audio (wav files) as input.
### Output
This model provides speaker embeddings for an audio file.
## Model Architecture
TitaNet model is a depth-wise separable conv1D model [1] for Speaker Verification and diarization tasks. You may find more info on the detail of this model here: [TitaNet-Model](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/speaker_recognition/models.html).
## Training
The NeMo toolkit [3] was used for training the models for over several hundred epochs. These model are trained with this [example script](https://github.com/NVIDIA/NeMo/blob/main/examples/speaker_tasks/recognition/speaker_reco.py) and this [base config](https://github.com/NVIDIA/NeMo/blob/main/examples/speaker_tasks/recognition/conf/titanet-large.yaml).
### Datasets
All the models in this collection are trained on a composite dataset comprising several thousand hours of English speech:
- Voxceleb-1
- Voxceleb-2
- Fisher
- Switchboard
- Librispeech
- SRE (2004-2010)
## Performance
Performances of the these models are reported in terms of Equal Error Rate (EER%) on speaker verification evaluation trial files and as Diarization Error Rate (DER%) on diarization test sessions.
* Speaker Verification (EER%)
| Version | Model | Model Size | VoxCeleb1 (Cleaned trial file) |
|---------|--------------|-----|---------------|
| 1.10.0 | TitaNet-Large | 23M | 0.66 |
* Speaker Diarization (DER%)
| Version | Model | Model Size | Evaluation Condition | NIST SRE 2000 | AMI (Lapel) | AMI (MixHeadset) | CH109 |
|---------|--------------|-----|----------------------|---------------|-------------|------------------|-------|
| 1.10.0 | TitaNet-Large | 23M | Oracle VAD KNOWN # of Speakers | 6.73 | 2.03 | 1.73 | 1.19 |
| 1.10.0 | TitaNet-Large | 23M | Oracle VAD UNKNOWN # of Speakers | 5.38 | 2.03 | 1.89 | 1.63 |
## Limitations
This model is trained on both telephonic and non-telephonic speech from voxceleb datasets, Fisher and switch board. If your domain of data differs from trained data or doesnot show relatively good performance consider finetuning for that speech domain.
## NVIDIA Riva: Deployment
[NVIDIA Riva](https://developer.nvidia.com/riva), is an accelerated speech AI SDK deployable on-prem, in all clouds, multi-cloud, hybrid, on edge, and embedded.
Additionally, Riva provides:
* World-class out-of-the-box accuracy for the most common languages with model checkpoints trained on proprietary data with hundreds of thousands of GPU-compute hours
* Best in class accuracy with run-time word boosting (e.g., brand and product names) and customization of acoustic model, language model, and inverse text normalization
* Streaming speech recognition, Kubernetes compatible scaling, and enterprise-grade support
Although this model isn’t supported yet by Riva, the [list of supported models is here](https://huggingface.co/models?other=Riva).
Check out [Riva live demo](https://developer.nvidia.com/riva#demos).
## References
[1] [TitaNet: Neural Model for Speaker Representation with 1D Depth-wise Separable convolutions and global context](https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9746806)
[2] [NVIDIA NeMo Toolkit](https://github.com/NVIDIA/NeMo)
## Licence
License to use this model is covered by the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). By downloading the public and release version of the model, you accept the terms and conditions of the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license. | [
-0.5861972570419312,
-0.8936721682548523,
0.06860203295946121,
-0.06277909129858017,
-0.1476210355758667,
-0.17160621285438538,
-0.24887864291667938,
-0.3966623544692993,
0.22572335600852966,
0.2711067497730255,
-0.4686437249183655,
-0.47664156556129456,
-0.5080291032791138,
-0.06838804483413696,
-0.2885744869709015,
0.5626325011253357,
0.5425476431846619,
0.09681573510169983,
-0.21425165235996246,
-0.13263897597789764,
-0.8112282156944275,
-0.12387106567621231,
-0.8389900326728821,
-0.630000114440918,
0.07966197282075882,
0.4481903314590454,
0.49666255712509155,
0.4916406273841858,
0.16276636719703674,
0.35652729868888855,
-0.29079052805900574,
0.3207843601703644,
-0.11221007257699966,
0.05166243016719818,
-0.03539610281586647,
-0.1241680309176445,
-0.5619191527366638,
-0.04660090431571007,
0.7983434796333313,
0.20033428072929382,
-0.2346339225769043,
0.13223974406719208,
0.003457397921010852,
0.0466950386762619,
-0.2681784927845001,
0.12664201855659485,
-0.365287721157074,
-0.17703847587108612,
-0.059677332639694214,
-0.28535139560699463,
-0.5384576916694641,
-0.26705002784729004,
0.18594740331172943,
-0.6365189552307129,
-0.027425028383731842,
0.018150243908166885,
1.1874456405639648,
0.29445409774780273,
-0.24991346895694733,
-0.1215851753950119,
-0.7128812670707703,
0.8674625158309937,
-1.1287379264831543,
0.6107301115989685,
0.41389814019203186,
0.27501216530799866,
-0.15344968438148499,
-0.5996560454368591,
-0.727484941482544,
-0.4060255289077759,
0.057190731167793274,
0.04275062307715416,
-0.5022904276847839,
0.04589105024933815,
0.288288414478302,
0.430944561958313,
-0.7090901136398315,
0.38302022218704224,
-0.37132784724235535,
-0.3545170724391937,
0.5993516445159912,
-0.09517048299312592,
0.6017293930053711,
-0.48491808772087097,
-0.29788151383399963,
-0.6274619698524475,
-0.547295331954956,
-0.09257768094539642,
0.3326740562915802,
0.4601523280143738,
-0.5526164770126343,
0.27271968126296997,
-0.139033704996109,
0.7238469123840332,
0.030248818919062614,
-0.2858313024044037,
0.7384362816810608,
-0.2556571960449219,
-0.31720873713493347,
0.1266343891620636,
1.1353906393051147,
0.12772129476070404,
-0.0404868982732296,
0.11687120050191879,
-0.15769074857234955,
-0.08858169615268707,
-0.1458805799484253,
-0.7065397500991821,
-0.035004813224077225,
0.4158076345920563,
-0.19267727434635162,
-0.1487189382314682,
-0.31428050994873047,
-0.7659633755683899,
-0.23785382509231567,
-0.3255466818809509,
0.8617807626724243,
-0.7682005167007446,
-0.5109722018241882,
0.20725490152835846,
-0.18829001486301422,
0.34921950101852417,
0.16061630845069885,
-1.0063508749008179,
0.4030252695083618,
0.5899856686592102,
0.8920449018478394,
0.21975275874137878,
-0.1627441793680191,
-0.6368983387947083,
-0.2199935019016266,
-0.0925852432847023,
0.6582774519920349,
-0.427276074886322,
-0.3771417737007141,
-0.17345838248729706,
0.02723827213048935,
-0.18960322439670563,
-0.41107362508773804,
0.5683653950691223,
-0.0824284628033638,
0.5035899877548218,
-0.02335021086037159,
-0.6749155521392822,
-0.3654276728630066,
0.19652171432971954,
-0.4537383019924164,
1.0388128757476807,
-0.20120246708393097,
-0.649471640586853,
0.19746047258377075,
-0.6848352551460266,
-0.12245059758424759,
0.1498352289199829,
-0.3634467124938965,
-0.4393734335899353,
-0.050300948321819305,
0.43444669246673584,
0.5624229311943054,
-0.5466403365135193,
0.1884378045797348,
-0.10907096415758133,
-0.4209825396537781,
0.04121023789048195,
-0.29525691270828247,
0.9181686639785767,
0.30483439564704895,
-0.5231462717056274,
0.03274809569120407,
-0.7849481701850891,
-0.08923374116420746,
0.13335832953453064,
-0.1974831521511078,
-0.06833375990390778,
0.038930147886276245,
0.3067454993724823,
0.05265155807137489,
0.16443613171577454,
-0.8739215731620789,
-0.11376585066318512,
-0.6558286547660828,
0.8162249326705933,
0.7350282669067383,
-0.046974051743745804,
0.22513917088508606,
-0.2833290100097656,
0.5458696484565735,
-0.2814235985279083,
0.20334671437740326,
-0.2006261795759201,
-0.6579982042312622,
-0.6419907212257385,
-0.3589520752429962,
0.5025815963745117,
0.6002325415611267,
-0.6862044334411621,
0.36211445927619934,
-0.5128307938575745,
-0.7648443579673767,
-0.5625795125961304,
-0.1483481228351593,
0.6667075157165527,
0.35611188411712646,
0.22055251896381378,
-0.21904146671295166,
-0.6003758311271667,
-1.071144700050354,
0.04303596913814545,
-0.13935844600200653,
0.06022310629487038,
0.7178712487220764,
0.5975062251091003,
-0.14822961390018463,
0.8192461729049683,
-0.30297166109085083,
-0.3237445652484894,
-0.16490529477596283,
0.11845032870769501,
0.5146428346633911,
0.7131883502006531,
0.5207436084747314,
-0.7584951519966125,
-0.4080343246459961,
0.4757750630378723,
-0.6778179407119751,
0.1272713840007782,
0.11875493824481964,
0.44226130843162537,
0.019078128039836884,
0.484531044960022,
-0.549915611743927,
0.19009216129779816,
0.6259887218475342,
-0.2756967544555664,
0.3207710087299347,
-0.2494370937347412,
0.03184237331151962,
-1.3049919605255127,
0.15391841530799866,
0.036147624254226685,
-0.1911468505859375,
-0.5970154404640198,
-0.15917180478572845,
-0.14126154780387878,
-0.19205370545387268,
-0.5273823142051697,
0.7849488854408264,
-0.2593158483505249,
-0.13760311901569366,
-0.2403569221496582,
0.2892964780330658,
0.003060840303078294,
0.4881397485733032,
-0.05502570793032646,
0.9570366740226746,
0.7470987439155579,
-0.6368741989135742,
0.5388997793197632,
0.45690611004829407,
-0.5750645399093628,
0.41133928298950195,
-1.108595609664917,
0.4157952666282654,
-0.05824662744998932,
0.11297161132097244,
-1.0782774686813354,
-0.2146426886320114,
0.2526080310344696,
-0.867016077041626,
0.3427133560180664,
-0.32819366455078125,
-0.6221818327903748,
-0.17098399996757507,
0.161118745803833,
0.3844560980796814,
0.557900607585907,
-0.5147008299827576,
0.7341174483299255,
0.566006600856781,
-0.30961939692497253,
-0.7198368310928345,
-0.6572645902633667,
-0.09795068949460983,
-0.24141910672187805,
-0.7066848874092102,
0.49368059635162354,
0.02978452481329441,
-0.045820653438568115,
-0.08665528893470764,
0.08030924946069717,
0.007823306135833263,
-0.18990594148635864,
0.5652245283126831,
0.23106376826763153,
-0.30242329835891724,
0.37467262148857117,
-0.21448713541030884,
-0.26393312215805054,
-0.3245569169521332,
-0.20574955642223358,
0.8479800820350647,
-0.33030498027801514,
-0.17978425323963165,
-0.9874541759490967,
0.10352467745542526,
0.7064247727394104,
-0.40668511390686035,
0.3980017304420471,
0.802886426448822,
-0.3979242742061615,
-0.03972018510103226,
-0.8457114696502686,
-0.29837504029273987,
-0.513870894908905,
0.5940982699394226,
-0.1924348771572113,
-0.7019475102424622,
0.46944689750671387,
0.3113289177417755,
0.09879914671182632,
0.5176816582679749,
0.38949546217918396,
0.17112533748149872,
0.8050916790962219,
0.47883477807044983,
-0.17888377606868744,
0.7807056307792664,
-0.34010493755340576,
0.14230605959892273,
-0.806892991065979,
-0.5186964869499207,
-0.6612161993980408,
-0.22481678426265717,
-0.6742154955863953,
-0.4371066093444824,
0.20023585855960846,
-0.4743316173553467,
-0.09331300854682922,
0.7027073502540588,
-0.7595800757408142,
0.4037482738494873,
0.6431306004524231,
0.003514965996146202,
-0.017226139083504677,
0.23409728705883026,
-0.1714055985212326,
-0.055128347128629684,
-0.5938459038734436,
-0.4772433340549469,
1.0680198669433594,
0.5321437120437622,
0.539130449295044,
-0.01065252348780632,
0.576897144317627,
0.23038052022457123,
-0.2505861222743988,
-0.5941125154495239,
0.5052585601806641,
-0.23885370790958405,
-0.9253762364387512,
-0.4360452890396118,
-0.45997747778892517,
-0.8210240006446838,
0.3288581967353821,
-0.20768007636070251,
-0.8178237080574036,
0.6875561475753784,
-0.014458716847002506,
-0.6802489757537842,
0.3513096272945404,
-0.8195937871932983,
0.8839588761329651,
0.027454860508441925,
-0.26039984822273254,
-0.38965389132499695,
-0.23304793238639832,
-0.08827264606952667,
0.34064677357673645,
0.25865426659584045,
-0.25626587867736816,
0.36515626311302185,
1.0206924676895142,
-0.058367032557725906,
0.6942957043647766,
-0.3332211673259735,
0.28205499053001404,
0.2971813976764679,
-0.17056207358837128,
0.4238186478614807,
0.11696028709411621,
-0.14170525968074799,
0.12986043095588684,
0.08110887557268143,
-0.23245196044445038,
-0.3458365499973297,
0.9008803367614746,
-1.1578840017318726,
-0.2833992540836334,
-0.31836310029029846,
-0.5956903696060181,
-0.12184058874845505,
0.17425838112831116,
0.45763251185417175,
0.9158992171287537,
-0.25270354747772217,
0.5877318978309631,
0.8689631819725037,
-0.567310631275177,
0.5211600661277771,
0.39175936579704285,
-0.15261337161064148,
-0.7190711498260498,
1.0446186065673828,
0.2576809227466583,
0.1849822998046875,
0.5354000926017761,
0.10511242598295212,
-0.3364632725715637,
-0.7002432942390442,
-0.17289207875728607,
0.2564350664615631,
-0.5287064909934998,
0.019367078319191933,
-0.6007183790206909,
-0.17812016606330872,
-0.617335319519043,
0.406494140625,
-0.736990213394165,
-0.3589947521686554,
-0.2909422814846039,
-0.23283688724040985,
0.4688127040863037,
0.701930582523346,
-0.058480728417634964,
0.5221507549285889,
-0.31219059228897095,
0.220252126455307,
0.5073014497756958,
0.12210152298212051,
-0.19447410106658936,
-1.0245816707611084,
-0.07840269804000854,
0.2067679762840271,
-0.43195563554763794,
-0.6515437960624695,
0.7229602336883545,
0.2936667501926422,
0.7136057615280151,
0.3857470452785492,
-0.3242330551147461,
0.7042981386184692,
-0.17638644576072693,
0.750032901763916,
0.1816103607416153,
-0.9465723037719727,
0.676123857498169,
-0.46746960282325745,
0.2934160828590393,
0.37497666478157043,
0.17964234948158264,
-0.6393476128578186,
0.10648536682128906,
-0.8016176223754883,
-0.7413594126701355,
0.9579672813415527,
0.3177020847797394,
0.26731792092323303,
0.030521240085363388,
0.07623771578073502,
0.03868186101317406,
-0.017946621403098106,
-0.7564831972122192,
-0.34512248635292053,
-0.2961658537387848,
0.16100196540355682,
-0.4769279956817627,
-0.2450716197490692,
0.040635351091623306,
-0.4895404875278473,
0.9342219829559326,
0.18712779879570007,
0.4183868169784546,
0.27734386920928955,
-0.05507740378379822,
0.30242788791656494,
0.3637162744998932,
0.7807531356811523,
0.36189788579940796,
-0.5683745741844177,
-0.11851192265748978,
0.31349706649780273,
-0.3357349634170532,
-0.09999001771211624,
0.05428212508559227,
0.019603626802563667,
0.3688269555568695,
0.1629416048526764,
1.199621319770813,
0.3095839321613312,
-0.5738044381141663,
0.572706937789917,
-0.14549322426319122,
-0.3827623128890991,
-0.5637184977531433,
-0.08372077345848083,
0.23747895658016205,
0.22458401322364807,
0.21709926426410675,
0.051018375903367996,
-0.0782175213098526,
-0.512451708316803,
0.1136610209941864,
0.33544275164604187,
-0.46404150128364563,
-0.3275770843029022,
0.6338126063346863,
0.18606024980545044,
-0.5254478454589844,
0.9602257609367371,
-0.11069565266370773,
0.028276169672608376,
0.7132864594459534,
0.48396432399749756,
0.9133994579315186,
-0.5280641317367554,
0.23899312317371368,
0.7239749431610107,
0.32272934913635254,
0.061983972787857056,
0.31964176893234253,
-0.013650965876877308,
-0.7748323082923889,
-0.45570048689842224,
-0.6325228810310364,
-0.34494441747665405,
0.33527690172195435,
-0.6241096258163452,
0.3752574622631073,
-0.6941789984703064,
-0.5656092166900635,
0.2918998897075653,
0.08922145515680313,
-0.6400778889656067,
0.17800037562847137,
0.49609315395355225,
0.7407065629959106,
-1.082627296447754,
0.9651520252227783,
0.5837730765342712,
-0.4958057999610901,
-0.9167636632919312,
-0.602837085723877,
-0.08194354176521301,
-0.7334169745445251,
0.4699169993400574,
0.1441381722688675,
-0.014528446830809116,
-0.08313240855932236,
-0.4436046779155731,
-0.9719823598861694,
1.268880844116211,
0.5838850140571594,
-0.5962035655975342,
0.08331585675477982,
-0.01595071330666542,
0.31771019101142883,
-0.47973138093948364,
0.6048944592475891,
0.26791203022003174,
0.4735763967037201,
0.06715286523103714,
-1.3125666379928589,
-0.07266736775636673,
-0.5998265743255615,
-0.20357930660247803,
-0.07479642331600189,
-0.6121453642845154,
1.1572927236557007,
0.11851351708173752,
-0.1253833919763565,
-0.11637457460165024,
0.490312784910202,
0.2563272714614868,
0.23500323295593262,
0.5344007015228271,
0.6493672132492065,
0.750210165977478,
-0.1982172131538391,
0.9687824249267578,
-0.14270754158496857,
0.32498157024383545,
1.1684938669204712,
0.21979987621307373,
1.05889892578125,
0.4140344262123108,
-0.1390010565519333,
0.6064919829368591,
0.506897509098053,
-0.23233310878276825,
0.45097219944000244,
-0.29089975357055664,
-0.028743300586938858,
-0.5167921185493469,
-0.23795872926712036,
-0.7739556431770325,
0.7155190110206604,
0.3840063214302063,
-0.30541563034057617,
0.06309663504362106,
0.16172169148921967,
-0.12645220756530762,
-0.09625117480754852,
-0.047436390072107315,
0.476047158241272,
0.24042260646820068,
-0.4006248414516449,
0.8643544912338257,
-0.08061272650957108,
0.7182143926620483,
-0.5050624012947083,
0.10503125935792923,
-0.08250895142555237,
0.23604688048362732,
-0.3106781244277954,
-0.2908839285373688,
0.04109463840723038,
-0.2597931921482086,
-0.21011190116405487,
-0.20368191599845886,
0.3225148618221283,
-0.023345010355114937,
-0.20755985379219055,
0.3371550440788269,
0.1405075639486313,
0.3593083322048187,
-0.026893891394138336,
-0.6417638063430786,
0.2591319680213928,
0.12001343816518784,
-0.09830963611602783,
0.18083839118480682,
-0.010465411469340324,
0.2602464258670807,
0.8886170387268066,
0.712772011756897,
0.016460638493299484,
0.24676720798015594,
0.059807050973176956,
0.5642603039741516,
-0.5419017672538757,
-0.5784022212028503,
-0.8132425546646118,
0.3894549012184143,
-0.22230975329875946,
-0.624484658241272,
0.9224807620048523,
0.6623249650001526,
0.7430469989776611,
0.007583466824144125,
0.5445650219917297,
-0.13927705585956573,
0.47789397835731506,
-0.24892887473106384,
0.6529074311256409,
-0.703906774520874,
0.31558507680892944,
-0.33005964756011963,
-0.7715810537338257,
-0.11630747467279434,
0.662423849105835,
-0.5980987548828125,
-0.011055138893425465,
0.46841001510620117,
1.1476901769638062,
-0.1652255803346634,
0.23402154445648193,
0.4431222081184387,
0.49486440420150757,
0.35078608989715576,
0.5864576101303101,
0.7631569504737854,
-0.8603807687759399,
0.5421551465988159,
-0.2545340359210968,
-0.06694169342517853,
-0.28191110491752625,
-0.5781158804893494,
-0.6738825440406799,
-0.6391043663024902,
-0.6290388107299805,
-0.23480714857578278,
0.14777563512325287,
0.977395236492157,
1.0847878456115723,
-0.8155795931816101,
-0.5410167574882507,
0.020288800820708275,
0.09504425525665283,
-0.2742516100406647,
-0.1662999838590622,
0.4007384777069092,
0.1375083327293396,
-1.0158329010009766,
0.7702362537384033,
0.09122668951749802,
-0.059339556843042374,
0.023526156321167946,
-0.2969861924648285,
-0.31678450107574463,
0.03961143642663956,
0.17475482821464539,
0.6055231094360352,
-0.834685742855072,
-0.21410556137561798,
-0.2652825117111206,
0.07448024302721024,
0.21126841008663177,
0.011034960858523846,
-0.7654712200164795,
0.6905863881111145,
0.8030059933662415,
0.2340594083070755,
0.728977382183075,
-0.41173186898231506,
0.4986605644226074,
-0.5328969359397888,
0.38727086782455444,
0.2598564624786377,
0.4230702817440033,
0.4262898564338684,
0.08731883019208908,
0.1857454925775528,
0.09370197355747223,
-0.6873726844787598,
-1.2071555852890015,
-0.10409433394670486,
-1.1921311616897583,
-0.0988803505897522,
1.1781028509140015,
0.026400774717330933,
-0.2649252116680145,
0.09899577498435974,
-0.11363296955823898,
0.21668657660484314,
-0.5255383253097534,
0.345233678817749,
0.4710047245025635,
0.23218481242656708,
-0.16283206641674042,
-0.9795488715171814,
0.2801293730735779,
0.5897558331489563,
-0.34495002031326294,
-0.23505176603794098,
0.14473314583301544,
0.7158510684967041,
0.40045562386512756,
0.5016756057739258,
-0.27319133281707764,
0.3878466486930847,
0.24988970160484314,
0.47035059332847595,
-0.38668861985206604,
-0.11759205162525177,
-0.4252140522003174,
0.2263820767402649,
-0.06861980259418488,
-0.6722080111503601
] |
ckiplab/bert-base-chinese-ner | ckiplab | "2022-05-10T03:28:12Z" | 1,774,062 | 61 | transformers | [
"transformers",
"pytorch",
"jax",
"bert",
"token-classification",
"zh",
"license:gpl-3.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | token-classification | "2022-03-02T23:29:05Z" | ---
language:
- zh
thumbnail: https://ckip.iis.sinica.edu.tw/files/ckip_logo.png
tags:
- pytorch
- token-classification
- bert
- zh
license: gpl-3.0
---
# CKIP BERT Base Chinese
This project provides traditional Chinese transformers models (including ALBERT, BERT, GPT2) and NLP tools (including word segmentation, part-of-speech tagging, named entity recognition).
這個專案提供了繁體中文的 transformers 模型(包含 ALBERT、BERT、GPT2)及自然語言處理工具(包含斷詞、詞性標記、實體辨識)。
## Homepage
- https://github.com/ckiplab/ckip-transformers
## Contributers
- [Mu Yang](https://muyang.pro) at [CKIP](https://ckip.iis.sinica.edu.tw) (Author & Maintainer)
## Usage
Please use BertTokenizerFast as tokenizer instead of AutoTokenizer.
請使用 BertTokenizerFast 而非 AutoTokenizer。
```
from transformers import (
BertTokenizerFast,
AutoModel,
)
tokenizer = BertTokenizerFast.from_pretrained('bert-base-chinese')
model = AutoModel.from_pretrained('ckiplab/bert-base-chinese-ner')
```
For full usage and more information, please refer to https://github.com/ckiplab/ckip-transformers.
有關完整使用方法及其他資訊,請參見 https://github.com/ckiplab/ckip-transformers 。
| [
-0.3094051480293274,
-0.37639573216438293,
0.01640866883099079,
0.7887858748435974,
-0.41035550832748413,
0.05451396480202675,
-0.19907128810882568,
-0.26700690388679504,
-0.0395166277885437,
0.4669400155544281,
-0.37522950768470764,
-0.30250468850135803,
-0.6235068440437317,
0.02518985979259014,
-0.2523133158683777,
0.9085775017738342,
-0.19762128591537476,
0.37333449721336365,
0.44602495431900024,
0.14178846776485443,
-0.2670288383960724,
-0.48298534750938416,
-0.7540739178657532,
-0.6327694058418274,
-0.04490828514099121,
0.276458203792572,
0.6976317167282104,
0.4168517589569092,
0.5228219032287598,
0.32659482955932617,
0.02743762917816639,
-0.11948671191930771,
-0.18790626525878906,
-0.29888129234313965,
0.007303390186280012,
-0.5490821003913879,
-0.40185481309890747,
-0.21962189674377441,
0.7028181552886963,
0.4932568669319153,
0.03213735669851303,
-0.031053876504302025,
0.2076244354248047,
0.37599724531173706,
-0.3395240604877472,
0.4414750933647156,
-0.6216973066329956,
0.30950453877449036,
-0.16493448615074158,
-0.08376611024141312,
-0.3848917782306671,
-0.28155219554901123,
0.1918104588985443,
-0.6458227634429932,
0.3634040653705597,
-0.1785932183265686,
1.387910008430481,
0.03461617976427078,
-0.32741838693618774,
-0.28351786732673645,
-0.7131026983261108,
1.0959686040878296,
-0.9091449975967407,
0.4662415683269501,
0.36382272839546204,
0.3077755570411682,
-0.05663543567061424,
-1.1053578853607178,
-0.692129909992218,
-0.19922396540641785,
-0.22227783501148224,
0.3351702094078064,
0.13905499875545502,
-0.039516106247901917,
0.3768637776374817,
0.31075412034988403,
-0.6254087686538696,
0.20477166771888733,
-0.40869948267936707,
-0.44575193524360657,
0.556086540222168,
-0.09731196612119675,
0.5022428631782532,
-0.46318820118904114,
-0.560321033000946,
-0.36698684096336365,
-0.6408212184906006,
0.232810378074646,
0.2829592227935791,
0.13377514481544495,
-0.49270376563072205,
0.6057155728340149,
-0.012002277188003063,
0.3091444969177246,
0.2115909457206726,
-0.09026192873716354,
0.48211243748664856,
-0.30443137884140015,
-0.0751241147518158,
-0.13264493644237518,
0.923439621925354,
0.24293744564056396,
0.11005574464797974,
0.06665508449077606,
-0.3370642066001892,
-0.3447989225387573,
-0.24941548705101013,
-0.7976214289665222,
-0.7213683128356934,
0.21186169981956482,
-0.8028796911239624,
-0.2094365507364273,
0.16503195464611053,
-0.6426733136177063,
0.3088753819465637,
-0.2537895441055298,
0.4454980790615082,
-0.7456166744232178,
-0.6283140778541565,
-0.0153663270175457,
-0.4221374988555908,
0.8821736574172974,
0.14742493629455566,
-1.251294732093811,
0.043943826109170914,
0.6282984614372253,
0.7606375813484192,
0.1527124047279358,
-0.17066259682178497,
0.1414450705051422,
0.3676190972328186,
-0.20717908442020416,
0.5575230121612549,
-0.1199694350361824,
-0.7347967028617859,
0.13280627131462097,
0.0991690456867218,
0.018994485959410667,
-0.4390338659286499,
0.8431530594825745,
-0.339511513710022,
0.416779100894928,
-0.2353919893503189,
-0.3106996417045593,
-0.07257044315338135,
0.09896543622016907,
-0.5451574325561523,
1.240992546081543,
0.23664534091949463,
-0.8843194842338562,
0.26040568947792053,
-0.9179275631904602,
-0.615420401096344,
0.34689292311668396,
-0.10763689875602722,
-0.42927807569503784,
-0.17833594977855682,
0.25353071093559265,
0.3280803859233856,
-0.0644030049443245,
0.22329829633235931,
-0.013200731948018074,
-0.2271645963191986,
0.017504211515188217,
-0.4481303095817566,
1.3949885368347168,
0.3436051309108734,
-0.34685468673706055,
0.17764799296855927,
-0.7045412659645081,
0.13679732382297516,
0.3212588429450989,
-0.25984376668930054,
-0.2523654103279114,
0.20953981578350067,
0.628503680229187,
0.17756524682044983,
0.5770571231842041,
-0.6253778338432312,
0.49569931626319885,
-0.5887448787689209,
0.7525607347488403,
0.869762659072876,
-0.33937254548072815,
0.29480138421058655,
-0.16038627922534943,
-0.006373514421284199,
0.061378978192806244,
0.37343859672546387,
-0.13404960930347443,
-0.5266228318214417,
-1.1733955144882202,
-0.3546077013015747,
0.4617348611354828,
0.8065857887268066,
-1.1558411121368408,
0.9484763741493225,
-0.25686115026474,
-0.6513785123825073,
-0.3414100408554077,
-0.07270877063274384,
0.033017996698617935,
0.19768860936164856,
0.5733192563056946,
-0.3108384907245636,
-0.605655312538147,
-1.053968071937561,
0.13104450702667236,
-0.5856712460517883,
-0.5820918679237366,
0.00039607842336408794,
0.5832822322845459,
-0.4609740972518921,
1.0345890522003174,
-0.5370373129844666,
-0.2949134111404419,
-0.3407544791698456,
0.5751137137413025,
0.3808009922504425,
0.9491197466850281,
0.6417345404624939,
-1.0631521940231323,
-0.7474472522735596,
-0.20895041525363922,
-0.36311864852905273,
-0.06600635498762131,
-0.23501582443714142,
-0.14035791158676147,
0.06398520618677139,
0.07302511483430862,
-0.6234303712844849,
0.19672144949436188,
0.4025018811225891,
0.008728149347007275,
0.8840667605400085,
-0.06011516600847244,
-0.29755699634552,
-1.3743809461593628,
0.1967191845178604,
-0.20982196927070618,
-0.029065437614917755,
-0.4493861198425293,
-0.007214986253529787,
0.1942247748374939,
-0.08919624239206314,
-0.5636783242225647,
0.5971820950508118,
-0.3665972054004669,
0.3425701856613159,
-0.2832324206829071,
-0.1785988211631775,
-0.22008204460144043,
0.6188808083534241,
0.4278457462787628,
0.7330002188682556,
0.628392219543457,
-0.7460700869560242,
0.43232953548431396,
0.6996585726737976,
-0.26647892594337463,
-0.09147021174430847,
-1.0019439458847046,
-0.011013388633728027,
0.3218957781791687,
0.17627333104610443,
-0.9934572577476501,
-0.06529147177934647,
0.6385538578033447,
-0.8006622791290283,
0.6297730803489685,
0.06006661802530289,
-0.9607445597648621,
-0.4674241244792938,
-0.45683014392852783,
0.3623436987400055,
0.7150132656097412,
-0.6582027673721313,
0.5258609652519226,
0.27711522579193115,
-0.22783039510250092,
-0.6182132363319397,
-0.8318606615066528,
-0.021688852459192276,
0.2847714126110077,
-0.6045160293579102,
0.6757672429084778,
-0.24029386043548584,
0.3530941903591156,
-0.009214937686920166,
0.09861642122268677,
-0.5038570761680603,
-0.09426957368850708,
-0.13724349439144135,
0.4234820008277893,
-0.15976332128047943,
-0.01666495017707348,
0.1982838660478592,
-0.33611008524894714,
0.14893139898777008,
-0.005732960999011993,
0.7661209106445312,
0.03941578418016434,
-0.33439525961875916,
-0.5814125537872314,
0.27458807826042175,
0.2090277075767517,
-0.2612878084182739,
0.32077914476394653,
1.0751807689666748,
-0.26832491159439087,
-0.18182630836963654,
-0.45778873562812805,
-0.166296124458313,
-0.5716481804847717,
0.6289379000663757,
-0.4795014262199402,
-0.8574600219726562,
0.3411615192890167,
-0.10701964795589447,
0.1901552975177765,
0.7890996932983398,
0.6581952571868896,
0.00016553388559259474,
1.2875735759735107,
0.9564827084541321,
-0.5709841847419739,
0.46179062128067017,
-0.4180549681186676,
0.3914308249950409,
-0.9348953366279602,
0.24103732407093048,
-0.6510975360870361,
0.10237755626440048,
-0.8746957182884216,
-0.3155871033668518,
-0.019928187131881714,
0.16552144289016724,
-0.2790383994579315,
0.7549565434455872,
-0.8331071734428406,
-0.03465968742966652,
0.8225682973861694,
-0.30956801772117615,
-0.10747237503528595,
-0.10139437764883041,
-0.28194788098335266,
-0.024553969502449036,
-0.6114084720611572,
-0.6857872009277344,
0.7815821170806885,
0.6941562294960022,
0.7457996010780334,
-0.021310850977897644,
0.5225739479064941,
-0.042756613343954086,
0.4437680244445801,
-0.822935938835144,
0.5725995898246765,
-0.2253335863351822,
-0.8740950226783752,
-0.31449568271636963,
-0.23488390445709229,
-0.8750448822975159,
0.23580309748649597,
-0.025689035654067993,
-0.8938707709312439,
0.17154307663440704,
0.05972103774547577,
-0.09208773076534271,
0.3854047656059265,
-0.44607508182525635,
0.7664771676063538,
-0.5147808790206909,
0.11797108501195908,
-0.07853981107473373,
-0.7624653577804565,
0.39822185039520264,
-0.003070924198254943,
-0.10106272995471954,
-0.07203628867864609,
0.11414726078510284,
0.7890138626098633,
-0.2147713601589203,
0.8691776990890503,
-0.19189757108688354,
-0.05632973089814186,
0.3227078318595886,
-0.32247936725616455,
0.3166261315345764,
0.17720012366771698,
0.11584769934415817,
0.6338334083557129,
0.20715782046318054,
-0.40741783380508423,
-0.22236856818199158,
0.4946407377719879,
-0.9654344320297241,
-0.4299737215042114,
-0.6129279732704163,
-0.2409064769744873,
0.1600964069366455,
0.570795476436615,
0.5921788215637207,
0.007792138960212469,
-0.013289672322571278,
0.27757692337036133,
0.3380717933177948,
-0.4606456458568573,
0.6091228127479553,
0.5831857919692993,
-0.07105522602796555,
-0.4954412579536438,
0.9734107851982117,
0.14965997636318207,
0.09616486728191376,
0.6816573143005371,
-0.04153198003768921,
-0.25555920600891113,
-0.4623134434223175,
-0.33768901228904724,
0.4038815200328827,
-0.4481240212917328,
0.012411247938871384,
-0.389588862657547,
-0.6219634413719177,
-0.6867481470108032,
0.13722477853298187,
-0.3599247336387634,
-0.4194567799568176,
-0.3053624629974365,
0.02143479324877262,
-0.3427194654941559,
0.1240236684679985,
-0.29746201634407043,
0.5049476623535156,
-1.0991438627243042,
0.5195743441581726,
0.218128964304924,
0.2535170316696167,
0.0248702485114336,
-0.25695398449897766,
-0.5732589960098267,
0.13287413120269775,
-0.895721971988678,
-0.7613081932067871,
0.5991039276123047,
0.008472010493278503,
0.753714382648468,
0.6410149335861206,
0.18922430276870728,
0.541019082069397,
-0.6803693771362305,
1.1549510955810547,
0.3913363516330719,
-1.2646070718765259,
0.42577099800109863,
-0.18471817672252655,
0.36383992433547974,
0.31466373801231384,
0.5227941274642944,
-0.8098825812339783,
-0.3439658284187317,
-0.5079115033149719,
-1.2181729078292847,
0.6873461604118347,
0.3879825174808502,
0.3776452839374542,
-0.031091362237930298,
0.003641613060608506,
-0.01751844212412834,
0.16791540384292603,
-1.1673086881637573,
-0.5715492367744446,
-0.5660281181335449,
-0.3134111166000366,
0.2270674854516983,
-0.42010951042175293,
0.10205627977848053,
-0.23592427372932434,
1.1251450777053833,
0.06582088023424149,
0.861718475818634,
0.5045549869537354,
-0.06162571907043457,
-0.13108515739440918,
0.10122210532426834,
0.4874345660209656,
0.5792236924171448,
-0.28950226306915283,
-0.2504764497280121,
0.08784090727567673,
-0.6737238168716431,
-0.23807330429553986,
0.43264779448509216,
-0.41519954800605774,
0.4654288589954376,
0.5110548734664917,
0.6547741293907166,
0.14187762141227722,
-0.437722772359848,
0.5717464685440063,
-0.16750408709049225,
-0.26024311780929565,
-1.029874563217163,
-0.05035020038485527,
0.04015209898352623,
0.02598986215889454,
0.7281875610351562,
-0.172678142786026,
0.1503971666097641,
-0.1850079447031021,
0.22672681510448456,
0.4352187216281891,
-0.5549265742301941,
-0.4859514534473419,
0.6921127438545227,
0.4956420660018921,
-0.28158703446388245,
0.9122854471206665,
-0.061324797570705414,
-1.0070990324020386,
0.7192692160606384,
0.5048269033432007,
1.077195644378662,
-0.35545918345451355,
0.04858756065368652,
0.6747063398361206,
0.5235477685928345,
0.07728597521781921,
0.2590734362602234,
-0.27270373702049255,
-0.9829133749008179,
-0.556964099407196,
-0.38286715745925903,
-0.472665399312973,
0.436247855424881,
-0.5261749625205994,
0.609691858291626,
-0.4924391508102417,
-0.13012464344501495,
-0.05853138491511345,
-0.0504336804151535,
-0.5114802718162537,
0.15659265220165253,
0.12459450215101242,
1.1894629001617432,
-0.6558050513267517,
1.2444716691970825,
0.6211604475975037,
-0.5710231065750122,
-0.8816918730735779,
0.17831145226955414,
-0.4044504463672638,
-0.766880452632904,
1.1236592531204224,
0.3763372302055359,
0.28749483823776245,
0.07514499872922897,
-0.7849157452583313,
-0.8106002807617188,
1.05435311794281,
-0.15879222750663757,
-0.3541792631149292,
-0.10526679456233978,
0.36235418915748596,
0.42562422156333923,
-0.04691320285201073,
0.4710295796394348,
0.06453946977853775,
0.6580220460891724,
-0.16612528264522552,
-1.202052116394043,
-0.24283099174499512,
-0.3176421821117401,
0.05464298650622368,
0.2725771963596344,
-0.8965230584144592,
0.9094983339309692,
0.10669882595539093,
-0.3492800295352936,
0.3992777466773987,
0.9547367691993713,
0.008838941343128681,
0.13490983843803406,
0.5923263430595398,
0.46891385316848755,
-0.03383215144276619,
-0.23355230689048767,
0.5127851963043213,
-0.613171398639679,
0.8242016434669495,
0.8823015689849854,
-0.07701777666807175,
0.7893807888031006,
0.3847944438457489,
-0.5189485549926758,
0.5665199756622314,
0.7132588028907776,
-0.6483067274093628,
0.6415597200393677,
0.027456356212496758,
-0.11292174458503723,
-0.11030319333076477,
0.12683849036693573,
-0.6016085147857666,
0.2530669867992401,
0.3151761591434479,
-0.3775668442249298,
-0.14542075991630554,
-0.2097216099500656,
-0.01246184203773737,
-0.4381963908672333,
-0.06145889684557915,
0.541451632976532,
0.14316578209400177,
-0.31001418828964233,
0.512535035610199,
0.3666835129261017,
1.0309901237487793,
-1.1035650968551636,
-0.3739650547504425,
0.2747449576854706,
0.16674335300922394,
-0.05466248095035553,
-0.6578044295310974,
0.1516769975423813,
-0.3589477837085724,
-0.16508308053016663,
-0.1528850793838501,
0.8510433435440063,
-0.3428257405757904,
-0.5693237781524658,
0.45312753319740295,
0.08621060848236084,
0.14854386448860168,
0.3127005696296692,
-1.2046306133270264,
-0.3586329221725464,
0.36484429240226746,
-0.4297054708003998,
0.1640593707561493,
0.1672852784395218,
0.1072639673948288,
0.6746634840965271,
0.9216880202293396,
0.08886929601430893,
-0.13708317279815674,
-0.04658401384949684,
0.9480705857276917,
-0.613899827003479,
-0.5801711082458496,
-0.7258849143981934,
0.7868161797523499,
-0.24904899299144745,
-0.3855590522289276,
0.7506584525108337,
0.745879590511322,
1.1937576532363892,
-0.37220436334609985,
1.0724517107009888,
-0.41602352261543274,
0.8008097410202026,
-0.20339052379131317,
0.8471335768699646,
-0.4227968156337738,
-0.15092076361179352,
-0.3640407621860504,
-0.9366281032562256,
-0.24822784960269928,
0.9338046908378601,
-0.1552172750234604,
-0.06655268371105194,
0.7084479928016663,
0.6390094757080078,
0.007548151537775993,
-0.23080576956272125,
0.15721449255943298,
0.18865899741649628,
0.6470962166786194,
0.47444072365760803,
0.5867832899093628,
-0.5551859140396118,
0.6550678610801697,
-0.681523859500885,
-0.21021130681037903,
-0.14016427099704742,
-0.7389732003211975,
-0.746959924697876,
-0.6293913722038269,
-0.28809353709220886,
-0.11012210696935654,
-0.2660921812057495,
0.8760043978691101,
0.7973306179046631,
-1.1152266263961792,
-0.4788879454135895,
-0.029430711641907692,
0.11049452424049377,
-0.35660189390182495,
-0.366147518157959,
0.6489894986152649,
-0.4408990740776062,
-1.1977583169937134,
0.013264622539281845,
0.08221959322690964,
0.10776060819625854,
-0.31874769926071167,
-0.014452415518462658,
-0.30452749133110046,
-0.18569156527519226,
0.4381124675273895,
0.4631252586841583,
-0.7868823409080505,
-0.3293067216873169,
-0.003974746912717819,
-0.21353313326835632,
0.1263802945613861,
0.6306383013725281,
-0.24030330777168274,
0.3931303322315216,
0.7117152810096741,
0.29961997270584106,
0.37077587842941284,
-0.16006198525428772,
0.7384554743766785,
-0.5069637298583984,
0.2726370692253113,
0.34290698170661926,
0.5623499751091003,
0.33580219745635986,
-0.23133628070354462,
0.5135906338691711,
0.43998584151268005,
-0.7583412528038025,
-0.6059789657592773,
0.3418117165565491,
-1.0816868543624878,
-0.28722599148750305,
0.9472413063049316,
-0.28442883491516113,
-0.1394139528274536,
-0.12832042574882507,
-0.6206808686256409,
0.6720387935638428,
-0.32690513134002686,
0.6260845065116882,
0.8976812362670898,
-0.06235409155488014,
-0.09909260272979736,
-0.534205973148346,
0.3995579183101654,
0.45890098810195923,
-0.36074113845825195,
-0.3742142617702484,
0.012869199737906456,
0.19866861402988434,
0.6493396162986755,
0.4692581593990326,
-0.1448817104101181,
0.12744548916816711,
-0.1673792153596878,
0.6365803480148315,
0.027646126225590706,
0.20884718000888824,
0.04397004842758179,
-0.1949807107448578,
0.03750014677643776,
-0.4361960291862488
] |
facebook/esm2_t12_35M_UR50D | facebook | "2023-03-21T15:04:57Z" | 1,763,510 | 4 | transformers | [
"transformers",
"pytorch",
"tf",
"safetensors",
"esm",
"fill-mask",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-09-27T14:30:05Z" | ---
license: mit
widget:
- text: "MQIFVKTLTGKTITLEVEPS<mask>TIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG"
---
## ESM-2
ESM-2 is a state-of-the-art protein model trained on a masked language modelling objective. It is suitable for fine-tuning on a wide range of tasks that take protein sequences as input. For detailed information on the model architecture and training data, please refer to the [accompanying paper](https://www.biorxiv.org/content/10.1101/2022.07.20.500902v2). You may also be interested in some demo notebooks ([PyTorch](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling.ipynb), [TensorFlow](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling-tf.ipynb)) which demonstrate how to fine-tune ESM-2 models on your tasks of interest.
Several ESM-2 checkpoints are available in the Hub with varying sizes. Larger sizes generally have somewhat better accuracy, but require much more memory and time to train:
| Checkpoint name | Num layers | Num parameters |
|------------------------------|----|----------|
| [esm2_t48_15B_UR50D](https://huggingface.co/facebook/esm2_t48_15B_UR50D) | 48 | 15B |
| [esm2_t36_3B_UR50D](https://huggingface.co/facebook/esm2_t36_3B_UR50D) | 36 | 3B |
| [esm2_t33_650M_UR50D](https://huggingface.co/facebook/esm2_t33_650M_UR50D) | 33 | 650M |
| [esm2_t30_150M_UR50D](https://huggingface.co/facebook/esm2_t30_150M_UR50D) | 30 | 150M |
| [esm2_t12_35M_UR50D](https://huggingface.co/facebook/esm2_t12_35M_UR50D) | 12 | 35M |
| [esm2_t6_8M_UR50D](https://huggingface.co/facebook/esm2_t6_8M_UR50D) | 6 | 8M | | [
-0.43286916613578796,
-0.5948188304901123,
0.3451700806617737,
0.25143834948539734,
-0.21601180732250214,
0.07263188809156418,
0.14439348876476288,
-0.5148124098777771,
0.26199525594711304,
0.41369765996932983,
-0.823645830154419,
-0.5298078060150146,
-0.9321447610855103,
0.08285602927207947,
-0.2009565830230713,
1.0775045156478882,
0.016725201159715652,
0.2736850380897522,
-0.3467542827129364,
-0.0974586233496666,
-0.10452957451343536,
-0.24699701368808746,
-0.8235457539558411,
-0.7321904897689819,
0.33444544672966003,
0.4830930233001709,
0.27816280722618103,
0.6799968481063843,
0.483710914850235,
0.23480339348316193,
-0.5061230659484863,
0.3614945709705353,
-0.5236067175865173,
0.1913013458251953,
-0.1278853714466095,
-0.4432218670845032,
-0.8108993768692017,
-0.15640226006507874,
0.4631693959236145,
0.5357983112335205,
0.05967068672180176,
0.5000954270362854,
0.20006313920021057,
0.9462715983390808,
-0.33044615387916565,
0.20107398927211761,
-0.4289981424808502,
0.2930558919906616,
-0.30063536763191223,
-0.0294165201485157,
-0.38406872749328613,
0.05322859063744545,
0.06543418020009995,
-0.3559257388114929,
0.20486700534820557,
0.15609800815582275,
1.3329850435256958,
0.22855551540851593,
-0.6410025358200073,
-0.2321455329656601,
-0.4450559914112091,
0.8633005023002625,
-0.4986128509044647,
0.44113239645957947,
0.7549484372138977,
0.31233540177345276,
-0.311479389667511,
-0.7776964902877808,
-0.03774675726890564,
0.31149277091026306,
-0.018207045271992683,
0.4075634479522705,
-0.2706676423549652,
0.19684995710849762,
0.5741735100746155,
0.3238019347190857,
-0.9867098331451416,
0.20061780512332916,
-0.6449559926986694,
-0.22502902150154114,
0.5896285176277161,
0.21261174976825714,
0.34234681725502014,
0.029040465131402016,
-0.4778575897216797,
0.15694497525691986,
-0.5793555378913879,
0.05346396192908287,
0.29802146553993225,
-0.04445972666144371,
-0.23009276390075684,
0.6315001249313354,
-0.480423241853714,
0.7830644249916077,
0.07780147343873978,
-0.1703084409236908,
0.49410390853881836,
-0.0571163147687912,
0.036438338458538055,
-0.5153999328613281,
0.5630656480789185,
0.7384749054908752,
-0.09274467825889587,
-0.11241381615400314,
-0.4512767791748047,
-0.11555881798267365,
0.056661564856767654,
-1.3266040086746216,
-0.17637522518634796,
0.6442699432373047,
-0.5269268155097961,
-0.24235236644744873,
0.14367489516735077,
-0.8252849578857422,
-0.012478902004659176,
-0.2597578763961792,
0.38785606622695923,
-0.5422586798667908,
-0.2528670132160187,
0.17664362490177155,
-0.4887385666370392,
0.35865965485572815,
0.22958333790302277,
-0.8911137580871582,
0.6524139046669006,
0.7310635447502136,
1.204780101776123,
-0.044345736503601074,
-0.23178869485855103,
-0.45360684394836426,
0.2968023121356964,
-0.14748544991016388,
0.8973982334136963,
-0.22378353774547577,
-0.054943036288022995,
0.03227940946817398,
0.3305625319480896,
-0.06580691784620285,
-0.5599132776260376,
0.4015985429286957,
-0.3154959976673126,
0.16187289357185364,
-0.44350239634513855,
-0.8219118118286133,
-0.42323148250579834,
0.12532706558704376,
-0.4397115111351013,
1.511417269706726,
0.22225822508335114,
-0.5932333469390869,
0.10905569791793823,
-0.596603274345398,
-0.36443719267845154,
-0.010763244703412056,
-0.15697887539863586,
-0.7766455411911011,
0.12372530996799469,
-0.1986265629529953,
0.44252124428749084,
-0.33904075622558594,
0.032737866044044495,
-0.348014771938324,
-0.3738921880722046,
0.07780202478170395,
0.46803247928619385,
0.72878497838974,
0.4880448877811432,
-0.6219625473022461,
-0.32824161648750305,
-0.9636508226394653,
0.27144044637680054,
0.22943241894245148,
-0.2865031957626343,
0.37163564562797546,
0.031491719186306,
0.2388780564069748,
0.6633126139640808,
0.26304522156715393,
-0.49460721015930176,
0.08127875626087189,
-0.3347261846065521,
0.6760265231132507,
0.47823628783226013,
0.021799767389893532,
0.30168917775154114,
-0.7133479118347168,
0.43020161986351013,
0.046437397599220276,
0.09081178903579712,
-0.11273607611656189,
-0.8875462412834167,
-0.9781202077865601,
-0.41126102209091187,
-0.09131547808647156,
0.709625780582428,
-0.28704267740249634,
0.7993070483207703,
0.1780405342578888,
-0.6202290058135986,
-0.3906804919242859,
0.11966904997825623,
0.5862323641777039,
0.26789480447769165,
0.49038735032081604,
-0.21219372749328613,
-0.8324195146560669,
-1.24872887134552,
-0.39795610308647156,
0.021931996569037437,
-0.32722410559654236,
0.2212991863489151,
0.8645740747451782,
-0.3867488205432892,
0.7940034866333008,
-0.38670575618743896,
-0.31946876645088196,
-0.18432576954364777,
0.1253906488418579,
0.13540205359458923,
0.6940749883651733,
0.6713649034500122,
-0.467111736536026,
-0.4518308937549591,
-0.12512120604515076,
-0.8316616415977478,
-0.22168487310409546,
0.16300183534622192,
-0.052125152200460434,
0.16502241790294647,
0.6559585332870483,
-0.49920654296875,
0.12339610606431961,
0.7405292391777039,
-0.6772065758705139,
0.1437574028968811,
-0.1701519787311554,
-0.03467698022723198,
-1.399620532989502,
0.22133202850818634,
0.0010441772174090147,
-0.4963051378726959,
-0.6787911057472229,
0.11090599000453949,
0.182108536362648,
-0.22018320858478546,
-0.6039910316467285,
0.701884388923645,
-0.7848694324493408,
-0.3400299847126007,
-0.3983633518218994,
-0.03083828277885914,
0.2713123857975006,
0.5318776369094849,
0.018705854192376137,
0.4734397828578949,
0.7913426160812378,
-0.37162044644355774,
0.058225031942129135,
0.3924252986907959,
-0.3197719156742096,
0.45273545384407043,
-0.9615444540977478,
0.5378125905990601,
-0.2790154218673706,
0.3468168079853058,
-1.0673848390579224,
-0.4796869158744812,
0.16322264075279236,
-0.5583397150039673,
0.5518417358398438,
-0.36080700159072876,
-0.4871777594089508,
-0.5269289016723633,
-0.4776739478111267,
0.1847769021987915,
0.8182274699211121,
-0.3804255425930023,
0.46660682559013367,
0.5981992483139038,
-0.04036524146795273,
-0.3835642635822296,
-1.0345759391784668,
-0.12370975315570831,
-0.12907953560352325,
-0.6919488906860352,
0.4997578561306,
0.030942892655730247,
0.1698799729347229,
-0.1807207614183426,
-0.14772100746631622,
0.11725518107414246,
0.026875590905547142,
0.6858153939247131,
-0.04615432769060135,
0.12290260940790176,
-0.20047304034233093,
0.3994077742099762,
-0.312433660030365,
-0.18986493349075317,
-0.2758200764656067,
0.7003496885299683,
-0.5158420205116272,
-0.20546548068523407,
-0.7183876037597656,
0.48914051055908203,
0.7337195873260498,
-0.1175120547413826,
0.9533959627151489,
0.8746064901351929,
-0.8861373066902161,
-0.125338613986969,
-0.6284884810447693,
-0.4729703664779663,
-0.4544825553894043,
0.8687288761138916,
-0.6350417733192444,
-1.1199365854263306,
0.8227498531341553,
-0.22240781784057617,
0.02171579748392105,
0.5882766246795654,
0.6833544969558716,
-0.2745453119277954,
1.3089244365692139,
0.4021073877811432,
0.3787214159965515,
0.42246222496032715,
-0.5024165511131287,
-0.09165925532579422,
-1.0258433818817139,
-0.8448766469955444,
-0.6438778638839722,
-0.49330946803092957,
-0.45237019658088684,
-0.5272616147994995,
0.13273440301418304,
0.6052178740501404,
-0.5750541687011719,
0.7132769227027893,
-0.3632934093475342,
0.49136853218078613,
0.26081541180610657,
0.3297274708747864,
-0.1986551135778427,
0.2191268354654312,
-0.09125966578722,
0.043674662709236145,
-0.8945397734642029,
-0.6452824473381042,
0.9477233290672302,
0.9216138124465942,
0.4873199760913849,
0.1407938450574875,
0.6541234850883484,
0.10780592262744904,
-0.10015279799699783,
-0.8777646422386169,
0.5124962329864502,
-0.16278061270713806,
-0.855940580368042,
-0.09292086213827133,
-0.20696617662906647,
-0.7199745774269104,
0.14624932408332825,
-0.2342839241027832,
-1.0072033405303955,
-0.029355701059103012,
0.1913592517375946,
-0.23155775666236877,
0.35147249698638916,
-0.5749273300170898,
0.6769623756408691,
0.01282842643558979,
-0.33755895495414734,
-0.12911729514598846,
-0.8871088027954102,
-0.025059595704078674,
0.0015477384440600872,
0.08690007776021957,
-0.42939531803131104,
-0.18667705357074738,
1.090214490890503,
-0.6050925850868225,
0.802660346031189,
-0.17979438602924347,
0.3715484142303467,
0.29586589336395264,
0.036759454756975174,
0.9599766135215759,
0.10200387239456177,
-0.19007724523544312,
0.32956254482269287,
0.12195350229740143,
-0.9123082756996155,
-0.24976876378059387,
0.5426566004753113,
-1.0748339891433716,
-0.1674443930387497,
-0.5904820561408997,
-0.35250917077064514,
-0.20058749616146088,
0.2541351616382599,
0.7725739479064941,
0.49955448508262634,
-0.015055048279464245,
0.3713914453983307,
0.6618280410766602,
-0.2682616710662842,
0.27281343936920166,
0.7709749341011047,
-0.23358692228794098,
-0.5733029246330261,
0.6574614644050598,
0.2715482711791992,
0.3607094883918762,
0.36277154088020325,
-0.13399241864681244,
-0.4601365029811859,
-0.6286524534225464,
-0.44345545768737793,
0.2813057005405426,
-0.5167379379272461,
-0.45645344257354736,
-1.1660727262496948,
-0.33647724986076355,
-0.3974854648113251,
-0.14647093415260315,
-0.8324502110481262,
-0.48203879594802856,
-0.23493880033493042,
-0.2952269911766052,
0.6371464133262634,
0.6796403527259827,
-0.29942893981933594,
0.242500439286232,
-0.6598784923553467,
0.20505554974079132,
0.18426337838172913,
0.42188572883605957,
-0.4713980257511139,
-1.010549783706665,
-0.19826146960258484,
-0.043430060148239136,
-0.2952716052532196,
-1.0545628070831299,
0.24816875159740448,
0.5593339800834656,
0.47217923402786255,
0.4722321927547455,
-0.430264413356781,
0.39207974076271057,
-0.4509093761444092,
0.7517218589782715,
0.3917974531650543,
-0.7027214169502258,
0.8234429359436035,
-0.4790959060192108,
0.30232948064804077,
0.6857604384422302,
0.3746759593486786,
-0.7092304229736328,
-0.4439576268196106,
-0.5651525855064392,
-0.8582442402839661,
0.9340387582778931,
0.34992745518684387,
-0.01652023382484913,
-0.15044862031936646,
0.47456297278404236,
0.10882019996643066,
0.0661044493317604,
-0.4665970504283905,
-0.5329884886741638,
0.0615118145942688,
-0.08179668337106705,
0.2044447809457779,
-0.7658749222755432,
-0.19441789388656616,
-0.3271101415157318,
1.094083309173584,
-0.17655408382415771,
0.5558725595474243,
0.021935194730758667,
-0.031178433448076248,
-0.4360264241695404,
-0.17567691206932068,
0.7940462231636047,
0.5575451254844666,
-0.5597056746482849,
0.1061491146683693,
0.39536455273628235,
-0.46131715178489685,
-0.04697268828749657,
0.09902091324329376,
-0.4287671148777008,
0.050634995102882385,
0.23913723230361938,
0.9357270002365112,
0.09405004978179932,
-0.4959694445133209,
0.5749691128730774,
0.2188093513250351,
-0.4756297171115875,
-0.2218163013458252,
-0.12192211300134659,
0.33507412672042847,
0.45828402042388916,
0.2343909740447998,
0.19782201945781708,
0.15282116830348969,
-0.6308636665344238,
0.467692494392395,
0.2777506411075592,
-0.6649008393287659,
-0.4118964672088623,
0.7857384085655212,
0.1880180537700653,
-0.4098900258541107,
0.7456859946250916,
-0.538620114326477,
-0.6710497140884399,
0.8551456332206726,
0.8817096948623657,
0.8575696349143982,
-0.2745877802371979,
0.23418395221233368,
0.9822799563407898,
0.2996458411216736,
-0.40997666120529175,
0.648109495639801,
0.407463014125824,
-0.6366848945617676,
-0.14258742332458496,
-0.9431370496749878,
-0.0515194833278656,
0.4995492398738861,
-0.9731295704841614,
0.550543487071991,
-0.4150903820991516,
-0.27912214398384094,
-0.10849761962890625,
0.18115390837192535,
-0.8356630802154541,
0.17058567702770233,
0.09854123741388321,
1.197348952293396,
-1.1796214580535889,
0.9587405323982239,
1.051628589630127,
-0.26639634370803833,
-0.504551351070404,
-0.5443487167358398,
0.4354577958583832,
-0.9515924453735352,
0.22350428998470306,
0.40875178575515747,
0.18324773013591766,
0.0760713517665863,
-0.3669179081916809,
-0.9488543272018433,
1.594597578048706,
0.2440950721502304,
-0.9640191197395325,
0.17932042479515076,
0.04864425212144852,
0.5473630428314209,
-0.2976279556751251,
0.416392058134079,
0.5125850439071655,
0.2287057489156723,
0.131259024143219,
-0.6905020475387573,
0.12463442236185074,
-0.5395618081092834,
0.1987660676240921,
0.16984392702579498,
-1.2356675863265991,
0.7695242762565613,
-0.28845879435539246,
-0.03907173126935959,
0.4521067440509796,
0.650055468082428,
0.6364552974700928,
0.44041356444358826,
0.31808698177337646,
0.8376544117927551,
0.7555709481239319,
-0.33967626094818115,
0.8847651481628418,
-0.5171399116516113,
0.9460013508796692,
0.9976338148117065,
-0.019087374210357666,
0.6146108508110046,
0.5725572109222412,
-0.31570547819137573,
0.28442123532295227,
1.1209683418273926,
-0.2828802764415741,
0.46939370036125183,
0.3305080533027649,
-0.0628325492143631,
-0.3642248511314392,
-0.07465386390686035,
-0.6704146265983582,
0.1814834475517273,
0.2459566444158554,
-0.39215797185897827,
-0.20207110047340393,
-0.05756114050745964,
0.1448030322790146,
-0.1788448840379715,
-0.018468767404556274,
0.7589463591575623,
0.24003605544567108,
-0.44018709659576416,
0.3197686970233917,
0.2985588610172272,
0.44438934326171875,
-0.6040270924568176,
0.050799038261175156,
-0.4867650866508484,
0.09601303189992905,
-0.3775447607040405,
-0.6895162463188171,
0.34429430961608887,
0.06953170895576477,
-0.25856372714042664,
-0.32116857171058655,
0.8495295643806458,
-0.5368079543113708,
-0.5446425080299377,
0.4853071868419647,
0.5193317532539368,
0.5130595564842224,
-0.05218454450368881,
-1.0712345838546753,
0.2279108613729477,
-0.23420660197734833,
-0.5590859055519104,
0.4882259666919708,
0.1224512830376625,
0.3459535241127014,
0.6662497520446777,
0.2276192456483841,
-0.18255087733268738,
-0.1301821917295456,
0.06933418661355972,
0.7336953282356262,
-0.5853554606437683,
-0.4619547426700592,
-0.7329950928688049,
0.5440044403076172,
-0.07051265984773636,
-0.4264679253101349,
0.711409330368042,
1.1590054035186768,
0.901970386505127,
-0.24581432342529297,
0.5727592706680298,
-0.20875731110572815,
0.5699768662452698,
-0.5159938931465149,
0.6337248682975769,
-0.7762610912322998,
-0.11790647357702255,
-0.007060658652335405,
-0.9663395285606384,
-0.18284662067890167,
0.7047803997993469,
0.09676951915025711,
0.16786301136016846,
0.641517162322998,
1.1378881931304932,
0.1565818190574646,
-0.10736837983131409,
0.18737508356571198,
0.15306153893470764,
0.139578178524971,
0.7925640940666199,
0.7373891472816467,
-1.008851408958435,
0.17869222164154053,
-0.2666102647781372,
-0.42373591661453247,
-0.4338560402393341,
-0.6463002562522888,
-1.1623371839523315,
-0.7806965708732605,
-0.6067060232162476,
-0.8000723719596863,
0.30066439509391785,
1.171266794204712,
1.1211860179901123,
-1.1225453615188599,
-0.1436522752046585,
-0.1925220489501953,
-0.29240062832832336,
-0.36766162514686584,
-0.14665351808071136,
0.25265151262283325,
-0.17920581996440887,
-0.9155244827270508,
0.34177500009536743,
0.5698809027671814,
0.26092207431793213,
0.21766024827957153,
-0.4829370379447937,
-0.28912749886512756,
0.007561840116977692,
0.7385510206222534,
0.3997464179992676,
-0.6201385855674744,
-0.3795100450515747,
0.021847322583198547,
-0.2776602506637573,
-0.09566562622785568,
0.4103512167930603,
-0.0979374498128891,
0.3248024582862854,
0.682682991027832,
0.42947113513946533,
1.052815318107605,
-0.21410758793354034,
0.42501717805862427,
-0.70964515209198,
0.29764965176582336,
0.11865447461605072,
0.3484519124031067,
0.0926651656627655,
-0.15573042631149292,
0.7088847160339355,
0.43991678953170776,
-0.5910385251045227,
-0.8363285064697266,
0.3932109475135803,
-1.2730122804641724,
-0.32323750853538513,
1.5713574886322021,
0.026301996782422066,
-0.011736903339624405,
-0.018540676683187485,
-0.06211797147989273,
0.4315938949584961,
-0.26602068543434143,
0.6443262100219727,
0.7616723775863647,
-0.24025817215442657,
-0.0173515435308218,
-0.6844722628593445,
0.8017314076423645,
0.5649874806404114,
-0.8154276013374329,
-0.5120301842689514,
0.10946990549564362,
0.5754485130310059,
-0.15814930200576782,
0.653670072555542,
-0.42765146493911743,
0.236716166138649,
0.1116117388010025,
-0.01058210339397192,
-0.31468769907951355,
-0.404886931180954,
-0.3129856586456299,
0.044454168528318405,
0.03808499500155449,
-0.2857479453086853
] |
vinai/bertweet-base | vinai | "2022-10-22T08:52:39Z" | 1,763,160 | 21 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"roberta",
"fill-mask",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:05Z" | # <a name="introduction"></a> BERTweet: A pre-trained language model for English Tweets
BERTweet is the first public large-scale language model pre-trained for English Tweets. BERTweet is trained based on the [RoBERTa](https://github.com/pytorch/fairseq/blob/master/examples/roberta/README.md) pre-training procedure. The corpus used to pre-train BERTweet consists of 850M English Tweets (16B word tokens ~ 80GB), containing 845M Tweets streamed from 01/2012 to 08/2019 and 5M Tweets related to the **COVID-19** pandemic. The general architecture and experimental results of BERTweet can be found in our [paper](https://aclanthology.org/2020.emnlp-demos.2/):
@inproceedings{bertweet,
title = {{BERTweet: A pre-trained language model for English Tweets}},
author = {Dat Quoc Nguyen and Thanh Vu and Anh Tuan Nguyen},
booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
pages = {9--14},
year = {2020}
}
**Please CITE** our paper when BERTweet is used to help produce published results or is incorporated into other software.
For further information or requests, please go to [BERTweet's homepage](https://github.com/VinAIResearch/BERTweet)!
### Main results
<p float="left">
<img width="275" alt="postagging" src="https://user-images.githubusercontent.com/2412555/135724590-01d8d435-262d-44fe-a383-cd39324fe190.png" />
<img width="275" alt="ner" src="https://user-images.githubusercontent.com/2412555/135724598-1e3605e7-d8ce-4c5e-be4a-62ae8501fae7.png" />
</p>
<p float="left">
<img width="275" alt="sentiment" src="https://user-images.githubusercontent.com/2412555/135724597-f1981f1e-fe73-4c03-b1ff-0cae0cc5f948.png" />
<img width="275" alt="irony" src="https://user-images.githubusercontent.com/2412555/135724595-15f4f2c8-bbb6-4ee6-82a0-034769dec183.png" />
</p>
| [
-0.5186978578567505,
-0.6306571364402771,
0.29735836386680603,
0.2943166196346283,
-0.4795588552951813,
0.030664963647723198,
-0.3726380467414856,
-0.5504613518714905,
0.5431251525878906,
0.15793870389461517,
-0.5621097683906555,
-0.6429836750030518,
-0.6499027609825134,
-0.19973675906658173,
-0.4062745273113251,
0.9311440587043762,
0.13629703223705292,
-0.2104843705892563,
0.22754526138305664,
0.08939236402511597,
0.022178081795573235,
-0.5130943059921265,
-0.7026499509811401,
-0.03221987932920456,
0.7278730869293213,
0.19425265491008759,
0.7806258797645569,
0.16424685716629028,
0.6082490086555481,
0.25567924976348877,
0.16180668771266937,
-0.1666124016046524,
-0.647852897644043,
-0.046505022794008255,
0.1719132363796234,
0.09091749042272568,
-0.3650040030479431,
0.010817107744514942,
0.40340182185173035,
0.3387872576713562,
0.1128678023815155,
0.15569815039634705,
0.10144830495119095,
0.6233742237091064,
-0.566534698009491,
0.010940509848296642,
-0.6806818842887878,
-0.20254254341125488,
-0.39074164628982544,
-0.22049932181835175,
-0.2850383222103119,
-0.6150380373001099,
0.39634376764297485,
-0.6069009900093079,
0.0731978714466095,
-0.04723460227251053,
1.620037317276001,
-0.201011061668396,
-0.23997822403907776,
-0.10073896497488022,
-0.47504231333732605,
0.7438873648643494,
-0.8595288395881653,
0.3672759234905243,
0.31297188997268677,
0.17988727986812592,
0.02427632175385952,
-0.903674304485321,
-0.6201285123825073,
-0.24510586261749268,
-0.1339322179555893,
0.26249614357948303,
-0.4779406487941742,
-0.12365338206291199,
-0.005977656226605177,
-0.00923110917210579,
-0.6989452242851257,
-0.024119392037391663,
-0.168810173869133,
-0.029428837820887566,
0.5479702353477478,
-0.3997980058193207,
0.2823158800601959,
-0.31176674365997314,
-0.6119980216026306,
-0.230643168091774,
-0.4194614887237549,
0.06221834197640419,
0.13167999684810638,
0.1401730626821518,
-0.2840580940246582,
0.2610032856464386,
0.14541107416152954,
0.3845502436161041,
-0.07820204645395279,
0.15797309577465057,
0.43744218349456787,
-0.1589566022157669,
-0.18380384147167206,
-0.402769535779953,
1.1905455589294434,
0.3970669209957123,
0.4838515818119049,
-0.04140006750822067,
-0.46314001083374023,
-0.28619393706321716,
0.21000389754772186,
-0.9793449640274048,
-0.29054147005081177,
0.16006428003311157,
-0.503837525844574,
-0.26960626244544983,
0.07333588600158691,
-0.6480169892311096,
-0.11829039454460144,
-0.0817689374089241,
0.7846280932426453,
-0.8525499105453491,
-0.3339385688304901,
-0.14231984317302704,
-0.06073882058262825,
0.4297751486301422,
0.5920478105545044,
-0.6767098903656006,
-0.02741905115544796,
0.5581026077270508,
0.7933474183082581,
0.30097460746765137,
-0.27098900079727173,
-0.05328931286931038,
0.0836540162563324,
-0.3109962046146393,
0.839532732963562,
-0.28384581208229065,
-0.052447546273469925,
0.2564936578273773,
0.017290666699409485,
-0.002365022199228406,
-0.007175032515078783,
0.5856353044509888,
-0.6348010897636414,
0.20569385588169098,
-0.4513123631477356,
-0.5920613408088684,
-0.14494271576404572,
0.2568407952785492,
-0.4803306758403778,
1.0112532377243042,
0.005556013435125351,
-1.1163257360458374,
0.4240422248840332,
-0.9312552213668823,
-0.5265015959739685,
0.2141011506319046,
-0.19791793823242188,
-0.5230733156204224,
-0.13624504208564758,
0.397594153881073,
0.8125947117805481,
-0.17666000127792358,
0.0987071692943573,
-0.5382605791091919,
-0.26343289017677307,
0.13255788385868073,
-0.26576268672943115,
1.2103638648986816,
0.12994441390037537,
-0.42561259865760803,
-0.10269070416688919,
-0.4915560483932495,
0.0205818060785532,
0.546904981136322,
-0.21291764080524445,
-0.17522215843200684,
-0.053206559270620346,
0.36150890588760376,
0.22184790670871735,
0.6372849345207214,
-0.6590787768363953,
0.12166526913642883,
-0.18654397130012512,
0.5687267780303955,
0.9639576077461243,
-0.11141347140073776,
0.2832961976528168,
-0.5949015021324158,
0.3075827956199646,
-0.22085489332675934,
0.338423490524292,
-0.17106007039546967,
-0.4542980194091797,
-0.5613263249397278,
-0.5582923293113708,
0.21640247106552124,
0.4981786608695984,
-0.5720254182815552,
0.7101046442985535,
-0.5836223363876343,
-0.6846135258674622,
-0.6246322989463806,
-0.24055646359920502,
0.08753824979066849,
0.40967804193496704,
0.3295081555843353,
-0.08762017637491226,
-0.6379473209381104,
-0.9661347270011902,
-0.12382517009973526,
-0.33254608511924744,
0.013560155406594276,
0.2828562259674072,
0.7066820859909058,
-0.2606334090232849,
0.9905043244361877,
-0.4747757911682129,
-0.13877710700035095,
0.0789262130856514,
0.30610668659210205,
0.16474997997283936,
0.528858482837677,
0.9414432644844055,
-0.8095712661743164,
-0.7478128671646118,
-0.05623338371515274,
-0.5366469621658325,
-0.08246824890375137,
-0.07413014769554138,
-0.2795381247997284,
0.5278926491737366,
0.3123806416988373,
-0.7352351546287537,
0.5547932982444763,
0.7624360918998718,
-0.2658458948135376,
0.6528533101081848,
-0.11339934170246124,
0.3300522267818451,
-1.3485734462738037,
0.18928289413452148,
0.039592064917087555,
-0.3763182461261749,
-0.4617827832698822,
-0.11182897537946701,
0.11461441218852997,
0.03155943751335144,
-0.4296518564224243,
0.5540626645088196,
-0.4573861062526703,
0.011275763623416424,
0.05096004530787468,
0.027526425197720528,
-0.018460053950548172,
0.42284175753593445,
-0.05468674749135971,
0.7181703448295593,
0.6969707012176514,
-0.1555071771144867,
0.25553643703460693,
-0.0032630800269544125,
-0.41416850686073303,
0.31706058979034424,
-0.8307273983955383,
0.1627989113330841,
0.028889058157801628,
0.3366025686264038,
-1.2765164375305176,
-0.27763161063194275,
0.08645975589752197,
-0.8745264410972595,
0.1597561538219452,
-0.18598897755146027,
-0.8873786926269531,
-0.44211551547050476,
-0.5738345384597778,
0.016084326431155205,
0.8690975904464722,
-0.5701411366462708,
0.4584469795227051,
0.31491032242774963,
-0.0435846708714962,
-0.5906947255134583,
-0.8856509327888489,
0.1143726333975792,
0.015943489968776703,
-1.0828920602798462,
0.2703705430030823,
-0.011655719019472599,
0.16866719722747803,
0.2562282085418701,
0.11935635656118393,
-0.3652926981449127,
-0.008756790310144424,
0.21366673707962036,
0.30382728576660156,
-0.19145695865154266,
0.3780772387981415,
-0.2714363634586334,
0.15752869844436646,
-0.1307661235332489,
-0.36389172077178955,
0.7653853297233582,
-0.30286842584609985,
-0.43411776423454285,
-0.624656081199646,
0.3715248703956604,
0.6269126534461975,
-0.24608807265758514,
0.969559907913208,
1.0117298364639282,
-0.41103851795196533,
0.006627645809203386,
-0.648435115814209,
-0.24711568653583527,
-0.46039679646492004,
0.30139943957328796,
-0.2170858085155487,
-1.009172797203064,
0.6773722767829895,
0.22553426027297974,
0.4027711749076843,
0.5772751569747925,
0.5820895433425903,
-0.7893080115318298,
0.7502269148826599,
0.29764217138290405,
-0.004690962377935648,
0.7993417382240295,
-0.3825612962245941,
0.29705581068992615,
-0.37931740283966064,
0.10452819615602493,
-0.49543389678001404,
-0.32575324177742004,
-0.9237661361694336,
-0.3820432424545288,
0.1639920324087143,
-0.015961753204464912,
-0.45435982942581177,
0.5310559868812561,
-0.5224108695983887,
0.2319287359714508,
0.6118137240409851,
0.27757999300956726,
-0.2156972736120224,
0.06003180518746376,
-0.014014019630849361,
-0.07345031946897507,
-0.5166328549385071,
-0.5838084816932678,
1.1777807474136353,
0.4075627326965332,
0.8540052771568298,
0.1991388201713562,
1.1336172819137573,
0.21322253346443176,
0.2747914791107178,
-0.5827070474624634,
0.6084523797035217,
-0.35616323351860046,
-0.8951238393783569,
-0.4661920368671417,
-0.30988672375679016,
-1.2511672973632812,
0.06461808830499649,
-0.29257848858833313,
-0.7188619375228882,
0.0774642750620842,
0.19117309153079987,
-0.18330703675746918,
0.5111759901046753,
-1.0214381217956543,
0.7246363162994385,
-0.31650713086128235,
-0.26181530952453613,
-0.14966197311878204,
-0.6544419527053833,
0.040265750139951706,
-0.09851685166358948,
0.27503901720046997,
-0.20048309862613678,
-0.036953192204236984,
0.8263001441955566,
-0.512077271938324,
0.95047527551651,
-0.3022921085357666,
0.05726701021194458,
0.16038261353969574,
-0.02277241460978985,
0.7190107703208923,
0.07205808162689209,
0.12885984778404236,
0.26469749212265015,
0.0059457034803926945,
-0.8131923079490662,
-0.2412298619747162,
0.6211839914321899,
-1.0447970628738403,
-0.5065220594406128,
-0.41959527134895325,
-0.20199169218540192,
0.09501771628856659,
0.3914021849632263,
0.5455420613288879,
0.31481224298477173,
-0.33112892508506775,
0.6592066884040833,
0.5767861008644104,
-0.34365037083625793,
0.6081410646438599,
0.30357667803764343,
-0.11322800815105438,
-0.4219142496585846,
0.6663834452629089,
0.34532278776168823,
0.1170782595872879,
0.5913585424423218,
0.1245948001742363,
-0.180354505777359,
-0.4729439616203308,
0.12215881049633026,
0.23067966103553772,
-0.5679028034210205,
-0.21285274624824524,
-0.7189300656318665,
-0.3465535342693329,
-0.9431520700454712,
-0.5627763867378235,
-0.4265701472759247,
-0.40388038754463196,
-0.38404422998428345,
0.14615346491336823,
0.6521187424659729,
0.5834292769432068,
-0.26402077078819275,
0.350145548582077,
-0.5869699716567993,
0.2773628234863281,
0.520534873008728,
0.34869661927223206,
0.02699245698750019,
-0.5584964156150818,
-0.29711779952049255,
0.07464820146560669,
-0.2854277491569519,
-0.7818388342857361,
0.46233299374580383,
0.15433986485004425,
0.4015628695487976,
0.4587489664554596,
0.10624295473098755,
0.6013955473899841,
-0.5269922614097595,
0.7829209566116333,
0.47823116183280945,
-0.8800058364868164,
0.650344729423523,
-0.5951677560806274,
0.266802579164505,
0.515434205532074,
0.3853215277194977,
-0.6128686666488647,
-0.4757233262062073,
-0.9072267413139343,
-1.06642484664917,
0.5986979007720947,
0.46008214354515076,
0.1611618846654892,
-0.10922398418188095,
-0.06614860147237778,
-0.11615213751792908,
-0.01817179284989834,
-0.8323590755462646,
-0.2126634418964386,
-0.21895325183868408,
-0.19281591475009918,
0.03850763663649559,
-0.21431173384189606,
-0.04077574983239174,
-0.5547064542770386,
0.7351548671722412,
0.21429499983787537,
0.7275714874267578,
0.2976168990135193,
-0.2274676114320755,
-0.051569677889347076,
0.20320622622966766,
0.6013193726539612,
0.7314199805259705,
-0.5749053955078125,
-0.02896779216825962,
-0.1538945436477661,
-0.5041407942771912,
-0.2970792353153229,
0.4133012294769287,
-0.15072238445281982,
0.22866059839725494,
0.6597639918327332,
0.8603978157043457,
0.16251279413700104,
-0.3354921042919159,
0.9313672780990601,
-0.09573899954557419,
-0.4477425515651703,
-0.6874209642410278,
-0.3792911469936371,
0.21156038343906403,
0.2506343126296997,
0.7857511043548584,
0.1419263631105423,
-0.14302890002727509,
-0.3478473126888275,
0.39692002534866333,
0.5451433658599854,
-0.23528869450092316,
-0.4656621813774109,
0.4121825397014618,
0.24571672081947327,
-0.12515214085578918,
0.2865448594093323,
-0.27693507075309753,
-0.7017253637313843,
0.5537168979644775,
0.20831219851970673,
1.181504249572754,
0.05640726536512375,
0.33907341957092285,
0.4333569407463074,
0.8189881443977356,
0.28635120391845703,
0.45252397656440735,
0.22911302745342255,
-0.7539655566215515,
-0.4105737805366516,
-0.5396589636802673,
-0.19365763664245605,
0.27847161889076233,
-0.4628959596157074,
0.3817451298236847,
-0.639164388179779,
-0.41270846128463745,
0.2407982349395752,
0.11400116980075836,
-0.9819185137748718,
0.19025717675685883,
0.19182626903057098,
1.0505235195159912,
-0.837543785572052,
0.9707918763160706,
0.953154981136322,
-0.5935372114181519,
-0.9603544473648071,
0.4244280457496643,
-0.28999799489974976,
-0.9773780703544617,
0.7422396540641785,
0.12761640548706055,
0.05910555273294449,
0.10742747038602829,
-1.0232484340667725,
-0.8494377136230469,
1.1248987913131714,
0.4862499237060547,
-0.4190545082092285,
-0.03368215635418892,
-0.17557397484779358,
0.47144949436187744,
-0.29124853014945984,
0.33739545941352844,
0.11300697922706604,
0.5449219346046448,
0.04500551521778107,
-0.9616513252258301,
0.10791000723838806,
-0.21469667553901672,
0.10103319585323334,
0.19707322120666504,
-0.7731072902679443,
1.0109387636184692,
-0.09554889798164368,
-0.19170686602592468,
-0.14900317788124084,
0.4976917803287506,
0.11320418119430542,
0.07603228837251663,
0.6227867007255554,
0.7405117154121399,
0.5523560047149658,
-0.40719127655029297,
1.0520989894866943,
-0.26549217104911804,
0.7834848165512085,
0.8608021140098572,
0.059596750885248184,
0.961155354976654,
0.604145884513855,
-0.2803765833377838,
0.5182509422302246,
0.7035254240036011,
0.16704267263412476,
0.5218870639801025,
0.06532933562994003,
-0.11463828384876251,
-0.24930162727832794,
0.0707068145275116,
-0.44805416464805603,
0.15956729650497437,
0.2181984931230545,
-0.40639764070510864,
-0.32239747047424316,
-0.07467668503522873,
0.20673851668834686,
-0.16556546092033386,
0.008299616165459156,
0.6075937747955322,
-0.12010768800973892,
-0.22774744033813477,
0.8556071519851685,
-0.3388030230998993,
0.9300094842910767,
-0.6674500107765198,
0.25868237018585205,
-0.10124219208955765,
-0.00028820434818044305,
-0.18461300432682037,
-1.1490485668182373,
0.03569436073303223,
0.0864017903804779,
0.01921035349369049,
-0.4152018129825592,
0.8091943860054016,
-0.17966331541538239,
-0.38949039578437805,
0.5216562151908875,
0.27042868733406067,
0.18361708521842957,
-0.08114819973707199,
-1.025928020477295,
0.08998070657253265,
0.09212230145931244,
-0.756563663482666,
0.021277641877532005,
0.8209486603736877,
0.20411579310894012,
0.5405548214912415,
0.5630365610122681,
0.08538250625133514,
0.28087958693504333,
0.12145473062992096,
1.1083611249923706,
-0.6185510754585266,
-0.5327203273773193,
-0.743208646774292,
0.6842224597930908,
-0.23080022633075714,
-0.19123442471027374,
0.5766887664794922,
0.45400720834732056,
0.8655122518539429,
-0.20884168148040771,
1.1216487884521484,
-0.5535668134689331,
0.6713714599609375,
-0.17414772510528564,
0.9702911376953125,
-0.850990355014801,
-0.166190043091774,
-0.37511706352233887,
-0.6216450333595276,
-0.28182509541511536,
0.7917037010192871,
-0.5006243586540222,
0.28502437472343445,
0.6736270189285278,
0.811073362827301,
0.0667724460363388,
-0.258463054895401,
0.3128674626350403,
0.40925508737564087,
0.3399788737297058,
0.5139551162719727,
0.7429608702659607,
-0.4791180491447449,
0.7132667899131775,
-0.35684677958488464,
-0.35753074288368225,
-0.5412145853042603,
-0.7984133362770081,
-0.9661608934402466,
-0.8213733434677124,
-0.15736520290374756,
-0.35631778836250305,
0.267042338848114,
1.1757948398590088,
1.022835612297058,
-0.9301998615264893,
-0.060995351523160934,
0.004709379747509956,
-0.13922825455665588,
0.09442715346813202,
-0.29451465606689453,
0.5524477958679199,
-0.3017549216747284,
-0.5904388427734375,
-0.24500949680805206,
0.1222018226981163,
0.22800582647323608,
-0.022789986804127693,
-0.1135927215218544,
-0.7106199860572815,
0.19210287928581238,
0.647092342376709,
0.2035961002111435,
-0.6153409481048584,
-0.4887380599975586,
0.01598677970468998,
-0.46206995844841003,
0.23331831395626068,
0.22789952158927917,
-0.4096798002719879,
0.14116300642490387,
0.6494715809822083,
0.5730436444282532,
0.4993007183074951,
-0.14245353639125824,
0.2374362051486969,
-1.0019563436508179,
0.21681934595108032,
0.44670024514198303,
0.32215172052383423,
0.25154224038124084,
-0.23336032032966614,
0.4297794699668884,
0.27861863374710083,
-0.673346757888794,
-0.8397414684295654,
-0.037391941994428635,
-1.2401307821273804,
-0.30829450488090515,
0.9867512583732605,
-0.26382243633270264,
-0.15610262751579285,
0.2699548304080963,
-0.16423292458057404,
0.3391788601875305,
-1.0228276252746582,
0.6522180438041687,
0.8232303261756897,
0.23776541650295258,
-0.328731894493103,
-0.593619167804718,
0.3862798810005188,
0.30560263991355896,
-0.7775848507881165,
-0.1282099038362503,
0.2545740604400635,
0.22999036312103271,
0.2518540024757385,
0.8644265532493591,
0.08342939615249634,
0.2644199728965759,
-0.3334800899028778,
0.5285270810127258,
0.32692205905914307,
0.004199468530714512,
-0.13077174127101898,
-0.019455406814813614,
0.0027795101050287485,
-0.438536137342453
] |
ProsusAI/finbert | ProsusAI | "2023-05-23T12:43:35Z" | 1,720,184 | 391 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"bert",
"text-classification",
"financial-sentiment-analysis",
"sentiment-analysis",
"en",
"arxiv:1908.10063",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:04Z" | ---
language: "en"
tags:
- financial-sentiment-analysis
- sentiment-analysis
widget:
- text: "Stocks rallied and the British pound gained."
---
FinBERT is a pre-trained NLP model to analyze sentiment of financial text. It is built by further training the BERT language model in the finance domain, using a large financial corpus and thereby fine-tuning it for financial sentiment classification. [Financial PhraseBank](https://www.researchgate.net/publication/251231107_Good_Debt_or_Bad_Debt_Detecting_Semantic_Orientations_in_Economic_Texts) by Malo et al. (2014) is used for fine-tuning. For more details, please see the paper [FinBERT: Financial Sentiment Analysis with Pre-trained Language Models](https://arxiv.org/abs/1908.10063) and our related [blog post](https://medium.com/prosus-ai-tech-blog/finbert-financial-sentiment-analysis-with-bert-b277a3607101) on Medium.
The model will give softmax outputs for three labels: positive, negative or neutral.
---
About Prosus
Prosus is a global consumer internet group and one of the largest technology investors in the world. Operating and investing globally in markets with long-term growth potential, Prosus builds leading consumer internet companies that empower people and enrich communities. For more information, please visit www.prosus.com.
Contact information
Please contact Dogu Araci dogu.araci[at]prosus[dot]com and Zulkuf Genc zulkuf.genc[at]prosus[dot]com about any FinBERT related issues and questions.
| [
-0.632326602935791,
-0.6054813861846924,
0.10096311569213867,
0.258531391620636,
-0.5443767309188843,
0.07644841074943542,
-0.11298477649688721,
-0.3709738254547119,
0.3733147978782654,
0.8145055770874023,
-0.7346611618995667,
-0.78035569190979,
-0.44957247376441956,
-0.13567088544368744,
-0.28857550024986267,
1.9274342060089111,
0.16765327751636505,
0.5382109880447388,
0.27045977115631104,
-0.028481286019086838,
-0.1343812346458435,
-0.47614917159080505,
-1.042383074760437,
-0.045517127960920334,
0.5173768401145935,
0.4984595775604248,
0.8743801712989807,
-0.05117957293987274,
0.8162838220596313,
0.37853968143463135,
0.07442997395992279,
-0.20342473685741425,
-0.4912416338920593,
-0.0002789938298519701,
-0.05978941172361374,
-0.45536506175994873,
-0.7266917824745178,
0.19905588030815125,
0.3728038966655731,
0.53509122133255,
0.20061704516410828,
0.501758873462677,
0.23002365231513977,
0.9436168074607849,
-0.5381402969360352,
0.37601837515830994,
-0.17050878703594208,
-0.0061561064794659615,
-0.197660431265831,
0.006692824885249138,
-0.253336101770401,
-0.7052962779998779,
0.5040034055709839,
-0.48776862025260925,
0.4021035432815552,
0.20078475773334503,
1.1315304040908813,
0.08544439822435379,
-0.25264567136764526,
-0.44197407364845276,
-0.6333478689193726,
0.9059119820594788,
-0.8013512492179871,
0.35544419288635254,
0.191105917096138,
0.2374444305896759,
0.0022320356220006943,
-0.8761274814605713,
-0.5037714838981628,
-0.0960746482014656,
-0.13019520044326782,
0.23259034752845764,
-0.3258802592754364,
0.24942375719547272,
-0.24399594962596893,
0.1665600836277008,
-0.3829815983772278,
-0.3282797634601593,
-0.8527494072914124,
-0.24874454736709595,
0.7232599854469299,
-0.18275919556617737,
-0.23679718375205994,
-0.0020354066509753466,
-1.016097903251648,
-0.26851534843444824,
-0.5237313508987427,
0.5254749655723572,
0.7492772340774536,
0.44673049449920654,
0.07364986836910248,
0.12450379133224487,
0.3554062247276306,
0.9592735171318054,
-0.01225843746215105,
-0.06355715543031693,
0.5809664130210876,
-0.07016759365797043,
-0.43405261635780334,
0.4240607023239136,
0.7976909279823303,
0.5942625403404236,
0.743143618106842,
0.1814792901277542,
-0.504538357257843,
-0.293307900428772,
0.40041667222976685,
-0.5640283823013306,
-0.31689453125,
0.5773187875747681,
-0.6824744939804077,
-0.49302053451538086,
0.35123008489608765,
-0.607729434967041,
-0.28526571393013,
-0.26058608293533325,
0.4295688569545746,
-0.49240532517433167,
-0.28565680980682373,
0.3112837076187134,
-0.24292273819446564,
0.1306936889886856,
0.06799448281526566,
-0.9632096290588379,
0.5260260701179504,
0.8622040152549744,
0.5410323739051819,
0.39481428265571594,
-0.07172120362520218,
-0.6378002762794495,
-0.3280148506164551,
-0.4322884678840637,
0.841439425945282,
-0.11777269095182419,
-0.11006729304790497,
0.18350672721862793,
0.12902364134788513,
0.0736829861998558,
-0.5065874457359314,
0.8303360342979431,
-0.5742637515068054,
0.0684918612241745,
-0.27084168791770935,
-0.5758115649223328,
-0.48672834038734436,
0.06257293373346329,
-0.5625702142715454,
0.5191097259521484,
0.4036952555179596,
-1.0748426914215088,
0.528939425945282,
-0.8104644417762756,
-0.19039271771907806,
0.2646961212158203,
0.1559099704027176,
-0.4105178117752075,
-0.08313632756471634,
-0.2945200502872467,
0.8203305006027222,
-0.4007588326931,
0.6901782751083374,
-0.33634623885154724,
-0.4411464035511017,
0.547187089920044,
-0.06546954810619354,
0.7710549831390381,
0.4305107593536377,
-0.35698866844177246,
0.486510306596756,
-0.6871691942214966,
-0.2861371338367462,
-0.11091640591621399,
0.14253152906894684,
-0.6979596614837646,
0.11893417686223984,
0.29992860555648804,
0.03687829151749611,
0.5872069001197815,
-0.8987410664558411,
0.04993718862533569,
-0.6789578199386597,
0.4687625467777252,
0.9943987131118774,
-0.16053687036037445,
0.23937422037124634,
-0.3072725832462311,
0.39004579186439514,
-0.14339405298233032,
0.6901004314422607,
0.3336983323097229,
-0.33201974630355835,
-0.7839483022689819,
-0.39549219608306885,
0.5026324391365051,
0.9418593645095825,
-0.3527587950229645,
0.3735921084880829,
0.13128171861171722,
-0.6052511930465698,
-0.6909345984458923,
0.3779401183128357,
0.19697809219360352,
0.6539066433906555,
0.29382726550102234,
-0.32061636447906494,
-0.4472760558128357,
-1.5593575239181519,
-0.11938681453466415,
-0.3970794677734375,
-0.028375528752803802,
-0.011510748416185379,
0.45008784532546997,
-0.18029753863811493,
0.9321401715278625,
-0.5766249299049377,
-0.5017312169075012,
-0.4033719003200531,
0.27053242921829224,
0.7802930474281311,
0.509401261806488,
0.88531893491745,
-1.1846154928207397,
-0.2621006965637207,
-0.3460882902145386,
-0.43787816166877747,
0.0908116027712822,
-0.4404071569442749,
-0.24427570402622223,
0.05760978162288666,
0.2775978744029999,
-0.35530388355255127,
0.1265404373407364,
0.5098994374275208,
-0.7415981292724609,
0.6704320907592773,
-0.18350805342197418,
-0.03918730467557907,
-0.8944668173789978,
0.200429767370224,
0.3354918360710144,
-0.09442957490682602,
-0.7519713044166565,
-0.20133757591247559,
-0.11391264945268631,
0.11264628916978836,
-0.6002089977264404,
0.29351934790611267,
0.24893470108509064,
-0.00861663743853569,
-0.15471681952476501,
0.31164786219596863,
-0.0461895689368248,
0.48190784454345703,
-0.05600255727767944,
0.8623757362365723,
0.5015584230422974,
-0.5992556810379028,
0.550956130027771,
0.32988420128822327,
-0.24917733669281006,
0.45488622784614563,
-0.7221518158912659,
-0.5058577060699463,
-0.00870583113282919,
0.08561605960130692,
-1.3235899209976196,
0.1705155223608017,
0.5810049176216125,
-0.5284467935562134,
0.12770313024520874,
0.3409156799316406,
-0.47991299629211426,
-0.29224368929862976,
-0.6592447757720947,
0.11643391102552414,
0.284654825925827,
-0.3692186176776886,
0.44945672154426575,
0.26524031162261963,
-0.5629171133041382,
-0.9255092740058899,
-0.5426740050315857,
-0.08179681748151779,
-0.31132936477661133,
-0.822791576385498,
0.3622434735298157,
-0.12818017601966858,
-0.6976499557495117,
0.06374602019786835,
-0.04889753833413124,
-0.147163525223732,
0.23401311039924622,
0.1554221212863922,
0.7759658098220825,
-0.30139094591140747,
0.38519424200057983,
-0.0005403931136243045,
-0.49032923579216003,
0.19565267860889435,
-0.49486416578292847,
0.4897353947162628,
-0.8751976490020752,
0.26558610796928406,
-0.4299575984477997,
0.17700724303722382,
0.601653516292572,
-0.17559562623500824,
0.9009920358657837,
0.9084386825561523,
-0.14136341214179993,
0.18421968817710876,
-0.5662119388580322,
-0.06446606665849686,
-0.5793437957763672,
-0.034583307802677155,
0.08407540619373322,
-1.0679004192352295,
0.6240934133529663,
-0.1577625423669815,
0.47412070631980896,
0.9488664865493774,
0.425615131855011,
-0.32976943254470825,
0.6207650899887085,
0.8229799270629883,
-0.099915511906147,
0.3415259122848511,
-0.5657957196235657,
0.4163739085197449,
-0.468058705329895,
-0.340368390083313,
-0.46124324202537537,
-0.45884785056114197,
-0.569358229637146,
0.32934311032295227,
0.059529710561037064,
0.28498604893684387,
-0.6794271469116211,
0.5364398956298828,
-0.5360783934593201,
0.009769654832780361,
0.718546450138092,
-0.25037866830825806,
-0.17423400282859802,
-0.1148039698600769,
-0.3095673620700836,
-0.13775166869163513,
-0.5704535841941833,
-0.7079108357429504,
0.8283867835998535,
0.4738384187221527,
0.6742405891418457,
-0.05011523887515068,
0.8705042600631714,
0.7911220192909241,
0.6057917475700378,
-0.7155986428260803,
0.5859899520874023,
-0.6166295409202576,
-0.7084434032440186,
-0.2084093540906906,
-0.2382010519504547,
-1.000325083732605,
-0.08920283615589142,
-0.4132099151611328,
-0.8703105449676514,
0.4361366927623749,
0.20766215026378632,
-1.0012017488479614,
0.35083654522895813,
-0.5828587412834167,
1.1458494663238525,
-0.533857524394989,
-0.44430696964263916,
-0.10942692309617996,
-0.7790237069129944,
0.4675033688545227,
-0.3123248815536499,
0.6119900345802307,
-0.19278962910175323,
-0.00841705221682787,
1.059893012046814,
-0.5671536922454834,
1.018520474433899,
-0.41336938738822937,
-0.3434925079345703,
0.5315262675285339,
-0.029296930879354477,
0.22505444288253784,
0.2432362288236618,
-0.030238576233386993,
0.10254108905792236,
0.2243901789188385,
-0.41875773668289185,
-0.34421953558921814,
0.5761327743530273,
-0.953316867351532,
-0.3324037194252014,
-0.4995573163032532,
-0.3028223216533661,
-0.10711759328842163,
0.03850670903921127,
0.141313835978508,
0.5273868441581726,
-0.10678654909133911,
0.19177187979221344,
0.5495023727416992,
-0.5013919472694397,
0.2586795389652252,
0.4271542727947235,
-0.30987614393234253,
-0.6491659283638,
1.166983962059021,
-0.042202554643154144,
0.00753546180203557,
0.27753394842147827,
0.20325829088687897,
-0.2885894477367401,
-0.2636200189590454,
-0.2138206958770752,
0.31971994042396545,
-0.7877030372619629,
-0.3515744209289551,
-0.41835886240005493,
-0.30731651186943054,
-0.47844964265823364,
-0.6763747930526733,
-0.6171399354934692,
-0.5143905282020569,
-0.3108748495578766,
-0.2457270324230194,
0.5301815867424011,
0.6536684632301331,
-0.30177462100982666,
0.6280811429023743,
-1.1292014122009277,
0.05303425341844559,
0.1159990131855011,
0.3310505449771881,
-0.2896399199962616,
-0.1627112329006195,
-0.3011992871761322,
-0.30344903469085693,
-0.08842440694570541,
-0.7753129005432129,
0.6635635495185852,
0.08749332278966904,
0.5561004281044006,
0.9539511203765869,
0.343034565448761,
0.19668088853359222,
0.16892826557159424,
0.8847841620445251,
0.39777013659477234,
-1.015589714050293,
0.4244528114795685,
-0.2587827742099762,
0.06766324490308762,
0.9499084949493408,
0.6245116591453552,
-0.5250852108001709,
-0.6226069331169128,
-0.8252778649330139,
-1.2871215343475342,
0.4819360077381134,
0.05815299600362778,
0.15180017054080963,
-0.012358236126601696,
0.44547000527381897,
0.4731100797653198,
0.4606039822101593,
-0.6895318627357483,
-0.36829426884651184,
-0.3292080760002136,
-0.3790077567100525,
-0.34733694791793823,
-0.5203604698181152,
-0.0741133913397789,
-0.3804962933063507,
0.9360800385475159,
0.19351953268051147,
0.37163886427879333,
0.27799859642982483,
0.19677859544754028,
0.08901796489953995,
0.2834336459636688,
0.9078173041343689,
0.6450472474098206,
-0.6677582263946533,
0.017299653962254524,
0.03850070387125015,
-0.5380045771598816,
-0.060132842510938644,
0.2888028621673584,
0.09726785123348236,
0.18336926400661469,
0.48991501331329346,
0.8752548694610596,
0.35568317770957947,
-0.8382808566093445,
0.7592175602912903,
-0.17851042747497559,
-0.9107370376586914,
-0.9896884560585022,
0.1279178261756897,
-0.09634844213724136,
0.7705995440483093,
0.6995895504951477,
0.519131600856781,
0.3467916250228882,
-0.2916802167892456,
0.373982697725296,
0.1667034924030304,
-0.8095975518226624,
-0.20907291769981384,
0.7931593656539917,
0.32320278882980347,
-0.14129695296287537,
0.82643723487854,
-0.18467074632644653,
-0.8103922605514526,
0.598387598991394,
0.299100786447525,
1.003135323524475,
-0.030469458550214767,
0.6177586913108826,
0.34669530391693115,
0.3849073350429535,
-0.10752540826797485,
0.6956481337547302,
-0.10885708034038544,
-0.7348461151123047,
-0.503792405128479,
-0.8556150794029236,
-0.2921733558177948,
0.15989550948143005,
-0.788186252117157,
0.25114914774894714,
-0.8335538506507874,
-0.7774642109870911,
0.048919204622507095,
0.07694468647241592,
-0.526068925857544,
0.34676694869995117,
0.15474462509155273,
1.16423761844635,
-0.8054524064064026,
0.6749696731567383,
0.6088387966156006,
-0.2551399767398834,
-0.5945177674293518,
-0.2513927221298218,
-0.15022434294223785,
-0.5428394079208374,
1.1978989839553833,
0.20449866354465485,
-0.45242270827293396,
-0.03170230612158775,
-0.7551450729370117,
-0.5680490732192993,
0.7506346106529236,
0.2786514163017273,
-0.7050538659095764,
0.3444859981536865,
-0.054617028683423996,
0.6377951502799988,
-0.4867042899131775,
-0.2867019474506378,
0.44680488109588623,
0.6865143179893494,
-0.02321474812924862,
-0.5107568502426147,
-0.19203922152519226,
-0.5432260036468506,
-0.6359093189239502,
0.41692134737968445,
-0.7243002653121948,
1.1507542133331299,
-0.16092409193515778,
0.1953304409980774,
-0.16018903255462646,
0.6585767269134521,
-0.019065959379076958,
0.42881470918655396,
0.792664647102356,
0.1993444859981537,
0.7298018932342529,
-0.09504561126232147,
0.9661809206008911,
-0.8943287134170532,
0.5916658639907837,
0.7029167413711548,
-0.08948103338479996,
0.8109807372093201,
0.425536572933197,
-0.08140503615140915,
0.7583953738212585,
0.9765617847442627,
-0.4665212333202362,
0.582975447177887,
0.39699220657348633,
-0.36240267753601074,
-0.48963791131973267,
0.038020920008420944,
-0.26420241594314575,
0.4157131314277649,
0.4395795166492462,
-0.7462077736854553,
-0.04756426811218262,
0.195590078830719,
0.03467326983809471,
-0.25897321105003357,
-0.45500603318214417,
0.37409737706184387,
0.16633884608745575,
-0.4903889298439026,
0.5083090662956238,
0.22927579283714294,
0.7150780558586121,
-0.9615069627761841,
0.2171846181154251,
-0.049909286201000214,
0.6080514788627625,
-0.1717238575220108,
-0.7152994871139526,
0.4294852912425995,
0.09713391214609146,
0.19773779809474945,
-0.3907370865345001,
0.9673246145248413,
-0.014342433772981167,
-0.6214799284934998,
0.4486762285232544,
0.4142453372478485,
0.2779024541378021,
0.27262744307518005,
-0.9877838492393494,
-0.29914262890815735,
-0.06612144410610199,
-0.439138799905777,
0.15395309031009674,
-0.08533861488103867,
0.1249791607260704,
0.686287522315979,
0.5812094807624817,
-0.08197557181119919,
-0.7000246047973633,
0.08948872983455658,
0.6975334882736206,
-0.5936518311500549,
-0.5392560958862305,
-1.1253750324249268,
0.3189769685268402,
-0.11454115062952042,
-0.554374098777771,
0.6969703435897827,
0.6732215881347656,
0.8142493963241577,
-0.2790067493915558,
0.6687630414962769,
0.22516417503356934,
0.20041002333164215,
-0.28617098927497864,
0.8552629947662354,
-0.6154974102973938,
0.04156609624624252,
-0.5429122447967529,
-0.8031567335128784,
-0.5262417793273926,
0.9351096153259277,
-0.4906075596809387,
-0.36936163902282715,
0.4361298382282257,
0.3830055892467499,
0.2665683627128601,
0.3606308102607727,
0.04577108845114708,
0.05312460660934448,
-0.14279469847679138,
0.21414010226726532,
0.5000619888305664,
-0.10485617816448212,
0.6232637763023376,
-0.07221180945634842,
-0.18655459582805634,
-0.2712191641330719,
-0.5779473781585693,
-0.8744605183601379,
-0.6675528287887573,
-0.2783133387565613,
-0.45183196663856506,
0.10370061546564102,
1.169628620147705,
0.32113999128341675,
-0.9926888346672058,
-0.516115128993988,
0.06641661375761032,
-0.13997213542461395,
-0.26063066720962524,
-0.19761154055595398,
0.6202636957168579,
-0.4571169912815094,
-0.3068772554397583,
-0.09327560663223267,
0.362620085477829,
0.03612947091460228,
-0.49720415472984314,
0.03895821049809456,
-0.1457866132259369,
0.33518826961517334,
0.4643445909023285,
0.06371879577636719,
-0.30183035135269165,
-0.22618161141872406,
0.042082302272319794,
-0.07920278608798981,
-0.11891774088144302,
0.8854707479476929,
-0.49136558175086975,
0.17147591710090637,
0.4181000590324402,
0.32701361179351807,
0.23172296583652496,
-0.03538551181554794,
0.7240948677062988,
-0.39275240898132324,
0.08554211258888245,
0.20541542768478394,
0.40302184224128723,
0.1353190839290619,
-0.40093499422073364,
0.39772412180900574,
0.1542341262102127,
-0.45842912793159485,
-0.4115653336048126,
-0.1043301373720169,
-0.9064180254936218,
-0.6851407885551453,
0.8481120467185974,
-0.2884586751461029,
-0.368922621011734,
-0.20077532529830933,
-0.4523247480392456,
0.2386590987443924,
-0.5311357975006104,
0.5576954483985901,
0.6525998115539551,
-0.13481931388378143,
0.1907223016023636,
-1.0760151147842407,
0.4919634461402893,
0.3283856511116028,
-0.18937347829341888,
-0.14932796359062195,
0.14369536936283112,
0.1882466971874237,
0.39325711131095886,
0.7770475149154663,
0.1898791640996933,
0.26394468545913696,
-0.01975022815167904,
0.4202195405960083,
-0.07745138555765152,
-0.3457353413105011,
0.17395229637622833,
0.3878866136074066,
-0.018984714522957802,
-0.21384403109550476
] |
cardiffnlp/twitter-roberta-base-sentiment-latest | cardiffnlp | "2023-05-28T05:45:10Z" | 1,632,960 | 268 | transformers | [
"transformers",
"pytorch",
"tf",
"roberta",
"text-classification",
"en",
"dataset:tweet_eval",
"arxiv:2202.03829",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-15T01:21:58Z" | ---
language: en
widget:
- text: Covid cases are increasing fast!
datasets:
- tweet_eval
---
# Twitter-roBERTa-base for Sentiment Analysis - UPDATED (2022)
This is a RoBERTa-base model trained on ~124M tweets from January 2018 to December 2021, and finetuned for sentiment analysis with the TweetEval benchmark.
The original Twitter-based RoBERTa model can be found [here](https://huggingface.co/cardiffnlp/twitter-roberta-base-2021-124m) and the original reference paper is [TweetEval](https://github.com/cardiffnlp/tweeteval). This model is suitable for English.
- Reference Paper: [TimeLMs paper](https://arxiv.org/abs/2202.03829).
- Git Repo: [TimeLMs official repository](https://github.com/cardiffnlp/timelms).
<b>Labels</b>:
0 -> Negative;
1 -> Neutral;
2 -> Positive
This sentiment analysis model has been integrated into [TweetNLP](https://github.com/cardiffnlp/tweetnlp). You can access the demo [here](https://tweetnlp.org).
## Example Pipeline
```python
from transformers import pipeline
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("Covid cases are increasing fast!")
```
```
[{'label': 'Negative', 'score': 0.7236}]
```
## Full classification example
```python
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
from scipy.special import softmax
# Preprocess text (username and link placeholders)
def preprocess(text):
new_text = []
for t in text.split(" "):
t = '@user' if t.startswith('@') and len(t) > 1 else t
t = 'http' if t.startswith('http') else t
new_text.append(t)
return " ".join(new_text)
MODEL = f"cardiffnlp/twitter-roberta-base-sentiment-latest"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
config = AutoConfig.from_pretrained(MODEL)
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
#model.save_pretrained(MODEL)
text = "Covid cases are increasing fast!"
text = preprocess(text)
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = softmax(scores)
# # TF
# model = TFAutoModelForSequenceClassification.from_pretrained(MODEL)
# model.save_pretrained(MODEL)
# text = "Covid cases are increasing fast!"
# encoded_input = tokenizer(text, return_tensors='tf')
# output = model(encoded_input)
# scores = output[0][0].numpy()
# scores = softmax(scores)
# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
for i in range(scores.shape[0]):
l = config.id2label[ranking[i]]
s = scores[ranking[i]]
print(f"{i+1}) {l} {np.round(float(s), 4)}")
```
Output:
```
1) Negative 0.7236
2) Neutral 0.2287
3) Positive 0.0477
```
### References
```
@inproceedings{camacho-collados-etal-2022-tweetnlp,
title = "{T}weet{NLP}: Cutting-Edge Natural Language Processing for Social Media",
author = "Camacho-collados, Jose and
Rezaee, Kiamehr and
Riahi, Talayeh and
Ushio, Asahi and
Loureiro, Daniel and
Antypas, Dimosthenis and
Boisson, Joanne and
Espinosa Anke, Luis and
Liu, Fangyu and
Mart{\'\i}nez C{\'a}mara, Eugenio" and others,
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
month = dec,
year = "2022",
address = "Abu Dhabi, UAE",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.emnlp-demos.5",
pages = "38--49"
}
```
```
@inproceedings{loureiro-etal-2022-timelms,
title = "{T}ime{LM}s: Diachronic Language Models from {T}witter",
author = "Loureiro, Daniel and
Barbieri, Francesco and
Neves, Leonardo and
Espinosa Anke, Luis and
Camacho-collados, Jose",
booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations",
month = may,
year = "2022",
address = "Dublin, Ireland",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.acl-demo.25",
doi = "10.18653/v1/2022.acl-demo.25",
pages = "251--260"
}
```
| [
-0.17200317978858948,
-0.7293568849563599,
0.2638394236564636,
0.4035067856311798,
-0.2594057023525238,
0.23109057545661926,
-0.3279559314250946,
-0.3370872437953949,
0.23672634363174438,
0.01346618216484785,
-0.5867047905921936,
-0.8321694135665894,
-0.6822740435600281,
0.04737871140241623,
-0.28417888283729553,
1.0205057859420776,
-0.04131794720888138,
0.05094477906823158,
0.20708802342414856,
-0.20600111782550812,
0.06383226066827774,
-0.5454474687576294,
-0.727372944355011,
-0.2799721658229828,
0.2652745842933655,
0.15735463798046112,
0.4415062665939331,
0.4027324616909027,
0.38883933424949646,
0.41996443271636963,
-0.08644264936447144,
0.010478923097252846,
-0.288507342338562,
0.181524857878685,
0.05418626219034195,
-0.23136110603809357,
-0.6251575946807861,
0.2073853611946106,
0.6870133280754089,
0.6328529119491577,
0.1315276175737381,
0.4019443988800049,
0.10590735077857971,
0.33022770285606384,
-0.4122355282306671,
0.22470349073410034,
-0.3599284887313843,
-0.03639042377471924,
-0.17594094574451447,
-0.2413678616285324,
-0.36889657378196716,
-0.49279385805130005,
0.10085140913724899,
-0.43667083978652954,
0.2847992181777954,
-0.07663771510124207,
1.2546027898788452,
0.20008091628551483,
-0.19665418565273285,
0.008730342611670494,
-0.5442604422569275,
1.1214548349380493,
-0.9879426956176758,
0.17765475809574127,
0.12143395096063614,
0.08519086241722107,
-0.0570976696908474,
-0.5587890148162842,
-0.5699586272239685,
-0.16608092188835144,
0.03363027051091194,
0.18685288727283478,
-0.33424821496009827,
-0.08713816851377487,
0.19274351000785828,
0.11764231324195862,
-0.5561060309410095,
-0.05628485232591629,
-0.3011750876903534,
-0.10685998946428299,
0.7000815272331238,
0.12261934578418732,
0.21095170080661774,
-0.35448601841926575,
-0.26809027791023254,
-0.18108342587947845,
-0.08030500262975693,
0.05731726437807083,
0.03640254586935043,
0.37353774905204773,
-0.4875281751155853,
0.6097267866134644,
-0.07722106575965881,
0.5779337882995605,
0.10409718006849289,
-0.1233343780040741,
0.7137678861618042,
-0.38057515025138855,
-0.32613372802734375,
-0.2212757021188736,
1.258966088294983,
0.3779584467411041,
0.379192590713501,
-0.1389460414648056,
-0.1682339906692505,
0.07084321975708008,
-0.20201854407787323,
-0.7697960138320923,
-0.07368876785039902,
0.40688493847846985,
-0.4536501169204712,
-0.5568113327026367,
0.03257779777050018,
-0.9337226152420044,
-0.0387662872672081,
-0.05385250225663185,
0.5469812154769897,
-0.5017576813697815,
-0.3623380959033966,
0.021702516824007034,
-0.2351270318031311,
0.13434049487113953,
0.1253790259361267,
-0.6099874973297119,
0.23359155654907227,
0.49438753724098206,
0.9486280679702759,
-0.0477927066385746,
-0.35527560114860535,
-0.408716082572937,
-0.01696867309510708,
-0.3289099633693695,
0.642646312713623,
-0.33474063873291016,
-0.26114532351493835,
-0.09357520937919617,
-0.07959681749343872,
-0.21815688908100128,
-0.1911872923374176,
0.4200764298439026,
-0.3334324359893799,
0.45903775095939636,
0.04081437736749649,
-0.499420702457428,
0.04512401297688484,
0.22359079122543335,
-0.3132079243659973,
1.188919186592102,
0.19320470094680786,
-0.7371201515197754,
0.1509927362203598,
-0.9042855501174927,
-0.4029228687286377,
-0.1659366637468338,
0.20511193573474884,
-0.478868305683136,
-0.031765956431627274,
0.3146701455116272,
0.5847337245941162,
-0.26340559124946594,
0.33733341097831726,
-0.528818666934967,
-0.1401805877685547,
0.3272625803947449,
-0.32547470927238464,
1.2944999933242798,
0.3112035095691681,
-0.5524488687515259,
0.10208675265312195,
-0.7414773106575012,
0.2899573743343353,
0.16870638728141785,
-0.3011537790298462,
-0.11704176664352417,
-0.1987437903881073,
0.10841864347457886,
0.32269030809402466,
0.3916940987110138,
-0.6446191072463989,
0.1819448471069336,
-0.5082433223724365,
0.6307759881019592,
0.7621757984161377,
0.09232248365879059,
0.4111446142196655,
-0.38302475214004517,
0.41608914732933044,
0.032376453280448914,
0.29539427161216736,
0.1360047310590744,
-0.48000580072402954,
-0.823893129825592,
-0.15149594843387604,
0.2735014855861664,
0.5742489099502563,
-0.594338059425354,
0.577145516872406,
-0.4742259085178375,
-0.6853976845741272,
-0.48029547929763794,
-0.2176569253206253,
0.3566754162311554,
0.5382207632064819,
0.6000555157661438,
0.04767119511961937,
-0.8000573515892029,
-0.5709550976753235,
-0.458619624376297,
-0.35888421535491943,
0.1597074419260025,
0.21146303415298462,
0.5572642087936401,
-0.24608108401298523,
0.8921340703964233,
-0.5502966046333313,
-0.15749110281467438,
-0.32771268486976624,
0.4029213488101959,
0.4684726297855377,
0.6445623636245728,
0.6426323056221008,
-0.5458605885505676,
-0.5937816500663757,
-0.3845839202404022,
-0.8616265654563904,
-0.3471447229385376,
0.15952326357364655,
-0.16876527667045593,
0.5732994675636292,
0.3963397145271301,
-0.6322832703590393,
0.3934188187122345,
0.4556853473186493,
-0.5725833773612976,
0.41867130994796753,
0.014320398680865765,
0.25254663825035095,
-1.3831013441085815,
0.09213671088218689,
0.25464585423469543,
-0.06752046197652817,
-0.7048465013504028,
-0.1917092502117157,
-0.272530734539032,
0.05685705691576004,
-0.40190592408180237,
0.8200039267539978,
-0.3637228012084961,
0.14633287489414215,
0.15921640396118164,
0.09495086222887039,
0.014042280614376068,
0.5285075306892395,
-0.19300074875354767,
0.5276734828948975,
0.5008584260940552,
-0.5167486071586609,
0.1833677440881729,
0.17206668853759766,
-0.07880721241235733,
0.3118618130683899,
-0.7769867181777954,
-0.01150045171380043,
0.05550184100866318,
0.2281637042760849,
-1.1297701597213745,
-0.099710613489151,
0.3541763126850128,
-0.910295844078064,
0.35687750577926636,
-0.26791366934776306,
-0.5270861983299255,
-0.40974611043930054,
-0.4800514280796051,
0.3541163206100464,
0.5637392401695251,
-0.31555309891700745,
0.6383081078529358,
0.43186381459236145,
0.1093897596001625,
-0.6926563382148743,
-0.8689032196998596,
0.0981568768620491,
-0.20533537864685059,
-0.749908983707428,
0.3965562582015991,
-0.1903861165046692,
-0.3794916570186615,
0.12205803394317627,
0.09867819398641586,
-0.09309545904397964,
0.12616610527038574,
0.12061037123203278,
0.3880442678928375,
-0.21786758303642273,
0.14152884483337402,
-0.19924688339233398,
-0.10712933540344238,
0.05050169676542282,
-0.38279208540916443,
0.7765286564826965,
-0.32948192954063416,
0.11517947912216187,
-0.6074143648147583,
0.21176950633525848,
0.49923890829086304,
-0.1017032191157341,
0.9228686094284058,
0.8297984004020691,
-0.396136075258255,
-0.10716403275728226,
-0.5948905944824219,
-0.09851979464292526,
-0.4724907875061035,
0.3897439241409302,
-0.24798817932605743,
-0.724534809589386,
0.5179242491722107,
0.3114127516746521,
0.104227714240551,
0.9434231519699097,
0.575921356678009,
-0.14242985844612122,
1.0571552515029907,
0.4529837667942047,
-0.17670373618602753,
0.615423858165741,
-0.7817308306694031,
0.14830844104290009,
-0.6771734952926636,
-0.22787614166736603,
-0.683172881603241,
-0.09151547402143478,
-0.8319046497344971,
-0.4093904197216034,
0.1966116577386856,
0.014744783751666546,
-0.5662594437599182,
0.2678842842578888,
-0.5359758734703064,
-0.020863566547632217,
0.46043169498443604,
0.07080880552530289,
-0.039060045033693314,
0.03193396329879761,
-0.1672387719154358,
-0.1366894543170929,
-0.6610525846481323,
-0.4927779734134674,
1.1331480741500854,
0.32394862174987793,
0.5188566446304321,
0.08855786919593811,
0.8963131904602051,
0.2514907419681549,
0.3411795496940613,
-0.6410937309265137,
0.7574692368507385,
-0.3628517687320709,
-0.5942933559417725,
-0.27812331914901733,
-0.5835497379302979,
-0.8104339838027954,
0.046502429991960526,
-0.1999618411064148,
-0.8090620636940002,
0.09868177771568298,
-0.05183805897831917,
-0.21212609112262726,
0.369171142578125,
-0.7363723516464233,
0.792058527469635,
-0.0898166373372078,
-0.4520787000656128,
-0.007925674319267273,
-0.5464476346969604,
0.09976532310247421,
0.2380339801311493,
0.3181086778640747,
-0.3104512691497803,
-0.13993577659130096,
1.1067872047424316,
-0.6027935147285461,
0.8205210566520691,
-0.34201720356941223,
0.2515367269515991,
0.27251532673835754,
-0.001098835957236588,
0.23522214591503143,
-0.024985268712043762,
-0.31326913833618164,
0.2772260308265686,
-0.07998254895210266,
-0.5002549290657043,
-0.3118377923965454,
0.7436974048614502,
-0.9918188452720642,
-0.47905921936035156,
-0.7692169547080994,
-0.31500911712646484,
-0.13256847858428955,
0.28799504041671753,
0.48475217819213867,
0.6200187802314758,
-0.08205284178256989,
0.1647661179304123,
0.3796243667602539,
-0.22395236790180206,
0.8239187002182007,
0.31354856491088867,
-0.0437450185418129,
-0.522599458694458,
0.7185152173042297,
0.2692742347717285,
0.14919333159923553,
0.4664270877838135,
0.31901001930236816,
-0.2735481262207031,
-0.43571382761001587,
-0.1561085283756256,
0.4531823992729187,
-0.5817798376083374,
-0.23994038999080658,
-0.8761215209960938,
-0.4080556035041809,
-0.785398006439209,
-0.06304924935102463,
-0.3229530155658722,
-0.7273147106170654,
-0.5313363075256348,
-0.008739784359931946,
0.5309726595878601,
0.6748107075691223,
-0.2685960531234741,
0.21449416875839233,
-0.6206245422363281,
0.2328176349401474,
-0.026873532682657242,
0.3384512960910797,
0.016066135838627815,
-0.7792220115661621,
-0.2140817791223526,
0.10583467781543732,
-0.2617805600166321,
-0.7759861946105957,
0.7122280597686768,
0.22129328548908234,
0.48829740285873413,
0.0899382010102272,
0.11300096660852432,
0.6731016635894775,
-0.20654092729091644,
1.0107698440551758,
0.10716243833303452,
-1.058851718902588,
0.5909337401390076,
-0.4220311641693115,
0.42981910705566406,
0.42025524377822876,
0.3112628757953644,
-0.5429549217224121,
-0.592449963092804,
-0.8404280543327332,
-0.9556330442428589,
0.8500398397445679,
0.2306433469057083,
0.04324829578399658,
-0.11993216723203659,
0.14529983699321747,
-0.2383473664522171,
0.08474832773208618,
-0.8250411748886108,
-0.570567786693573,
-0.38360971212387085,
-0.5196844339370728,
-0.3090108633041382,
-0.3579210340976715,
-0.00949200801551342,
-0.46245276927948,
0.9780044555664062,
0.11937529593706131,
0.6260583996772766,
0.2026306837797165,
-0.12039761245250702,
-0.0978526622056961,
0.2614763677120209,
0.5645799040794373,
0.559235692024231,
-0.4762948155403137,
-0.03186449408531189,
0.19006982445716858,
-0.47408437728881836,
0.05788702517747879,
0.2689913809299469,
-0.15656636655330658,
0.2706853747367859,
0.6171815395355225,
0.6907309889793396,
0.22109882533550262,
-0.09004954993724823,
0.5591048002243042,
-0.14085552096366882,
-0.324933260679245,
-0.4917151927947998,
-0.05945611372590065,
-0.0826810896396637,
0.17997756600379944,
0.6481403708457947,
0.22479403018951416,
-0.06692377477884293,
-0.4068826735019684,
0.10241241008043289,
0.2978378236293793,
-0.42017218470573425,
-0.44313710927963257,
0.7154044508934021,
-0.008911279030144215,
-0.4285953938961029,
0.4304050803184509,
-0.16284796595573425,
-0.8258890509605408,
0.5807613730430603,
0.3786088228225708,
1.2172815799713135,
-0.1230538859963417,
0.3071131110191345,
0.7483277320861816,
0.15578599274158478,
-0.06465849280357361,
0.43408629298210144,
0.08539511263370514,
-0.637277364730835,
-0.22210244834423065,
-0.7696136832237244,
-0.04730755090713501,
0.08846407383680344,
-0.406467080116272,
0.2868597209453583,
-0.5564573407173157,
-0.466937780380249,
0.16018229722976685,
0.34872308373451233,
-0.6252599358558655,
0.3555082678794861,
-0.03596337512135506,
0.8280267715454102,
-0.8140720129013062,
0.7344940304756165,
0.6299773454666138,
-0.5397959351539612,
-0.9879730343818665,
0.1308566778898239,
-0.08813895285129547,
-0.49151360988616943,
0.7735208868980408,
0.08144764602184296,
-0.16767889261245728,
0.1204507127404213,
-0.7456867694854736,
-1.013756513595581,
1.0538594722747803,
0.16109035909175873,
-0.05460487678647041,
-0.10240525007247925,
0.07165026664733887,
0.8057399392127991,
-0.3903701603412628,
0.49365779757499695,
0.3855328857898712,
0.4344809949398041,
-0.05029776692390442,
-0.6866896152496338,
0.12011896818876266,
-0.5402660369873047,
-0.10175292193889618,
0.04573734849691391,
-0.8822542428970337,
1.136746883392334,
-0.17084917426109314,
-0.159122034907341,
0.045271266251802444,
0.6318709850311279,
0.3573724329471588,
0.32551586627960205,
0.4052301347255707,
0.5615121126174927,
0.5415912866592407,
-0.3511587977409363,
0.9900780916213989,
-0.36191603541374207,
0.6879081130027771,
0.9123898148536682,
0.24835056066513062,
0.801295280456543,
0.43346482515335083,
-0.33150404691696167,
0.7045847773551941,
0.6195299625396729,
-0.0391976572573185,
0.40708720684051514,
-0.016431894153356552,
-0.11306145787239075,
-0.19016054272651672,
-0.13370206952095032,
-0.42762938141822815,
0.36639344692230225,
0.26721739768981934,
-0.3952406048774719,
-0.18514613807201385,
-0.14045986533164978,
0.33690279722213745,
-0.06711495667695999,
-0.11265911906957626,
0.5150799751281738,
0.13682420551776886,
-0.7004502415657043,
0.9271764159202576,
0.06802250444889069,
0.8507519960403442,
-0.4068247377872467,
0.13287889957427979,
-0.11185751110315323,
0.32359036803245544,
-0.27547821402549744,
-0.8109466433525085,
0.1647193282842636,
0.19568215310573578,
-0.10599151998758316,
-0.2876943051815033,
0.40705734491348267,
-0.31487584114074707,
-0.6613786816596985,
0.5723351836204529,
0.33941900730133057,
0.16356298327445984,
0.33234596252441406,
-0.987956166267395,
0.07222311943769455,
-0.01315243635326624,
-0.6879285573959351,
-0.058275215327739716,
0.369457870721817,
0.09281086176633835,
0.6626719832420349,
0.553248405456543,
0.14249420166015625,
0.2637285888195038,
0.22214704751968384,
0.8155972957611084,
-0.647527813911438,
-0.40190190076828003,
-1.0731990337371826,
0.48312434554100037,
-0.23578119277954102,
-0.5279731750488281,
0.833262026309967,
0.6228476762771606,
0.6940933465957642,
0.0020076949149370193,
0.8753717541694641,
-0.3525625169277191,
0.6597513556480408,
-0.33516544103622437,
0.7186385989189148,
-0.7133285403251648,
0.2244493067264557,
-0.3468494117259979,
-0.7610823512077332,
-0.3745402991771698,
0.5658969283103943,
-0.5619304776191711,
0.40933099389076233,
0.768045961856842,
0.7280223965644836,
0.12184182554483414,
-0.2540547251701355,
0.04112132266163826,
0.648194432258606,
0.4122388958930969,
0.6280563473701477,
0.5063726305961609,
-0.7228780388832092,
0.6126719117164612,
-0.5789328217506409,
-0.2235116958618164,
-0.31574195623397827,
-0.8527623414993286,
-0.9899858832359314,
-0.7789766788482666,
-0.3582030236721039,
-0.888923704624176,
0.1151098757982254,
1.1266741752624512,
0.5251477360725403,
-0.950718343257904,
-0.34257936477661133,
0.013036590069532394,
0.045895323157310486,
-0.03955072909593582,
-0.32080405950546265,
0.5682358741760254,
-0.35650449991226196,
-0.7692404389381409,
0.05103788524866104,
-0.000570841773878783,
0.19254513084888458,
-0.008271667174994946,
-0.04538736864924431,
-0.5732030868530273,
0.04894348978996277,
0.3982583284378052,
0.19036729633808136,
-0.5941358804702759,
-0.22896860539913177,
0.15615351498126984,
-0.454349547624588,
0.15607158839702606,
0.3178279399871826,
-0.622299313545227,
0.17933936417102814,
0.7048376798629761,
0.13923557102680206,
0.6758850812911987,
-0.04684934765100479,
0.4181942939758301,
-0.5862250924110413,
0.1518324315547943,
0.35817983746528625,
0.34932011365890503,
0.46564069390296936,
-0.18551546335220337,
0.5669307708740234,
0.4569697678089142,
-0.4621792733669281,
-0.9327841997146606,
-0.21312421560287476,
-1.1222715377807617,
-0.2659699618816376,
1.2857080698013306,
-0.10961512476205826,
-0.4761183261871338,
-0.02396382950246334,
0.08715999871492386,
0.7565563321113586,
-0.6287148594856262,
0.7732837796211243,
0.5628371238708496,
0.11556831002235413,
0.033377163112163544,
-0.4174867272377014,
0.5420701503753662,
0.2971143424510956,
-0.6160321235656738,
-0.14772078394889832,
0.04924013465642929,
0.4813728332519531,
0.1844017207622528,
0.7914650440216064,
-0.11262715607881546,
0.1400243192911148,
-0.1541045755147934,
0.0634128749370575,
-0.09908903390169144,
-0.04034403711557388,
-0.4205824136734009,
0.12204358726739883,
-0.2376195788383484,
-0.19281280040740967
] |
Kyle1668/boss-sentiment-t5-large | Kyle1668 | "2023-08-09T17:50:47Z" | 1,613,295 | 0 | transformers | [
"transformers",
"pytorch",
"safetensors",
"t5",
"text2text-generation",
"autotrain_compatible",
"endpoints_compatible",
"text-generation-inference",
"region:us"
] | text2text-generation | "2023-08-08T16:33:42Z" | Entry not found | [
-0.3227650225162506,
-0.22568431496620178,
0.862226128578186,
0.43461495637893677,
-0.5282987952232361,
0.7012965679168701,
0.7915717363357544,
0.07618638128042221,
0.7746025919914246,
0.2563219666481018,
-0.7852817177772522,
-0.22573819756507874,
-0.9104480743408203,
0.5715669393539429,
-0.3992334008216858,
0.5791245698928833,
-0.14494505524635315,
-0.10751161724328995,
0.28233757615089417,
-0.2768954336643219,
-0.5409224033355713,
-0.36855220794677734,
-1.1902776956558228,
0.061491113156080246,
0.5316578149795532,
0.7435142397880554,
0.7584060430526733,
0.3652167320251465,
0.6432578563690186,
0.3932291269302368,
-0.23138920962810516,
0.4827055037021637,
-0.04171813279390335,
0.00260411505587399,
-0.3524433970451355,
-0.5516898036003113,
-0.28596609830856323,
0.07584730535745621,
1.0961304903030396,
0.966687798500061,
-0.284663587808609,
0.05330817773938179,
-0.3063621520996094,
0.33088892698287964,
-0.49734312295913696,
0.3054099678993225,
-0.022506045177578926,
0.16318801045417786,
-0.7041513919830322,
-0.5535354018211365,
0.012794834561645985,
-0.7361212968826294,
0.17926570773124695,
-0.690081000328064,
0.8269098401069641,
0.18583157658576965,
1.1533750295639038,
0.14819414913654327,
-0.462487131357193,
-0.8161764144897461,
-0.6538989543914795,
0.5711171627044678,
-0.32703715562820435,
0.39680248498916626,
0.7028235197067261,
-0.048573412001132965,
-0.9820332527160645,
-0.6745741367340088,
-0.46466192603111267,
0.2923962473869324,
0.35402774810791016,
-0.3411678075790405,
-0.17522086203098297,
-0.3058989644050598,
0.15792037546634674,
0.12811517715454102,
-0.4841994643211365,
-0.5543919205665588,
-0.5475160479545593,
-0.3960252106189728,
0.6206658482551575,
0.3482950031757355,
0.2429177463054657,
-0.1888415813446045,
-0.3228583335876465,
0.0880163162946701,
-0.4160851538181305,
0.3402571678161621,
0.6335517168045044,
0.7114017009735107,
-0.5811444520950317,
0.560215950012207,
-0.04927587881684303,
0.7439703941345215,
0.11445561796426773,
-0.27478092908859253,
0.41460567712783813,
-0.14724725484848022,
0.055171746760606766,
0.4226345121860504,
0.31524422764778137,
0.2841312289237976,
-0.3273695111274719,
0.2032228708267212,
-0.3215144872665405,
-0.30496224761009216,
-0.22332167625427246,
-0.29490774869918823,
-0.3592180609703064,
0.5492289066314697,
-0.3314017057418823,
-0.42855486273765564,
1.143175721168518,
-0.4200771450996399,
-0.7302224040031433,
0.33156412839889526,
0.4065209925174713,
-0.0994480773806572,
-0.37146568298339844,
-0.052260834723711014,
-0.8458789587020874,
-0.007907390594482422,
0.7491172552108765,
-0.7198970913887024,
0.3371737599372864,
0.4728063642978668,
0.7417217493057251,
0.19650575518608093,
-0.14034469425678253,
-0.42949390411376953,
0.2971969544887543,
-0.8659994006156921,
0.6320174336433411,
-0.20135220885276794,
-1.0051977634429932,
0.11150479316711426,
0.8971705436706543,
-0.37896400690078735,
-1.2094876766204834,
1.0605159997940063,
-0.6887932419776917,
0.16017857193946838,
-0.676761269569397,
-0.14661237597465515,
-0.07118501514196396,
-0.005096632521599531,
-0.6088156700134277,
0.7567102313041687,
0.587267279624939,
-0.4995276927947998,
0.21429483592510223,
-0.26029831171035767,
-0.39151400327682495,
0.38824859261512756,
-0.07935450226068497,
-0.21858926117420197,
0.713833212852478,
-0.6647079586982727,
-0.26932814717292786,
0.2942774295806885,
0.2368936538696289,
-0.35706108808517456,
-0.7931919097900391,
0.08478113263845444,
-0.05786270648241043,
1.550750494003296,
-0.03868847340345383,
-0.3586106300354004,
-0.679383397102356,
-1.1506240367889404,
-0.07070787996053696,
0.6886883974075317,
-0.9194989204406738,
-0.27839475870132446,
-0.046410128474235535,
-0.26169314980506897,
0.08994917571544647,
0.7390589714050293,
-1.1194051504135132,
0.2832726836204529,
-0.05092663690447807,
-0.22794683277606964,
0.8271058797836304,
0.15387225151062012,
0.24758946895599365,
0.14913396537303925,
0.42958706617355347,
0.527725338935852,
0.11115207523107529,
0.683587908744812,
-0.34720373153686523,
-0.9694353938102722,
0.6154631972312927,
0.25266361236572266,
0.8121447563171387,
-0.49945297837257385,
0.2685093879699707,
0.27025535702705383,
-0.3409680724143982,
-0.5682371854782104,
-0.3102838397026062,
0.09025752544403076,
0.14930562674999237,
0.11142510175704956,
-0.5721710324287415,
-0.6576125025749207,
-0.9689140319824219,
-0.13590654730796814,
-0.4314374029636383,
-0.3571570813655853,
0.21006910502910614,
0.5792906284332275,
-1.1975523233413696,
0.4128875136375427,
-0.7705625891685486,
-0.7038741111755371,
-0.01065548975020647,
-0.19338123500347137,
0.7540656328201294,
0.43240174651145935,
0.5033966898918152,
-0.6397148370742798,
-0.5661987066268921,
-0.22470176219940186,
-1.0333747863769531,
-0.13280506432056427,
0.24819621443748474,
0.3065737783908844,
-0.13423344492912292,
-0.2744963765144348,
-0.48740333318710327,
0.8100387454032898,
0.14789170026779175,
-0.5391897559165955,
0.5220767259597778,
-0.3020317256450653,
0.17224803566932678,
-0.6369150280952454,
-0.06916818022727966,
-0.661676287651062,
-0.0009071884560398757,
-0.3608308732509613,
-0.5737438797950745,
0.14772287011146545,
0.07017494738101959,
-0.16065457463264465,
0.28808408975601196,
-0.909277081489563,
-0.0010852962732315063,
-0.7442210912704468,
0.379071980714798,
0.06394772231578827,
-0.3145078718662262,
-0.017517540603876114,
1.0000386238098145,
0.7784460783004761,
-0.3848048746585846,
0.721744179725647,
0.4440041184425354,
0.19036155939102173,
0.7630521059036255,
-0.18725109100341797,
0.16478213667869568,
-0.5245416760444641,
-0.12161104381084442,
-0.8887597918510437,
-1.0982946157455444,
0.7320570349693298,
-0.6114250421524048,
0.36542922258377075,
-0.4277869760990143,
0.2589159905910492,
-0.6919258832931519,
-0.03885362669825554,
0.4808599352836609,
-0.05936325341463089,
-0.6863942742347717,
0.5232570171356201,
0.45317530632019043,
-0.2019241601228714,
-0.6609031558036804,
-0.530157208442688,
0.39365822076797485,
0.6154114007949829,
-0.16390392184257507,
0.06878514587879181,
0.14941060543060303,
-0.5441926121711731,
-0.040802597999572754,
-0.38691970705986023,
-0.45766758918762207,
0.054224006831645966,
0.13053473830223083,
-0.005750799085944891,
-0.404820054769516,
-0.0868026465177536,
-0.35842007398605347,
-0.4656120240688324,
0.21876516938209534,
0.3011947274208069,
-0.04096309468150139,
-0.42599788308143616,
-0.3619818687438965,
-0.888181209564209,
0.6719610095024109,
0.5370282530784607,
0.05281545966863632,
0.7555549740791321,
0.16819314658641815,
-0.8014987707138062,
-0.13532210886478424,
-0.1760706603527069,
0.2696830928325653,
-0.5588056445121765,
0.13849826157093048,
-0.013484534807503223,
-0.0637492910027504,
0.26297882199287415,
0.25386232137680054,
-0.4300556778907776,
0.9276250004768372,
-0.2615274488925934,
-0.3592521846294403,
0.7960181832313538,
0.5974742770195007,
0.49583131074905396,
0.16503219306468964,
-0.044541798532009125,
0.900709331035614,
-1.1966516971588135,
-0.6563175916671753,
-0.7409549355506897,
-0.15945707261562347,
-0.43510833382606506,
-0.032105933874845505,
0.6254412531852722,
0.2900990843772888,
-0.1333388388156891,
0.4756395220756531,
-0.5243489742279053,
0.3556033670902252,
1.01198410987854,
0.35748639702796936,
0.3435698449611664,
-0.7570229172706604,
-0.2515777349472046,
-0.1402427852153778,
-0.9998157620429993,
-0.2631377875804901,
0.8871029019355774,
0.22752606868743896,
0.844460666179657,
0.5992541313171387,
0.6784542798995972,
0.1367226243019104,
0.2523828148841858,
-0.30590319633483887,
0.3920294940471649,
0.4376082420349121,
-1.0401138067245483,
-0.42758408188819885,
0.021418681368231773,
-0.9703338742256165,
-0.14227519929409027,
-0.03495011106133461,
-0.42617112398147583,
0.7681737542152405,
0.00016589462757110596,
-0.4076709747314453,
0.7732734084129333,
-0.455583393573761,
0.7562873363494873,
-0.4473648965358734,
-0.02663906291127205,
0.4699096083641052,
-0.7070636749267578,
0.4677430987358093,
0.12878790497779846,
0.6205843091011047,
-0.015572631731629372,
-0.04078587517142296,
0.7104941606521606,
-0.9129160046577454,
0.25438642501831055,
-0.6348397135734558,
0.22421300411224365,
0.24246945977210999,
0.51606285572052,
0.5969953536987305,
0.4371243417263031,
0.10119888931512833,
-0.23920902609825134,
0.04115807265043259,
-0.8241125345230103,
-0.210506409406662,
0.697515606880188,
-0.7186890840530396,
-0.6864197850227356,
-1.2355337142944336,
0.14438660442829132,
0.27347055077552795,
0.389305055141449,
0.7959296107292175,
0.571408748626709,
0.1289544403553009,
0.680525004863739,
0.9888588190078735,
-0.0688566341996193,
0.9166924357414246,
0.3224477171897888,
0.09175168722867966,
-0.21944808959960938,
0.7036820650100708,
0.26627904176712036,
-0.24707956612110138,
-0.11939732730388641,
0.20913465321063995,
-0.11069409549236298,
-0.591761589050293,
-0.49990686774253845,
0.3701757788658142,
-0.6731787919998169,
-0.18303893506526947,
-0.6243735551834106,
-0.6043769717216492,
-0.511759340763092,
0.06927360594272614,
-0.7147687673568726,
0.23979046940803528,
-0.7753565907478333,
-0.10574902594089508,
0.04323432594537735,
0.9792009592056274,
-0.589311957359314,
0.5805224180221558,
-1.1218582391738892,
0.19345788657665253,
-0.07949887961149216,
0.7921058535575867,
0.21395787596702576,
-0.7344395518302917,
-0.3975418508052826,
-0.11592631042003632,
-0.3729911744594574,
-1.3576762676239014,
0.21404948830604553,
-0.2454141080379486,
0.23094046115875244,
0.6145404577255249,
0.1397707313299179,
0.5258248448371887,
-0.34326282143592834,
0.7029101848602295,
-0.057017259299755096,
-0.7069286704063416,
0.7934495210647583,
-0.5026894807815552,
0.4963534474372864,
0.9765996932983398,
0.5333835482597351,
-0.7984007596969604,
0.035741209983825684,
-1.041123390197754,
-0.6008695363998413,
0.38426393270492554,
0.11928944289684296,
-0.03601083159446716,
-0.6659559011459351,
-0.054019637405872345,
-0.16143807768821716,
0.6043745279312134,
-1.039069414138794,
-0.7858356237411499,
0.2576698362827301,
0.5277302861213684,
0.0816856250166893,
-0.5653398633003235,
0.20880667865276337,
-0.544416069984436,
1.0657774209976196,
0.45109400153160095,
0.3274499475955963,
0.8406060934066772,
0.46492424607276917,
-0.3823164403438568,
0.09252490103244781,
0.7662695050239563,
0.6666232347488403,
-0.5239797830581665,
-0.2908027470111847,
-0.08827541768550873,
-0.9143403768539429,
0.05927472561597824,
0.11168918758630753,
-0.013455932028591633,
0.9082110524177551,
0.5793083310127258,
0.2539709210395813,
0.4514279365539551,
-0.726460337638855,
0.8859451413154602,
-0.14954176545143127,
-0.12472866475582123,
-1.0677239894866943,
0.1948619782924652,
-0.23984959721565247,
0.5006402134895325,
1.0061326026916504,
0.5250048041343689,
-0.047630298882722855,
-0.8143380880355835,
-0.01473585981875658,
0.6939172148704529,
-0.7091123461723328,
-0.17449834942817688,
0.944853663444519,
0.3847099542617798,
-1.2953051328659058,
1.106776475906372,
-0.5381771326065063,
-0.560332179069519,
0.9121301770210266,
0.522956907749176,
1.1221847534179688,
-0.44204121828079224,
0.0008676342549733818,
0.2662237286567688,
0.41378432512283325,
0.5423170328140259,
1.0869629383087158,
0.431413471698761,
-0.7931063771247864,
0.8826584815979004,
-0.24776044487953186,
-0.40361151099205017,
-0.05347571521997452,
-0.42859897017478943,
0.16892178356647491,
-0.4406192898750305,
-0.10713007301092148,
-0.3444187641143799,
0.28543180227279663,
-0.7072042226791382,
0.42807620763778687,
-0.0838567465543747,
0.8653068542480469,
-0.8553727269172668,
0.47207626700401306,
0.635470449924469,
-0.3337355852127075,
-0.8508191108703613,
-0.26198428869247437,
-0.11448462307453156,
-0.6389466524124146,
0.30214807391166687,
-0.4554102420806885,
0.044398851692676544,
0.09623463451862335,
-0.649151623249054,
-1.1778275966644287,
0.9093633890151978,
-0.639612078666687,
-0.2784462869167328,
0.20464053750038147,
-0.11514760553836823,
0.28811705112457275,
-0.2524643540382385,
0.010661216452717781,
0.41876548528671265,
0.748940110206604,
0.2844654619693756,
-0.7727053761482239,
-0.3694884479045868,
0.0015032943338155746,
-0.44474777579307556,
0.7582978010177612,
-0.6002101898193359,
1.1840779781341553,
-0.5563543438911438,
-0.059654366225004196,
0.44384512305259705,
0.24690914154052734,
0.21076197922229767,
0.6629220843315125,
0.1442081481218338,
0.7282265424728394,
1.07012140750885,
-0.40835219621658325,
0.8811809420585632,
0.26432839035987854,
0.47430819272994995,
0.7238501906394958,
-0.6487724781036377,
0.7513749003410339,
0.31810489296913147,
-0.5682924389839172,
0.9228013753890991,
1.2906063795089722,
-0.15699204802513123,
0.8079374432563782,
0.05136508867144585,
-1.081600546836853,
0.325833261013031,
-0.20724765956401825,
-0.7530064582824707,
0.3150254189968109,
0.19055864214897156,
-0.6920982599258423,
-0.5770308971405029,
-0.24046507477760315,
-0.35662803053855896,
-0.11552901566028595,
-0.7631728649139404,
0.6720563769340515,
-0.016969164833426476,
-0.5103683471679688,
0.18857547640800476,
0.2877499461174011,
0.17368432879447937,
-0.5235732793807983,
-0.02939440682530403,
-0.22823619842529297,
0.2660655975341797,
-0.5670853853225708,
-0.5234526991844177,
0.5724433064460754,
-0.32430219650268555,
-0.5343255400657654,
0.18147465586662292,
0.763587236404419,
-0.16923809051513672,
-0.4515409469604492,
0.32472723722457886,
0.6959525346755981,
0.1665852814912796,
0.4250282347202301,
-0.23511263728141785,
0.24480605125427246,
-0.08044824004173279,
-0.06651552021503448,
0.27714768052101135,
0.3449169099330902,
0.22435641288757324,
0.4450142979621887,
0.43285664916038513,
-0.01808755099773407,
-0.10736498981714249,
-0.382819801568985,
0.4124940037727356,
-0.9542785882949829,
-0.5713282823562622,
-0.6307113766670227,
0.2740660607814789,
-0.02315417304635048,
-1.0836423635482788,
0.4145168364048004,
1.4406683444976807,
1.0359982252120972,
-0.4756383001804352,
1.067226529121399,
-0.21818485856056213,
0.9594791531562805,
0.41483086347579956,
0.5420440435409546,
-0.6030411720275879,
0.03835370019078255,
-0.4364396035671234,
-1.076962947845459,
-0.35716333985328674,
0.4539391100406647,
-0.022899555042386055,
-0.3429867625236511,
0.872571587562561,
0.5887166261672974,
-0.33473607897758484,
-0.11728022992610931,
0.048487238585948944,
-0.029941488057374954,
-0.12433847039937973,
0.5145376324653625,
0.7648399472236633,
-0.9344304800033569,
-0.10680416971445084,
-0.21577754616737366,
-0.6382725834846497,
-0.5047279000282288,
-0.9632009267807007,
-0.12959396839141846,
-0.16037796437740326,
0.035343267023563385,
-0.5662806630134583,
0.00255737011320889,
1.208324909210205,
0.5684957504272461,
-1.1113994121551514,
-0.5303789377212524,
0.3371853232383728,
0.3920421898365021,
-0.1874791383743286,
-0.24202413856983185,
0.2984568774700165,
0.15382249653339386,
-0.5908876657485962,
0.6875665783882141,
0.8089625239372253,
0.208888977766037,
0.19554761052131653,
0.15893013775348663,
-0.8229473829269409,
-0.14913435280323029,
0.17440445721149445,
0.9450570344924927,
-0.939853310585022,
-0.7114843130111694,
-0.03168516233563423,
-0.27094873785972595,
-0.05765746906399727,
0.17102102935314178,
-0.4046344757080078,
0.5180677175521851,
0.34591493010520935,
0.49933457374572754,
0.0561608150601387,
-0.054746925830841064,
0.5409556031227112,
-0.9069057703018188,
0.09425963461399078,
0.4134361147880554,
0.4154115319252014,
-0.4000864028930664,
-0.5910194516181946,
0.6713420748710632,
1.0073972940444946,
-0.6594868898391724,
-0.8743268847465515,
-0.19846712052822113,
-1.0016002655029297,
0.04189709946513176,
0.6762762069702148,
0.5009527802467346,
-0.4806513786315918,
-0.4174500107765198,
-0.5617399215698242,
-0.1254672110080719,
-0.1369970738887787,
0.7621601819992065,
1.179680585861206,
-0.7432094812393188,
0.07975747436285019,
-1.038639783859253,
0.6594986915588379,
-0.2419457733631134,
-0.3457581698894501,
-0.48644304275512695,
0.3832802176475525,
0.35236993432044983,
0.440481036901474,
0.614812433719635,
0.1408471167087555,
0.8338426351547241,
0.3126053214073181,
-0.1702686995267868,
0.2698982357978821,
-0.4559200704097748,
-0.028932858258485794,
-0.057962555438280106,
0.31015971302986145,
-1.0262157917022705
] |
indobenchmark/indobert-base-p1 | indobenchmark | "2021-05-19T20:22:23Z" | 1,483,227 | 10 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"bert",
"feature-extraction",
"indobert",
"indobenchmark",
"indonlu",
"id",
"dataset:Indo4B",
"arxiv:2009.05387",
"license:mit",
"has_space",
"region:us"
] | feature-extraction | "2022-03-02T23:29:05Z" | ---
language: id
tags:
- indobert
- indobenchmark
- indonlu
license: mit
inference: false
datasets:
- Indo4B
---
# IndoBERT Base Model (phase1 - uncased)
[IndoBERT](https://arxiv.org/abs/2009.05387) is a state-of-the-art language model for Indonesian based on the BERT model. The pretrained model is trained using a masked language modeling (MLM) objective and next sentence prediction (NSP) objective.
## All Pre-trained Models
| Model | #params | Arch. | Training data |
|--------------------------------|--------------------------------|-------|-----------------------------------|
| `indobenchmark/indobert-base-p1` | 124.5M | Base | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-base-p2` | 124.5M | Base | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-large-p1` | 335.2M | Large | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-large-p2` | 335.2M | Large | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-lite-base-p1` | 11.7M | Base | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-lite-base-p2` | 11.7M | Base | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-lite-large-p1` | 17.7M | Large | Indo4B (23.43 GB of text) |
| `indobenchmark/indobert-lite-large-p2` | 17.7M | Large | Indo4B (23.43 GB of text) |
## How to use
### Load model and tokenizer
```python
from transformers import BertTokenizer, AutoModel
tokenizer = BertTokenizer.from_pretrained("indobenchmark/indobert-base-p1")
model = AutoModel.from_pretrained("indobenchmark/indobert-base-p1")
```
### Extract contextual representation
```python
x = torch.LongTensor(tokenizer.encode('aku adalah anak [MASK]')).view(1,-1)
print(x, model(x)[0].sum())
```
## Authors
<b>IndoBERT</b> was trained and evaluated by Bryan Wilie\*, Karissa Vincentio\*, Genta Indra Winata\*, Samuel Cahyawijaya\*, Xiaohong Li, Zhi Yuan Lim, Sidik Soleman, Rahmad Mahendra, Pascale Fung, Syafri Bahar, Ayu Purwarianti.
## Citation
If you use our work, please cite:
```bibtex
@inproceedings{wilie2020indonlu,
title={IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding},
author={Bryan Wilie and Karissa Vincentio and Genta Indra Winata and Samuel Cahyawijaya and X. Li and Zhi Yuan Lim and S. Soleman and R. Mahendra and Pascale Fung and Syafri Bahar and A. Purwarianti},
booktitle={Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing},
year={2020}
}
```
| [
-0.40831658244132996,
-0.5132914185523987,
0.10795985162258148,
0.5591232776641846,
-0.5080158710479736,
-0.3135017454624176,
-0.5402799248695374,
-0.35649001598358154,
0.2509886920452118,
0.544610321521759,
-0.39392533898353577,
-0.43498244881629944,
-0.7309859395027161,
0.33566853404045105,
-0.08213440328836441,
0.888378918170929,
-0.0813077837228775,
0.07053298503160477,
-0.08705000579357147,
-0.4480675458908081,
-0.37427932024002075,
-0.7703549861907959,
-0.48849713802337646,
-0.3847426176071167,
0.05178447067737579,
0.367710143327713,
0.285933256149292,
0.4217255413532257,
0.4140915870666504,
0.29649117588996887,
-0.25920188426971436,
-0.10794999450445175,
-0.16741067171096802,
0.16895540058612823,
0.15600930154323578,
-0.5921028852462769,
-0.4132293462753296,
-0.04705677181482315,
0.696851372718811,
0.7083593010902405,
0.2436004877090454,
0.26584863662719727,
0.23889347910881042,
0.8922662734985352,
-0.7938670516014099,
0.5901204943656921,
-0.3701384365558624,
-0.12031189352273941,
-0.19617801904678345,
-0.09858768433332443,
-0.6853077411651611,
-0.28886350989341736,
0.3981441259384155,
-0.5780258178710938,
-0.19272956252098083,
0.02142239175736904,
1.1829023361206055,
0.35982921719551086,
-0.5913386940956116,
-0.3107821047306061,
-0.5923865437507629,
1.0880218744277954,
-0.8665190935134888,
0.2729208171367645,
0.4803268611431122,
0.1719796061515808,
-0.0060442606918513775,
-0.960603654384613,
-0.7640376687049866,
-0.1604195088148117,
-0.5794927477836609,
0.2667275369167328,
-0.2108978033065796,
0.1823660284280777,
0.2546456754207611,
0.35190194845199585,
-0.674588680267334,
-0.29064828157424927,
-0.6739475131034851,
-0.051783110946416855,
0.8337916135787964,
-0.17629262804985046,
0.22984784841537476,
-0.7673118710517883,
-0.5153337121009827,
-0.33194735646247864,
-0.5822800397872925,
0.3527328372001648,
0.31772899627685547,
0.27017584443092346,
-0.22360584139823914,
0.5846871733665466,
-0.1840907782316208,
0.8864245414733887,
0.0739632174372673,
-0.3064800202846527,
0.661974310874939,
-0.40681207180023193,
-0.44744232296943665,
0.3668094873428345,
0.867527186870575,
0.34020447731018066,
0.5662412643432617,
0.184696227312088,
0.07211144268512726,
-0.10068156570196152,
-0.0883658230304718,
-0.9813863039016724,
-0.34129494428634644,
0.30299392342567444,
-0.8006570339202881,
-0.12288448959589005,
-0.14454275369644165,
-0.6263620853424072,
-0.007522891741245985,
-0.4869019091129303,
0.5922629237174988,
-0.8952429294586182,
-0.6065216064453125,
-0.18764780461788177,
-0.09323254972696304,
0.6281418800354004,
-0.15356428921222687,
-1.033146619796753,
0.28780120611190796,
0.4402839243412018,
0.8367428183555603,
-0.045404933393001556,
-0.2480938583612442,
-0.06069716066122055,
-0.03785755857825279,
-0.3506511449813843,
0.5427078008651733,
-0.6357553005218506,
-0.347506582736969,
0.020675376057624817,
0.020118510350584984,
-0.4542335569858551,
-0.47683724761009216,
0.8371008634567261,
-0.18432645499706268,
0.4667160212993622,
-0.18395677208900452,
-0.8171466588973999,
-0.694881021976471,
0.2736220359802246,
-0.41556888818740845,
1.24782133102417,
0.18261678516864777,
-1.0745463371276855,
0.6078102588653564,
-0.7046453952789307,
-0.24503466486930847,
0.10163756459951401,
-0.1802997589111328,
-0.43103107810020447,
-0.07671058923006058,
0.5155103802680969,
0.5944182872772217,
-0.11506236344575882,
0.33857011795043945,
-0.05263151973485947,
-0.33895453810691833,
0.04054342210292816,
-0.15492162108421326,
1.5315303802490234,
0.2889806032180786,
-0.43082526326179504,
0.42061591148376465,
-1.1903527975082397,
0.09280068427324295,
0.10279324650764465,
-0.1841236799955368,
-0.7244911193847656,
-0.1612795889377594,
0.23619574308395386,
0.22300207614898682,
0.3308509588241577,
-0.5079349875450134,
0.31628888845443726,
-0.7738924622535706,
0.38812482357025146,
0.7148500084877014,
0.21892130374908447,
0.3098050057888031,
-0.2904241681098938,
0.4424745738506317,
0.03050956502556801,
0.13893161714076996,
-0.41699424386024475,
-0.4392804503440857,
-1.2678513526916504,
-0.6379737257957458,
0.42661112546920776,
0.666379451751709,
-0.6845263242721558,
0.7610755562782288,
-0.3468443751335144,
-0.7374538779258728,
-0.42438486218452454,
0.07229302823543549,
0.29766324162483215,
0.5339713096618652,
0.4923543930053711,
-0.26593726873397827,
-0.8233627676963806,
-1.2367867231369019,
-0.4603230059146881,
-0.34228673577308655,
0.037249088287353516,
0.2971583902835846,
0.6240101456642151,
-0.21845223009586334,
1.252598762512207,
-0.1901615858078003,
-0.3105447292327881,
-0.447754442691803,
0.2849556803703308,
0.5436634421348572,
0.7647696733474731,
0.8750127553939819,
-0.7859935164451599,
-1.086147665977478,
-0.4330538809299469,
-0.7965779304504395,
0.007395980414003134,
-0.005869853775948286,
-0.15183325111865997,
0.530614972114563,
0.5466004014015198,
-0.7135124206542969,
0.6149682998657227,
0.3410246670246124,
-0.33834943175315857,
0.5615919232368469,
-0.30533358454704285,
-0.05436699837446213,
-1.409423589706421,
0.31713056564331055,
-0.100201316177845,
-0.01846134662628174,
-0.6949678659439087,
-0.05553632602095604,
0.2429640293121338,
0.013388088904321194,
-0.43036702275276184,
0.7694850564002991,
-0.5501487255096436,
0.2548854351043701,
-0.0756717324256897,
-0.07213519513607025,
-0.2692999243736267,
0.9044851064682007,
0.0639539286494255,
0.7292554378509521,
0.8187870979309082,
-0.6217401027679443,
0.15014132857322693,
0.49009209871292114,
-0.535548210144043,
0.543937623500824,
-0.9011092782020569,
-0.14300192892551422,
-0.3150009512901306,
0.3960784077644348,
-1.2921264171600342,
-0.18947666883468628,
0.5577406883239746,
-0.49273863434791565,
0.43246981501579285,
-0.2455027550458908,
-0.6570426225662231,
-0.0844939649105072,
-0.3534875810146332,
0.4804595708847046,
0.8164050579071045,
-0.6482231616973877,
0.8827967643737793,
0.048115864396095276,
-0.3849332928657532,
-0.7781263589859009,
-0.7104251980781555,
-0.16704705357551575,
-0.35906869173049927,
-0.7847421765327454,
0.4002002477645874,
-0.02010917477309704,
-0.1675495058298111,
0.09099811315536499,
0.00941514316946268,
-0.07631487399339676,
-0.1817370504140854,
0.5450443625450134,
0.34450867772102356,
-0.06176256388425827,
0.16633284091949463,
0.10378019511699677,
-0.17999419569969177,
0.23214367032051086,
-0.1760859191417694,
0.6770410537719727,
-0.25828254222869873,
0.00574964564293623,
-0.43876925110816956,
0.0735129788517952,
0.49801167845726013,
-0.46516039967536926,
1.0110840797424316,
0.630567729473114,
-0.46587321162223816,
0.13683272898197174,
-0.4505690634250641,
-0.07973414659500122,
-0.4620230495929718,
0.24519267678260803,
-0.4792110323905945,
-0.4843751788139343,
0.4388091564178467,
0.06378611922264099,
0.21910300850868225,
0.9376958608627319,
0.6303120255470276,
0.3261149823665619,
1.0393776893615723,
0.9794322848320007,
0.014915116131305695,
0.4612293243408203,
-0.5038762092590332,
0.4356536567211151,
-0.909684956073761,
-0.31627756357192993,
-0.541221559047699,
-0.08551863580942154,
-0.8519954681396484,
-0.11555321514606476,
0.28649213910102844,
0.2590249478816986,
-0.45185115933418274,
0.39750078320503235,
-0.7650855779647827,
0.15875516831874847,
0.6955778002738953,
-0.14421695470809937,
0.15830270946025848,
0.16504821181297302,
-0.4553927183151245,
-0.26406922936439514,
-0.7916482090950012,
-0.6048592925071716,
1.550878882408142,
0.26384270191192627,
0.5807590484619141,
0.023724129423499107,
0.82310950756073,
-0.05286914482712746,
0.6441214084625244,
-0.6027211546897888,
0.5873947739601135,
0.11648683995008469,
-0.9483667612075806,
-0.1479610949754715,
-0.19517336785793304,
-0.9380381107330322,
0.5437157154083252,
-0.07107223570346832,
-0.9502677321434021,
0.43495920300483704,
0.02395843155682087,
-0.230372354388237,
0.10641998052597046,
-0.8113579154014587,
1.000441312789917,
-0.16755613684654236,
-0.15800011157989502,
-0.07974685728549957,
-0.8152332901954651,
0.5350680947303772,
0.19479873776435852,
0.0443958081305027,
-0.07966442406177521,
0.10855107754468918,
1.059034824371338,
-0.49082469940185547,
0.7384008765220642,
-0.29319459199905396,
0.25718626379966736,
0.43793925642967224,
-0.26250743865966797,
0.2377825528383255,
0.06794183701276779,
-0.07361579686403275,
0.1664542704820633,
0.15433508157730103,
-0.5918262600898743,
-0.3376539945602417,
0.674372673034668,
-1.0236902236938477,
-0.3642081320285797,
-0.9713072180747986,
-0.3934139311313629,
-0.01952303759753704,
0.46228817105293274,
0.5714318752288818,
0.36232006549835205,
0.18282438814640045,
0.4513039290904999,
0.40293988585472107,
-0.31893566250801086,
0.6035894155502319,
0.37689751386642456,
-0.25837820768356323,
-0.43724581599235535,
0.8950681686401367,
0.20519819855690002,
0.09955840557813644,
0.1770700216293335,
0.03239395096898079,
-0.34168562293052673,
-0.23590636253356934,
-0.26787182688713074,
0.35345005989074707,
-1.01274836063385,
0.04301324114203453,
-0.967099666595459,
-0.5115067362785339,
-0.5417571663856506,
-0.01632414385676384,
-0.3028159737586975,
-0.5676434636116028,
-0.18281756341457367,
0.044907096773386,
0.3059093952178955,
0.4189368188381195,
-0.12871836125850677,
0.24280716478824615,
-0.4225268065929413,
-0.05492683872580528,
0.29073506593704224,
0.26461079716682434,
-0.023579461500048637,
-0.6808462738990784,
0.03475916013121605,
-0.1175442710518837,
-0.10458001494407654,
-0.8946579098701477,
0.7063248753547668,
0.18218407034873962,
0.579546332359314,
0.2596385180950165,
0.25618278980255127,
0.5829131007194519,
-0.30172979831695557,
0.8954472541809082,
-0.017949672415852547,
-0.9827024340629578,
0.6516000628471375,
0.1564919799566269,
0.3458918333053589,
0.7742314338684082,
0.7391342520713806,
-0.47019338607788086,
-0.2531284987926483,
-0.8977311253547668,
-1.2564594745635986,
0.8003438115119934,
0.42317670583724976,
-0.030048079788684845,
0.13887262344360352,
0.26431065797805786,
0.028651466593146324,
0.2596384584903717,
-1.089345932006836,
-0.7286703586578369,
-0.5261920094490051,
-0.4052278995513916,
-0.18618634343147278,
-0.5744839310646057,
-0.018356306478381157,
-0.6463139653205872,
1.0731215476989746,
0.05637376010417938,
0.3064432442188263,
0.4480072855949402,
-0.4352574944496155,
0.12208117544651031,
0.32210516929626465,
0.5998887419700623,
0.936782956123352,
-0.5967638492584229,
-0.05565908923745155,
0.13654737174510956,
-0.4272804260253906,
0.04100710526108742,
0.604939341545105,
-0.2930312156677246,
0.26034241914749146,
0.6069173216819763,
1.066904902458191,
0.016462385654449463,
-0.8403810858726501,
0.6408631205558777,
-0.2694188952445984,
-0.3476203382015228,
-1.0323207378387451,
0.015050330199301243,
-0.17959758639335632,
0.06136114522814751,
0.6333139538764954,
0.10429617017507553,
-0.05935659632086754,
-0.2896531820297241,
0.017741650342941284,
0.1689632385969162,
-0.475072979927063,
-0.0762392207980156,
0.6847556233406067,
0.040531642735004425,
-0.12817473709583282,
0.7056598663330078,
-0.19338078796863556,
-0.7410653829574585,
0.5924745202064514,
0.4739956557750702,
1.0003987550735474,
-0.12034893780946732,
-0.06927371770143509,
0.9469255805015564,
0.5620102882385254,
0.2549479007720947,
0.3190464973449707,
-0.11001651734113693,
-0.41328543424606323,
-0.5215862989425659,
-0.772723376750946,
-0.26368439197540283,
0.3186972737312317,
-0.6795420050621033,
0.16122621297836304,
-0.44788235425949097,
0.07222891598939896,
0.031499508768320084,
0.21425886452198029,
-0.7172930240631104,
0.1863556057214737,
-0.06484731286764145,
1.0918611288070679,
-0.8537243604660034,
0.8636332750320435,
0.9175003170967102,
-0.6742444038391113,
-0.9873535633087158,
0.030595477670431137,
-0.2839139997959137,
-0.5725409984588623,
1.1016730070114136,
0.5718501806259155,
0.3355981409549713,
-0.0734458789229393,
-0.5732729434967041,
-1.0909712314605713,
1.0735448598861694,
0.1327948272228241,
-0.37706777453422546,
0.2677837014198303,
-0.008874574676156044,
0.6130589842796326,
-0.25695449113845825,
0.5139342546463013,
0.624896228313446,
0.5693239569664001,
-0.22377069294452667,
-0.7716103792190552,
0.1404399573802948,
-0.6617403030395508,
0.0760110542178154,
-0.10801512748003006,
-0.7871094942092896,
1.2622531652450562,
0.22798718512058258,
-0.2204289436340332,
0.023966945707798004,
0.8555152416229248,
0.32588550448417664,
-0.09000864624977112,
0.6449523568153381,
0.624674379825592,
0.4754343032836914,
-0.0245582964271307,
1.1471744775772095,
-0.8838260173797607,
0.5611047148704529,
0.8102882504463196,
0.051492732018232346,
0.8787515163421631,
0.590096116065979,
-0.19652049243450165,
0.749918520450592,
0.6584352850914001,
0.13912898302078247,
0.4986821115016937,
0.091765396296978,
-0.23048633337020874,
-0.14420361816883087,
0.08275746554136276,
-0.6214932203292847,
0.5073553919792175,
0.3396883010864258,
-0.4129158556461334,
-0.08338216692209244,
0.07224557548761368,
0.17715226113796234,
-0.05235932767391205,
-0.03058690018951893,
0.610213577747345,
-0.009926875121891499,
-1.0003432035446167,
1.180372953414917,
0.1739456057548523,
0.7989476323127747,
-0.7406453490257263,
0.004271510522812605,
-0.2878754138946533,
0.4182667136192322,
-0.1702985018491745,
-0.4751976430416107,
0.2031007558107376,
-0.07674036920070648,
-0.061859581619501114,
-0.057416174560785294,
0.9024496078491211,
-0.6207013130187988,
-0.7753610014915466,
0.2155299037694931,
0.14028458297252655,
0.09294261783361435,
0.007366607431322336,
-0.7650632262229919,
0.09562909603118896,
0.07832495123147964,
-0.6141629219055176,
0.030423521995544434,
0.11380702257156372,
0.13511672616004944,
0.5473882555961609,
0.4993446171283722,
-0.13121430575847626,
0.23016269505023956,
-0.32749176025390625,
0.7190535068511963,
-0.5085201263427734,
-0.7128069996833801,
-0.9625605344772339,
0.6153533458709717,
-0.4559827148914337,
-0.6989293694496155,
0.9706875681877136,
0.6644728183746338,
0.9700307250022888,
-0.0041318186558783054,
1.074458122253418,
-0.3601737320423126,
0.6405081748962402,
-0.2616730332374573,
0.6955634951591492,
-0.7441513538360596,
-0.02173186093568802,
-0.279226154088974,
-1.1906439065933228,
-0.37378254532814026,
1.0887043476104736,
-0.4987469017505646,
0.09535163640975952,
0.6719505190849304,
0.6636079549789429,
-0.09710309654474258,
-0.09108742326498032,
-0.17419803142547607,
0.49786776304244995,
0.5216912031173706,
0.5170559287071228,
0.3560786843299866,
-0.6680959463119507,
0.699536919593811,
-0.7656800150871277,
-0.46287262439727783,
-0.4890456199645996,
-0.8393194079399109,
-1.3846555948257446,
-0.9052993059158325,
-0.1742139309644699,
-0.3480686843395233,
-0.09245584905147552,
1.2567774057388306,
0.7600140571594238,
-0.9465104341506958,
-0.27322158217430115,
-0.2032676786184311,
-0.09367191791534424,
-0.23678770661354065,
-0.2857837378978729,
0.9064586162567139,
-0.49303489923477173,
-0.8455377817153931,
0.057528477162122726,
0.28790172934532166,
0.02656812220811844,
-0.3446013331413269,
-0.22785580158233643,
-0.6113463640213013,
0.18660026788711548,
0.6601215600967407,
0.36363282799720764,
-0.7646270990371704,
-0.06787218898534775,
-0.1888183355331421,
-0.29789969325065613,
0.15861201286315918,
0.4276711940765381,
-0.7701658606529236,
0.7256367206573486,
0.5839919447898865,
0.6644073724746704,
0.8621583580970764,
-0.173482283949852,
0.3623647093772888,
-0.742915689945221,
0.7467292547225952,
0.1933591067790985,
0.40173086524009705,
0.39997243881225586,
0.00005777896512881853,
0.6290733814239502,
0.24507607519626617,
-0.5467590689659119,
-0.8859299421310425,
0.005746373441070318,
-0.9943389892578125,
-0.3203405439853668,
0.9912895560264587,
-0.17463418841362,
-0.41864991188049316,
0.11943171918392181,
-0.445345014333725,
0.3609154522418976,
-0.16018706560134888,
0.5609706044197083,
0.8577937483787537,
-0.19667814671993256,
-0.2020527422428131,
-0.6300954818725586,
0.6608936786651611,
0.9064085483551025,
-0.6223071813583374,
-0.26194706559181213,
0.10276687890291214,
0.3542473614215851,
0.2804566025733948,
0.8080543279647827,
0.009181799367070198,
0.1406116932630539,
0.042224377393722534,
0.1840992420911789,
0.0006845787866041064,
-0.14484435319900513,
-0.2218293994665146,
0.018454646691679955,
-0.05737324431538582,
-0.21409650146961212
] |
davidkim205/komt-mistral-7b-v1 | davidkim205 | "2023-10-24T04:41:07Z" | 1,450,870 | 5 | transformers | [
"transformers",
"pytorch",
"mistral",
"text-generation",
"finetuned",
"en",
"ko",
"arxiv:2308.06502",
"arxiv:2308.06259",
"endpoints_compatible",
"text-generation-inference",
"region:us"
] | text-generation | "2023-10-24T01:58:52Z" | ---
language:
- en
- ko
pipeline_tag: text-generation
tags:
- finetuned
---
# komt : korean multi task instruction tuning model
![multi task instruction tuning.jpg](https://github.com/davidkim205/komt/assets/16680469/c7f6ade7-247e-4b62-a94f-47e19abea68e)
Recently, due to the success of ChatGPT, numerous large language models have emerged in an attempt to catch up with ChatGPT's capabilities.
However, when it comes to Korean language performance, it has been observed that many models still struggle to provide accurate answers or generate Korean text effectively.
This study addresses these challenges by introducing a multi-task instruction technique that leverages supervised datasets from various tasks to create training data for Large Language Models (LLMs).
## Model Details
* **Model Developers** : davidkim(changyeon kim)
* **Repository** : https://github.com/davidkim205/komt
* **Model Architecture** : The komt-mistral-7b-v1 is is a fine-tuned version of the Mistral-7B-Instruct-v0.1.
## Dataset
korean multi-task instruction dataset
## Hardware and Software
- nvidia driver : 535.54.03
- CUDA Version: 12.2
## Training
Refer https://github.com/davidkim205/komt
## Prompt template: Mistral
```
<s>[INST] {prompt} [/INST]</s>
```
## Usage
```
from transformers import AutoTokenizer, AutoModelForCausalLM
from transformers import TextStreamer, GenerationConfig
model_name='davidkim205/komt-mistral-7b-v1'
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
streamer = TextStreamer(tokenizer)
def gen(x):
generation_config = GenerationConfig(
temperature=0.8,
top_p=0.8,
top_k=100,
max_new_tokens=1024,
early_stopping=True,
do_sample=True,
)
q = f"[INST]{x} [/INST]"
gened = model.generate(
**tokenizer(
q,
return_tensors='pt',
return_token_type_ids=False
).to('cuda'),
generation_config=generation_config,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
streamer=streamer,
)
result_str = tokenizer.decode(gened[0])
start_tag = f"\n\n### Response: "
start_index = result_str.find(start_tag)
if start_index != -1:
result_str = result_str[start_index + len(start_tag):].strip()
return result_str
print(gen('제주도를 1박2일로 혼자 여행하려고 하는데 여행 코스를 만들어줘'))
```
output
```
<s> [INST]제주도를 1박2일로 혼자 여행하려고 하는데 여행 코스를 만들어줘 [/INST]1박 2일 여행 코스
제주 여행 코스는 다음과 같습니다:
첫째 날:
* 아침: 제주시 신라로 이동하여 한라산 국립공원에 도착합니다. 오른쪽 발자국 광장에서 눈에 띄는 맥주숍을 찾아 한 병의 맥주를 마시고 계단으로 올라가 한라산 정상에 도착합니다.
* 점심: 정상에서 계단을 내려와 중도에 위치한 골목에서 음식을 즐깁니다. 젓갈, 곰탕, 전복 등 맛있는 제주 특산물을 맛보며 힐링을 즐깁니다.
* 오후: 중도에서 남하하여 남서쪽 제주로 이동합니다. 남서쪽 제주는 섬의 자연 경관과 백사장, 아름다운 바다 등 아름다운 풍광이 있는 곳입니다. 숙소에 숙박합니다.
둘째 날:
* 아침: 남서쪽 제주에서 북서쪽 제주로 이동합니다. 이 지역은 푸른 잔디 해변과 투명한 바다가 펼쳐져 있는 아름다운 풍광입니다. 숙소에서 아침을 먹고 바다로 향하여 해변에서 휴식을 취합니다.
* 점심: 북서쪽 제주의 앞바다에서 시원한 바다를 보며 한 끼의 해산물을 맛보고 계절에 따라 해산물 요리를 즐깁니다.
* 오후: 남서쪽 제주에서 이동하여 서쪽 제주로 이동합니다. 서쪽 제주는 절벽과 암석 해변, 수수께끼의 돌 정원 등 독특한 경관이 있는 곳입니다. 이곳에서는 서쪽 제주의 대표적인 명소인 청량사를 방문하고 서쪽 제주의 아름다운 풍광을 감상합니다.
* 저녁: 서쪽 제주에서 제주 시로 이동하여 한 끼의 제주 특산물을 맛보고 도착한 제주 도심에서 저녁을 즐깁니다.
* 야간: 제주 시의 도심에서 야간 활동을 즐기며 1박 2일의 여행을 마무리합니다.
이렇게 제주를 1박 2일로 혼자 여행하면 제주의 아름다운 풍광, 푸른 잔디 해변, 투명한 바다 등을 경험할 수 있습니다.
```
## Evaluation
For objective model evaluation, we initially used EleutherAI's lm-evaluation-harness but obtained unsatisfactory results. Consequently, we conducted evaluations using ChatGPT, a widely used model, as described in [Self-Alignment with Instruction Backtranslation](https://arxiv.org/pdf/2308.06502.pdf) and [Three Ways of Using Large Language Models to Evaluate Chat](https://arxiv.org/pdf/2308.06259.pdf) .
| model | score | average(0~5) | percentage |
| --------------------------------------- |---------| ------------ | ---------- |
| gpt-3.5-turbo(close) | 147 | 3.97 | 79.45% |
| naver Cue(close) | 140 | 3.78 | 75.67% |
| clova X(close) | 136 | 3.67 | 73.51% |
| WizardLM-13B-V1.2(open) | 96 | 2.59 | 51.89% |
| Llama-2-7b-chat-hf(open) | 67 | 1.81 | 36.21% |
| Llama-2-13b-chat-hf(open) | 73 | 1.91 | 38.37% |
| nlpai-lab/kullm-polyglot-12.8b-v2(open) | 70 | 1.89 | 37.83% |
| kfkas/Llama-2-ko-7b-Chat(open) | 96 | 2.59 | 51.89% |
| beomi/KoAlpaca-Polyglot-12.8B(open) | 100 | 2.70 | 54.05% |
| **komt-llama2-7b-v1 (open)(ours)** | **117** | **3.16** | **63.24%** |
| **komt-llama2-13b-v1 (open)(ours)** | **129** | **3.48** | **69.72%** |
| **komt-llama-30b-v1 (open)(ours)** | **129** | **3.16** | **63.24%** |
| **komt-mistral-7b-v1 (open)(ours)** | **131** | **3.54** | **70.81%** |
| [
-0.5289522409439087,
-0.6946714520454407,
0.3030605912208557,
0.3562195301055908,
-0.39383119344711304,
0.0818999707698822,
-0.03390306234359741,
-0.2856239974498749,
0.3462279736995697,
0.2994280457496643,
-0.5225958824157715,
-0.60051429271698,
-0.6821227073669434,
0.049837708473205566,
-0.2167131006717682,
0.8760694861412048,
-0.06167877838015556,
-0.07179560512304306,
0.08256762474775314,
-0.006548798177391291,
-0.725972056388855,
-0.3919510543346405,
-0.7996155023574829,
-0.2132427841424942,
0.059204090386629105,
0.3930211365222931,
0.5403382778167725,
0.500338077545166,
0.5951967239379883,
0.47144952416419983,
0.04125600680708885,
0.13141010701656342,
-0.45507144927978516,
0.16268283128738403,
0.21199743449687958,
-0.4742109775543213,
-0.3681705892086029,
-0.18216991424560547,
0.6369668245315552,
0.3324437141418457,
-0.2662193179130554,
0.5690019130706787,
0.21021854877471924,
0.910923421382904,
-0.466452419757843,
0.1819017231464386,
-0.14140787720680237,
0.05984259396791458,
-0.1674630492925644,
-0.2533819079399109,
-0.14387047290802002,
-0.6396563649177551,
-0.08552217483520508,
-0.5136013031005859,
0.09149676561355591,
0.19672837853431702,
1.1831048727035522,
0.08455298840999603,
-0.2024775743484497,
-0.2902124226093292,
-0.690207302570343,
0.9233424663543701,
-0.9417308568954468,
0.47148236632347107,
0.3806648254394531,
0.20159399509429932,
-0.39965298771858215,
-0.607028603553772,
-0.6050710678100586,
-0.09644725918769836,
-0.29703274369239807,
0.4821496605873108,
-0.20618630945682526,
-0.344394713640213,
0.3481834828853607,
0.4236462116241455,
-0.6687896847724915,
0.10796233266592026,
-0.47670432925224304,
-0.1738840788602829,
0.8299756050109863,
0.30561861395835876,
0.5086190700531006,
-0.3527858555316925,
-0.5238136649131775,
-0.15460063517093658,
-0.2684393525123596,
0.3608444035053253,
0.4048628807067871,
-0.009730126708745956,
-0.3786362409591675,
0.6289728283882141,
-0.3817795217037201,
0.6788821816444397,
0.2929343581199646,
-0.4313063621520996,
0.6154367327690125,
-0.6226975917816162,
-0.5901351571083069,
-0.036292914301157,
1.1290830373764038,
0.48102158308029175,
-0.05423368141055107,
0.287936270236969,
-0.2203667163848877,
-0.01987692154943943,
-0.08274531364440918,
-0.9124161601066589,
-0.10261448472738266,
0.3034990429878235,
-0.5950006246566772,
-0.21324056386947632,
0.08441948145627975,
-1.1666946411132812,
0.020983969792723656,
-0.2908346354961395,
0.5833058953285217,
-0.5337607264518738,
-0.43276160955429077,
0.028993934392929077,
0.030481046065688133,
0.3849315047264099,
0.3120259642601013,
-0.7054734826087952,
0.4238298237323761,
0.3233254551887512,
0.926172137260437,
-0.07599876075983047,
-0.2275473177433014,
0.10518647730350494,
0.10005766153335571,
-0.3124285042285919,
0.7369074821472168,
0.02009587548673153,
-0.5447717308998108,
-0.3374040424823761,
0.13398680090904236,
-0.5452859997749329,
-0.22477100789546967,
0.4234941899776459,
-0.1833668053150177,
0.3069765567779541,
-0.07558102160692215,
-0.6329160928726196,
-0.11904669553041458,
0.27908486127853394,
-0.5414155125617981,
1.440519094467163,
-0.0652736946940422,
-0.994404137134552,
-0.03895743563771248,
-0.6333326697349548,
-0.1984943300485611,
-0.04693232476711273,
-0.02374906837940216,
-0.617851972579956,
-0.24815189838409424,
0.43118607997894287,
0.5932610034942627,
-0.15723605453968048,
0.047098785638809204,
-0.0909968838095665,
-0.4902348816394806,
0.31243765354156494,
-0.4613511562347412,
0.9167987704277039,
0.4166306257247925,
-0.579479455947876,
0.07177118211984634,
-0.9073505401611328,
0.42899879813194275,
0.4952603876590729,
-0.3680341839790344,
-0.0011646727798506618,
-0.48198604583740234,
-0.26335906982421875,
0.5323363542556763,
0.41027238965034485,
-0.4488734006881714,
0.08271323144435883,
-0.5595800280570984,
0.4268797039985657,
1.112289547920227,
0.07425086945295334,
0.31657615303993225,
-0.540741503238678,
0.6754534244537354,
0.038792990148067474,
0.29020294547080994,
-0.03384155407547951,
-0.5221419930458069,
-0.864425539970398,
-0.22395142912864685,
0.07756004482507706,
0.6829565167427063,
-0.7051950693130493,
0.5735291242599487,
-0.25041455030441284,
-0.8020704388618469,
-0.7963870763778687,
0.015430504456162453,
0.6053239107131958,
0.6092270612716675,
0.2756548225879669,
-0.14681778848171234,
-0.6079444289207458,
-0.8377461433410645,
-0.07924456894397736,
-0.0451321117579937,
0.20563167333602905,
0.5543747544288635,
0.7786891460418701,
-0.159157857298851,
0.7375212907791138,
-0.6861956119537354,
-0.28986433148384094,
-0.23574580252170563,
-0.07381001859903336,
0.6960368752479553,
0.8423786163330078,
0.6817710399627686,
-0.6918521523475647,
-1.0439695119857788,
0.04596700891852379,
-0.7675878405570984,
-0.07636705785989761,
0.05235438421368599,
-0.27532273530960083,
0.572761595249176,
0.37718886137008667,
-0.790191113948822,
0.6072759628295898,
0.7457025647163391,
-0.5332195162773132,
0.9035742282867432,
-0.42590248584747314,
0.40336328744888306,
-1.3773741722106934,
0.2844047546386719,
-0.08306491374969482,
-0.11716464906930923,
-0.596817672252655,
-0.08544430136680603,
-0.12746961414813995,
0.04102422669529915,
-0.5332576036453247,
0.68934565782547,
-0.7883209586143494,
0.08597443997859955,
-0.05501698702573776,
0.22426718473434448,
0.048528868705034256,
0.7045771479606628,
-0.27389660477638245,
0.9989266991615295,
0.5181419253349304,
-0.4404495358467102,
0.3683283030986786,
0.132086843252182,
-0.3368974030017853,
0.43221697211265564,
-0.8342500925064087,
0.12526866793632507,
-0.23343373835086823,
0.30626392364501953,
-1.6102957725524902,
-0.3190985321998596,
0.7598626017570496,
-0.6624951362609863,
0.4472272992134094,
-0.20832766592502594,
-0.31551873683929443,
-0.6781944036483765,
-0.4780459403991699,
0.33856138586997986,
0.43827804923057556,
-0.3724380135536194,
0.4264649450778961,
0.288540244102478,
-0.16230148077011108,
-0.7118681073188782,
-0.5293225049972534,
-0.12395122647285461,
-0.23426128923892975,
-0.852749764919281,
0.38903528451919556,
-0.27703455090522766,
0.11458121985197067,
-0.15478074550628662,
-0.22447870671749115,
0.01772264577448368,
-0.14501559734344482,
0.5153811573982239,
0.43456053733825684,
-0.2531976103782654,
-0.06397414207458496,
-0.21605677902698517,
-0.17432184517383575,
0.02854354865849018,
-0.021455300971865654,
0.916427493095398,
-0.27219223976135254,
-0.4539138376712799,
-0.8790243864059448,
0.33128082752227783,
0.636780858039856,
-0.13763752579689026,
0.8639622926712036,
0.8696621060371399,
-0.1681024730205536,
0.09576012939214706,
-0.7148732542991638,
0.0845627635717392,
-0.5575399398803711,
0.2770676612854004,
-0.39034968614578247,
-0.7483438849449158,
0.7084947824478149,
-0.0076098632998764515,
-0.21763069927692413,
0.7258437871932983,
0.7584467530250549,
-0.12018921971321106,
1.2335587739944458,
0.2765614092350006,
0.008171869441866875,
0.52983558177948,
-0.6581364870071411,
0.36455073952674866,
-0.8814531564712524,
-0.524642288684845,
-0.5406557321548462,
-0.2988932430744171,
-0.8164318799972534,
-0.37370893359184265,
0.32673391699790955,
0.09953361749649048,
-0.31831005215644836,
0.31957316398620605,
-0.9160844683647156,
0.18940769135951996,
0.49618765711784363,
0.35234150290489197,
0.0015012361109256744,
-0.2772288918495178,
-0.18832066655158997,
-0.018651088699698448,
-0.72883540391922,
-0.3944629430770874,
1.1658376455307007,
0.41065898537635803,
0.8265326619148254,
0.16098690032958984,
0.7284817695617676,
0.2653774917125702,
0.007542036473751068,
-0.6870714426040649,
0.5965372323989868,
0.2446245700120926,
-0.6385902166366577,
-0.5119510293006897,
-0.38954171538352966,
-1.1254907846450806,
0.484502375125885,
-0.1784331053495407,
-1.0127254724502563,
0.15566563606262207,
0.13461555540561676,
-0.3218778073787689,
0.31686365604400635,
-1.015609860420227,
1.0398828983306885,
-0.21361568570137024,
-0.553371012210846,
0.053005386143922806,
-0.7189555764198303,
0.5028849244117737,
-0.005176460836082697,
0.3704597055912018,
-0.29941174387931824,
0.2443617284297943,
0.9781937599182129,
-0.7983351945877075,
0.6706361174583435,
-0.20071829855442047,
-0.15077976882457733,
0.5123860836029053,
-0.05888111889362335,
0.6565540432929993,
0.03565722703933716,
0.07634063810110092,
0.06683153659105301,
0.19769620895385742,
-0.4334293007850647,
-0.4589741826057434,
0.865249752998352,
-1.0459474325180054,
-0.7816941142082214,
-0.5017534494400024,
-0.2518862783908844,
0.1655140221118927,
0.39992958307266235,
0.50593101978302,
0.4150325655937195,
0.139182910323143,
0.1977929323911667,
0.4836699962615967,
-0.3421564996242523,
0.7717680335044861,
0.29857680201530457,
-0.23866671323776245,
-0.51483553647995,
0.8687480092048645,
0.27317607402801514,
0.3291957378387451,
0.07778684049844742,
0.27214285731315613,
-0.5038996934890747,
-0.4708751142024994,
-0.443876177072525,
0.30887314677238464,
-0.6368524432182312,
-0.4032473862171173,
-0.6665159463882446,
-0.24946385622024536,
-0.8271456956863403,
0.058683130890131,
-0.48119375109672546,
-0.46904051303863525,
-0.11538910865783691,
-0.0964672863483429,
0.39316487312316895,
0.5615920424461365,
-0.1355370730161667,
0.5067868828773499,
-0.7987546920776367,
0.2345465123653412,
0.08589036017656326,
0.4096064269542694,
0.22823947668075562,
-0.7680448293685913,
-0.3375430107116699,
0.2638944387435913,
-0.4689975678920746,
-1.1419659852981567,
0.7499200701713562,
-0.23172694444656372,
0.5114819407463074,
0.4022728502750397,
-0.051748812198638916,
1.0395028591156006,
-0.3065178692340851,
0.8427847623825073,
0.26773664355278015,
-1.0231586694717407,
0.737565815448761,
-0.3727923631668091,
0.2092474400997162,
0.3686060905456543,
0.4544745087623596,
-0.61697918176651,
-0.25564196705818176,
-0.69294673204422,
-0.9400089979171753,
0.9876911044120789,
0.39032453298568726,
-0.10203969478607178,
0.18767526745796204,
0.1256370097398758,
-0.24268434941768646,
0.06276019662618637,
-0.6682098507881165,
-0.6726928949356079,
-0.263505220413208,
-0.053742386400699615,
0.029617710039019585,
-0.23131142556667328,
-0.013949904590845108,
-0.5871209502220154,
0.8488901257514954,
0.2252628654241562,
0.6050516366958618,
0.5096231698989868,
0.07475002855062485,
-0.12056230753660202,
0.28900060057640076,
0.7469634413719177,
0.8547332286834717,
-0.1901649534702301,
-0.20009395480155945,
0.3838660418987274,
-0.7789840698242188,
0.25437742471694946,
-0.03277801722288132,
-0.10348638892173767,
-0.01801438257098198,
0.12339973449707031,
0.8824130892753601,
0.06275031715631485,
-0.42756643891334534,
0.6335034966468811,
-0.19243605434894562,
-0.10853075236082077,
-0.5215935707092285,
0.008945804089307785,
0.11869724094867706,
0.1602272093296051,
0.35488009452819824,
-0.09786715358495712,
-0.039689138531684875,
-0.36028560996055603,
0.09441132843494415,
0.41089877486228943,
-0.20963555574417114,
-0.14358477294445038,
0.6058638691902161,
-0.07470677047967911,
-0.23883455991744995,
0.5163557529449463,
-0.04626154154539108,
-0.614012598991394,
0.8656131029129028,
0.8667261004447937,
0.6423882246017456,
-0.6861575245857239,
0.16747123003005981,
0.8829114437103271,
0.16904376447200775,
-0.11459619551897049,
0.3327086269855499,
0.21482910215854645,
-0.6494012475013733,
-0.31245359778404236,
-0.7838231921195984,
-0.11253489553928375,
0.3494443893432617,
-0.6866083741188049,
0.12953080236911774,
-0.4615424573421478,
-0.41387149691581726,
-0.026005111634731293,
0.26844194531440735,
-0.7434109449386597,
0.2678644061088562,
-0.04512808099389076,
0.7125142812728882,
-0.9138315320014954,
0.8817542791366577,
0.7196426391601562,
-0.4161379337310791,
-1.1922799348831177,
-0.16224783658981323,
-0.12667015194892883,
-1.0934734344482422,
0.7014146447181702,
0.1088239923119545,
0.07063981145620346,
0.11016539484262466,
-0.619531512260437,
-1.4677913188934326,
1.4996123313903809,
0.017293473705649376,
-0.5701044201850891,
0.24261534214019775,
0.22297969460487366,
0.5572436451911926,
-0.08023721724748611,
0.42333829402923584,
0.5610061883926392,
0.5531342029571533,
0.21317800879478455,
-1.1239820718765259,
0.5294591188430786,
-0.4454347491264343,
0.028603648766875267,
0.39299672842025757,
-1.1439560651779175,
1.0431582927703857,
-0.053723789751529694,
-0.1103304848074913,
-0.13309262692928314,
0.5219842791557312,
0.39437443017959595,
0.28589215874671936,
0.435187965631485,
0.7010968327522278,
0.5353114008903503,
-0.10774228721857071,
0.8927890062332153,
-0.42688700556755066,
0.6427460312843323,
0.7850679159164429,
0.14843860268592834,
0.6604122519493103,
0.5045872926712036,
-0.5266829133033752,
0.32742980122566223,
0.4805064797401428,
-0.3630668520927429,
0.3539329767227173,
0.13841265439987183,
-0.33658039569854736,
-0.025687554851174355,
0.11506956070661545,
-0.5307533740997314,
0.4934937059879303,
0.4206311106681824,
-0.2918550670146942,
-0.10632701218128204,
0.0017338667530566454,
0.18082626163959503,
-0.19494518637657166,
-0.28114306926727295,
0.6911482810974121,
0.03871484473347664,
-0.7461902499198914,
0.7496142387390137,
0.06989618390798569,
0.6995666027069092,
-0.5460200905799866,
0.026404712349176407,
-0.23989689350128174,
0.13902486860752106,
-0.43259701132774353,
-0.9352315068244934,
0.17413800954818726,
-0.048827771097421646,
-0.1329161822795868,
-0.050093088299036026,
0.9915978908538818,
-0.153465136885643,
-0.6191872358322144,
0.3347150385379791,
0.5188260078430176,
0.33919650316238403,
0.11221736669540405,
-0.9006298184394836,
0.07967767119407654,
0.1787067949771881,
-0.590262234210968,
0.45022186636924744,
0.4016946256160736,
0.10538721084594727,
0.8092368245124817,
0.9025271534919739,
0.11395325511693954,
0.437325119972229,
-0.34033218026161194,
0.9615283608436584,
-0.8004054427146912,
-0.5246087312698364,
-1.0674054622650146,
0.5777931809425354,
-0.14914092421531677,
-0.3267476558685303,
1.0731037855148315,
0.74746173620224,
0.8092854619026184,
-0.04552065208554268,
0.8276547193527222,
-0.24458345770835876,
0.527212381362915,
-0.4284672439098358,
0.7579549551010132,
-0.4892176687717438,
0.10723497718572617,
-0.3539924621582031,
-0.674466073513031,
-0.07613427191972733,
0.6556093692779541,
-0.3052559196949005,
0.16955649852752686,
0.43852347135543823,
0.9018788933753967,
0.047364119440317154,
-0.047490544617176056,
0.2080608457326889,
0.38341158628463745,
0.22160182893276215,
0.7847768068313599,
0.7875477075576782,
-0.7793868780136108,
0.7033710479736328,
-0.627360999584198,
-0.16554376482963562,
-0.34674376249313354,
-0.655534029006958,
-0.981423556804657,
-0.33190372586250305,
-0.22454431653022766,
-0.4163569211959839,
-0.11622044444084167,
1.0498124361038208,
0.4900986850261688,
-0.7598165273666382,
-0.3925700783729553,
0.1828588992357254,
0.17940619587898254,
-0.3717694878578186,
-0.3529348373413086,
0.792596697807312,
-0.252663791179657,
-0.8940160870552063,
0.04947725683450699,
-0.14940880239009857,
0.21889904141426086,
-0.018834199756383896,
-0.022650334984064102,
-0.4199250340461731,
-0.09431185573339462,
0.5939118266105652,
0.22086414694786072,
-0.6512174010276794,
-0.27474865317344666,
0.10437904298305511,
-0.39321601390838623,
0.332229346036911,
0.18856573104858398,
-0.4865787625312805,
0.20317703485488892,
0.6535273790359497,
0.2825064957141876,
0.8261396884918213,
0.2576529085636139,
0.2039889097213745,
-0.595436692237854,
0.1450076848268509,
-0.03901473432779312,
0.31772446632385254,
-0.04212823137640953,
-0.5561385154724121,
0.5267761945724487,
0.41204577684402466,
-0.8708375692367554,
-0.7849119305610657,
-0.1873588263988495,
-1.1567615270614624,
-0.3299243450164795,
1.1409510374069214,
-0.3200915455818176,
-0.4744362235069275,
0.030742201954126358,
-0.5043219327926636,
0.42593610286712646,
-0.60468989610672,
0.8796388506889343,
0.6397641897201538,
-0.3694590628147125,
-0.13609977066516876,
-0.8512346148490906,
0.3278859257698059,
0.4106186032295227,
-0.8177419900894165,
-0.2817865014076233,
0.3645226061344147,
0.49113577604293823,
0.1998843550682068,
1.0529048442840576,
0.0029674815014004707,
0.1641663908958435,
-0.07029420137405396,
0.09030391275882721,
-0.0840371772646904,
0.1129184439778328,
-0.24804940819740295,
0.01711634360253811,
-0.37211862206459045,
-0.6655540466308594
] |
rsvp-ai/bertserini-bert-base-squad | rsvp-ai | "2022-06-23T14:13:40Z" | 1,427,127 | 5 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"bert",
"question-answering",
"autotrain_compatible",
"endpoints_compatible",
"region:us"
] | question-answering | "2022-03-02T23:29:05Z" | Entry not found | [
-0.3227650225162506,
-0.22568431496620178,
0.862226128578186,
0.43461495637893677,
-0.5282987952232361,
0.7012965679168701,
0.7915717363357544,
0.07618638128042221,
0.7746025919914246,
0.2563219666481018,
-0.7852817177772522,
-0.22573819756507874,
-0.9104480743408203,
0.5715669393539429,
-0.3992334008216858,
0.5791245698928833,
-0.14494505524635315,
-0.10751161724328995,
0.28233757615089417,
-0.2768954336643219,
-0.5409224033355713,
-0.36855220794677734,
-1.1902776956558228,
0.061491113156080246,
0.5316578149795532,
0.7435142397880554,
0.7584060430526733,
0.3652167320251465,
0.6432578563690186,
0.3932291269302368,
-0.23138920962810516,
0.4827055037021637,
-0.04171813279390335,
0.00260411505587399,
-0.3524433970451355,
-0.5516898036003113,
-0.28596609830856323,
0.07584730535745621,
1.0961304903030396,
0.966687798500061,
-0.284663587808609,
0.05330817773938179,
-0.3063621520996094,
0.33088892698287964,
-0.49734312295913696,
0.3054099678993225,
-0.022506045177578926,
0.16318801045417786,
-0.7041513919830322,
-0.5535354018211365,
0.012794834561645985,
-0.7361212968826294,
0.17926570773124695,
-0.690081000328064,
0.8269098401069641,
0.18583157658576965,
1.1533750295639038,
0.14819414913654327,
-0.462487131357193,
-0.8161764144897461,
-0.6538989543914795,
0.5711171627044678,
-0.32703715562820435,
0.39680248498916626,
0.7028235197067261,
-0.048573412001132965,
-0.9820332527160645,
-0.6745741367340088,
-0.46466192603111267,
0.2923962473869324,
0.35402774810791016,
-0.3411678075790405,
-0.17522086203098297,
-0.3058989644050598,
0.15792037546634674,
0.12811517715454102,
-0.4841994643211365,
-0.5543919205665588,
-0.5475160479545593,
-0.3960252106189728,
0.6206658482551575,
0.3482950031757355,
0.2429177463054657,
-0.1888415813446045,
-0.3228583335876465,
0.0880163162946701,
-0.4160851538181305,
0.3402571678161621,
0.6335517168045044,
0.7114017009735107,
-0.5811444520950317,
0.560215950012207,
-0.04927587881684303,
0.7439703941345215,
0.11445561796426773,
-0.27478092908859253,
0.41460567712783813,
-0.14724725484848022,
0.055171746760606766,
0.4226345121860504,
0.31524422764778137,
0.2841312289237976,
-0.3273695111274719,
0.2032228708267212,
-0.3215144872665405,
-0.30496224761009216,
-0.22332167625427246,
-0.29490774869918823,
-0.3592180609703064,
0.5492289066314697,
-0.3314017057418823,
-0.42855486273765564,
1.143175721168518,
-0.4200771450996399,
-0.7302224040031433,
0.33156412839889526,
0.4065209925174713,
-0.0994480773806572,
-0.37146568298339844,
-0.052260834723711014,
-0.8458789587020874,
-0.007907390594482422,
0.7491172552108765,
-0.7198970913887024,
0.3371737599372864,
0.4728063642978668,
0.7417217493057251,
0.19650575518608093,
-0.14034469425678253,
-0.42949390411376953,
0.2971969544887543,
-0.8659994006156921,
0.6320174336433411,
-0.20135220885276794,
-1.0051977634429932,
0.11150479316711426,
0.8971705436706543,
-0.37896400690078735,
-1.2094876766204834,
1.0605159997940063,
-0.6887932419776917,
0.16017857193946838,
-0.676761269569397,
-0.14661237597465515,
-0.07118501514196396,
-0.005096632521599531,
-0.6088156700134277,
0.7567102313041687,
0.587267279624939,
-0.4995276927947998,
0.21429483592510223,
-0.26029831171035767,
-0.39151400327682495,
0.38824859261512756,
-0.07935450226068497,
-0.21858926117420197,
0.713833212852478,
-0.6647079586982727,
-0.26932814717292786,
0.2942774295806885,
0.2368936538696289,
-0.35706108808517456,
-0.7931919097900391,
0.08478113263845444,
-0.05786270648241043,
1.550750494003296,
-0.03868847340345383,
-0.3586106300354004,
-0.679383397102356,
-1.1506240367889404,
-0.07070787996053696,
0.6886883974075317,
-0.9194989204406738,
-0.27839475870132446,
-0.046410128474235535,
-0.26169314980506897,
0.08994917571544647,
0.7390589714050293,
-1.1194051504135132,
0.2832726836204529,
-0.05092663690447807,
-0.22794683277606964,
0.8271058797836304,
0.15387225151062012,
0.24758946895599365,
0.14913396537303925,
0.42958706617355347,
0.527725338935852,
0.11115207523107529,
0.683587908744812,
-0.34720373153686523,
-0.9694353938102722,
0.6154631972312927,
0.25266361236572266,
0.8121447563171387,
-0.49945297837257385,
0.2685093879699707,
0.27025535702705383,
-0.3409680724143982,
-0.5682371854782104,
-0.3102838397026062,
0.09025752544403076,
0.14930562674999237,
0.11142510175704956,
-0.5721710324287415,
-0.6576125025749207,
-0.9689140319824219,
-0.13590654730796814,
-0.4314374029636383,
-0.3571570813655853,
0.21006910502910614,
0.5792906284332275,
-1.1975523233413696,
0.4128875136375427,
-0.7705625891685486,
-0.7038741111755371,
-0.01065548975020647,
-0.19338123500347137,
0.7540656328201294,
0.43240174651145935,
0.5033966898918152,
-0.6397148370742798,
-0.5661987066268921,
-0.22470176219940186,
-1.0333747863769531,
-0.13280506432056427,
0.24819621443748474,
0.3065737783908844,
-0.13423344492912292,
-0.2744963765144348,
-0.48740333318710327,
0.8100387454032898,
0.14789170026779175,
-0.5391897559165955,
0.5220767259597778,
-0.3020317256450653,
0.17224803566932678,
-0.6369150280952454,
-0.06916818022727966,
-0.661676287651062,
-0.0009071884560398757,
-0.3608308732509613,
-0.5737438797950745,
0.14772287011146545,
0.07017494738101959,
-0.16065457463264465,
0.28808408975601196,
-0.909277081489563,
-0.0010852962732315063,
-0.7442210912704468,
0.379071980714798,
0.06394772231578827,
-0.3145078718662262,
-0.017517540603876114,
1.0000386238098145,
0.7784460783004761,
-0.3848048746585846,
0.721744179725647,
0.4440041184425354,
0.19036155939102173,
0.7630521059036255,
-0.18725109100341797,
0.16478213667869568,
-0.5245416760444641,
-0.12161104381084442,
-0.8887597918510437,
-1.0982946157455444,
0.7320570349693298,
-0.6114250421524048,
0.36542922258377075,
-0.4277869760990143,
0.2589159905910492,
-0.6919258832931519,
-0.03885362669825554,
0.4808599352836609,
-0.05936325341463089,
-0.6863942742347717,
0.5232570171356201,
0.45317530632019043,
-0.2019241601228714,
-0.6609031558036804,
-0.530157208442688,
0.39365822076797485,
0.6154114007949829,
-0.16390392184257507,
0.06878514587879181,
0.14941060543060303,
-0.5441926121711731,
-0.040802597999572754,
-0.38691970705986023,
-0.45766758918762207,
0.054224006831645966,
0.13053473830223083,
-0.005750799085944891,
-0.404820054769516,
-0.0868026465177536,
-0.35842007398605347,
-0.4656120240688324,
0.21876516938209534,
0.3011947274208069,
-0.04096309468150139,
-0.42599788308143616,
-0.3619818687438965,
-0.888181209564209,
0.6719610095024109,
0.5370282530784607,
0.05281545966863632,
0.7555549740791321,
0.16819314658641815,
-0.8014987707138062,
-0.13532210886478424,
-0.1760706603527069,
0.2696830928325653,
-0.5588056445121765,
0.13849826157093048,
-0.013484534807503223,
-0.0637492910027504,
0.26297882199287415,
0.25386232137680054,
-0.4300556778907776,
0.9276250004768372,
-0.2615274488925934,
-0.3592521846294403,
0.7960181832313538,
0.5974742770195007,
0.49583131074905396,
0.16503219306468964,
-0.044541798532009125,
0.900709331035614,
-1.1966516971588135,
-0.6563175916671753,
-0.7409549355506897,
-0.15945707261562347,
-0.43510833382606506,
-0.032105933874845505,
0.6254412531852722,
0.2900990843772888,
-0.1333388388156891,
0.4756395220756531,
-0.5243489742279053,
0.3556033670902252,
1.01198410987854,
0.35748639702796936,
0.3435698449611664,
-0.7570229172706604,
-0.2515777349472046,
-0.1402427852153778,
-0.9998157620429993,
-0.2631377875804901,
0.8871029019355774,
0.22752606868743896,
0.844460666179657,
0.5992541313171387,
0.6784542798995972,
0.1367226243019104,
0.2523828148841858,
-0.30590319633483887,
0.3920294940471649,
0.4376082420349121,
-1.0401138067245483,
-0.42758408188819885,
0.021418681368231773,
-0.9703338742256165,
-0.14227519929409027,
-0.03495011106133461,
-0.42617112398147583,
0.7681737542152405,
0.00016589462757110596,
-0.4076709747314453,
0.7732734084129333,
-0.455583393573761,
0.7562873363494873,
-0.4473648965358734,
-0.02663906291127205,
0.4699096083641052,
-0.7070636749267578,
0.4677430987358093,
0.12878790497779846,
0.6205843091011047,
-0.015572631731629372,
-0.04078587517142296,
0.7104941606521606,
-0.9129160046577454,
0.25438642501831055,
-0.6348397135734558,
0.22421300411224365,
0.24246945977210999,
0.51606285572052,
0.5969953536987305,
0.4371243417263031,
0.10119888931512833,
-0.23920902609825134,
0.04115807265043259,
-0.8241125345230103,
-0.210506409406662,
0.697515606880188,
-0.7186890840530396,
-0.6864197850227356,
-1.2355337142944336,
0.14438660442829132,
0.27347055077552795,
0.389305055141449,
0.7959296107292175,
0.571408748626709,
0.1289544403553009,
0.680525004863739,
0.9888588190078735,
-0.0688566341996193,
0.9166924357414246,
0.3224477171897888,
0.09175168722867966,
-0.21944808959960938,
0.7036820650100708,
0.26627904176712036,
-0.24707956612110138,
-0.11939732730388641,
0.20913465321063995,
-0.11069409549236298,
-0.591761589050293,
-0.49990686774253845,
0.3701757788658142,
-0.6731787919998169,
-0.18303893506526947,
-0.6243735551834106,
-0.6043769717216492,
-0.511759340763092,
0.06927360594272614,
-0.7147687673568726,
0.23979046940803528,
-0.7753565907478333,
-0.10574902594089508,
0.04323432594537735,
0.9792009592056274,
-0.589311957359314,
0.5805224180221558,
-1.1218582391738892,
0.19345788657665253,
-0.07949887961149216,
0.7921058535575867,
0.21395787596702576,
-0.7344395518302917,
-0.3975418508052826,
-0.11592631042003632,
-0.3729911744594574,
-1.3576762676239014,
0.21404948830604553,
-0.2454141080379486,
0.23094046115875244,
0.6145404577255249,
0.1397707313299179,
0.5258248448371887,
-0.34326282143592834,
0.7029101848602295,
-0.057017259299755096,
-0.7069286704063416,
0.7934495210647583,
-0.5026894807815552,
0.4963534474372864,
0.9765996932983398,
0.5333835482597351,
-0.7984007596969604,
0.035741209983825684,
-1.041123390197754,
-0.6008695363998413,
0.38426393270492554,
0.11928944289684296,
-0.03601083159446716,
-0.6659559011459351,
-0.054019637405872345,
-0.16143807768821716,
0.6043745279312134,
-1.039069414138794,
-0.7858356237411499,
0.2576698362827301,
0.5277302861213684,
0.0816856250166893,
-0.5653398633003235,
0.20880667865276337,
-0.544416069984436,
1.0657774209976196,
0.45109400153160095,
0.3274499475955963,
0.8406060934066772,
0.46492424607276917,
-0.3823164403438568,
0.09252490103244781,
0.7662695050239563,
0.6666232347488403,
-0.5239797830581665,
-0.2908027470111847,
-0.08827541768550873,
-0.9143403768539429,
0.05927472561597824,
0.11168918758630753,
-0.013455932028591633,
0.9082110524177551,
0.5793083310127258,
0.2539709210395813,
0.4514279365539551,
-0.726460337638855,
0.8859451413154602,
-0.14954176545143127,
-0.12472866475582123,
-1.0677239894866943,
0.1948619782924652,
-0.23984959721565247,
0.5006402134895325,
1.0061326026916504,
0.5250048041343689,
-0.047630298882722855,
-0.8143380880355835,
-0.01473585981875658,
0.6939172148704529,
-0.7091123461723328,
-0.17449834942817688,
0.944853663444519,
0.3847099542617798,
-1.2953051328659058,
1.106776475906372,
-0.5381771326065063,
-0.560332179069519,
0.9121301770210266,
0.522956907749176,
1.1221847534179688,
-0.44204121828079224,
0.0008676342549733818,
0.2662237286567688,
0.41378432512283325,
0.5423170328140259,
1.0869629383087158,
0.431413471698761,
-0.7931063771247864,
0.8826584815979004,
-0.24776044487953186,
-0.40361151099205017,
-0.05347571521997452,
-0.42859897017478943,
0.16892178356647491,
-0.4406192898750305,
-0.10713007301092148,
-0.3444187641143799,
0.28543180227279663,
-0.7072042226791382,
0.42807620763778687,
-0.0838567465543747,
0.8653068542480469,
-0.8553727269172668,
0.47207626700401306,
0.635470449924469,
-0.3337355852127075,
-0.8508191108703613,
-0.26198428869247437,
-0.11448462307453156,
-0.6389466524124146,
0.30214807391166687,
-0.4554102420806885,
0.044398851692676544,
0.09623463451862335,
-0.649151623249054,
-1.1778275966644287,
0.9093633890151978,
-0.639612078666687,
-0.2784462869167328,
0.20464053750038147,
-0.11514760553836823,
0.28811705112457275,
-0.2524643540382385,
0.010661216452717781,
0.41876548528671265,
0.748940110206604,
0.2844654619693756,
-0.7727053761482239,
-0.3694884479045868,
0.0015032943338155746,
-0.44474777579307556,
0.7582978010177612,
-0.6002101898193359,
1.1840779781341553,
-0.5563543438911438,
-0.059654366225004196,
0.44384512305259705,
0.24690914154052734,
0.21076197922229767,
0.6629220843315125,
0.1442081481218338,
0.7282265424728394,
1.07012140750885,
-0.40835219621658325,
0.8811809420585632,
0.26432839035987854,
0.47430819272994995,
0.7238501906394958,
-0.6487724781036377,
0.7513749003410339,
0.31810489296913147,
-0.5682924389839172,
0.9228013753890991,
1.2906063795089722,
-0.15699204802513123,
0.8079374432563782,
0.05136508867144585,
-1.081600546836853,
0.325833261013031,
-0.20724765956401825,
-0.7530064582824707,
0.3150254189968109,
0.19055864214897156,
-0.6920982599258423,
-0.5770308971405029,
-0.24046507477760315,
-0.35662803053855896,
-0.11552901566028595,
-0.7631728649139404,
0.6720563769340515,
-0.016969164833426476,
-0.5103683471679688,
0.18857547640800476,
0.2877499461174011,
0.17368432879447937,
-0.5235732793807983,
-0.02939440682530403,
-0.22823619842529297,
0.2660655975341797,
-0.5670853853225708,
-0.5234526991844177,
0.5724433064460754,
-0.32430219650268555,
-0.5343255400657654,
0.18147465586662292,
0.763587236404419,
-0.16923809051513672,
-0.4515409469604492,
0.32472723722457886,
0.6959525346755981,
0.1665852814912796,
0.4250282347202301,
-0.23511263728141785,
0.24480605125427246,
-0.08044824004173279,
-0.06651552021503448,
0.27714768052101135,
0.3449169099330902,
0.22435641288757324,
0.4450142979621887,
0.43285664916038513,
-0.01808755099773407,
-0.10736498981714249,
-0.382819801568985,
0.4124940037727356,
-0.9542785882949829,
-0.5713282823562622,
-0.6307113766670227,
0.2740660607814789,
-0.02315417304635048,
-1.0836423635482788,
0.4145168364048004,
1.4406683444976807,
1.0359982252120972,
-0.4756383001804352,
1.067226529121399,
-0.21818485856056213,
0.9594791531562805,
0.41483086347579956,
0.5420440435409546,
-0.6030411720275879,
0.03835370019078255,
-0.4364396035671234,
-1.076962947845459,
-0.35716333985328674,
0.4539391100406647,
-0.022899555042386055,
-0.3429867625236511,
0.872571587562561,
0.5887166261672974,
-0.33473607897758484,
-0.11728022992610931,
0.048487238585948944,
-0.029941488057374954,
-0.12433847039937973,
0.5145376324653625,
0.7648399472236633,
-0.9344304800033569,
-0.10680416971445084,
-0.21577754616737366,
-0.6382725834846497,
-0.5047279000282288,
-0.9632009267807007,
-0.12959396839141846,
-0.16037796437740326,
0.035343267023563385,
-0.5662806630134583,
0.00255737011320889,
1.208324909210205,
0.5684957504272461,
-1.1113994121551514,
-0.5303789377212524,
0.3371853232383728,
0.3920421898365021,
-0.1874791383743286,
-0.24202413856983185,
0.2984568774700165,
0.15382249653339386,
-0.5908876657485962,
0.6875665783882141,
0.8089625239372253,
0.208888977766037,
0.19554761052131653,
0.15893013775348663,
-0.8229473829269409,
-0.14913435280323029,
0.17440445721149445,
0.9450570344924927,
-0.939853310585022,
-0.7114843130111694,
-0.03168516233563423,
-0.27094873785972595,
-0.05765746906399727,
0.17102102935314178,
-0.4046344757080078,
0.5180677175521851,
0.34591493010520935,
0.49933457374572754,
0.0561608150601387,
-0.054746925830841064,
0.5409556031227112,
-0.9069057703018188,
0.09425963461399078,
0.4134361147880554,
0.4154115319252014,
-0.4000864028930664,
-0.5910194516181946,
0.6713420748710632,
1.0073972940444946,
-0.6594868898391724,
-0.8743268847465515,
-0.19846712052822113,
-1.0016002655029297,
0.04189709946513176,
0.6762762069702148,
0.5009527802467346,
-0.4806513786315918,
-0.4174500107765198,
-0.5617399215698242,
-0.1254672110080719,
-0.1369970738887787,
0.7621601819992065,
1.179680585861206,
-0.7432094812393188,
0.07975747436285019,
-1.038639783859253,
0.6594986915588379,
-0.2419457733631134,
-0.3457581698894501,
-0.48644304275512695,
0.3832802176475525,
0.35236993432044983,
0.440481036901474,
0.614812433719635,
0.1408471167087555,
0.8338426351547241,
0.3126053214073181,
-0.1702686995267868,
0.2698982357978821,
-0.4559200704097748,
-0.028932858258485794,
-0.057962555438280106,
0.31015971302986145,
-1.0262157917022705
] |
timm/efficientnet_b0.ra_in1k | timm | "2023-04-27T21:09:50Z" | 1,421,528 | 2 | timm | [
"timm",
"pytorch",
"safetensors",
"image-classification",
"dataset:imagenet-1k",
"arxiv:2110.00476",
"arxiv:1905.11946",
"license:apache-2.0",
"region:us"
] | image-classification | "2022-12-12T23:52:52Z" | ---
tags:
- image-classification
- timm
library_name: timm
license: apache-2.0
datasets:
- imagenet-1k
---
# Model card for efficientnet_b0.ra_in1k
A EfficientNet image classification model. Trained on ImageNet-1k in `timm` using recipe template described below.
Recipe details:
* RandAugment `RA` recipe. Inspired by and evolved from EfficientNet RandAugment recipes. Published as `B` recipe in [ResNet Strikes Back](https://arxiv.org/abs/2110.00476).
* RMSProp (TF 1.0 behaviour) optimizer, EMA weight averaging
* Step (exponential decay w/ staircase) LR schedule with warmup
## Model Details
- **Model Type:** Image classification / feature backbone
- **Model Stats:**
- Params (M): 5.3
- GMACs: 0.4
- Activations (M): 6.7
- Image size: 224 x 224
- **Papers:**
- EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks: https://arxiv.org/abs/1905.11946
- ResNet strikes back: An improved training procedure in timm: https://arxiv.org/abs/2110.00476
- **Dataset:** ImageNet-1k
- **Original:** https://github.com/huggingface/pytorch-image-models
## Model Usage
### Image Classification
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model('efficientnet_b0.ra_in1k', pretrained=True)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)
```
### Feature Map Extraction
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'efficientnet_b0.ra_in1k',
pretrained=True,
features_only=True,
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
for o in output:
# print shape of each feature map in output
# e.g.:
# torch.Size([1, 16, 112, 112])
# torch.Size([1, 24, 56, 56])
# torch.Size([1, 40, 28, 28])
# torch.Size([1, 112, 14, 14])
# torch.Size([1, 320, 7, 7])
print(o.shape)
```
### Image Embeddings
```python
from urllib.request import urlopen
from PIL import Image
import timm
img = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
model = timm.create_model(
'efficientnet_b0.ra_in1k',
pretrained=True,
num_classes=0, # remove classifier nn.Linear
)
model = model.eval()
# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
# or equivalently (without needing to set num_classes=0)
output = model.forward_features(transforms(img).unsqueeze(0))
# output is unpooled, a (1, 1280, 7, 7) shaped tensor
output = model.forward_head(output, pre_logits=True)
# output is a (1, num_features) shaped tensor
```
## Model Comparison
Explore the dataset and runtime metrics of this model in timm [model results](https://github.com/huggingface/pytorch-image-models/tree/main/results).
## Citation
```bibtex
@inproceedings{tan2019efficientnet,
title={Efficientnet: Rethinking model scaling for convolutional neural networks},
author={Tan, Mingxing and Le, Quoc},
booktitle={International conference on machine learning},
pages={6105--6114},
year={2019},
organization={PMLR}
}
```
```bibtex
@misc{rw2019timm,
author = {Ross Wightman},
title = {PyTorch Image Models},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
doi = {10.5281/zenodo.4414861},
howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
}
```
```bibtex
@inproceedings{wightman2021resnet,
title={ResNet strikes back: An improved training procedure in timm},
author={Wightman, Ross and Touvron, Hugo and Jegou, Herve},
booktitle={NeurIPS 2021 Workshop on ImageNet: Past, Present, and Future}
}
```
| [
-0.39059004187583923,
-0.5088057518005371,
-0.11751069128513336,
0.06030486896634102,
-0.21740694344043732,
-0.47933852672576904,
-0.3147055506706238,
-0.3762834966182709,
0.2926810085773468,
0.43902572989463806,
-0.45833879709243774,
-0.5898841619491577,
-0.7615395188331604,
-0.10919776558876038,
-0.18890073895454407,
0.8526139855384827,
-0.02945002354681492,
0.031061682850122452,
-0.1502637267112732,
-0.6427609324455261,
-0.16646650433540344,
-0.23016877472400665,
-1.090997338294983,
-0.5436637997627258,
0.451336532831192,
0.3484918475151062,
0.5689800381660461,
0.6969097852706909,
0.7394617795944214,
0.5060312747955322,
-0.0664188489317894,
0.16745826601982117,
-0.248844176530838,
-0.09433306753635406,
0.40684232115745544,
-0.637396514415741,
-0.41711458563804626,
0.2174404263496399,
0.7098631262779236,
0.4183494746685028,
-0.0857565701007843,
0.48155155777931213,
0.09918635338544846,
0.6871975064277649,
-0.3440806269645691,
0.09651146084070206,
-0.4733426868915558,
0.1877652108669281,
-0.07522116601467133,
0.1006377637386322,
-0.364782452583313,
-0.3776668608188629,
0.11311300843954086,
-0.5760443806648254,
0.4211499094963074,
0.005212815944105387,
1.2992900609970093,
0.3163844645023346,
0.0013333297101780772,
-0.06340380758047104,
-0.20567530393600464,
0.7699426412582397,
-0.8701982498168945,
0.18058493733406067,
0.21248607337474823,
0.32968926429748535,
-0.07129896432161331,
-1.205955982208252,
-0.5627238750457764,
-0.23450958728790283,
-0.20343853533267975,
-0.08160203695297241,
-0.3737764358520508,
0.03190005570650101,
0.3814374506473541,
0.25726595520973206,
-0.4080842435359955,
0.17391882836818695,
-0.4560658037662506,
-0.13089855015277863,
0.5158107876777649,
0.07404489070177078,
0.3762081265449524,
-0.15563470125198364,
-0.4661974012851715,
-0.47450023889541626,
-0.40855664014816284,
0.3275955021381378,
0.29437845945358276,
0.33401668071746826,
-0.5662441253662109,
0.3730428218841553,
0.10790378600358963,
0.6746014356613159,
0.11511625349521637,
-0.28731009364128113,
0.5778970718383789,
0.04755577817559242,
-0.4685616195201874,
-0.16033296287059784,
1.0682053565979004,
0.36857596039772034,
0.1971704661846161,
0.1524449586868286,
-0.175278440117836,
-0.4607791602611542,
0.047996144741773605,
-1.2946041822433472,
-0.3682183623313904,
0.258517324924469,
-0.7197787761688232,
-0.38723528385162354,
0.14034590125083923,
-0.5012460350990295,
-0.11743701994419098,
-0.05065929517149925,
0.6030784845352173,
-0.48570773005485535,
-0.40625572204589844,
0.003302456345409155,
-0.19234488904476166,
0.21614494919776917,
0.24164985120296478,
-0.5784085392951965,
0.20932896435260773,
0.3195456862449646,
1.1867610216140747,
0.17620687186717987,
-0.4280751049518585,
-0.2771123945713043,
-0.4501383602619171,
-0.2800447344779968,
0.3719789683818817,
-0.11017075926065445,
0.07413249462842941,
-0.3601522743701935,
0.33060139417648315,
-0.1460362672805786,
-0.7772414684295654,
0.27639177441596985,
-0.3036971390247345,
0.07988931238651276,
-0.04414792358875275,
-0.2841375768184662,
-0.6210797429084778,
0.39467570185661316,
-0.5828495621681213,
1.157425045967102,
0.2838905155658722,
-0.932580292224884,
0.2792143225669861,
-0.6170858144760132,
-0.11560437828302383,
-0.2931949496269226,
-0.007412169594317675,
-1.083195447921753,
-0.08319002389907837,
0.1323014199733734,
0.7953526973724365,
-0.36325013637542725,
0.03421422839164734,
-0.5647627711296082,
-0.20190507173538208,
0.34731805324554443,
-0.05109647661447525,
1.1119153499603271,
0.29276615381240845,
-0.47262006998062134,
0.2585018277168274,
-0.6844175457954407,
0.26946061849594116,
0.5239047408103943,
-0.2349344938993454,
-0.06808705627918243,
-0.5911893248558044,
0.12452207505702972,
0.26918402314186096,
0.0953775942325592,
-0.5618921518325806,
0.20757675170898438,
-0.18544773757457733,
0.49733787775039673,
0.6189261078834534,
-0.12738348543643951,
0.3546299636363983,
-0.4179832637310028,
0.3058665096759796,
0.1993987262248993,
0.2636050283908844,
-0.10021422058343887,
-0.4626087546348572,
-0.8390883207321167,
-0.5289719104766846,
0.3909361958503723,
0.3485455811023712,
-0.5088889598846436,
0.41289418935775757,
-0.20124433934688568,
-0.8391982913017273,
-0.4768840968608856,
0.0637359544634819,
0.5271813869476318,
0.6378920674324036,
0.3036126494407654,
-0.47443193197250366,
-0.49386903643608093,
-1.0173654556274414,
-0.03639698028564453,
0.10237415134906769,
0.06883672624826431,
0.404191792011261,
0.6420402526855469,
-0.048427339643239975,
0.5784813165664673,
-0.40190833806991577,
-0.24282000958919525,
-0.31488287448883057,
0.06447826325893402,
0.48309221863746643,
0.893979012966156,
0.7764557003974915,
-0.6902036666870117,
-0.6106710433959961,
-0.11900101602077484,
-0.9374152421951294,
0.20436953008174896,
-0.13784220814704895,
-0.15604129433631897,
0.14914485812187195,
0.22331568598747253,
-0.57135009765625,
0.4922891855239868,
0.24670588970184326,
-0.23713469505310059,
0.4167816638946533,
-0.2506103217601776,
0.24589762091636658,
-1.1504409313201904,
0.1909727305173874,
0.40890824794769287,
-0.14124764502048492,
-0.5301021337509155,
0.25115150213241577,
0.07983002811670303,
-0.11177118867635727,
-0.49478593468666077,
0.6503481864929199,
-0.5889399647712708,
-0.15531042218208313,
-0.16275011003017426,
-0.3175860643386841,
-0.00471413042396307,
0.7107713222503662,
-0.21252937614917755,
0.34043678641319275,
0.8291223645210266,
-0.44940468668937683,
0.4775448441505432,
0.24709178507328033,
-0.2496005743741989,
0.3654917776584625,
-0.7550766468048096,
0.22295019030570984,
0.03975945711135864,
0.2641928195953369,
-1.0421383380889893,
-0.22064298391342163,
0.39080965518951416,
-0.6323591470718384,
0.7259459495544434,
-0.4905671179294586,
-0.46193191409111023,
-0.47134676575660706,
-0.41822195053100586,
0.3979783356189728,
0.6224915981292725,
-0.7787719368934631,
0.486362487077713,
0.2173965573310852,
0.37167224287986755,
-0.6430075168609619,
-0.9225729703903198,
-0.16828344762325287,
-0.40082597732543945,
-0.7935341596603394,
0.30653154850006104,
0.10563171654939651,
0.03935309499502182,
0.14967027306556702,
-0.0010210782056674361,
-0.16334642469882965,
0.002162923337891698,
0.5156324505805969,
0.19006502628326416,
-0.2809917628765106,
-0.08616898208856583,
-0.33001652359962463,
-0.027404485270380974,
0.021431365981698036,
-0.3464587926864624,
0.5428850650787354,
-0.24340742826461792,
-0.1024370938539505,
-0.8918666839599609,
-0.03537148982286453,
0.5059261918067932,
-0.03943527489900589,
0.8788756132125854,
1.095598578453064,
-0.5669956207275391,
-0.08763467520475388,
-0.4504542052745819,
-0.38021013140678406,
-0.5015233755111694,
0.49516579508781433,
-0.3465663492679596,
-0.44540655612945557,
0.89674973487854,
-0.06374628841876984,
0.13697858154773712,
0.6669996380805969,
0.3373262286186218,
-0.04037371650338173,
0.6530757546424866,
0.6561422348022461,
0.254300981760025,
0.7781705260276794,
-1.1241756677627563,
-0.20373864471912384,
-0.8989628553390503,
-0.40410906076431274,
-0.42682600021362305,
-0.7971013784408569,
-0.6531656384468079,
-0.2927343249320984,
0.4797999858856201,
0.19534678757190704,
-0.501946747303009,
0.459343284368515,
-0.8867560029029846,
0.061207666993141174,
0.7020869255065918,
0.6170986890792847,
-0.41929277777671814,
0.3273354470729828,
-0.2433178424835205,
-0.00024647722602821887,
-0.9214752912521362,
-0.17242838442325592,
1.1433156728744507,
0.4160115122795105,
0.620359480381012,
-0.12974677979946136,
0.7396807670593262,
-0.22871805727481842,
0.4533047378063202,
-0.5895057916641235,
0.6040070652961731,
-0.22876176238059998,
-0.49765074253082275,
-0.2487771213054657,
-0.5485388040542603,
-1.101090669631958,
0.14760740101337433,
-0.2710314393043518,
-0.6323352456092834,
0.20380710065364838,
0.24443572759628296,
-0.2609589397907257,
0.8288986682891846,
-0.8592028617858887,
0.9414064884185791,
-0.07984843105077744,
-0.4495692551136017,
-0.03894592449069023,
-0.7045212388038635,
0.30825290083885193,
0.27014145255088806,
-0.19424425065517426,
-0.03744872286915779,
0.09186340868473053,
1.0694847106933594,
-0.7165438532829285,
0.9108144640922546,
-0.5453612804412842,
0.4812217652797699,
0.5266329050064087,
-0.13415288925170898,
0.40117087960243225,
-0.15882964432239532,
-0.2440406233072281,
0.35181283950805664,
-0.13172882795333862,
-0.49408555030822754,
-0.609058141708374,
0.6388509273529053,
-0.958430290222168,
-0.3053717017173767,
-0.20419028401374817,
-0.4762543737888336,
0.3035244643688202,
0.1418224424123764,
0.5665459632873535,
0.7695216536521912,
0.28822705149650574,
0.36049214005470276,
0.5644425749778748,
-0.44237542152404785,
0.47217321395874023,
-0.03917601704597473,
-0.07108790427446365,
-0.5268906354904175,
0.7981586456298828,
0.4170380234718323,
0.20402905344963074,
0.17056885361671448,
0.2817003130912781,
-0.2011120766401291,
-0.6339747905731201,
-0.36328259110450745,
0.23190702497959137,
-0.7577140927314758,
-0.616245448589325,
-0.6983864903450012,
-0.43383440375328064,
-0.33558037877082825,
-0.09624633193016052,
-0.5733468532562256,
-0.42745015025138855,
-0.34952524304389954,
0.22857436537742615,
0.721741259098053,
0.5242070555686951,
-0.2412322610616684,
0.5891116857528687,
-0.48774197697639465,
0.10176830738782883,
0.10530000180006027,
0.42388081550598145,
0.1489468812942505,
-0.878864049911499,
-0.35244837403297424,
-0.06871029734611511,
-0.44111746549606323,
-0.6597504019737244,
0.5274366736412048,
0.2456158697605133,
0.5565305352210999,
0.345840185880661,
-0.15902361273765564,
0.6634441614151001,
-0.05298436060547829,
0.5182673931121826,
0.5333053469657898,
-0.463855117559433,
0.5767185091972351,
0.04058521240949631,
0.2149510532617569,
0.11775524914264679,
0.3710356652736664,
-0.24882729351520538,
-0.05142980441451073,
-0.9925675392150879,
-0.8230935335159302,
0.8213578462600708,
0.03663824126124382,
0.0436573401093483,
0.2760731279850006,
0.8402162194252014,
0.07956982403993607,
-0.03836182504892349,
-0.7464785575866699,
-0.544377863407135,
-0.2796967923641205,
-0.2459568828344345,
0.046374645084142685,
-0.0707373172044754,
-0.08360417187213898,
-0.6644930243492126,
0.7004880309104919,
-0.05019620805978775,
0.7196469306945801,
0.3602188229560852,
-0.010005492717027664,
-0.10297267884016037,
-0.39967939257621765,
0.43544802069664,
0.3152751326560974,
-0.2756213843822479,
0.1313852220773697,
0.17913059890270233,
-0.5451220870018005,
0.14357306063175201,
0.12694485485553741,
-0.06111264228820801,
-0.019185062497854233,
0.5297144651412964,
0.950252115726471,
0.015162871219217777,
0.10603901743888855,
0.3325999677181244,
-0.1193404495716095,
-0.40523749589920044,
-0.25924089550971985,
0.17755217850208282,
-0.013104666955769062,
0.4884684681892395,
0.3037551939487457,
0.4959430992603302,
-0.09164968132972717,
-0.249126136302948,
0.30676740407943726,
0.5424366593360901,
-0.24566137790679932,
-0.3116273581981659,
0.6421791911125183,
-0.18098077178001404,
-0.2690508961677551,
0.8975189328193665,
-0.17241132259368896,
-0.44341230392456055,
1.2181190252304077,
0.48576632142066956,
1.0093104839324951,
0.0040071746334433556,
-0.029736164957284927,
0.9673359394073486,
0.30884045362472534,
-0.05450736731290817,
0.13381130993366241,
0.1687794327735901,
-0.8392472863197327,
0.03103693202137947,
-0.506346583366394,
0.04477597400546074,
0.2985270321369171,
-0.5295274257659912,
0.24530529975891113,
-0.7623216509819031,
-0.479695200920105,
0.1930326521396637,
0.39118853211402893,
-1.0085698366165161,
0.2100880742073059,
-0.13578946888446808,
0.9752271771430969,
-0.6911918520927429,
0.7812126874923706,
0.9038823843002319,
-0.5168761610984802,
-1.1734308004379272,
-0.16816425323486328,
-0.0037110354751348495,
-0.9000592827796936,
0.7393212914466858,
0.4663460850715637,
0.15914557874202728,
0.10412014275789261,
-0.9123601913452148,
-0.700298011302948,
1.4579474925994873,
0.6118163466453552,
-0.17635421454906464,
0.3387451469898224,
-0.21712137758731842,
0.2112559676170349,
-0.5141907334327698,
0.5145463943481445,
0.09011373668909073,
0.4217783808708191,
0.2832815945148468,
-0.6104293465614319,
0.356010377407074,
-0.3836424648761749,
0.07070175558328629,
0.1655139923095703,
-0.9154847264289856,
0.9627317190170288,
-0.5404085516929626,
-0.14595045149326324,
0.026470769196748734,
0.6853641867637634,
0.15291588008403778,
0.1949736326932907,
0.6012459993362427,
0.9747433662414551,
0.5713946223258972,
-0.22093059122562408,
1.0117260217666626,
-0.0110243558883667,
0.5552589893341064,
0.652641773223877,
0.4535030424594879,
0.5246076583862305,
0.30198994278907776,
-0.23188944160938263,
0.35647690296173096,
1.0806970596313477,
-0.3225094974040985,
0.3039631247520447,
0.3164636790752411,
0.1037834882736206,
-0.09915274381637573,
0.1001460924744606,
-0.41351211071014404,
0.4985395073890686,
0.1324957013130188,
-0.5692956447601318,
-0.25161153078079224,
0.061366528272628784,
0.022681815549731255,
-0.27898845076560974,
-0.2867792844772339,
0.4673277735710144,
0.071241095662117,
-0.3786102533340454,
0.9600827097892761,
0.13230830430984497,
0.9257869720458984,
-0.4415434002876282,
0.00605575880035758,
-0.31863635778427124,
0.24100543558597565,
-0.36134082078933716,
-0.6935191750526428,
0.3239818513393402,
-0.3079620897769928,
-0.07268144935369492,
0.03613670542836189,
0.6967741847038269,
-0.30427151918411255,
-0.4830494225025177,
0.2028052806854248,
0.25815191864967346,
0.5287089347839355,
0.09879089891910553,
-1.3125245571136475,
0.19858404994010925,
0.014328216202557087,
-0.7151103615760803,
0.36012473702430725,
0.4813184142112732,
0.16201505064964294,
0.8213472962379456,
0.5611774921417236,
-0.083626389503479,
0.11042563617229462,
-0.15693363547325134,
0.8360313177108765,
-0.4174520671367645,
-0.24321486055850983,
-0.8127907514572144,
0.5918338894844055,
-0.13993637263774872,
-0.5591593980789185,
0.5070357918739319,
0.52411949634552,
0.8137068748474121,
0.01680218055844307,
0.3937990963459015,
-0.30441877245903015,
-0.08793701976537704,
-0.4019855558872223,
0.8004258275032043,
-0.8269832730293274,
0.01279988419264555,
-0.09077555686235428,
-0.6624073386192322,
-0.3750273883342743,
0.7039512395858765,
-0.1693868190050125,
0.45343804359436035,
0.45326322317123413,
1.0405046939849854,
-0.3718685507774353,
-0.3868565261363983,
0.21542735397815704,
0.1682785153388977,
0.11698061227798462,
0.37904784083366394,
0.30307844281196594,
-0.7650038599967957,
0.31998544931411743,
-0.6847630739212036,
-0.2670567035675049,
-0.1444830596446991,
-0.7618870735168457,
-0.8227409720420837,
-0.8794183135032654,
-0.6114963293075562,
-0.6600755453109741,
-0.12527544796466827,
0.9903482794761658,
1.1231238842010498,
-0.6458781361579895,
-0.1579703986644745,
-0.0071810586377978325,
0.20004668831825256,
-0.4032365679740906,
-0.2334759384393692,
0.6625485420227051,
-0.3163124620914459,
-0.6933486461639404,
-0.34576287865638733,
0.013197756372392178,
0.2308664321899414,
0.018340757116675377,
-0.20870159566402435,
-0.21567322313785553,
-0.25114062428474426,
0.19774489104747772,
0.29540568590164185,
-0.574158251285553,
-0.17333905398845673,
-0.25401049852371216,
-0.15117500722408295,
0.32361936569213867,
0.5156125426292419,
-0.4481636881828308,
0.35598599910736084,
0.38812851905822754,
0.4556345045566559,
0.7821035385131836,
-0.42941591143608093,
0.0765729695558548,
-0.8606547713279724,
0.5728936791419983,
-0.13800454139709473,
0.4934912919998169,
0.4552220106124878,
-0.4103887975215912,
0.6676307916641235,
0.3503965139389038,
-0.4657093286514282,
-0.8879451751708984,
-0.09229463338851929,
-1.0534940958023071,
-0.2084227204322815,
0.8969109058380127,
-0.5264679193496704,
-0.5365339517593384,
0.579051673412323,
0.07995421439409256,
0.6869590282440186,
-0.1048855111002922,
0.4722289741039276,
0.2169916033744812,
-0.13255488872528076,
-0.6719048619270325,
-0.5744128823280334,
0.39456310868263245,
0.19924341142177582,
-0.557436466217041,
-0.3743301331996918,
-0.02568507194519043,
0.6794378757476807,
0.22190989553928375,
0.5397484302520752,
-0.10316302627325058,
0.12873263657093048,
0.1461409628391266,
0.5581876039505005,
-0.5498242378234863,
-0.08905079960823059,
-0.3289225697517395,
0.10820060223340988,
-0.05563011392951012,
-0.6247243285179138
] |
alexandrainst/scandi-nli-large | alexandrainst | "2023-09-20T11:55:47Z" | 1,355,403 | 5 | transformers | [
"transformers",
"pytorch",
"safetensors",
"bert",
"text-classification",
"zero-shot-classification",
"da",
"no",
"nb",
"sv",
"dataset:strombergnlp/danfever",
"dataset:KBLab/overlim",
"dataset:MoritzLaurer/multilingual-NLI-26lang-2mil7",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | zero-shot-classification | "2022-11-28T07:05:27Z" | ---
pipeline_tag: zero-shot-classification
language:
- da
- 'no'
- nb
- sv
license: apache-2.0
datasets:
- strombergnlp/danfever
- KBLab/overlim
- MoritzLaurer/multilingual-NLI-26lang-2mil7
widget:
- example_title: Danish
text: >-
Mexicansk bokser advarer Messi - 'Du skal bede til gud, om at jeg ikke
finder dig'
candidate_labels: sundhed, politik, sport, religion
- example_title: Norwegian
text: >-
Regjeringen i Russland hevder Norge fører en politikk som vil føre til
opptrapping i Arktis og «den endelige ødeleggelsen av russisk-norske
relasjoner».
candidate_labels: helse, politikk, sport, religion
- example_title: Swedish
text: Så luras kroppens immunförsvar att bota cancer
candidate_labels: hälsa, politik, sport, religion
inference:
parameters:
hypothesis_template: Dette eksempel handler om {}
---
# ScandiNLI - Natural Language Inference model for Scandinavian Languages
This model is a fine-tuned version of [NbAiLab/nb-bert-large](https://huggingface.co/NbAiLab/nb-bert-large) for Natural Language Inference in Danish, Norwegian Bokmål and Swedish.
We have released three models for Scandinavian NLI, of different sizes:
- alexandrainst/scandi-nli-large (this)
- [alexandrainst/scandi-nli-base](https://huggingface.co/alexandrainst/scandi-nli-base)
- [alexandrainst/scandi-nli-small](https://huggingface.co/alexandrainst/scandi-nli-small)
A demo of the large model can be found in [this Hugging Face Space](https://huggingface.co/spaces/alexandrainst/zero-shot-classification) - check it out!
The performance and model size of each of them can be found in the Performance section below.
## Quick start
You can use this model in your scripts as follows:
```python
>>> from transformers import pipeline
>>> classifier = pipeline(
... "zero-shot-classification",
... model="alexandrainst/scandi-nli-large",
... )
>>> classifier(
... "Mexicansk bokser advarer Messi - 'Du skal bede til gud, om at jeg ikke finder dig'",
... candidate_labels=['sundhed', 'politik', 'sport', 'religion'],
... hypothesis_template="Dette eksempel handler om {}",
... )
{'sequence': "Mexicansk bokser advarer Messi - 'Du skal bede til gud, om at jeg ikke finder dig'",
'labels': ['sport', 'religion', 'politik', 'sundhed'],
'scores': [0.6134647727012634,
0.30309760570526123,
0.05021871626377106,
0.03321893885731697]}
```
## Performance
We assess the models both on their aggregate Scandinavian performance, as well as their language-specific Danish, Swedish and Norwegian Bokmål performance.
In all cases, we report Matthew's Correlation Coefficient (MCC), macro-average F1-score as well as accuracy.
### Scandinavian Evaluation
The Scandinavian scores are the average of the Danish, Swedish and Norwegian scores, which can be found in the sections below.
| **Model** | **MCC** | **Macro-F1** | **Accuracy** | **Number of Parameters** |
| :-------- | :------------ | :--------- | :----------- | :----------- |
| `alexandrainst/scandi-nli-large` (this) | **73.70%** | **74.44%** | **83.91%** | 354M |
| [`MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7) | 69.01% | 71.99% | 80.66% | 279M |
| [`alexandrainst/scandi-nli-base`](https://huggingface.co/alexandrainst/scandi-nli-base) | 67.42% | 71.54% | 80.09% | 178M |
| [`joeddav/xlm-roberta-large-xnli`](https://huggingface.co/joeddav/xlm-roberta-large-xnli) | 64.17% | 70.80% | 77.29% | 560M |
| [`MoritzLaurer/mDeBERTa-v3-base-mnli-xnli`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-mnli-xnli) | 63.94% | 70.41% | 77.23% | 279M |
| [`NbAiLab/nb-bert-base-mnli`](https://huggingface.co/NbAiLab/nb-bert-base-mnli) | 61.71% | 68.36% | 76.08% | 178M |
| [`alexandrainst/scandi-nli-small`](https://huggingface.co/alexandrainst/scandi-nli-small) | 56.02% | 65.30% | 73.56% | **22M** |
### Danish Evaluation
We use a test split of the [DanFEVER dataset](https://aclanthology.org/2021.nodalida-main.pdf#page=439) to evaluate the Danish performance of the models.
The test split is generated using [this gist](https://gist.github.com/saattrupdan/1cb8379232fdec6e943dc84595a85e7c).
| **Model** | **MCC** | **Macro-F1** | **Accuracy** | **Number of Parameters** |
| :-------- | :------------ | :--------- | :----------- | :----------- |
| `alexandrainst/scandi-nli-large` (this) | **73.80%** | **58.41%** | **86.98%** | 354M |
| [`MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7) | 68.37% | 57.10% | 83.25% | 279M |
| [`alexandrainst/scandi-nli-base`](https://huggingface.co/alexandrainst/scandi-nli-base) | 62.44% | 55.00% | 80.42% | 178M |
| [`NbAiLab/nb-bert-base-mnli`](https://huggingface.co/NbAiLab/nb-bert-base-mnli) | 56.92% | 53.25% | 76.39% | 178M |
| [`MoritzLaurer/mDeBERTa-v3-base-mnli-xnli`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-mnli-xnli) | 52.79% | 52.00% | 72.35% | 279M |
| [`joeddav/xlm-roberta-large-xnli`](https://huggingface.co/joeddav/xlm-roberta-large-xnli) | 49.18% | 50.31% | 69.73% | 560M |
| [`alexandrainst/scandi-nli-small`](https://huggingface.co/alexandrainst/scandi-nli-small) | 47.28% | 48.88% | 73.46% | **22M** |
### Swedish Evaluation
We use the test split of the machine translated version of the [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) dataset to evaluate the Swedish performance of the models.
We acknowledge that not evaluating on a gold standard dataset is not ideal, but unfortunately we are not aware of any NLI datasets in Swedish.
| **Model** | **MCC** | **Macro-F1** | **Accuracy** | **Number of Parameters** |
| :-------- | :------------ | :--------- | :----------- | :----------- |
| `alexandrainst/scandi-nli-large` (this) | **76.69%** | **84.47%** | **84.38%** | 354M |
| [`joeddav/xlm-roberta-large-xnli`](https://huggingface.co/joeddav/xlm-roberta-large-xnli) | 75.35% | 83.42% | 83.55% | 560M |
| [`MoritzLaurer/mDeBERTa-v3-base-mnli-xnli`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-mnli-xnli) | 73.84% | 82.46% | 82.58% | 279M |
| [`MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7) | 73.32% | 82.15% | 82.08% | 279M |
| [`alexandrainst/scandi-nli-base`](https://huggingface.co/alexandrainst/scandi-nli-base) | 72.29% | 81.37% | 81.51% | 178M |
| [`NbAiLab/nb-bert-base-mnli`](https://huggingface.co/NbAiLab/nb-bert-base-mnli) | 64.69% | 76.40% | 76.47% | 178M |
| [`alexandrainst/scandi-nli-small`](https://huggingface.co/alexandrainst/scandi-nli-small) | 62.35% | 74.79% | 74.93% | **22M** |
### Norwegian Evaluation
We use the test split of the machine translated version of the [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) dataset to evaluate the Norwegian performance of the models.
We acknowledge that not evaluating on a gold standard dataset is not ideal, but unfortunately we are not aware of any NLI datasets in Norwegian.
| **Model** | **MCC** | **Macro-F1** | **Accuracy** | **Number of Parameters** |
| :-------- | :------------ | :--------- | :----------- | :----------- |
| `alexandrainst/scandi-nli-large` (this) | **70.61%** | **80.43%** | **80.36%** | 354M |
| [`joeddav/xlm-roberta-large-xnli`](https://huggingface.co/joeddav/xlm-roberta-large-xnli) | 67.99% | 78.68% | 78.60% | 560M |
| [`alexandrainst/scandi-nli-base`](https://huggingface.co/alexandrainst/scandi-nli-base) | 67.53% | 78.24% | 78.33% | 178M |
| [`MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7) | 65.33% | 76.73% | 76.65% | 279M |
| [`MoritzLaurer/mDeBERTa-v3-base-mnli-xnli`](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-mnli-xnli) | 65.18% | 76.76% | 76.77% | 279M |
| [`NbAiLab/nb-bert-base-mnli`](https://huggingface.co/NbAiLab/nb-bert-base-mnli) | 63.51% | 75.42% | 75.39% | 178M |
| [`alexandrainst/scandi-nli-small`](https://huggingface.co/alexandrainst/scandi-nli-small) | 58.42% | 72.22% | 72.30% | **22M** |
## Training procedure
It has been fine-tuned on a dataset composed of [DanFEVER](https://aclanthology.org/2021.nodalida-main.pdf#page=439) as well as machine translated versions of [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) and [CommitmentBank](https://doi.org/10.18148/sub/2019.v23i2.601) into all three languages, and machine translated versions of [FEVER](https://aclanthology.org/N18-1074/) and [Adversarial NLI](https://aclanthology.org/2020.acl-main.441/) into Swedish.
The training split of DanFEVER is generated using [this gist](https://gist.github.com/saattrupdan/1cb8379232fdec6e943dc84595a85e7c).
The three languages are sampled equally during training, and they're validated on validation splits of [DanFEVER](https://aclanthology.org/2021.nodalida-main.pdf#page=439) and machine translated versions of [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) for Swedish and Norwegian Bokmål, sampled equally.
Check out the [Github repository](https://github.com/alexandrainst/ScandiNLI) for the code used to train the ScandiNLI models, and the full training logs can be found in [this Weights and Biases report](https://wandb.ai/saattrupdan/huggingface/reports/ScandiNLI--VmlldzozMDQyOTk1?accessToken=r9crgxqvvigy2hatdjeobzwipz7f3id5vqg8ooksljhfw6wl0hv1b05asypsfj9v).
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 2
- eval_batch_size: 2
- seed: 4242
- gradient_accumulation_steps: 16
- total_train_batch_size: 32
- optimizer: Adam with betas=(0.9, 0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 500
- max_steps: 50,000 | [
-0.6841660737991333,
-0.41172879934310913,
0.20555807650089264,
0.3014991581439972,
-0.29256460070610046,
-0.1302579641342163,
-0.2678139805793762,
-0.6229797005653381,
0.8457328081130981,
0.008774171583354473,
-0.6788859367370605,
-0.8692259192466736,
-0.5754921436309814,
0.2764919102191925,
0.15632450580596924,
1.0495954751968384,
-0.01572422683238983,
0.36783814430236816,
0.0650595873594284,
-0.3020726144313812,
-0.1640857607126236,
-0.5556966662406921,
-0.666486382484436,
-0.13233423233032227,
0.5536540150642395,
0.17500019073486328,
0.6616334319114685,
0.38528764247894287,
0.545925498008728,
0.2734302878379822,
-0.4677625298500061,
-0.020684685558080673,
-0.3113960325717926,
-0.1346520185470581,
0.1796225905418396,
-0.4638373553752899,
-0.9274787902832031,
-0.07220958918333054,
0.8215433955192566,
0.6165823936462402,
-0.09421750158071518,
0.20998141169548035,
0.07390213757753372,
0.6888958811759949,
-0.2825515866279602,
0.07767000794410706,
-0.09439928829669952,
0.028492596000432968,
-0.14584773778915405,
0.24964359402656555,
-0.22180859744548798,
-0.41815924644470215,
0.019057275727391243,
-0.5304883718490601,
0.0404241718351841,
0.09362643957138062,
1.238377571105957,
0.030862726271152496,
-0.39379191398620605,
-0.225473552942276,
-0.13739173114299774,
1.0305448770523071,
-1.182541847229004,
0.43271520733833313,
0.42036229372024536,
-0.0638158917427063,
-0.15221020579338074,
-0.24832849204540253,
-0.4476645290851593,
-0.20184077322483063,
-0.3486064374446869,
0.42588239908218384,
-0.3239624500274658,
-0.16025158762931824,
0.3766232430934906,
0.40177133679389954,
-0.8951608538627625,
0.07708387821912766,
-0.29847070574760437,
-0.01094019878655672,
1.1790106296539307,
0.11236990243196487,
0.5178232192993164,
-0.34342673420906067,
-0.28402191400527954,
-0.29757457971572876,
-0.2714114785194397,
0.17032094299793243,
0.47530120611190796,
0.3851107954978943,
-0.837915301322937,
0.6912078261375427,
-0.057555507868528366,
0.7461917996406555,
0.1273946613073349,
-0.2629241943359375,
0.8430731892585754,
-0.6037108898162842,
-0.26332059502601624,
-0.25498390197753906,
1.2064369916915894,
0.5334777235984802,
0.14758622646331787,
0.22368986904621124,
-0.14142648875713348,
-0.03413398563861847,
-0.28575438261032104,
-0.7765852212905884,
0.06547486782073975,
0.2692655324935913,
-0.6206868290901184,
-0.2988848388195038,
0.17509566247463226,
-0.8913201093673706,
0.1314239352941513,
-0.11612866818904877,
0.13286319375038147,
-0.7412989139556885,
-0.7252432703971863,
0.17760343849658966,
-0.043597884476184845,
0.44753652811050415,
0.05899859592318535,
-0.45284536480903625,
0.2584114074707031,
0.32730185985565186,
0.8479872941970825,
-0.25104838609695435,
-0.22558896243572235,
0.027872411534190178,
-0.2847583293914795,
-0.4286324083805084,
0.3745388686656952,
-0.05636000260710716,
-0.4666237533092499,
-0.23880581557750702,
0.10683824867010117,
-0.5971625447273254,
-0.18167495727539062,
0.7113662362098694,
0.13837260007858276,
0.3860543966293335,
-0.2615441381931305,
-0.6512466073036194,
-0.08999417722225189,
0.4473665654659271,
-0.9567042589187622,
1.1537069082260132,
0.15845941007137299,
-1.0840457677841187,
0.10679970681667328,
-0.6598817706108093,
-0.09139857441186905,
-0.4374443590641022,
0.1759057193994522,
-0.6697829961776733,
-0.006832273211330175,
0.23601558804512024,
0.6361193656921387,
-0.43038442730903625,
0.20066317915916443,
-0.5027992129325867,
-0.08951660245656967,
0.40646612644195557,
-0.16517727077007294,
1.0858641862869263,
0.2270004004240036,
-0.28099897503852844,
-0.08817414939403534,
-1.0708270072937012,
0.2612985670566559,
0.2652297019958496,
-0.31541502475738525,
-0.22702990472316742,
-0.5584739446640015,
0.23526722192764282,
0.601793110370636,
0.09054586291313171,
-0.6475132703781128,
0.20874255895614624,
-0.5928035974502563,
0.08491929620504379,
0.43043485283851624,
-0.02621292695403099,
0.10797146707773209,
-0.40777379274368286,
0.8061692118644714,
-0.013775159604847431,
0.3035423457622528,
0.15539470314979553,
-0.7408836483955383,
-0.564070999622345,
-0.5753525495529175,
0.5643157958984375,
0.45357927680015564,
-0.8553001880645752,
0.554423451423645,
-0.3637087643146515,
-0.8195306062698364,
-0.636162281036377,
-0.006761578842997551,
0.7956569194793701,
0.21769855916500092,
0.09099485725164413,
-0.15243737399578094,
-0.5407266616821289,
-1.1982793807983398,
-0.224917471408844,
-0.23330727219581604,
0.0317484587430954,
0.441994309425354,
0.7784444093704224,
-0.13504379987716675,
0.6451629996299744,
-0.4219093322753906,
-0.07896681129932404,
-0.29223036766052246,
0.05181799456477165,
0.7691041827201843,
0.7539621591567993,
1.0462325811386108,
-0.9939258098602295,
-0.9759905934333801,
0.19445058703422546,
-0.9270749092102051,
-0.022959699854254723,
0.14514778554439545,
-0.14566516876220703,
0.6154168248176575,
0.20249485969543457,
-0.8110727667808533,
0.5067486763000488,
0.8619073033332825,
-0.8402465581893921,
0.7437644600868225,
-0.13248281180858612,
0.18707339465618134,
-1.4571611881256104,
0.48631593585014343,
0.1861700415611267,
-0.11890795826911926,
-0.8085275888442993,
0.0689254105091095,
-0.15889112651348114,
0.36115020513534546,
-0.7978836894035339,
1.0192084312438965,
-0.5760219097137451,
0.08138784766197205,
0.2828679084777832,
0.059610798954963684,
-0.06970131397247314,
0.672878623008728,
0.06261729449033737,
0.7302358746528625,
0.6016559600830078,
-0.2802693247795105,
0.08624400198459625,
0.476842999458313,
-0.33106034994125366,
0.6503614187240601,
-0.7168914675712585,
-0.01940794847905636,
0.026646841317415237,
0.15721021592617035,
-0.9926777482032776,
-0.34111130237579346,
0.3469792306423187,
-0.8016170859336853,
0.497017502784729,
-0.08433230221271515,
-0.3422996997833252,
-0.5805422067642212,
-0.7295545339584351,
0.2925143837928772,
0.45951053500175476,
-0.42830491065979004,
0.7750093340873718,
0.18949995934963226,
-0.21411317586898804,
-0.7569613456726074,
-0.7587087750434875,
-0.18577620387077332,
-0.27739012241363525,
-0.8193181753158569,
0.23257707059383392,
-0.1795833557844162,
-0.14030605554580688,
0.19580702483654022,
0.05655915290117264,
-0.16966544091701508,
-0.006706321146339178,
0.25920161604881287,
0.5556844472885132,
-0.3400286138057709,
-0.24937337636947632,
-0.17814470827579498,
0.03707190975546837,
-0.035885557532310486,
0.07238520681858063,
0.6149783730506897,
-0.35270339250564575,
-0.2091691493988037,
-0.8474118709564209,
0.41455426812171936,
0.7286227941513062,
-0.13783639669418335,
1.0485949516296387,
0.8538961410522461,
-0.27103111147880554,
0.2528875768184662,
-0.6626449227333069,
0.015375150367617607,
-0.33708155155181885,
0.1613122969865799,
-0.672907292842865,
-0.7285912036895752,
0.8507745862007141,
0.3567256033420563,
-0.031135965138673782,
1.011504888534546,
0.504618227481842,
-0.0052239615470170975,
1.4241276979446411,
0.42181023955345154,
-0.1034465953707695,
0.4153890907764435,
-0.7898969650268555,
-0.05043812096118927,
-0.9783921241760254,
-0.2979787290096283,
-0.40536797046661377,
-0.3041371703147888,
-0.8087643384933472,
-0.340457946062088,
0.32522666454315186,
0.07877703011035919,
-0.14007475972175598,
0.3763681948184967,
-0.31926262378692627,
0.22553542256355286,
0.5282572507858276,
0.04797547310590744,
-0.043617814779281616,
-0.06789857149124146,
-0.3464548885822296,
-0.20767483115196228,
-0.8474017381668091,
-0.23116838932037354,
1.2153531312942505,
0.4831516742706299,
0.5365245938301086,
0.2780495882034302,
0.5990191102027893,
0.01815977692604065,
0.21979710459709167,
-0.47356244921684265,
0.49287480115890503,
-0.07716238498687744,
-0.7997955083847046,
-0.29294872283935547,
-0.6475676894187927,
-0.9033962488174438,
0.41939347982406616,
-0.44923532009124756,
-0.7721549868583679,
0.3679724931716919,
-0.01819421909749508,
-0.3750757873058319,
0.37770968675613403,
-0.7215978503227234,
0.788852334022522,
-0.12066451460123062,
-0.44538748264312744,
0.06660563498735428,
-0.7110558152198792,
0.4468528628349304,
-0.06429657340049744,
0.27702704071998596,
-0.16034016013145447,
0.11973226070404053,
0.8771284222602844,
-0.46098190546035767,
0.8539643883705139,
-0.2382632941007614,
-0.08415233343839645,
0.21021436154842377,
-0.13412593305110931,
0.2685377299785614,
0.07888805121183395,
-0.4239616096019745,
0.5158811211585999,
0.39015257358551025,
-0.5545564293861389,
-0.4059254825115204,
0.6862974166870117,
-0.6350336670875549,
-0.276601642370224,
-0.7550370097160339,
-0.48859068751335144,
0.04244178906083107,
0.25915810465812683,
0.43979519605636597,
0.4692412316799164,
-0.3637842833995819,
0.2843087911605835,
0.5308443903923035,
-0.4191862642765045,
0.4481765627861023,
0.32651689648628235,
-0.3342828154563904,
-0.6980465650558472,
0.7990636825561523,
-0.020684218034148216,
0.3664729595184326,
-0.013790409080684185,
0.11842819303274155,
-0.5346931219100952,
-0.4960426986217499,
-0.4109600782394409,
0.8421567678451538,
-0.4093177616596222,
-0.24107204377651215,
-0.6801509857177734,
-0.2715734541416168,
-0.5107141733169556,
-0.055919066071510315,
-0.42137184739112854,
-0.6581591963768005,
-0.2499924749135971,
-0.10108383744955063,
0.2724107801914215,
0.6516305804252625,
-0.1847711056470871,
0.1577243208885193,
-0.5741583704948425,
0.10052581131458282,
-0.13987605273723602,
0.5192955732345581,
-0.20293544232845306,
-0.520118772983551,
-0.1944001019001007,
0.24360428750514984,
0.06866377592086792,
-0.7951828241348267,
0.7202520966529846,
0.19208335876464844,
0.429204523563385,
0.3325859010219574,
-0.16592887043952942,
0.5404688119888306,
-0.21934066712856293,
0.9682848453521729,
0.5549442768096924,
-0.8346307873725891,
0.4445740282535553,
-0.4590425491333008,
0.3751782178878784,
0.5615370273590088,
0.513755738735199,
-0.5204594731330872,
-0.4423827528953552,
-0.8054717183113098,
-0.9262548685073853,
0.9797958731651306,
0.38554710149765015,
-0.023194661363959312,
-0.020048508420586586,
0.5036486983299255,
-0.16476747393608093,
0.1295710802078247,
-0.7013843655586243,
-0.6545585989952087,
0.07578988373279572,
-0.3377951383590698,
-0.31077510118484497,
-0.39582234621047974,
-0.07535316050052643,
-0.5212219953536987,
1.0149613618850708,
-0.182057723402977,
0.26255664229393005,
0.21366940438747406,
0.09312327951192856,
0.15183721482753754,
-0.06022574380040169,
0.8360894322395325,
0.6213579177856445,
-0.35395103693008423,
-0.4937877655029297,
0.4733632206916809,
-0.6580733060836792,
-0.0003964772040490061,
0.10776492208242416,
-0.2230396270751953,
0.40031498670578003,
0.6793805956840515,
1.1383225917816162,
0.3648267388343811,
-0.5694868564605713,
0.7616275548934937,
-0.48663756251335144,
-0.5290537476539612,
-0.44695067405700684,
-0.13933712244033813,
0.2586621344089508,
0.10682350397109985,
0.04100828245282173,
-0.08977506309747696,
-0.07240939885377884,
-0.21857163310050964,
0.17271651327610016,
0.5012317299842834,
-0.4381881058216095,
-0.6173270344734192,
0.5423581004142761,
-0.06887242943048477,
-0.021543124690651894,
0.2789405584335327,
-0.2496463656425476,
-0.4390958547592163,
0.7842979431152344,
0.45926937460899353,
0.710443913936615,
-0.7035425901412964,
0.28033292293548584,
0.8735535740852356,
0.1386687457561493,
-0.11941607296466827,
0.7814577221870422,
0.49819415807724,
-0.6516963243484497,
-0.3957635462284088,
-0.9403939843177795,
-0.003476954996585846,
0.2086014598608017,
-0.9416179656982422,
0.33758416771888733,
-0.2506389617919922,
-0.465766966342926,
0.19018660485744476,
0.27142858505249023,
-0.7210696339607239,
0.30770063400268555,
0.05884699895977974,
1.210753321647644,
-1.094425916671753,
0.926191508769989,
0.8396664261817932,
-0.5310801267623901,
-1.0145732164382935,
-0.2062472701072693,
0.11088573187589645,
-0.666181743144989,
0.5604334473609924,
-0.01015052106231451,
0.1140199601650238,
-0.15114106237888336,
-0.3655107319355011,
-1.132601261138916,
1.1316566467285156,
0.341827929019928,
-0.4901553988456726,
-0.04255075007677078,
0.0691886618733406,
0.7668607831001282,
-0.390078067779541,
0.6877814531326294,
0.5842371582984924,
0.5047266483306885,
0.20218947529792786,
-1.0590704679489136,
-0.0018199554178863764,
-0.7048190832138062,
0.1846349984407425,
0.10360099375247955,
-0.8591919541358948,
1.0355079174041748,
-0.04593599960207939,
0.0325920470058918,
0.09843612462282181,
0.5434389114379883,
0.4678010642528534,
0.2204439491033554,
0.5235756635665894,
0.7761654257774353,
0.5386338233947754,
-0.04661204293370247,
1.4123104810714722,
-0.5359564423561096,
0.5097289681434631,
0.7219122648239136,
0.08375497907400131,
0.9021236896514893,
0.3980846107006073,
-0.2778782546520233,
0.39063072204589844,
0.5492566823959351,
-0.07921788841485977,
0.135797381401062,
-0.0265022162348032,
-0.17377562820911407,
-0.04947330430150032,
-0.10896215587854385,
-0.4076758921146393,
0.4190512001514435,
0.20694491267204285,
-0.2332414984703064,
0.040005553513765335,
0.09142190963029861,
0.6549651622772217,
-0.06749242544174194,
-0.049309439957141876,
0.829659104347229,
0.17024552822113037,
-0.6702030301094055,
1.079285740852356,
-0.17551329731941223,
0.9149633049964905,
-0.6193006038665771,
0.09927647560834885,
-0.20257282257080078,
0.1579410880804062,
-0.20800359547138214,
-0.8668029308319092,
0.3798755407333374,
0.1778615117073059,
-0.11818376928567886,
-0.09133841097354889,
0.496743381023407,
-0.551544725894928,
-0.9196485877037048,
0.6249349117279053,
0.48290905356407166,
0.3894760012626648,
0.16329127550125122,
-1.1747807264328003,
0.22244437038898468,
0.3049682378768921,
-0.66953045129776,
0.2201349288225174,
0.059305500239133835,
0.06564994156360626,
0.6322574615478516,
0.6955605149269104,
0.3258839547634125,
0.07872962206602097,
0.0457441508769989,
0.8846834301948547,
-0.466539204120636,
-0.3645276129245758,
-0.8819139003753662,
0.709705114364624,
-0.3905985355377197,
-0.5774708986282349,
1.0371496677398682,
0.6861240267753601,
0.7632907032966614,
-0.07389266788959503,
0.7264915108680725,
-0.274246484041214,
0.7253599762916565,
-0.5655308365821838,
0.8309375047683716,
-0.8405680060386658,
-0.08754081279039383,
-0.3511591851711273,
-0.9180301427841187,
-0.5219280123710632,
0.46388086676597595,
-0.2979913055896759,
0.10685844719409943,
0.48870158195495605,
0.7019575834274292,
-0.0626673698425293,
-0.14980651438236237,
0.17644205689430237,
0.4986349940299988,
0.17579784989356995,
0.7352709770202637,
0.49098464846611023,
-0.6576729416847229,
0.05523364245891571,
-0.5207144021987915,
-0.2395424246788025,
-0.17683859169483185,
-0.7764195203781128,
-1.1707344055175781,
-0.6095425486564636,
-0.5286107063293457,
-0.5045036673545837,
-0.04898593947291374,
1.214355230331421,
0.6404141187667847,
-1.0309854745864868,
-0.3938376307487488,
0.3783479928970337,
-0.14068393409252167,
-0.31780293583869934,
-0.169569730758667,
0.5933680534362793,
0.15326152741909027,
-0.9549493789672852,
0.1861725002527237,
-0.10842487215995789,
0.2553879916667938,
-0.054765500128269196,
-0.4383528232574463,
-0.6423006653785706,
0.023051736876368523,
0.5493616461753845,
0.3405258357524872,
-0.768328070640564,
0.05916917324066162,
0.17066138982772827,
-0.20720672607421875,
0.08591172099113464,
0.0729793831706047,
-0.1872764378786087,
0.13643665611743927,
0.5252991914749146,
0.2936333119869232,
0.6595857739448547,
0.055368516594171524,
0.322456032037735,
-0.7318258285522461,
0.34491658210754395,
0.19885393977165222,
0.4094628095626831,
0.38064926862716675,
-0.24044418334960938,
0.7562346458435059,
0.2033320516347885,
-0.2715195417404175,
-1.178870677947998,
-0.20436032116413116,
-1.112059473991394,
-0.19866333901882172,
1.1980738639831543,
-0.32648468017578125,
-0.756165087223053,
0.3412538766860962,
-0.20770244300365448,
0.16499142348766327,
-0.2466241866350174,
0.3217860758304596,
0.7839516401290894,
-0.08342056721448898,
-0.03245086967945099,
-0.7688718438148499,
0.5263668298721313,
0.5566542148590088,
-0.7540127038955688,
-0.2374233454465866,
0.22537870705127716,
0.3436010479927063,
0.3924643397331238,
0.7330469489097595,
-0.37790873646736145,
0.1255221962928772,
-0.14144949615001678,
0.4973453879356384,
0.1850205510854721,
0.014858108013868332,
-0.6628424525260925,
-0.18038888275623322,
-0.22463470697402954,
-0.13372431695461273
] |
Kyle1668/boss-toxicity-t5-large | Kyle1668 | "2023-09-23T00:03:08Z" | 1,286,682 | 1 | transformers | [
"transformers",
"pytorch",
"safetensors",
"t5",
"text2text-generation",
"autotrain_compatible",
"endpoints_compatible",
"text-generation-inference",
"region:us"
] | text2text-generation | "2023-08-08T16:40:42Z" | Entry not found | [
-0.3227650225162506,
-0.22568431496620178,
0.862226128578186,
0.43461495637893677,
-0.5282987952232361,
0.7012965679168701,
0.7915717363357544,
0.07618638128042221,
0.7746025919914246,
0.2563219666481018,
-0.7852817177772522,
-0.22573819756507874,
-0.9104480743408203,
0.5715669393539429,
-0.3992334008216858,
0.5791245698928833,
-0.14494505524635315,
-0.10751161724328995,
0.28233757615089417,
-0.2768954336643219,
-0.5409224033355713,
-0.36855220794677734,
-1.1902776956558228,
0.061491113156080246,
0.5316578149795532,
0.7435142397880554,
0.7584060430526733,
0.3652167320251465,
0.6432578563690186,
0.3932291269302368,
-0.23138920962810516,
0.4827055037021637,
-0.04171813279390335,
0.00260411505587399,
-0.3524433970451355,
-0.5516898036003113,
-0.28596609830856323,
0.07584730535745621,
1.0961304903030396,
0.966687798500061,
-0.284663587808609,
0.05330817773938179,
-0.3063621520996094,
0.33088892698287964,
-0.49734312295913696,
0.3054099678993225,
-0.022506045177578926,
0.16318801045417786,
-0.7041513919830322,
-0.5535354018211365,
0.012794834561645985,
-0.7361212968826294,
0.17926570773124695,
-0.690081000328064,
0.8269098401069641,
0.18583157658576965,
1.1533750295639038,
0.14819414913654327,
-0.462487131357193,
-0.8161764144897461,
-0.6538989543914795,
0.5711171627044678,
-0.32703715562820435,
0.39680248498916626,
0.7028235197067261,
-0.048573412001132965,
-0.9820332527160645,
-0.6745741367340088,
-0.46466192603111267,
0.2923962473869324,
0.35402774810791016,
-0.3411678075790405,
-0.17522086203098297,
-0.3058989644050598,
0.15792037546634674,
0.12811517715454102,
-0.4841994643211365,
-0.5543919205665588,
-0.5475160479545593,
-0.3960252106189728,
0.6206658482551575,
0.3482950031757355,
0.2429177463054657,
-0.1888415813446045,
-0.3228583335876465,
0.0880163162946701,
-0.4160851538181305,
0.3402571678161621,
0.6335517168045044,
0.7114017009735107,
-0.5811444520950317,
0.560215950012207,
-0.04927587881684303,
0.7439703941345215,
0.11445561796426773,
-0.27478092908859253,
0.41460567712783813,
-0.14724725484848022,
0.055171746760606766,
0.4226345121860504,
0.31524422764778137,
0.2841312289237976,
-0.3273695111274719,
0.2032228708267212,
-0.3215144872665405,
-0.30496224761009216,
-0.22332167625427246,
-0.29490774869918823,
-0.3592180609703064,
0.5492289066314697,
-0.3314017057418823,
-0.42855486273765564,
1.143175721168518,
-0.4200771450996399,
-0.7302224040031433,
0.33156412839889526,
0.4065209925174713,
-0.0994480773806572,
-0.37146568298339844,
-0.052260834723711014,
-0.8458789587020874,
-0.007907390594482422,
0.7491172552108765,
-0.7198970913887024,
0.3371737599372864,
0.4728063642978668,
0.7417217493057251,
0.19650575518608093,
-0.14034469425678253,
-0.42949390411376953,
0.2971969544887543,
-0.8659994006156921,
0.6320174336433411,
-0.20135220885276794,
-1.0051977634429932,
0.11150479316711426,
0.8971705436706543,
-0.37896400690078735,
-1.2094876766204834,
1.0605159997940063,
-0.6887932419776917,
0.16017857193946838,
-0.676761269569397,
-0.14661237597465515,
-0.07118501514196396,
-0.005096632521599531,
-0.6088156700134277,
0.7567102313041687,
0.587267279624939,
-0.4995276927947998,
0.21429483592510223,
-0.26029831171035767,
-0.39151400327682495,
0.38824859261512756,
-0.07935450226068497,
-0.21858926117420197,
0.713833212852478,
-0.6647079586982727,
-0.26932814717292786,
0.2942774295806885,
0.2368936538696289,
-0.35706108808517456,
-0.7931919097900391,
0.08478113263845444,
-0.05786270648241043,
1.550750494003296,
-0.03868847340345383,
-0.3586106300354004,
-0.679383397102356,
-1.1506240367889404,
-0.07070787996053696,
0.6886883974075317,
-0.9194989204406738,
-0.27839475870132446,
-0.046410128474235535,
-0.26169314980506897,
0.08994917571544647,
0.7390589714050293,
-1.1194051504135132,
0.2832726836204529,
-0.05092663690447807,
-0.22794683277606964,
0.8271058797836304,
0.15387225151062012,
0.24758946895599365,
0.14913396537303925,
0.42958706617355347,
0.527725338935852,
0.11115207523107529,
0.683587908744812,
-0.34720373153686523,
-0.9694353938102722,
0.6154631972312927,
0.25266361236572266,
0.8121447563171387,
-0.49945297837257385,
0.2685093879699707,
0.27025535702705383,
-0.3409680724143982,
-0.5682371854782104,
-0.3102838397026062,
0.09025752544403076,
0.14930562674999237,
0.11142510175704956,
-0.5721710324287415,
-0.6576125025749207,
-0.9689140319824219,
-0.13590654730796814,
-0.4314374029636383,
-0.3571570813655853,
0.21006910502910614,
0.5792906284332275,
-1.1975523233413696,
0.4128875136375427,
-0.7705625891685486,
-0.7038741111755371,
-0.01065548975020647,
-0.19338123500347137,
0.7540656328201294,
0.43240174651145935,
0.5033966898918152,
-0.6397148370742798,
-0.5661987066268921,
-0.22470176219940186,
-1.0333747863769531,
-0.13280506432056427,
0.24819621443748474,
0.3065737783908844,
-0.13423344492912292,
-0.2744963765144348,
-0.48740333318710327,
0.8100387454032898,
0.14789170026779175,
-0.5391897559165955,
0.5220767259597778,
-0.3020317256450653,
0.17224803566932678,
-0.6369150280952454,
-0.06916818022727966,
-0.661676287651062,
-0.0009071884560398757,
-0.3608308732509613,
-0.5737438797950745,
0.14772287011146545,
0.07017494738101959,
-0.16065457463264465,
0.28808408975601196,
-0.909277081489563,
-0.0010852962732315063,
-0.7442210912704468,
0.379071980714798,
0.06394772231578827,
-0.3145078718662262,
-0.017517540603876114,
1.0000386238098145,
0.7784460783004761,
-0.3848048746585846,
0.721744179725647,
0.4440041184425354,
0.19036155939102173,
0.7630521059036255,
-0.18725109100341797,
0.16478213667869568,
-0.5245416760444641,
-0.12161104381084442,
-0.8887597918510437,
-1.0982946157455444,
0.7320570349693298,
-0.6114250421524048,
0.36542922258377075,
-0.4277869760990143,
0.2589159905910492,
-0.6919258832931519,
-0.03885362669825554,
0.4808599352836609,
-0.05936325341463089,
-0.6863942742347717,
0.5232570171356201,
0.45317530632019043,
-0.2019241601228714,
-0.6609031558036804,
-0.530157208442688,
0.39365822076797485,
0.6154114007949829,
-0.16390392184257507,
0.06878514587879181,
0.14941060543060303,
-0.5441926121711731,
-0.040802597999572754,
-0.38691970705986023,
-0.45766758918762207,
0.054224006831645966,
0.13053473830223083,
-0.005750799085944891,
-0.404820054769516,
-0.0868026465177536,
-0.35842007398605347,
-0.4656120240688324,
0.21876516938209534,
0.3011947274208069,
-0.04096309468150139,
-0.42599788308143616,
-0.3619818687438965,
-0.888181209564209,
0.6719610095024109,
0.5370282530784607,
0.05281545966863632,
0.7555549740791321,
0.16819314658641815,
-0.8014987707138062,
-0.13532210886478424,
-0.1760706603527069,
0.2696830928325653,
-0.5588056445121765,
0.13849826157093048,
-0.013484534807503223,
-0.0637492910027504,
0.26297882199287415,
0.25386232137680054,
-0.4300556778907776,
0.9276250004768372,
-0.2615274488925934,
-0.3592521846294403,
0.7960181832313538,
0.5974742770195007,
0.49583131074905396,
0.16503219306468964,
-0.044541798532009125,
0.900709331035614,
-1.1966516971588135,
-0.6563175916671753,
-0.7409549355506897,
-0.15945707261562347,
-0.43510833382606506,
-0.032105933874845505,
0.6254412531852722,
0.2900990843772888,
-0.1333388388156891,
0.4756395220756531,
-0.5243489742279053,
0.3556033670902252,
1.01198410987854,
0.35748639702796936,
0.3435698449611664,
-0.7570229172706604,
-0.2515777349472046,
-0.1402427852153778,
-0.9998157620429993,
-0.2631377875804901,
0.8871029019355774,
0.22752606868743896,
0.844460666179657,
0.5992541313171387,
0.6784542798995972,
0.1367226243019104,
0.2523828148841858,
-0.30590319633483887,
0.3920294940471649,
0.4376082420349121,
-1.0401138067245483,
-0.42758408188819885,
0.021418681368231773,
-0.9703338742256165,
-0.14227519929409027,
-0.03495011106133461,
-0.42617112398147583,
0.7681737542152405,
0.00016589462757110596,
-0.4076709747314453,
0.7732734084129333,
-0.455583393573761,
0.7562873363494873,
-0.4473648965358734,
-0.02663906291127205,
0.4699096083641052,
-0.7070636749267578,
0.4677430987358093,
0.12878790497779846,
0.6205843091011047,
-0.015572631731629372,
-0.04078587517142296,
0.7104941606521606,
-0.9129160046577454,
0.25438642501831055,
-0.6348397135734558,
0.22421300411224365,
0.24246945977210999,
0.51606285572052,
0.5969953536987305,
0.4371243417263031,
0.10119888931512833,
-0.23920902609825134,
0.04115807265043259,
-0.8241125345230103,
-0.210506409406662,
0.697515606880188,
-0.7186890840530396,
-0.6864197850227356,
-1.2355337142944336,
0.14438660442829132,
0.27347055077552795,
0.389305055141449,
0.7959296107292175,
0.571408748626709,
0.1289544403553009,
0.680525004863739,
0.9888588190078735,
-0.0688566341996193,
0.9166924357414246,
0.3224477171897888,
0.09175168722867966,
-0.21944808959960938,
0.7036820650100708,
0.26627904176712036,
-0.24707956612110138,
-0.11939732730388641,
0.20913465321063995,
-0.11069409549236298,
-0.591761589050293,
-0.49990686774253845,
0.3701757788658142,
-0.6731787919998169,
-0.18303893506526947,
-0.6243735551834106,
-0.6043769717216492,
-0.511759340763092,
0.06927360594272614,
-0.7147687673568726,
0.23979046940803528,
-0.7753565907478333,
-0.10574902594089508,
0.04323432594537735,
0.9792009592056274,
-0.589311957359314,
0.5805224180221558,
-1.1218582391738892,
0.19345788657665253,
-0.07949887961149216,
0.7921058535575867,
0.21395787596702576,
-0.7344395518302917,
-0.3975418508052826,
-0.11592631042003632,
-0.3729911744594574,
-1.3576762676239014,
0.21404948830604553,
-0.2454141080379486,
0.23094046115875244,
0.6145404577255249,
0.1397707313299179,
0.5258248448371887,
-0.34326282143592834,
0.7029101848602295,
-0.057017259299755096,
-0.7069286704063416,
0.7934495210647583,
-0.5026894807815552,
0.4963534474372864,
0.9765996932983398,
0.5333835482597351,
-0.7984007596969604,
0.035741209983825684,
-1.041123390197754,
-0.6008695363998413,
0.38426393270492554,
0.11928944289684296,
-0.03601083159446716,
-0.6659559011459351,
-0.054019637405872345,
-0.16143807768821716,
0.6043745279312134,
-1.039069414138794,
-0.7858356237411499,
0.2576698362827301,
0.5277302861213684,
0.0816856250166893,
-0.5653398633003235,
0.20880667865276337,
-0.544416069984436,
1.0657774209976196,
0.45109400153160095,
0.3274499475955963,
0.8406060934066772,
0.46492424607276917,
-0.3823164403438568,
0.09252490103244781,
0.7662695050239563,
0.6666232347488403,
-0.5239797830581665,
-0.2908027470111847,
-0.08827541768550873,
-0.9143403768539429,
0.05927472561597824,
0.11168918758630753,
-0.013455932028591633,
0.9082110524177551,
0.5793083310127258,
0.2539709210395813,
0.4514279365539551,
-0.726460337638855,
0.8859451413154602,
-0.14954176545143127,
-0.12472866475582123,
-1.0677239894866943,
0.1948619782924652,
-0.23984959721565247,
0.5006402134895325,
1.0061326026916504,
0.5250048041343689,
-0.047630298882722855,
-0.8143380880355835,
-0.01473585981875658,
0.6939172148704529,
-0.7091123461723328,
-0.17449834942817688,
0.944853663444519,
0.3847099542617798,
-1.2953051328659058,
1.106776475906372,
-0.5381771326065063,
-0.560332179069519,
0.9121301770210266,
0.522956907749176,
1.1221847534179688,
-0.44204121828079224,
0.0008676342549733818,
0.2662237286567688,
0.41378432512283325,
0.5423170328140259,
1.0869629383087158,
0.431413471698761,
-0.7931063771247864,
0.8826584815979004,
-0.24776044487953186,
-0.40361151099205017,
-0.05347571521997452,
-0.42859897017478943,
0.16892178356647491,
-0.4406192898750305,
-0.10713007301092148,
-0.3444187641143799,
0.28543180227279663,
-0.7072042226791382,
0.42807620763778687,
-0.0838567465543747,
0.8653068542480469,
-0.8553727269172668,
0.47207626700401306,
0.635470449924469,
-0.3337355852127075,
-0.8508191108703613,
-0.26198428869247437,
-0.11448462307453156,
-0.6389466524124146,
0.30214807391166687,
-0.4554102420806885,
0.044398851692676544,
0.09623463451862335,
-0.649151623249054,
-1.1778275966644287,
0.9093633890151978,
-0.639612078666687,
-0.2784462869167328,
0.20464053750038147,
-0.11514760553836823,
0.28811705112457275,
-0.2524643540382385,
0.010661216452717781,
0.41876548528671265,
0.748940110206604,
0.2844654619693756,
-0.7727053761482239,
-0.3694884479045868,
0.0015032943338155746,
-0.44474777579307556,
0.7582978010177612,
-0.6002101898193359,
1.1840779781341553,
-0.5563543438911438,
-0.059654366225004196,
0.44384512305259705,
0.24690914154052734,
0.21076197922229767,
0.6629220843315125,
0.1442081481218338,
0.7282265424728394,
1.07012140750885,
-0.40835219621658325,
0.8811809420585632,
0.26432839035987854,
0.47430819272994995,
0.7238501906394958,
-0.6487724781036377,
0.7513749003410339,
0.31810489296913147,
-0.5682924389839172,
0.9228013753890991,
1.2906063795089722,
-0.15699204802513123,
0.8079374432563782,
0.05136508867144585,
-1.081600546836853,
0.325833261013031,
-0.20724765956401825,
-0.7530064582824707,
0.3150254189968109,
0.19055864214897156,
-0.6920982599258423,
-0.5770308971405029,
-0.24046507477760315,
-0.35662803053855896,
-0.11552901566028595,
-0.7631728649139404,
0.6720563769340515,
-0.016969164833426476,
-0.5103683471679688,
0.18857547640800476,
0.2877499461174011,
0.17368432879447937,
-0.5235732793807983,
-0.02939440682530403,
-0.22823619842529297,
0.2660655975341797,
-0.5670853853225708,
-0.5234526991844177,
0.5724433064460754,
-0.32430219650268555,
-0.5343255400657654,
0.18147465586662292,
0.763587236404419,
-0.16923809051513672,
-0.4515409469604492,
0.32472723722457886,
0.6959525346755981,
0.1665852814912796,
0.4250282347202301,
-0.23511263728141785,
0.24480605125427246,
-0.08044824004173279,
-0.06651552021503448,
0.27714768052101135,
0.3449169099330902,
0.22435641288757324,
0.4450142979621887,
0.43285664916038513,
-0.01808755099773407,
-0.10736498981714249,
-0.382819801568985,
0.4124940037727356,
-0.9542785882949829,
-0.5713282823562622,
-0.6307113766670227,
0.2740660607814789,
-0.02315417304635048,
-1.0836423635482788,
0.4145168364048004,
1.4406683444976807,
1.0359982252120972,
-0.4756383001804352,
1.067226529121399,
-0.21818485856056213,
0.9594791531562805,
0.41483086347579956,
0.5420440435409546,
-0.6030411720275879,
0.03835370019078255,
-0.4364396035671234,
-1.076962947845459,
-0.35716333985328674,
0.4539391100406647,
-0.022899555042386055,
-0.3429867625236511,
0.872571587562561,
0.5887166261672974,
-0.33473607897758484,
-0.11728022992610931,
0.048487238585948944,
-0.029941488057374954,
-0.12433847039937973,
0.5145376324653625,
0.7648399472236633,
-0.9344304800033569,
-0.10680416971445084,
-0.21577754616737366,
-0.6382725834846497,
-0.5047279000282288,
-0.9632009267807007,
-0.12959396839141846,
-0.16037796437740326,
0.035343267023563385,
-0.5662806630134583,
0.00255737011320889,
1.208324909210205,
0.5684957504272461,
-1.1113994121551514,
-0.5303789377212524,
0.3371853232383728,
0.3920421898365021,
-0.1874791383743286,
-0.24202413856983185,
0.2984568774700165,
0.15382249653339386,
-0.5908876657485962,
0.6875665783882141,
0.8089625239372253,
0.208888977766037,
0.19554761052131653,
0.15893013775348663,
-0.8229473829269409,
-0.14913435280323029,
0.17440445721149445,
0.9450570344924927,
-0.939853310585022,
-0.7114843130111694,
-0.03168516233563423,
-0.27094873785972595,
-0.05765746906399727,
0.17102102935314178,
-0.4046344757080078,
0.5180677175521851,
0.34591493010520935,
0.49933457374572754,
0.0561608150601387,
-0.054746925830841064,
0.5409556031227112,
-0.9069057703018188,
0.09425963461399078,
0.4134361147880554,
0.4154115319252014,
-0.4000864028930664,
-0.5910194516181946,
0.6713420748710632,
1.0073972940444946,
-0.6594868898391724,
-0.8743268847465515,
-0.19846712052822113,
-1.0016002655029297,
0.04189709946513176,
0.6762762069702148,
0.5009527802467346,
-0.4806513786315918,
-0.4174500107765198,
-0.5617399215698242,
-0.1254672110080719,
-0.1369970738887787,
0.7621601819992065,
1.179680585861206,
-0.7432094812393188,
0.07975747436285019,
-1.038639783859253,
0.6594986915588379,
-0.2419457733631134,
-0.3457581698894501,
-0.48644304275512695,
0.3832802176475525,
0.35236993432044983,
0.440481036901474,
0.614812433719635,
0.1408471167087555,
0.8338426351547241,
0.3126053214073181,
-0.1702686995267868,
0.2698982357978821,
-0.4559200704097748,
-0.028932858258485794,
-0.057962555438280106,
0.31015971302986145,
-1.0262157917022705
] |
microsoft/table-transformer-detection | microsoft | "2023-09-06T14:49:09Z" | 1,278,488 | 98 | transformers | [
"transformers",
"pytorch",
"safetensors",
"table-transformer",
"object-detection",
"arxiv:2110.00061",
"license:mit",
"endpoints_compatible",
"has_space",
"region:us"
] | object-detection | "2022-10-14T09:14:13Z" | ---
license: mit
widget:
- src: https://www.invoicesimple.com/wp-content/uploads/2018/06/Sample-Invoice-printable.png
example_title: Invoice
---
# Table Transformer (fine-tuned for Table Detection)
Table Transformer (DETR) model trained on PubTables1M. It was introduced in the paper [PubTables-1M: Towards Comprehensive Table Extraction From Unstructured Documents](https://arxiv.org/abs/2110.00061) by Smock et al. and first released in [this repository](https://github.com/microsoft/table-transformer).
Disclaimer: The team releasing Table Transformer did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
The Table Transformer is equivalent to [DETR](https://huggingface.co/docs/transformers/model_doc/detr), a Transformer-based object detection model. Note that the authors decided to use the "normalize before" setting of DETR, which means that layernorm is applied before self- and cross-attention.
## Usage
You can use the raw model for detecting tables in documents. See the [documentation](https://huggingface.co/docs/transformers/main/en/model_doc/table-transformer) for more info. | [
-0.5323225259780884,
-0.5682713389396667,
0.2637466490268707,
-0.3004693388938904,
-0.3316004276275635,
-0.1775510460138321,
0.45144280791282654,
-0.422410249710083,
0.011674889363348484,
0.6638921499252319,
-0.7020613551139832,
-0.46261557936668396,
-0.6199028491973877,
0.15607759356498718,
-0.6156291961669922,
1.2047507762908936,
0.06906488537788391,
-0.1340327113866806,
-0.2447211891412735,
0.03562517091631889,
-0.359992653131485,
-0.15441210567951202,
-0.25311708450317383,
-0.6869997382164001,
0.33163681626319885,
0.42842260003089905,
0.7307702898979187,
0.7149113416671753,
1.004854440689087,
0.38297343254089355,
-0.07518690824508667,
-0.23734799027442932,
-0.345120370388031,
-0.09324345737695694,
-0.3281140625476837,
-0.6006973385810852,
-0.4919283390045166,
0.12656857073307037,
0.44192689657211304,
0.18881158530712128,
-0.13677842915058136,
0.2858268916606903,
-0.09571166336536407,
1.0201538801193237,
-0.4590683877468109,
0.4035772383213043,
-0.748640239238739,
0.4250465929508209,
-0.3423886001110077,
0.1041199192404747,
-0.511080265045166,
-0.2653750777244568,
0.09292645752429962,
-0.3795333504676819,
0.6293389201164246,
0.13750101625919342,
1.2583736181259155,
0.20950238406658173,
-0.4367814362049103,
0.08244650065898895,
-1.0777020454406738,
0.41826921701431274,
-0.5093351006507874,
0.7921114563941956,
0.022731149569153786,
0.8004957437515259,
-0.15987560153007507,
-1.0816314220428467,
-0.8687482476234436,
-0.2545831799507141,
-0.4088246524333954,
-0.05169843137264252,
-0.4751000702381134,
-0.01778176985681057,
0.4540981650352478,
0.41599076986312866,
-0.6823492050170898,
-0.09761618077754974,
-0.46497926115989685,
-0.016090532764792442,
0.34936922788619995,
0.1368931382894516,
0.357124388217926,
-0.18235813081264496,
-0.7170516848564148,
-0.13293445110321045,
-0.29921695590019226,
-0.14772993326187134,
-0.15262047946453094,
0.25465887784957886,
-0.40903371572494507,
0.5108652710914612,
-0.019498150795698166,
0.7816234827041626,
0.23883876204490662,
-0.08579571545124054,
0.20316851139068604,
-0.11769857257604599,
-0.13282714784145355,
-0.025388501584529877,
0.8537335395812988,
0.31159308552742004,
0.364238977432251,
-0.4448826313018799,
-0.4639335870742798,
0.21272775530815125,
0.5904345512390137,
-0.732970654964447,
-0.4956621825695038,
0.042156025767326355,
-0.6610978841781616,
-0.4369380474090576,
0.3993421196937561,
-0.8575539588928223,
-0.37791961431503296,
-0.26242929697036743,
0.4032380282878876,
-0.2531895041465759,
-0.32200247049331665,
-0.25047755241394043,
-0.2667039930820465,
0.5553350448608398,
0.2491074949502945,
-0.6494092345237732,
0.44150224328041077,
0.7015538811683655,
0.751590371131897,
-0.4627417325973511,
-0.09705565869808197,
-0.4396398663520813,
0.2711470425128937,
-0.12865450978279114,
1.2874246835708618,
-0.35278987884521484,
-0.45171278715133667,
0.056507740169763565,
0.2759629487991333,
0.018174193799495697,
-0.6758779883384705,
0.9903474450111389,
-0.42195090651512146,
0.1285395324230194,
-0.36915460228919983,
-0.3276776969432831,
-0.10839804261922836,
0.4319447875022888,
-1.0943509340286255,
1.0762379169464111,
0.5105932950973511,
-0.968633770942688,
0.7128074169158936,
-0.8647729158401489,
-0.21474812924861908,
0.26563262939453125,
-0.02953539602458477,
-0.9395690560340881,
0.14312005043029785,
0.10615384578704834,
0.35888350009918213,
-0.2342071235179901,
0.23305371403694153,
-0.10627568513154984,
-0.3717930316925049,
0.21129602193832397,
0.03316289931535721,
0.47658562660217285,
0.26617732644081116,
-0.1531800627708435,
0.46937426924705505,
-0.7269531488418579,
-0.24310728907585144,
0.3305046856403351,
-0.31106293201446533,
-0.009834297001361847,
0.05018100142478943,
0.45450565218925476,
0.5172778964042664,
-0.05455462262034416,
-0.7321356534957886,
0.13940857350826263,
-0.19168733060359955,
0.2637959122657776,
0.24466396868228912,
-0.07087809592485428,
0.6480758786201477,
-0.566614031791687,
0.28476682305336,
0.29798150062561035,
0.2826453149318695,
0.13441117107868195,
-0.19770364463329315,
-0.622117280960083,
-0.16179904341697693,
0.22679370641708374,
0.609173059463501,
-0.7405118346214294,
0.6457028985023499,
-0.3161032199859619,
-0.703607439994812,
-0.39368605613708496,
-0.22556725144386292,
0.2708915174007416,
0.719857931137085,
0.6080442667007446,
-0.16025950014591217,
-0.6885849833488464,
-1.052667498588562,
-0.49404963850975037,
-0.0040204175747931,
-0.1850605010986328,
-0.17346012592315674,
0.5827173590660095,
-0.18875618278980255,
1.1179982423782349,
-0.36349424719810486,
-0.7343092560768127,
-0.5078839063644409,
0.057729002088308334,
0.21740098297595978,
0.6060343384742737,
0.45872408151626587,
-0.7714978456497192,
-0.6790902018547058,
-0.07666639983654022,
-0.8296785950660706,
-0.09480872005224228,
0.06032209470868111,
-0.0654338002204895,
0.33598774671554565,
0.4874167740345001,
-0.8048194646835327,
0.6965200901031494,
0.06811169534921646,
-0.32606396079063416,
0.4883511960506439,
0.1069704219698906,
-0.09891017526388168,
-1.0266896486282349,
0.0655418261885643,
0.3500763773918152,
-0.25148671865463257,
-1.0296335220336914,
0.1552470177412033,
0.35752975940704346,
-0.26931366324424744,
-0.6259108185768127,
0.5741301774978638,
-0.7309309840202332,
0.011519521474838257,
-0.29658645391464233,
0.07293231040239334,
0.10097941011190414,
0.27487003803253174,
0.09867114573717117,
0.5903657078742981,
0.21222282946109772,
-0.4134730100631714,
0.021424194797873497,
0.7027258276939392,
-0.13883228600025177,
0.9286293983459473,
-0.7662233114242554,
0.2459048628807068,
-0.2625669538974762,
0.0964846983551979,
-1.1500463485717773,
0.07667972147464752,
0.386147677898407,
-0.11302834004163742,
0.8437657952308655,
-0.227348193526268,
-0.2709237039089203,
-0.9518381953239441,
-0.3672945499420166,
-0.26129665970802307,
0.31199413537979126,
-0.7119856476783752,
1.0490992069244385,
0.5214705467224121,
0.3913293182849884,
-0.46802932024002075,
-0.8198032975196838,
-0.18845446407794952,
-0.16770948469638824,
-0.5365496277809143,
0.5994430780410767,
0.08875350654125214,
-0.2905133068561554,
-0.1097763255238533,
-0.6938220858573914,
-0.11546734720468521,
-0.2308681458234787,
0.473432719707489,
0.32268497347831726,
-0.02990957908332348,
-0.1393924355506897,
-0.10497504472732544,
-0.4858013689517975,
0.23891931772232056,
0.08210252970457077,
0.5463456511497498,
-0.29363149404525757,
-0.07993292808532715,
-0.7258723974227905,
0.049010057002305984,
0.5198938250541687,
-0.3643646836280823,
0.5981957912445068,
0.8886329531669617,
-0.4138312339782715,
-0.06631691753864288,
-1.050265908241272,
-0.4062933325767517,
-0.5433111190795898,
0.2697419822216034,
-0.666721761226654,
-0.6110632419586182,
0.9156510829925537,
0.0481930635869503,
-0.14664708077907562,
0.8306756615638733,
0.17905355989933014,
0.023980526253581047,
0.8261739015579224,
0.7350630164146423,
-0.1489345133304596,
0.5278515815734863,
-0.20673179626464844,
-0.0034778511617332697,
-0.8955843448638916,
-0.605593204498291,
-1.0198198556900024,
-0.5613576173782349,
-0.704806387424469,
-0.14286741614341736,
0.23228314518928528,
-0.16223593056201935,
-0.3648182451725006,
0.7074460387229919,
-1.25918710231781,
0.6462550163269043,
0.5413743257522583,
0.2192627340555191,
0.3791915774345398,
-0.03791433945298195,
0.11016422510147095,
-0.13613945245742798,
-0.4673558473587036,
-0.46400076150894165,
0.5738014578819275,
0.45009371638298035,
1.1079366207122803,
-0.15348924696445465,
0.7446314692497253,
0.21416571736335754,
0.5319015383720398,
-0.7617670893669128,
0.5993416905403137,
-0.1375209540128708,
-0.7934197783470154,
-0.29164671897888184,
-0.36879175901412964,
-0.9763450622558594,
0.1474313586950302,
-0.30404341220855713,
-0.7863022685050964,
0.41654205322265625,
-0.19599692523479462,
0.1293630599975586,
0.6323402523994446,
-0.5423305630683899,
1.2403377294540405,
0.070057213306427,
-0.07947622984647751,
0.45970943570137024,
-0.7005913853645325,
0.341336727142334,
0.10262074321508408,
-0.11919422447681427,
-0.2465803176164627,
0.13924147188663483,
0.9375056624412537,
-0.41908398270606995,
0.507675051689148,
-0.6214083433151245,
0.02238861657679081,
0.4200589656829834,
0.6116636991500854,
0.6516188383102417,
-0.1640782207250595,
-0.14892904460430145,
0.37974104285240173,
0.16682252287864685,
0.07008837163448334,
-0.2548728585243225,
0.4391072690486908,
-0.6597545742988586,
-0.42560169100761414,
-0.5517656803131104,
-0.8932919502258301,
0.2048584669828415,
0.34607750177383423,
0.24615275859832764,
0.053824350237846375,
-0.22402264177799225,
0.29072272777557373,
0.5910873413085938,
0.07426480948925018,
0.6263626217842102,
0.9069468975067139,
-0.25486451387405396,
-0.052460018545389175,
0.544670581817627,
0.23689638078212738,
-0.24910102784633636,
0.7734143733978271,
0.31938228011131287,
-0.4330163598060608,
-0.42030560970306396,
-0.1977599710226059,
0.19686806201934814,
-0.41951262950897217,
-0.5965328216552734,
-0.8885087370872498,
-0.5051265358924866,
-0.19258126616477966,
-0.11203540861606598,
-0.3367581069469452,
-0.3467042148113251,
-0.2807120978832245,
-0.22848232090473175,
0.5311465263366699,
0.6302683353424072,
0.041887640953063965,
0.6168925166130066,
-1.0182716846466064,
0.503720223903656,
0.25105544924736023,
0.5851011276245117,
-0.2904893755912781,
-0.679950475692749,
0.24548587203025818,
-0.35883498191833496,
-0.2779306173324585,
-1.0811704397201538,
0.6254603266716003,
0.1510583609342575,
0.8596410155296326,
0.35968995094299316,
0.07895729690790176,
0.12166669964790344,
-0.6200123429298401,
0.4126526117324829,
0.1150892972946167,
-0.8232512474060059,
0.54710453748703,
-0.26044777035713196,
0.5371331572532654,
0.7211105823516846,
0.47328516840934753,
-0.22021672129631042,
-0.06321868300437927,
-0.4023582935333252,
-0.5422293543815613,
0.8978645205497742,
-0.15543270111083984,
0.03649043291807175,
0.1091356873512268,
0.4682999849319458,
0.18166004121303558,
0.07556317746639252,
-1.097548484802246,
-0.24318230152130127,
-0.2318994551897049,
-0.016055867075920105,
0.32306382060050964,
-0.5684740543365479,
0.022510820999741554,
-0.4097156822681427,
0.4630877673625946,
0.08789951354265213,
0.5013296604156494,
0.2014767825603485,
-0.187231183052063,
-0.5360559821128845,
0.15473970770835876,
0.3925654888153076,
0.5197957158088684,
-0.6235111355781555,
0.13195769488811493,
-0.018167657777667046,
-0.6765641570091248,
-0.08610164374113083,
0.4584789574146271,
-0.2829464077949524,
0.2348906546831131,
0.0719507709145546,
0.6584559679031372,
0.19383348524570465,
0.06047879159450531,
0.36191004514694214,
-0.17142771184444427,
-0.28503215312957764,
-0.2657068967819214,
0.09733647108078003,
-0.004779119975864887,
0.20884519815444946,
0.4695298373699188,
-0.20313191413879395,
0.3645845055580139,
-0.4004601836204529,
0.7333951592445374,
0.6731209754943848,
-0.8734543323516846,
-0.16871869564056396,
1.019374132156372,
-0.02022368088364601,
-0.7784295082092285,
0.7158570289611816,
-0.15188150107860565,
-0.5645818710327148,
0.5684742331504822,
0.8507422208786011,
0.9338908791542053,
-0.6787147521972656,
0.2996154725551605,
0.32373595237731934,
0.6829369068145752,
0.15517155826091766,
0.5211876034736633,
-0.023610752075910568,
-0.8022919297218323,
0.08973105251789093,
-0.7348408699035645,
-0.2636919319629669,
0.1902143508195877,
-0.7681089043617249,
0.28623658418655396,
-0.22995123267173767,
-0.1998249739408493,
0.537207305431366,
0.049207836389541626,
-0.7695940136909485,
-0.07102809101343155,
-0.055290788412094116,
1.3163881301879883,
-0.8898282051086426,
0.813323438167572,
0.4038858413696289,
-0.617962121963501,
-0.7354164123535156,
-0.2088446170091629,
0.14218907058238983,
-0.546782910823822,
0.43514472246170044,
0.236129030585289,
0.3318313658237457,
-0.00995676964521408,
-0.5873446464538574,
-0.7332375049591064,
1.0257726907730103,
0.10524013638496399,
-0.7430068254470825,
-0.1302577406167984,
0.4849604368209839,
0.47252070903778076,
-0.18910659849643707,
0.5590173602104187,
0.7220362424850464,
0.7671590447425842,
0.23504313826560974,
-0.8386022448539734,
0.2331039160490036,
-0.2859834134578705,
0.11014828085899353,
0.4781363904476166,
-0.24582958221435547,
0.9116320610046387,
0.10345599800348282,
-0.039448898285627365,
-0.26925188302993774,
0.7280965447425842,
0.07343807071447372,
0.39782389998435974,
0.4946037232875824,
0.6745848655700684,
0.31113508343696594,
-0.6265685558319092,
1.0031938552856445,
-0.12815959751605988,
0.39137133955955505,
1.3445298671722412,
-0.7348065972328186,
0.5145186185836792,
0.3585995137691498,
-0.39213114976882935,
0.6585534811019897,
0.28843581676483154,
-0.5810794830322266,
0.4387139081954956,
0.1649370789527893,
0.15590912103652954,
0.18254151940345764,
-0.10246110707521439,
-0.47202828526496887,
0.468402624130249,
0.31108546257019043,
-0.43762969970703125,
-0.6633570790290833,
-0.09739860147237778,
-0.1766233891248703,
0.04322824999690056,
-0.35160765051841736,
1.0877690315246582,
-0.03155328705906868,
-0.22043807804584503,
0.4654459059238434,
-0.1892460137605667,
0.5604237914085388,
-0.5052738189697266,
-0.16536429524421692,
-0.35169804096221924,
0.2261074185371399,
-0.36131057143211365,
-0.889068067073822,
0.6154084205627441,
-0.24560047686100006,
-0.2758137583732605,
0.1788424253463745,
1.3704535961151123,
-0.4187954068183899,
-0.42388999462127686,
0.23172786831855774,
0.6575785279273987,
0.11770286411046982,
-0.2874600887298584,
-0.889237105846405,
0.24665725231170654,
-0.2653319239616394,
-0.3895953893661499,
0.36403700709342957,
0.4162827730178833,
0.06870201230049133,
0.645751416683197,
0.5971162915229797,
-0.5603438019752502,
-0.17738759517669678,
0.16176675260066986,
1.0032203197479248,
-0.3563964366912842,
-0.3715352416038513,
-0.7385178804397583,
0.6902394890785217,
-0.16020911931991577,
0.120393306016922,
0.7851483821868896,
0.9085925817489624,
0.648806631565094,
-0.594735860824585,
0.17197857797145844,
0.02133782207965851,
0.5228102207183838,
-0.03577367216348648,
1.1324816942214966,
-0.3010827898979187,
-0.13673639297485352,
-0.5090392827987671,
-1.3083767890930176,
-0.48638248443603516,
0.7978192567825317,
-0.22694949805736542,
0.11970368772745132,
0.6011986136436462,
0.9044647216796875,
-0.24254776537418365,
0.01241236925125122,
0.2999299466609955,
0.20848000049591064,
0.19197869300842285,
0.04745560511946678,
0.5089098811149597,
-0.6280422210693359,
0.512126624584198,
-0.4653628170490265,
-0.08971679955720901,
-0.05489430949091911,
-0.8829950094223022,
-1.056723952293396,
-0.5824013948440552,
-0.3183230757713318,
-0.5241199731826782,
-0.006174043286591768,
0.613714337348938,
0.844534158706665,
-1.0132657289505005,
-0.10517565906047821,
-0.24701286852359772,
0.13820669054985046,
-0.160848006606102,
-0.3562980890274048,
0.4816884398460388,
0.004608888644725084,
-0.41734081506729126,
0.23654749989509583,
0.1314021497964859,
0.12599168717861176,
-0.02176877297461033,
0.2975161373615265,
-0.5487179756164551,
-0.025051884353160858,
0.41575583815574646,
0.34136322140693665,
-0.3409698009490967,
-0.2979296147823334,
-0.1860150247812271,
-0.10655879974365234,
0.41113343834877014,
0.4834415316581726,
-0.7866146564483643,
0.24139703810214996,
0.5858291387557983,
0.21335259079933167,
0.8692956566810608,
0.05550364404916763,
0.07786331325769424,
-0.7152121067047119,
0.27318936586380005,
0.10214599221944809,
0.3614768981933594,
0.224435493350029,
-0.5527661442756653,
0.9910500645637512,
0.10099153965711594,
-0.6760934591293335,
-1.0043442249298096,
0.020703565329313278,
-1.3417154550552368,
-0.0561547689139843,
0.6449215412139893,
0.2958569824695587,
-0.7290301322937012,
-0.05675502493977547,
-0.19113194942474365,
0.611602246761322,
-0.41377338767051697,
0.9825707674026489,
0.06687901169061661,
0.013007432222366333,
-0.4958471357822418,
-0.35266372561454773,
0.6531541347503662,
-0.211278036236763,
-1.071252703666687,
-0.1333409696817398,
0.19824326038360596,
0.3390820324420929,
0.572583794593811,
0.23930251598358154,
-0.45870348811149597,
0.10291311144828796,
0.009613524191081524,
0.6996459364891052,
-0.36594170331954956,
-0.4859919250011444,
-0.2888367474079132,
0.2428469955921173,
-0.3100588321685791,
-0.10032825171947479
] |
distilbert-base-uncased-distilled-squad | null | "2023-04-06T13:40:56Z" | 1,269,799 | 73 | transformers | [
"transformers",
"pytorch",
"tf",
"tflite",
"coreml",
"safetensors",
"distilbert",
"question-answering",
"en",
"dataset:squad",
"arxiv:1910.01108",
"arxiv:1910.09700",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | question-answering | "2022-03-02T23:29:04Z" | ---
language: en
datasets:
- squad
widget:
- text: "Which name is also used to describe the Amazon rainforest in English?"
context: "The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain \"Amazonas\" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
- text: "How many square kilometers of rainforest is covered in the basin?"
context: "The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain \"Amazonas\" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
license: apache-2.0
---
# DistilBERT base uncased distilled SQuAD
## Table of Contents
- [Model Details](#model-details)
- [How To Get Started With the Model](#how-to-get-started-with-the-model)
- [Uses](#uses)
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
- [Training](#training)
- [Evaluation](#evaluation)
- [Environmental Impact](#environmental-impact)
- [Technical Specifications](#technical-specifications)
- [Citation Information](#citation-information)
- [Model Card Authors](#model-card-authors)
## Model Details
**Model Description:** The DistilBERT model was proposed in the blog post [Smaller, faster, cheaper, lighter: Introducing DistilBERT, adistilled version of BERT](https://medium.com/huggingface/distilbert-8cf3380435b5), and the paper [DistilBERT, adistilled version of BERT: smaller, faster, cheaper and lighter](https://arxiv.org/abs/1910.01108). DistilBERT is a small, fast, cheap and light Transformer model trained by distilling BERT base. It has 40% less parameters than *bert-base-uncased*, runs 60% faster while preserving over 95% of BERT's performances as measured on the GLUE language understanding benchmark.
This model is a fine-tune checkpoint of [DistilBERT-base-uncased](https://huggingface.co/distilbert-base-uncased), fine-tuned using (a second step of) knowledge distillation on [SQuAD v1.1](https://huggingface.co/datasets/squad).
- **Developed by:** Hugging Face
- **Model Type:** Transformer-based language model
- **Language(s):** English
- **License:** Apache 2.0
- **Related Models:** [DistilBERT-base-uncased](https://huggingface.co/distilbert-base-uncased)
- **Resources for more information:**
- See [this repository](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation) for more about Distil\* (a class of compressed models including this model)
- See [Sanh et al. (2019)](https://arxiv.org/abs/1910.01108) for more information about knowledge distillation and the training procedure
## How to Get Started with the Model
Use the code below to get started with the model.
```python
>>> from transformers import pipeline
>>> question_answerer = pipeline("question-answering", model='distilbert-base-uncased-distilled-squad')
>>> context = r"""
... Extractive Question Answering is the task of extracting an answer from a text given a question. An example of a
... question answering dataset is the SQuAD dataset, which is entirely based on that task. If you would like to fine-tune
... a model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.
... """
>>> result = question_answerer(question="What is a good example of a question answering dataset?", context=context)
>>> print(
... f"Answer: '{result['answer']}', score: {round(result['score'], 4)}, start: {result['start']}, end: {result['end']}"
...)
Answer: 'SQuAD dataset', score: 0.4704, start: 147, end: 160
```
Here is how to use this model in PyTorch:
```python
from transformers import DistilBertTokenizer, DistilBertForQuestionAnswering
import torch
tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased-distilled-squad')
model = DistilBertForQuestionAnswering.from_pretrained('distilbert-base-uncased-distilled-squad')
question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
answer_start_index = torch.argmax(outputs.start_logits)
answer_end_index = torch.argmax(outputs.end_logits)
predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)
```
And in TensorFlow:
```python
from transformers import DistilBertTokenizer, TFDistilBertForQuestionAnswering
import tensorflow as tf
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased-distilled-squad")
model = TFDistilBertForQuestionAnswering.from_pretrained("distilbert-base-uncased-distilled-squad")
question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="tf")
outputs = model(**inputs)
answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])
predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)
```
## Uses
This model can be used for question answering.
#### Misuse and Out-of-scope Use
The model should not be used to intentionally create hostile or alienating environments for people. In addition, the model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
## Risks, Limitations and Biases
**CONTENT WARNING: Readers should be aware that language generated by this model can be disturbing or offensive to some and can propagate historical and current stereotypes.**
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model can include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. For example:
```python
>>> from transformers import pipeline
>>> question_answerer = pipeline("question-answering", model='distilbert-base-uncased-distilled-squad')
>>> context = r"""
... Alice is sitting on the bench. Bob is sitting next to her.
... """
>>> result = question_answerer(question="Who is the CEO?", context=context)
>>> print(
... f"Answer: '{result['answer']}', score: {round(result['score'], 4)}, start: {result['start']}, end: {result['end']}"
...)
Answer: 'Bob', score: 0.4183, start: 32, end: 35
```
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
## Training
#### Training Data
The [distilbert-base-uncased model](https://huggingface.co/distilbert-base-uncased) model describes it's training data as:
> DistilBERT pretrained on the same data as BERT, which is [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038 unpublished books and [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and headers).
To learn more about the SQuAD v1.1 dataset, see the [SQuAD v1.1 data card](https://huggingface.co/datasets/squad).
#### Training Procedure
##### Preprocessing
See the [distilbert-base-uncased model card](https://huggingface.co/distilbert-base-uncased) for further details.
##### Pretraining
See the [distilbert-base-uncased model card](https://huggingface.co/distilbert-base-uncased) for further details.
## Evaluation
As discussed in the [model repository](https://github.com/huggingface/transformers/blob/main/examples/research_projects/distillation/README.md)
> This model reaches a F1 score of 86.9 on the [SQuAD v1.1] dev set (for comparison, Bert bert-base-uncased version reaches a F1 score of 88.5).
## Environmental Impact
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). We present the hardware type and hours used based on the [associated paper](https://arxiv.org/pdf/1910.01108.pdf). Note that these details are just for training DistilBERT, not including the fine-tuning with SQuAD.
- **Hardware Type:** 8 16GB V100 GPUs
- **Hours used:** 90 hours
- **Cloud Provider:** Unknown
- **Compute Region:** Unknown
- **Carbon Emitted:** Unknown
## Technical Specifications
See the [associated paper](https://arxiv.org/abs/1910.01108) for details on the modeling architecture, objective, compute infrastructure, and training details.
## Citation Information
```bibtex
@inproceedings{sanh2019distilbert,
title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
author={Sanh, Victor and Debut, Lysandre and Chaumond, Julien and Wolf, Thomas},
booktitle={NeurIPS EMC^2 Workshop},
year={2019}
}
```
APA:
- Sanh, V., Debut, L., Chaumond, J., & Wolf, T. (2019). DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108.
## Model Card Authors
This model card was written by the Hugging Face team.
| [
-0.35065045952796936,
-0.8725157976150513,
0.22245916724205017,
0.14677977561950684,
-0.10524468123912811,
0.19723621010780334,
-0.19225279986858368,
-0.28156936168670654,
-0.06112495809793472,
0.1462583988904953,
-0.7896097898483276,
-0.27438434958457947,
-0.7389736771583557,
0.11225657165050507,
-0.27320483326911926,
1.2318357229232788,
-0.05570489168167114,
0.03950320556759834,
-0.18244363367557526,
-0.0005806994158774614,
-0.2764835059642792,
-0.6666293740272522,
-0.41383931040763855,
-0.39411523938179016,
0.27118542790412903,
0.09509168565273285,
0.4853151738643646,
0.31645408272743225,
0.5122768878936768,
0.44848254323005676,
-0.23155438899993896,
-0.17059975862503052,
-0.7184454798698425,
-0.04221737012267113,
0.07827550917863846,
-0.4553878605365753,
-0.3708415627479553,
0.3108365833759308,
0.2701723873615265,
0.650968611240387,
-0.20638082921504974,
0.32942646741867065,
0.16171523928642273,
0.5718732476234436,
-0.2531454563140869,
0.4590141177177429,
-0.7152019739151001,
-0.13642637431621552,
0.17233555018901825,
0.22033701837062836,
-0.344561904668808,
-0.14987264573574066,
0.3823651671409607,
-0.3554883599281311,
0.5386653542518616,
-0.03633616119623184,
1.010117530822754,
0.4516407251358032,
-0.07430656999349594,
-0.3150404691696167,
-0.5329486727714539,
0.9433375597000122,
-0.7954627275466919,
-0.019785622134804726,
0.28080984950065613,
0.3073790371417999,
-0.07131939381361008,
-0.816119909286499,
-0.7655438780784607,
-0.20583440363407135,
-0.2498968243598938,
0.317403644323349,
-0.43113410472869873,
0.022901790216565132,
0.25717654824256897,
0.38400331139564514,
-0.433255672454834,
-0.08828085660934448,
-0.7590859532356262,
-0.06647361814975739,
0.8049737215042114,
0.06989679485559464,
0.030623601749539375,
-0.09695418924093246,
-0.5190288424491882,
-0.3049356937408447,
-0.19707824289798737,
0.23468981683254242,
0.40941333770751953,
0.3326217234134674,
-0.18151873350143433,
0.5784456729888916,
-0.2251465916633606,
0.4834570288658142,
0.4017370939254761,
-0.03406042233109474,
0.3982968330383301,
-0.23410525918006897,
-0.3588244318962097,
0.16877083480358124,
0.863761305809021,
0.33186787366867065,
0.2645740807056427,
-0.10067149251699448,
-0.14922069013118744,
-0.03947250172495842,
0.09380797296762466,
-1.0602695941925049,
-0.5173870325088501,
0.4188605546951294,
-0.3084344267845154,
-0.5209865570068359,
0.0664445161819458,
-0.591413140296936,
-0.02961033396422863,
-0.013186193071305752,
0.5020360946655273,
-0.3736388683319092,
-0.35234642028808594,
0.13929399847984314,
-0.4295474886894226,
0.03920219466090202,
0.13490083813667297,
-0.8906564712524414,
0.04508605971932411,
0.21340380609035492,
0.6964536905288696,
-0.06556950509548187,
-0.2259141057729721,
-0.18476995825767517,
-0.21398116648197174,
0.09124018996953964,
0.4015832245349884,
-0.14207158982753754,
-0.3302546441555023,
-0.20342202484607697,
0.20721158385276794,
0.0237917248159647,
-0.5011043548583984,
0.24174046516418457,
-0.4055422842502594,
0.38533908128738403,
-0.1601865440607071,
-0.5847375988960266,
-0.24839268624782562,
0.1646818220615387,
-0.6224710941314697,
1.1719887256622314,
0.3820442855358124,
-0.7586292028427124,
0.34505942463874817,
-0.609619140625,
-0.3576352298259735,
-0.12376167625188828,
0.21180681884288788,
-0.5138335227966309,
0.00008722449274500832,
0.2596908211708069,
0.5409754514694214,
-0.2777183949947357,
0.5011727213859558,
-0.36046087741851807,
-0.26359063386917114,
0.2177661955356598,
-0.45691797137260437,
1.3078967332839966,
0.1690448373556137,
-0.38690295815467834,
-0.21327422559261322,
-0.6446276307106018,
0.0404570996761322,
0.2723374664783478,
-0.4348059594631195,
0.016541704535484314,
-0.18794231116771698,
0.04635791853070259,
0.2743641138076782,
0.3300662636756897,
-0.4743741750717163,
0.19099058210849762,
-0.13085781037807465,
0.72523432970047,
0.7869082093238831,
-0.21390290558338165,
0.326660692691803,
-0.39087867736816406,
0.3577863276004791,
0.3041824996471405,
0.1949041187763214,
0.06867355853319168,
-0.5031463503837585,
-0.8433594703674316,
-0.3998953104019165,
0.254614919424057,
0.5450786352157593,
-0.6398837566375732,
0.726362407207489,
-0.09541592746973038,
-0.7633204460144043,
-0.4919830560684204,
0.036557842046022415,
0.32444140315055847,
0.8611891865730286,
0.5543413758277893,
0.1668594777584076,
-0.7069843411445618,
-0.8849442005157471,
0.14985178411006927,
-0.56717848777771,
-0.029727501794695854,
0.054424550384283066,
0.8373147249221802,
-0.07076181471347809,
1.0571998357772827,
-0.7087224125862122,
-0.1450117975473404,
-0.5359180569648743,
0.12994909286499023,
0.5902799963951111,
0.5630139708518982,
0.6943759322166443,
-0.8124960064888,
-0.5011940002441406,
-0.429841548204422,
-0.8792691826820374,
0.05020004138350487,
0.21185937523841858,
-0.03159560263156891,
0.15224839746952057,
0.3441915214061737,
-0.6069294214248657,
0.4078613221645355,
0.4697001576423645,
-0.2528937757015228,
0.548623263835907,
-0.16983002424240112,
0.11796858161687851,
-1.11374831199646,
0.17895068228244781,
-0.03612232208251953,
-0.014091182500123978,
-0.6869356632232666,
-0.23371870815753937,
-0.24873681366443634,
-0.010043374262750149,
-0.6500848531723022,
0.4086882174015045,
-0.22617249190807343,
0.3760358393192291,
0.03686760365962982,
-0.20828212797641754,
0.22171466052532196,
0.7820956707000732,
0.11103872209787369,
0.7458659410476685,
0.47887682914733887,
-0.591347873210907,
0.512615442276001,
0.43232524394989014,
-0.3836233615875244,
0.2765232026576996,
-1.0843828916549683,
0.15005731582641602,
-0.2777993083000183,
0.21637795865535736,
-1.1334306001663208,
0.03474999964237213,
0.08197201043367386,
-0.5578354597091675,
0.404995858669281,
-0.22716185450553894,
-0.5343592166900635,
-0.5633515119552612,
-0.058766331523656845,
0.2885487973690033,
0.793285608291626,
-0.3952708840370178,
0.4090942442417145,
0.3606506586074829,
-0.0012009399943053722,
-0.7188006043434143,
-0.8932039737701416,
-0.5088822245597839,
-0.49913790822029114,
-0.661168098449707,
0.4056132435798645,
-0.210759237408638,
-0.33210447430610657,
0.028484510257840157,
-0.14427009224891663,
-0.44415009021759033,
0.11657482385635376,
0.12868459522724152,
0.6096897125244141,
-0.08304940164089203,
0.11273923516273499,
-0.11477985978126526,
0.054904159158468246,
0.03520789369940758,
-0.10850873589515686,
0.49453043937683105,
-0.38733893632888794,
0.14567707479000092,
-0.42457810044288635,
0.2219839096069336,
0.4397338628768921,
-0.022666476666927338,
0.8997095823287964,
0.4816460609436035,
-0.23843449354171753,
0.05462091043591499,
-0.5110660791397095,
-0.4356856048107147,
-0.5146039724349976,
0.7265504002571106,
-0.1961088627576828,
-0.6272987127304077,
0.6010994911193848,
0.2371775507926941,
0.1509985327720642,
0.7782266736030579,
0.5939491391181946,
-0.4724246561527252,
0.8979248404502869,
0.5782430171966553,
-0.16648928821086884,
0.3280692398548126,
-0.693157434463501,
0.1398695707321167,
-0.5240442156791687,
-0.35209742188453674,
-0.5222465991973877,
-0.5321542024612427,
-0.5396215915679932,
-0.371431440114975,
0.3177993893623352,
0.44597214460372925,
-0.46676957607269287,
0.6210570335388184,
-0.7035481929779053,
0.3084854185581207,
0.5369910001754761,
0.1616111546754837,
0.15995922684669495,
-0.012706163339316845,
-0.025303617119789124,
0.015419038943946362,
-0.8524330854415894,
-0.5129794478416443,
1.0824097394943237,
0.4167896807193756,
0.7963091135025024,
-0.1364976465702057,
0.666256844997406,
0.1927211433649063,
0.2694118618965149,
-0.5261927247047424,
0.3618755340576172,
-0.05958764627575874,
-1.220597505569458,
-0.3561762273311615,
-0.466183066368103,
-0.723215639591217,
0.0729006826877594,
-0.08058187365531921,
-0.7386091947555542,
0.09545178711414337,
0.06461798399686813,
-0.3996604382991791,
0.3278536796569824,
-0.949479877948761,
0.9206922650337219,
-0.3481222689151764,
-0.28236448764801025,
0.1405666172504425,
-0.7210705280303955,
0.2511560916900635,
0.08624900132417679,
-0.10684730112552643,
-0.14742982387542725,
0.34432846307754517,
0.7873671054840088,
-0.6101301312446594,
0.8048401474952698,
-0.35569390654563904,
0.1457575559616089,
0.6083303689956665,
-0.3210444152355194,
0.2831992208957672,
0.08702928572893143,
-0.2674073278903961,
0.5021119713783264,
0.1989784687757492,
-0.3877258002758026,
-0.5074373483657837,
0.42111384868621826,
-0.9246057271957397,
-0.6039323210716248,
-0.6432665586471558,
-0.6602569222450256,
0.015055583789944649,
0.10649777203798294,
0.5147557854652405,
0.22578944265842438,
-0.23050318658351898,
0.26897940039634705,
0.6947797536849976,
-0.33169758319854736,
0.5655590295791626,
0.3951788544654846,
-0.10019849240779877,
-0.048133209347724915,
0.4759591519832611,
0.07757391035556793,
0.38843658566474915,
0.404502272605896,
0.1709776222705841,
-0.6827462911605835,
-0.34104788303375244,
-0.4625799059867859,
0.08789088577032089,
-0.6831363439559937,
-0.2600412666797638,
-0.630292534828186,
-0.4634890854358673,
-0.45817673206329346,
0.07492879033088684,
-0.37566134333610535,
-0.4246206283569336,
-0.4984983503818512,
-0.23254719376564026,
0.6087095141410828,
0.6101576089859009,
0.11955410242080688,
0.33598294854164124,
-0.5105555057525635,
0.1730319857597351,
0.36592400074005127,
0.14357797801494598,
-0.1904485821723938,
-0.6593098640441895,
-0.06986084580421448,
0.5044503808021545,
-0.48689818382263184,
-0.7950094938278198,
0.27711114287376404,
0.13156858086585999,
0.573615312576294,
0.22495263814926147,
0.28984251618385315,
0.7903775572776794,
-0.3852415680885315,
0.7583165764808655,
0.2756553590297699,
-0.7171344757080078,
0.5612422227859497,
-0.06458809226751328,
0.12871064245700836,
0.7551522254943848,
0.482251912355423,
-0.03609965741634369,
-0.2851967215538025,
-0.7630954384803772,
-0.7554640769958496,
0.8863174319267273,
0.4735715389251709,
0.16218453645706177,
-0.04203091934323311,
0.1345157027244568,
0.06462699174880981,
0.430271714925766,
-0.8411654233932495,
-0.5232445001602173,
-0.332319051027298,
-0.14530883729457855,
-0.2699078321456909,
0.01606929674744606,
0.03809890151023865,
-0.7076733112335205,
0.7945245504379272,
0.16132476925849915,
0.3870989680290222,
0.2723632752895355,
-0.13768021762371063,
0.3015909790992737,
-0.03191741928458214,
0.2808395028114319,
0.44557034969329834,
-0.6265245079994202,
-0.1391153633594513,
0.3241327702999115,
-0.5056379437446594,
0.27566441893577576,
0.26892444491386414,
-0.01707744598388672,
0.19548951089382172,
0.2864883542060852,
0.8294453024864197,
-0.15031304955482483,
-0.6047284007072449,
0.40449318289756775,
-0.07837611436843872,
-0.40131255984306335,
-0.3724920451641083,
0.08166847378015518,
0.1736624836921692,
0.36317867040634155,
0.4487994611263275,
0.08040805160999298,
-0.048274025321006775,
-0.753709614276886,
0.20566272735595703,
0.31809812784194946,
-0.4783288836479187,
-0.1546943038702011,
0.8089993596076965,
0.15989409387111664,
-0.0944073498249054,
0.9532752633094788,
-0.1312824785709381,
-0.5900557637214661,
0.8713932633399963,
0.3192239999771118,
0.6557630896568298,
-0.004018998239189386,
0.20730000734329224,
0.5741865634918213,
0.3023526966571808,
-0.1053709015250206,
0.021473990753293037,
0.07528916746377945,
-0.6141700148582458,
-0.016856351867318153,
-0.7509377002716064,
0.13273371756076813,
0.2234863042831421,
-0.6521446108818054,
0.3243336081504822,
-0.33288952708244324,
-0.256684809923172,
0.13416390120983124,
0.20872820913791656,
-1.0063393115997314,
0.2167825996875763,
-0.1366060972213745,
0.8172688484191895,
-0.8819131255149841,
0.8264371156692505,
0.5111085772514343,
-0.8257224559783936,
-0.8826452493667603,
-0.1884094476699829,
-0.29228007793426514,
-0.8792743682861328,
0.8908151388168335,
0.32271263003349304,
0.1834285408258438,
0.047273579984903336,
-0.4804379940032959,
-0.5691857933998108,
1.2518092393875122,
0.510444700717926,
-0.596330463886261,
-0.2507358491420746,
0.3331516683101654,
0.6392195820808411,
-0.28052911162376404,
0.6613088250160217,
0.690009355545044,
0.34579557180404663,
0.31746524572372437,
-0.795990526676178,
-0.08675213158130646,
-0.33571290969848633,
-0.13293641805648804,
-0.15719319880008698,
-0.7045813202857971,
1.164121389389038,
-0.34261810779571533,
-0.05307541787624359,
0.030829451978206635,
0.5306508541107178,
0.2928551435470581,
0.09782133996486664,
0.5051983594894409,
0.6116288304328918,
0.7263317108154297,
-0.3788353204727173,
1.0168176889419556,
-0.14444604516029358,
0.6617564558982849,
0.984100878238678,
-0.05830773338675499,
0.5909885168075562,
0.5634585618972778,
-0.5210009217262268,
0.47606271505355835,
0.5904709100723267,
-0.23803046345710754,
0.8157842755317688,
0.40712764859199524,
-0.0988537073135376,
-0.08632771670818329,
0.15705665946006775,
-0.48292985558509827,
0.5328480005264282,
-0.04143238440155983,
-0.44785022735595703,
-0.22080393135547638,
-0.16683617234230042,
0.012625777162611485,
-0.16445019841194153,
-0.00584819819778204,
0.6549832820892334,
-0.07397135347127914,
-0.8068700432777405,
0.9402063488960266,
-0.1363251805305481,
0.7403393387794495,
-0.6060969233512878,
-0.019883349537849426,
-0.19904863834381104,
0.31268659234046936,
-0.03877396881580353,
-0.8111419081687927,
0.2305508852005005,
0.08367978036403656,
-0.4531615376472473,
-0.302049845457077,
0.3200494647026062,
-0.566981315612793,
-0.8586498498916626,
0.1548445224761963,
0.437655508518219,
0.23544694483280182,
-0.09638778865337372,
-0.9500006437301636,
-0.08249246329069138,
0.1458868682384491,
-0.20996008813381195,
0.17523236572742462,
0.3495708703994751,
0.38768962025642395,
0.6157256364822388,
0.5264385342597961,
-0.2697564959526062,
0.10341803729534149,
-0.21593418717384338,
0.9961561560630798,
-0.21313665807247162,
-0.22372886538505554,
-1.0250333547592163,
0.8923256993293762,
-0.1597379595041275,
-0.4507700204849243,
0.5803516507148743,
0.7334977388381958,
0.8973719477653503,
-0.29049915075302124,
0.9582963585853577,
-0.4436553120613098,
0.1746879369020462,
-0.27937743067741394,
0.9034609794616699,
-0.5854473114013672,
0.1252405047416687,
-0.36454179883003235,
-0.9041696190834045,
0.2517748773097992,
0.8025681972503662,
-0.174859881401062,
0.25650539994239807,
0.5800201892852783,
0.7760070562362671,
-0.11825129389762878,
-0.030498763546347618,
0.06064881384372711,
0.2230367511510849,
0.2546060383319855,
0.6974945664405823,
0.6907567977905273,
-0.7529547810554504,
0.7083371877670288,
-0.5952997207641602,
-0.2846073806285858,
-0.0859169140458107,
-0.8504274487495422,
-1.2497526407241821,
-0.7935827374458313,
-0.3915180265903473,
-0.5103728771209717,
-0.10609164834022522,
0.7299662828445435,
0.8386845588684082,
-0.7987509369850159,
-0.24253562092781067,
-0.17324016988277435,
-0.050880152732133865,
-0.2611960172653198,
-0.24113230407238007,
0.294773131608963,
-0.22371584177017212,
-0.9555410146713257,
0.021667812019586563,
-0.14534100890159607,
0.22404301166534424,
-0.25324302911758423,
-0.05037998408079147,
-0.43424129486083984,
-0.1949842870235443,
0.4258372485637665,
-0.03920067101716995,
-0.5719130635261536,
-0.1844346672296524,
0.24586142599582672,
0.015505819581449032,
0.15738248825073242,
0.3565409183502197,
-0.7078316807746887,
0.4171035587787628,
0.4332332909107208,
0.32824739813804626,
0.7232109308242798,
-0.060712046921253204,
0.4911780059337616,
-0.7811223864555359,
0.4193331301212311,
0.43842166662216187,
0.4759077727794647,
0.21328772604465485,
-0.41323256492614746,
0.472756028175354,
0.19059878587722778,
-0.5018211603164673,
-0.7994146943092346,
-0.06913286447525024,
-0.9799242615699768,
-0.3058635890483856,
1.0443644523620605,
-0.38315725326538086,
-0.2015598863363266,
0.06444190442562103,
-0.2525559663772583,
0.5872244834899902,
-0.44201651215553284,
0.950424075126648,
0.8838145732879639,
0.05333626642823219,
0.12136702239513397,
-0.5436939001083374,
0.4041074514389038,
0.2855445146560669,
-0.6167110204696655,
0.0006034058169461787,
0.23259888589382172,
0.5686609745025635,
0.07729662954807281,
0.41470199823379517,
-0.010999838821589947,
-0.07461026310920715,
0.06821335107088089,
-0.004353017080575228,
-0.2961692214012146,
-0.13744719326496124,
0.02868269942700863,
-0.10235343873500824,
-0.35637661814689636,
-0.34157586097717285
] |
shibing624/text2vec-base-chinese | shibing624 | "2023-08-28T08:58:03Z" | 1,250,320 | 494 | transformers | [
"transformers",
"pytorch",
"onnx",
"bert",
"feature-extraction",
"text2vec",
"sentence-similarity",
"zh",
"dataset:shibing624/nli_zh",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | sentence-similarity | "2022-03-02T23:29:05Z" | ---
pipeline_tag: sentence-similarity
license: apache-2.0
tags:
- text2vec
- feature-extraction
- sentence-similarity
- transformers
datasets:
- shibing624/nli_zh
language:
- zh
metrics:
- spearmanr
library_name: transformers
---
# shibing624/text2vec-base-chinese
This is a CoSENT(Cosine Sentence) model: shibing624/text2vec-base-chinese.
It maps sentences to a 768 dimensional dense vector space and can be used for tasks
like sentence embeddings, text matching or semantic search.
## Evaluation
For an automated evaluation of this model, see the *Evaluation Benchmark*: [text2vec](https://github.com/shibing624/text2vec)
- chinese text matching task:
| Arch | BaseModel | Model | ATEC | BQ | LCQMC | PAWSX | STS-B | SOHU-dd | SOHU-dc | Avg | QPS |
|:-----------|:----------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------|:-----:|:-----:|:-----:|:-----:|:-----:|:-------:|:-------:|:---------:|:-----:|
| Word2Vec | word2vec | [w2v-light-tencent-chinese](https://ai.tencent.com/ailab/nlp/en/download.html) | 20.00 | 31.49 | 59.46 | 2.57 | 55.78 | 55.04 | 20.70 | 35.03 | 23769 |
| SBERT | xlm-roberta-base | [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2) | 18.42 | 38.52 | 63.96 | 10.14 | 78.90 | 63.01 | 52.28 | 46.46 | 3138 |
| Instructor | hfl/chinese-roberta-wwm-ext | [moka-ai/m3e-base](https://huggingface.co/moka-ai/m3e-base) | 41.27 | 63.81 | 74.87 | 12.20 | 76.96 | 75.83 | 60.55 | 57.93 | 2980 |
| CoSENT | hfl/chinese-macbert-base | [shibing624/text2vec-base-chinese](https://huggingface.co/shibing624/text2vec-base-chinese) | 31.93 | 42.67 | 70.16 | 17.21 | 79.30 | 70.27 | 50.42 | 51.61 | 3008 |
| CoSENT | hfl/chinese-lert-large | [GanymedeNil/text2vec-large-chinese](https://huggingface.co/GanymedeNil/text2vec-large-chinese) | 32.61 | 44.59 | 69.30 | 14.51 | 79.44 | 73.01 | 59.04 | 53.12 | 2092 |
| CoSENT | nghuyong/ernie-3.0-base-zh | [shibing624/text2vec-base-chinese-sentence](https://huggingface.co/shibing624/text2vec-base-chinese-sentence) | 43.37 | 61.43 | 73.48 | 38.90 | 78.25 | 70.60 | 53.08 | 59.87 | 3089 |
| CoSENT | nghuyong/ernie-3.0-base-zh | [shibing624/text2vec-base-chinese-paraphrase](https://huggingface.co/shibing624/text2vec-base-chinese-paraphrase) | 44.89 | 63.58 | 74.24 | 40.90 | 78.93 | 76.70 | 63.30 | 63.08 | 3066 |
| CoSENT | sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | [shibing624/text2vec-base-multilingual](https://huggingface.co/shibing624/text2vec-base-multilingual) | 32.39 | 50.33 | 65.64 | 32.56 | 74.45 | 68.88 | 51.17 | 53.67 | 4004 |
说明:
- 结果评测指标:spearman系数
- `shibing624/text2vec-base-chinese`模型,是用CoSENT方法训练,基于`hfl/chinese-macbert-base`在中文STS-B数据训练得到,并在中文STS-B测试集评估达到较好效果,运行[examples/training_sup_text_matching_model.py](https://github.com/shibing624/text2vec/blob/master/examples/training_sup_text_matching_model.py)代码可训练模型,模型文件已经上传HF model hub,中文通用语义匹配任务推荐使用
- `shibing624/text2vec-base-chinese-sentence`模型,是用CoSENT方法训练,基于`nghuyong/ernie-3.0-base-zh`用人工挑选后的中文STS数据集[shibing624/nli-zh-all/text2vec-base-chinese-sentence-dataset](https://huggingface.co/datasets/shibing624/nli-zh-all/tree/main/text2vec-base-chinese-sentence-dataset)训练得到,并在中文各NLI测试集评估达到较好效果,运行[examples/training_sup_text_matching_model_jsonl_data.py](https://github.com/shibing624/text2vec/blob/master/examples/training_sup_text_matching_model_jsonl_data.py)代码可训练模型,模型文件已经上传HF model hub,中文s2s(句子vs句子)语义匹配任务推荐使用
- `shibing624/text2vec-base-chinese-paraphrase`模型,是用CoSENT方法训练,基于`nghuyong/ernie-3.0-base-zh`用人工挑选后的中文STS数据集[shibing624/nli-zh-all/text2vec-base-chinese-paraphrase-dataset](https://huggingface.co/datasets/shibing624/nli-zh-all/tree/main/text2vec-base-chinese-paraphrase-dataset),数据集相对于[shibing624/nli-zh-all/text2vec-base-chinese-sentence-dataset](https://huggingface.co/datasets/shibing624/nli-zh-all/tree/main/text2vec-base-chinese-sentence-dataset)加入了s2p(sentence to paraphrase)数据,强化了其长文本的表征能力,并在中文各NLI测试集评估达到SOTA,运行[examples/training_sup_text_matching_model_jsonl_data.py](https://github.com/shibing624/text2vec/blob/master/examples/training_sup_text_matching_model_jsonl_data.py)代码可训练模型,模型文件已经上传HF model hub,中文s2p(句子vs段落)语义匹配任务推荐使用
- `sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2`模型是用SBERT训练,是`paraphrase-MiniLM-L12-v2`模型的多语言版本,支持中文、英文等
- `w2v-light-tencent-chinese`是腾讯词向量的Word2Vec模型,CPU加载使用,适用于中文字面匹配任务和缺少数据的冷启动情况
## Usage (text2vec)
Using this model becomes easy when you have [text2vec](https://github.com/shibing624/text2vec) installed:
```
pip install -U text2vec
```
Then you can use the model like this:
```python
from text2vec import SentenceModel
sentences = ['如何更换花呗绑定银行卡', '花呗更改绑定银行卡']
model = SentenceModel('shibing624/text2vec-base-chinese')
embeddings = model.encode(sentences)
print(embeddings)
```
## Usage (HuggingFace Transformers)
Without [text2vec](https://github.com/shibing624/text2vec), you can use the model like this:
First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
Install transformers:
```
pip install transformers
```
Then load model and predict:
```python
from transformers import BertTokenizer, BertModel
import torch
# Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] # First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
# Load model from HuggingFace Hub
tokenizer = BertTokenizer.from_pretrained('shibing624/text2vec-base-chinese')
model = BertModel.from_pretrained('shibing624/text2vec-base-chinese')
sentences = ['如何更换花呗绑定银行卡', '花呗更改绑定银行卡']
# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform pooling. In this case, mean pooling.
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
print("Sentence embeddings:")
print(sentence_embeddings)
```
## Usage (sentence-transformers)
[sentence-transformers](https://github.com/UKPLab/sentence-transformers) is a popular library to compute dense vector representations for sentences.
Install sentence-transformers:
```
pip install -U sentence-transformers
```
Then load model and predict:
```python
from sentence_transformers import SentenceTransformer
m = SentenceTransformer("shibing624/text2vec-base-chinese")
sentences = ['如何更换花呗绑定银行卡', '花呗更改绑定银行卡']
sentence_embeddings = m.encode(sentences)
print("Sentence embeddings:")
print(sentence_embeddings)
```
## Full Model Architecture
```
CoSENT(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_mean_tokens': True})
)
```
## Intended uses
Our model is intented to be used as a sentence and short paragraph encoder. Given an input text, it ouptuts a vector which captures
the semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.
By default, input text longer than 256 word pieces is truncated.
## Training procedure
### Pre-training
We use the pretrained [`hfl/chinese-macbert-base`](https://huggingface.co/hfl/chinese-macbert-base) model.
Please refer to the model card for more detailed information about the pre-training procedure.
### Fine-tuning
We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each
possible sentence pairs from the batch.
We then apply the rank loss by comparing with true pairs and false pairs.
#### Hyper parameters
- training dataset: https://huggingface.co/datasets/shibing624/nli_zh
- max_seq_length: 128
- best epoch: 5
- sentence embedding dim: 768
## Citing & Authors
This model was trained by [text2vec](https://github.com/shibing624/text2vec).
If you find this model helpful, feel free to cite:
```bibtex
@software{text2vec,
author = {Xu Ming},
title = {text2vec: A Tool for Text to Vector},
year = {2022},
url = {https://github.com/shibing624/text2vec},
}
``` | [
-0.09042555093765259,
-0.786501944065094,
0.31972551345825195,
0.4172061085700989,
-0.31662964820861816,
-0.47093871235847473,
-0.2835773229598999,
-0.18274708092212677,
0.09688406437635422,
0.41482487320899963,
-0.42954006791114807,
-0.5778605937957764,
-0.575556755065918,
0.11145289242267609,
-0.0983661636710167,
0.8634085059165955,
-0.2842107117176056,
0.22282850742340088,
-0.131127268075943,
-0.3918493092060089,
-0.5181392431259155,
-0.4285374879837036,
-0.5740619897842407,
-0.18816839158535004,
0.14455676078796387,
0.3273305296897888,
0.6949889063835144,
0.5247365236282349,
0.46987834572792053,
0.2772882282733917,
-0.05921897664666176,
0.21988779306411743,
-0.2900201082229614,
-0.07680070400238037,
0.038468025624752045,
-0.5979987978935242,
-0.08489952981472015,
0.011452374048531055,
0.5161275267601013,
0.26776689291000366,
0.06388146430253983,
-0.061037156730890274,
0.3578963279724121,
0.5940370559692383,
-0.36477574706077576,
0.33809638023376465,
-0.5290027260780334,
-0.005425401963293552,
-0.14397813379764557,
-0.09722984582185745,
-0.3807743191719055,
-0.21695972979068756,
0.15051323175430298,
-0.5654929876327515,
0.0684276670217514,
0.16792859137058258,
1.2938358783721924,
0.1597234606742859,
-0.3364278972148895,
-0.49978283047676086,
-0.20325122773647308,
0.9701586961746216,
-0.8972548842430115,
0.2109045684337616,
0.5506706237792969,
-0.0369558148086071,
0.034224946051836014,
-0.823422908782959,
-0.7350935935974121,
-0.06038711592555046,
-0.5645093321800232,
0.41234833002090454,
-0.041792161762714386,
-0.19114404916763306,
0.12151345610618591,
0.11249011009931564,
-0.8175725936889648,
-0.25665608048439026,
-0.4016852080821991,
-0.18434622883796692,
0.5388023257255554,
0.05733462795615196,
0.609405517578125,
-0.6826298832893372,
-0.5403875112533569,
-0.3398733139038086,
-0.4427461624145508,
0.31379976868629456,
-0.052968207746744156,
0.16787993907928467,
-0.5657200217247009,
0.7327420711517334,
0.029198626056313515,
0.4520764946937561,
-0.12440584599971771,
0.019920457154512405,
0.6250268816947937,
-0.7164643406867981,
-0.0839652270078659,
-0.286197304725647,
1.3166813850402832,
0.6609839797019958,
0.2734907865524292,
0.03039267472922802,
-0.07602390646934509,
0.01083124428987503,
-0.3372218906879425,
-0.7133670449256897,
-0.3288933038711548,
0.3520890474319458,
-0.6256619691848755,
-0.1716204732656479,
0.19734808802604675,
-0.9022027254104614,
-0.029764821752905846,
0.0019819012377411127,
0.5033611059188843,
-0.8020592331886292,
-0.11303636431694031,
0.12991191446781158,
-0.4405815601348877,
0.4914030432701111,
-0.13702790439128876,
-0.7984240651130676,
0.13883662223815918,
0.563524603843689,
1.1453999280929565,
-0.04985625296831131,
-0.45346489548683167,
-0.3534829318523407,
0.07269939035177231,
-0.29210424423217773,
0.507964015007019,
-0.2770277261734009,
-0.15537922084331512,
0.1989557445049286,
0.1757161021232605,
-0.3419158160686493,
-0.37589389085769653,
0.7696506381034851,
-0.09709107130765915,
0.7066521644592285,
-0.44765037298202515,
-0.5788871645927429,
-0.055185526609420776,
0.09801295399665833,
-0.5326095223426819,
1.388169288635254,
0.0965811088681221,
-1.2053762674331665,
-0.04584183171391487,
-0.35318222641944885,
-0.45044204592704773,
-0.11882451921701431,
-0.21086092293262482,
-0.6104159355163574,
-0.19462932646274567,
0.4495869576931,
0.6549068093299866,
-0.19546128809452057,
0.04516850411891937,
-0.005087053868919611,
-0.33612388372421265,
0.2224278748035431,
-0.15822279453277588,
1.1232205629348755,
0.14188669621944427,
-0.5089296698570251,
0.039189863950014114,
-0.6135398745536804,
0.0763755664229393,
0.3034726679325104,
-0.24445952475070953,
-0.47777485847473145,
-0.05259271338582039,
0.3756914734840393,
0.5010277032852173,
0.4500722885131836,
-0.38593339920043945,
-0.18484629690647125,
-0.6859784722328186,
0.8083472847938538,
0.5058178901672363,
0.06333250552415848,
0.4619242548942566,
-0.4006796181201935,
0.13758474588394165,
0.06961537897586823,
-0.01874006725847721,
-0.21166469156742096,
-0.7561561465263367,
-0.964866578578949,
-0.07065016031265259,
0.22811350226402283,
0.9693323969841003,
-1.1732547283172607,
0.8798992037773132,
-0.38314634561538696,
-0.5552923083305359,
-0.6699272990226746,
0.09463473409414291,
0.5164927244186401,
0.33191046118736267,
0.7885280251502991,
0.29876577854156494,
-0.5128631591796875,
-0.8415880799293518,
-0.30572786927223206,
-0.29707881808280945,
-0.07586464285850525,
0.3758261501789093,
0.6431326866149902,
-0.20416447520256042,
0.7103889584541321,
-0.48394834995269775,
-0.5314283967018127,
-0.6067439317703247,
0.028078529983758926,
0.19405564665794373,
0.5331575274467468,
0.6233910918235779,
-0.9421812295913696,
-0.7360300421714783,
-0.1615183800458908,
-0.9988328814506531,
0.09208553284406662,
-0.36296361684799194,
-0.3926309049129486,
0.20014429092407227,
0.6440014243125916,
-0.6012189388275146,
0.35003727674484253,
0.7436875700950623,
-0.46356651186943054,
0.3129136860370636,
-0.5093829035758972,
0.09124995768070221,
-1.554763913154602,
0.0763707384467125,
0.18013691902160645,
-0.04494563862681389,
-0.6106323003768921,
0.12589576840400696,
0.27713218331336975,
0.20214122533798218,
-0.4676280617713928,
0.6090388894081116,
-0.5894332528114319,
0.4424692392349243,
-0.06929200887680054,
0.48909106850624084,
0.06519637256860733,
0.7125756740570068,
0.1568833887577057,
0.7969716191291809,
0.3853875696659088,
-0.6204099655151367,
0.28953492641448975,
0.6936823129653931,
-0.4710293114185333,
0.180214524269104,
-0.854484498500824,
-0.12784551084041595,
0.0451371930539608,
0.2666717767715454,
-1.2631007432937622,
-0.04658965766429901,
0.5369513630867004,
-0.7487314343452454,
-0.022797459736466408,
0.32351037859916687,
-0.4207454323768616,
-0.5601779818534851,
-0.7512586116790771,
0.1775214523077011,
0.7055433988571167,
-0.5356197357177734,
0.4621955454349518,
0.16670189797878265,
-0.09121358394622803,
-0.5934398770332336,
-1.1865354776382446,
0.13321217894554138,
-0.03858806937932968,
-0.8364728093147278,
0.5262660384178162,
-0.08576873689889908,
0.14646762609481812,
0.0032131134066730738,
0.2900089919567108,
-0.09899777173995972,
-0.12428543716669083,
-0.03518279269337654,
0.3318752646446228,
-0.0685354694724083,
-0.0864097997546196,
0.18918292224407196,
-0.024533091112971306,
-0.08790162205696106,
0.08960166573524475,
0.6473104953765869,
0.03853999450802803,
0.002155137248337269,
-0.6987482905387878,
0.34506237506866455,
0.2784346640110016,
-0.22729326784610748,
0.9415179491043091,
0.8745225667953491,
-0.4208435118198395,
0.1279957890510559,
-0.39113175868988037,
-0.08075986057519913,
-0.49126121401786804,
0.6344954371452332,
-0.4921461045742035,
-0.8816688060760498,
0.4106315076351166,
0.33274900913238525,
0.1896146982908249,
0.8992332816123962,
0.7700262665748596,
-0.038081686943769455,
0.8909269571304321,
0.37525659799575806,
-0.15657418966293335,
0.4376503527164459,
-0.3599267601966858,
0.13264335691928864,
-0.9126711487770081,
-0.411516934633255,
-0.48131364583969116,
-0.10785237699747086,
-0.6853564381599426,
-0.7451401948928833,
0.25730061531066895,
0.12296882271766663,
0.019924025982618332,
0.7479694485664368,
-0.5898247957229614,
0.03551724553108215,
0.5340597629547119,
0.23632140457630157,
-0.11932555586099625,
-0.0019238454988226295,
-0.42018747329711914,
-0.24413679540157318,
-0.5646271705627441,
-0.5136691331863403,
0.8758576512336731,
0.5083178281784058,
0.4110579490661621,
-0.030199047178030014,
0.4943372309207916,
-0.0004247943579684943,
-0.22790881991386414,
-0.6270607113838196,
0.6201874613761902,
-0.3440043330192566,
-0.45276373624801636,
-0.3584947884082794,
-0.38943934440612793,
-0.90130615234375,
0.3290632963180542,
-0.2323465794324875,
-0.7551436424255371,
0.09231211245059967,
-0.1420321762561798,
-0.3278954327106476,
0.14458221197128296,
-0.6670503616333008,
0.9691252112388611,
-0.15896238386631012,
-0.2879790961742401,
-0.06498390436172485,
-0.873092532157898,
0.2986585199832916,
0.2335163652896881,
0.29439809918403625,
-0.00983172282576561,
-0.19765512645244598,
1.0258758068084717,
-0.48325812816619873,
0.5960093140602112,
-0.1529713273048401,
-0.0071035949513316154,
0.5637477040290833,
-0.24004234373569489,
0.6847438812255859,
0.03678438812494278,
-0.09394457191228867,
0.23423728346824646,
0.21056875586509705,
-0.44090718030929565,
-0.47707435488700867,
0.7205541133880615,
-0.8578053712844849,
-0.32680919766426086,
-0.5740466713905334,
-0.2906435430049896,
0.06413295120000839,
0.1345500349998474,
0.6928408145904541,
0.20893731713294983,
-0.15871544182300568,
0.49926719069480896,
0.5582827925682068,
-0.5506751537322998,
0.5361985564231873,
0.12234680354595184,
0.12869858741760254,
-0.6824145317077637,
0.9516897797584534,
0.04086936265230179,
0.11920157074928284,
0.7442253232002258,
0.2994207441806793,
-0.36036214232444763,
-0.4303167164325714,
-0.31331250071525574,
0.5151371955871582,
-0.4762255847454071,
-0.01821139082312584,
-1.1135135889053345,
-0.3819080889225006,
-0.7727825045585632,
0.004218447487801313,
-0.1413191258907318,
-0.33999526500701904,
-0.46665865182876587,
-0.06772422790527344,
0.3114187717437744,
0.4479007124900818,
0.10398371517658234,
0.26701322197914124,
-0.7853708267211914,
0.4025687873363495,
-0.012493365444242954,
-0.14080961048603058,
-0.20800693333148956,
-0.720113217830658,
-0.4824162423610687,
0.14617611467838287,
-0.2136356383562088,
-0.8464362621307373,
0.6216543316841125,
0.21846315264701843,
0.5005882382392883,
0.22505275905132294,
0.05297316238284111,
0.5335494875907898,
-0.6635953783988953,
1.2505265474319458,
0.39089885354042053,
-1.017350196838379,
0.4717262387275696,
-0.15861041843891144,
0.22864395380020142,
0.50498366355896,
0.33834412693977356,
-0.9282906651496887,
-0.37363529205322266,
-0.3822762966156006,
-1.1053146123886108,
0.7768689393997192,
0.4355246126651764,
0.3841424584388733,
-0.16748206317424774,
0.5412389039993286,
-0.18752047419548035,
-0.08380629122257233,
-0.9386632442474365,
-0.5673487186431885,
-0.38278207182884216,
-0.7468242049217224,
-0.12817533314228058,
-0.4896780848503113,
0.1330978125333786,
-0.3768889009952545,
0.7540530562400818,
-0.005689176730811596,
0.6624985933303833,
0.39747607707977295,
-0.16134397685527802,
0.20798271894454956,
0.047609686851501465,
0.5645122528076172,
0.2702274024486542,
0.039206892251968384,
-0.020806001499295235,
0.49461016058921814,
-0.5434271693229675,
-0.056083884090185165,
0.1148783415555954,
-0.34605517983436584,
0.22764435410499573,
0.6781114339828491,
0.9020006060600281,
0.2469710111618042,
-0.699913740158081,
0.9187250733375549,
-0.19504989683628082,
-0.5269184112548828,
-0.38318687677383423,
-0.020802993327379227,
0.3786299526691437,
0.21519388258457184,
0.20000587403774261,
-0.1296294927597046,
0.046097248792648315,
-0.3804745078086853,
0.2806399166584015,
0.3484347462654114,
-0.5205457210540771,
-0.2321447730064392,
0.8416129946708679,
0.06535317748785019,
-0.08580636978149414,
0.5947057008743286,
-0.07495752722024918,
-0.7622312903404236,
0.49130380153656006,
0.40996721386909485,
0.8050457239151001,
-0.10920689254999161,
0.18999285995960236,
0.7757524847984314,
0.3630825877189636,
-0.3177962005138397,
0.1735597848892212,
0.2785796821117401,
-0.7301572561264038,
-0.027489764615893364,
-0.4528246521949768,
0.10179013013839722,
0.1542426198720932,
-0.5177516937255859,
0.5114592909812927,
-0.3751195967197418,
0.02386428974568844,
-0.1126115694642067,
0.07472935318946838,
-0.49679291248321533,
0.21373872458934784,
0.0651639997959137,
0.9689176678657532,
-0.9035024046897888,
1.0127614736557007,
0.5916959643363953,
-0.6110295057296753,
-0.8145216703414917,
0.24858179688453674,
-0.2698737680912018,
-0.9576093554496765,
0.46928870677948,
0.2651234269142151,
0.20397131145000458,
-0.17926563322544098,
-0.44574791193008423,
-0.7348151206970215,
1.3015806674957275,
-0.06418774276971817,
-0.41715508699417114,
-0.32850852608680725,
0.17411665618419647,
0.6996275186538696,
-0.2046053260564804,
0.4667971432209015,
0.5500726699829102,
0.5046704411506653,
0.094741091132164,
-0.6376882195472717,
0.37692683935165405,
-0.33226609230041504,
0.2129327803850174,
-0.324584424495697,
-1.0862010717391968,
1.1358823776245117,
-0.13330543041229248,
-0.15081317722797394,
0.43917274475097656,
1.003464698791504,
0.2321673184633255,
0.11844328790903091,
0.427273690700531,
0.44957277178764343,
0.5072862505912781,
-0.08999811112880707,
0.9652954936027527,
-0.38782572746276855,
0.6705256700515747,
0.8096912503242493,
0.11688864976167679,
1.1811058521270752,
0.39515039324760437,
-0.26986822485923767,
0.5291834473609924,
0.5995028018951416,
-0.18798410892486572,
0.7646273374557495,
-0.06976563483476639,
-0.04257155954837799,
-0.08637771755456924,
0.13049177825450897,
-0.36923688650131226,
0.27036231756210327,
0.20960640907287598,
-0.4274652898311615,
0.1234009712934494,
-0.04912028834223747,
0.4388500154018402,
0.2463923543691635,
0.09769856184720993,
0.7665922045707703,
0.18985584378242493,
-0.7587900161743164,
0.624372661113739,
0.4228192865848541,
1.1083195209503174,
-0.550615131855011,
0.13781562447547913,
-0.011040940880775452,
0.3199973404407501,
-0.1457255333662033,
-0.8655683398246765,
0.23460443317890167,
-0.16867026686668396,
-0.06250851601362228,
-0.07385498285293579,
0.6011385917663574,
-0.8123185038566589,
-0.5442535281181335,
0.6246219873428345,
0.409714937210083,
0.09660106897354126,
-0.0203767791390419,
-1.3056999444961548,
-0.06733828783035278,
0.40862444043159485,
-0.5267119407653809,
0.24606631696224213,
0.5718491673469543,
0.10889976471662521,
0.49476101994514465,
0.4184989929199219,
-0.0835120901465416,
0.03680514916777611,
-0.015535914339125156,
0.719903826713562,
-0.783519983291626,
-0.48212674260139465,
-1.0893216133117676,
0.5144293308258057,
-0.2555132508277893,
-0.45610496401786804,
0.9972769021987915,
0.7361117601394653,
0.6902405023574829,
-0.054910171777009964,
1.0261645317077637,
-0.16624052822589874,
0.6593958139419556,
-0.6369031071662903,
0.8075351715087891,
-0.7332728505134583,
-0.09534446895122528,
-0.37742194533348083,
-0.5808162689208984,
-0.21742592751979828,
0.9098128080368042,
-0.2584574222564697,
0.025401638820767403,
1.0425888299942017,
0.827355146408081,
0.27456310391426086,
-0.1792140156030655,
0.09920282661914825,
0.28340134024620056,
0.3621024787425995,
0.9125901460647583,
0.423250287771225,
-1.1315110921859741,
0.9308736324310303,
-0.37423768639564514,
-0.17322008311748505,
-0.23026718199253082,
-0.48953115940093994,
-1.2104209661483765,
-0.965196967124939,
-0.38215410709381104,
-0.7308514714241028,
-0.051412150263786316,
0.9339757561683655,
0.22635649144649506,
-0.9620063900947571,
-0.14735637605190277,
-0.16572868824005127,
-0.0520038940012455,
-0.2891849875450134,
-0.27859461307525635,
0.7464212775230408,
-0.3784511387348175,
-0.98990797996521,
0.051447734236717224,
0.057663414627313614,
0.021349932998418808,
-0.019916966557502747,
-0.25586599111557007,
-0.648927628993988,
0.16231025755405426,
0.5013168454170227,
-0.016659429296851158,
-0.7010793089866638,
-0.2871544063091278,
0.22472281754016876,
-0.6207618117332458,
0.07927891612052917,
0.5082762837409973,
-0.37302345037460327,
0.16151945292949677,
0.7891722917556763,
0.41431719064712524,
0.44902101159095764,
-0.04586121439933777,
0.4049278199672699,
-0.5422371625900269,
0.37190040946006775,
-0.023491721600294113,
0.48806479573249817,
0.409078985452652,
-0.39692655205726624,
0.49035051465034485,
0.4722420871257782,
-0.4528632164001465,
-0.5465437769889832,
-0.2778880000114441,
-1.1606806516647339,
-0.4946500062942505,
1.6131168603897095,
-0.3903598487377167,
-0.4673599600791931,
0.0728011354804039,
-0.5385516881942749,
0.5922950506210327,
-0.3034554123878479,
0.3844740390777588,
0.8731086254119873,
0.18913251161575317,
-0.14779680967330933,
-0.5492036938667297,
0.5454511046409607,
0.5402150750160217,
-0.7112910747528076,
0.1593317687511444,
0.07697227597236633,
0.37360307574272156,
0.06983043253421783,
0.6580044031143188,
-0.10416111350059509,
0.03585369139909744,
-0.03907010704278946,
0.008547795005142689,
0.1528383195400238,
0.15299159288406372,
-0.17370621860027313,
-0.018361248075962067,
-0.35247382521629333,
-0.37356558442115784
] |
bigscience/bloom-560m | bigscience | "2023-09-26T09:16:49Z" | 1,241,498 | 285 | transformers | [
"transformers",
"pytorch",
"jax",
"onnx",
"safetensors",
"bloom",
"text-generation",
"ak",
"ar",
"as",
"bm",
"bn",
"ca",
"code",
"en",
"es",
"eu",
"fon",
"fr",
"gu",
"hi",
"id",
"ig",
"ki",
"kn",
"lg",
"ln",
"ml",
"mr",
"ne",
"nso",
"ny",
"or",
"pa",
"pt",
"rn",
"rw",
"sn",
"st",
"sw",
"ta",
"te",
"tn",
"ts",
"tum",
"tw",
"ur",
"vi",
"wo",
"xh",
"yo",
"zh",
"zhs",
"zht",
"zu",
"arxiv:1909.08053",
"arxiv:2110.02861",
"arxiv:2108.12409",
"license:bigscience-bloom-rail-1.0",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text-generation | "2022-05-19T11:51:24Z" | ---
license: bigscience-bloom-rail-1.0
language:
- ak
- ar
- as
- bm
- bn
- ca
- code
- en
- es
- eu
- fon
- fr
- gu
- hi
- id
- ig
- ki
- kn
- lg
- ln
- ml
- mr
- ne
- nso
- ny
- or
- pa
- pt
- rn
- rw
- sn
- st
- sw
- ta
- te
- tn
- ts
- tum
- tw
- ur
- vi
- wo
- xh
- yo
- zh
- zhs
- zht
- zu
pipeline_tag: text-generation
---
<h1 style='text-align: center '>BLOOM LM</h1>
<h2 style='text-align: center '><em>BigScience Large Open-science Open-access Multilingual Language Model</em> </h2>
<h3 style='text-align: center '>Model Card</h3>
<img src="https://s3.amazonaws.com/moonup/production/uploads/1657124309515-5f17f0a0925b9863e28ad517.png" alt="BigScience Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
Version 1.0 / 26.May.2022
# Model Card for Bloom-560m
<!-- Provide a quick summary of what the model is/does. -->
## Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
4. [Recommendations](#recommendations)
5. [Training Data](#training-data)
6. [Evaluation](#evaluation)
7. [Environmental Impact](#environmental-impact)
8. [Technical Specifications](#techincal-specifications)
9. [Citation](#citation)
10. [Glossary and Calculations](#glossary-and-calculations)
11. [More Information](#more-information)
12. [Model Card Authors](#model-card-authors)
13. [Model Card Contact](#model-card-contact)
## Model Details
### Model Description
*This section provides information for anyone who wants to know about the model.*
- **Developed by:** BigScience ([website](https://bigscience.huggingface.co))
* All collaborators are either volunteers or have an agreement with their employer. *(Further breakdown of participants forthcoming.)*
- **Model Type:** Transformer-based Language Model
- **Version:** 1.0.0
- **Languages:** Multiple; see [training data](#training-data)
- **License:** RAIL License v1.0 ([link](https://huggingface.co/spaces/bigscience/license))
- **Release Date Estimate:** Monday, 11.July.2022
- **Funded by:**
* The French government.
* Hugging Face ([website](https://huggingface.co)).
* Organizations of contributors. *(Further breakdown of organizations forthcoming.)*
## Uses
*This section addresses questions around how the model is intended to be used, discusses the foreseeable users of the model (including those affected by the model), and describes uses that are considered out of scope or misuse of the model.
It provides information for anyone considering using the model or who is affected by the model.*
### Intended Use
This model is being created in order to enable public research on large language models (LLMs). LLMs are intended to be used for language generation or as a pretrained base model that can be further fine-tuned for specific tasks. Use cases below are not exhaustive.
#### **Direct Use**
- Text generation
- Exploring characteristics of language generated by a language model
- Examples: Cloze tests, counterfactuals, generations with reframings
#### **Downstream Use**
- Tasks that leverage language models include: Information Extraction, Question Answering, Summarization
### Misuse and Out-of-scope Use
*This section addresses what users ought not do with the model.*
See the [BLOOM License](https://huggingface.co/spaces/bigscience/license), Attachment A, for detailed usage restrictions. The below list is non-exhaustive, but lists some easily foreseeable problematic use cases.
#### **Out-of-scope Uses**
Using the model in [high-stakes](#high-stakes) settings is out of scope for this model. The model is not designed for [critical decisions](#critical-decisions) nor uses with any material consequences on an individual's livelihood or wellbeing. The model outputs content that appears factual but is not correct.
##### Out-of-scope Uses Include:
- Usage in biomedical domains, political and legal domains, or finance domains
- Usage for evaluating or scoring individuals, such as for employment, education, or credit
- Applying the model for critical automatic decisions, generating factual content, creating reliable summaries, or generating predictions that must be correct
#### **Misuse**
Intentionally using the model for harm, violating [human rights](#human-rights), or other kinds of malicious activities, is a misuse of this model. This includes:
- Spam generation
- Disinformation and influence operations
- Disparagement and defamation
- Harassment and abuse
- [Deception](#deception)
- Unconsented impersonation and imitation
- Unconsented surveillance
- Generating content without attribution to the model, as specified in the [RAIL License, Use Restrictions](https://huggingface.co/spaces/bigscience/license)
### Intended Users
#### **Direct Users**
- General Public
- Researchers
- Students
- Educators
- Engineers/developers
- Non-commercial entities
- Community advocates, including human and civil rights groups
#### Indirect Users
- Users of derivatives created by Direct Users, such as those using software with an [intended use](#intended-use)
- Users of [Derivatives of the Model, as described in the License](https://huggingface.co/spaces/bigscience/license)
#### Others Affected (Parties Prenantes)
- People and groups referred to by the LLM
- People and groups exposed to outputs of, or decisions based on, the LLM
- People and groups whose original work is included in the LLM
## Bias, Risks and Limitations
*This section identifies foreseeable harms and misunderstandings.*
Model may:
- Overrepresent some viewpoints and underrepresent others
- Contain stereotypes
- Contain [personal information](#personal-data-and-information)
- Generate:
- Hateful, abusive, or violent language
- Discriminatory or prejudicial language
- Content that may not be appropriate for all settings, including sexual content
- Make errors, including producing incorrect information as if it were factual
- Generate irrelevant or repetitive outputs
### Recommendations
*This section provides information on warnings and potential mitigations.*
- Indirect users should be made aware when the content they're working with is created by the LLM.
- Users should be aware of [Risks and Limitations](#risks-and-limitations), and include an appropriate age disclaimer or blocking interface as necessary.
- Models pretrained with the LLM should include an updated Model Card.
- Users of the model should provide mechanisms for those affected to provide feedback, such as an email address for comments.
## Training Data
*This section provides a high-level overview of the training data. It is relevant for anyone who wants to know the basics of what the model is learning.*
Details for each dataset are provided in individual [Data Cards](https://huggingface.co/spaces/bigscience/BigScienceCorpus).
Training data includes:
- 45 natural languages
- 12 programming languages
- In 1.5TB of pre-processed text, converted into 350B unique tokens (see [the tokenizer section](#tokenization) for more.)
#### **Languages**
The pie chart shows the distribution of languages in training data.
![pie chart showing the distribution of languages in training data](https://github.com/bigscience-workshop/model_card/blob/main/assets/data/pie_chart.svg?raw=true)
**The following table shows the further distribution of Niger-Congo and Indic languages in the training data.**
| Niger Congo | Percentage | | Indic | Percentage |
|----------------|------------ |------ |-----------|------------|
| Chi Tumbuka | 0.00002 | | Assamese | 0.01 |
| Kikuyu | 0.00004 | | Odia | 0.04 |
| Bambara | 0.00004 | | Gujarati | 0.04 |
| Akan | 0.00007 | | Marathi | 0.05 |
| Xitsonga | 0.00007 | | Punjabi | 0.05 |
| Sesotho | 0.00007 | | Kannada | 0.06 |
| Chi Chewa | 0.0001 | | Nepali | 0.07 |
| Setswana | 0.0002 | | Telugu | 0.09 |
| Northern Sotho | 0.0002 | | Malayalam | 0.10 |
| Fon | 0.0002 | | Urdu | 0.10 |
| Kirundi | 0.0003 | | Tamil | 0.20 |
| Wolof | 0.0004 | | Bengali | 0.50 |
| Kuganda | 0.0004 | | Hindi | 0.70 |
| Chi Shona | 0.001 |
| Isi Zulu | 0.001 |
| Igbo | 0.001 |
| Xhosa | 0.001 |
| Kinyarwanda | 0.003 |
| Yoruba | 0.006 |
| Swahili | 0.02 |
**The following table shows the distribution of programming languages.**
| Extension | Language | Number of files |
|----------------|------------|-----------------|
| java | Java | 5,407,724 |
| php | PHP | 4,942,186 |
| cpp | C++ | 2,503,930 |
| py | Python | 2,435,072 |
| js | JavaScript | 1,905,518 |
| cs | C# | 1,577,347 |
| rb | Ruby | 6,78,413 |
| cc | C++ | 443,054 |
| hpp | C++ | 391,048 |
| lua | Lua | 352,317 |
| go | GO | 227,763 |
| ts | TypeScript | 195,254 |
| C | C | 134,537 |
| scala | Scala | 92,052 |
| hh | C++ | 67,161 |
| H | C++ | 55,899 |
| tsx | TypeScript | 33,107 |
| rs | Rust | 29,693 |
| phpt | PHP | 9,702 |
| c++ | C++ | 1,342 |
| h++ | C++ | 791 |
| php3 | PHP | 540 |
| phps | PHP | 270 |
| php5 | PHP | 166 |
| php4 | PHP | 29 |
## Evaluation
*This section describes the evaluation protocols and provides the results.*
### Metrics
*This section describes the different ways performance is calculated and why.*
Includes:
| Metric | Why chosen |
|--------------------|--------------------------------------------------------------------|
| [Perplexity](#perplexity) | Standard metric for quantifying model improvements during training |
| Cross Entropy [Loss](#loss) | Standard objective for language models. |
And multiple different metrics for specific tasks. _(More evaluation metrics forthcoming upon completion of evaluation protocol.)_
### Factors
*This section lists some different aspects of what BLOOM models. Its focus is on those aspects that are likely to give rise to high variance in model behavior.*
- Language, such as English or Yoruba
- Domain, such as newswire or stories
- Demographic characteristics, such as gender or nationality
### Results
*Results are based on the [Factors](#factors) and [Metrics](#metrics).*
**Train-time Evaluation:**
As of 25.May.2022, 15:00 PST:
- Training Loss: 2.0
- Validation Loss: 2.2
- Perplexity: 8.9
(More evaluation scores forthcoming at the end of model training.)
## Environmental Impact
The training supercomputer, Jean Zay ([website](http://www.idris.fr/eng/jean-zay/jean-zay-presentation-eng.html)), uses mostly nuclear energy. The heat generated by it is reused for heating campus housing.
**Estimated carbon emissions:** *(Forthcoming upon completion of training.)*
**Estimated electricity usage:** *(Forthcoming upon completion of training.)*
## Technical Specifications
*This section provides information for people who work on model development.*
Please see [the BLOOM training README](https://github.com/bigscience-workshop/bigscience/tree/master/train/tr11-176B-ml#readme) for full details on replicating training.
**Model Architecture:** Modified from Megatron-LM GPT2 (see [paper](https://arxiv.org/abs/1909.08053), [BLOOM Megatron code](https://github.com/bigscience-workshop/Megatron-DeepSpeed)):
* Decoder-only architecture
* Layer normalization applied to word embeddings layer (`StableEmbedding`; see [code](https://github.com/facebookresearch/bitsandbytes), [paper](https://arxiv.org/pdf/2110.02861.pdf))
* ALiBI positional encodings (see [paper](https://arxiv.org/pdf/2108.12409.pdf)), with GeLU activation functions
* 559,214,592 parameters:
* 256,901,120 embedding parameters
* 24 layers, 16 attention heads
* Hidden layers are 1024-dimensional
* Sequence length of 2048 tokens (see [BLOOM tokenizer](https://huggingface.co/bigscience/tokenizer), [tokenizer description](#tokenization))
**Objective Function:** Cross Entropy with mean reduction (see [API documentation](https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html#torch.nn.CrossEntropyLoss)).
**Compute infrastructure:** Jean Zay Public Supercomputer, provided by the French government (see [announcement](https://www.enseignementsup-recherche.gouv.fr/fr/signature-du-marche-d-acquisition-de-l-un-des-supercalculateurs-les-plus-puissants-d-europe-46733)).
* Hardware: 384 A100 80GB GPUs (48 nodes):
* Additional 32 A100 80GB GPUs (4 nodes) in reserve
* 8 GPUs per node Using NVLink 4 inter-gpu connects, 4 OmniPath links
* CPU: AMD
* CPU memory: 512GB per node
* GPU memory: 640GB per node
* Inter-node connect: Omni-Path Architecture (OPA)
* NCCL-communications network: a fully dedicated subnet
* Disc IO network: shared network with other types of nodes
* Software:
* Megatron-DeepSpeed ([Github link](https://github.com/bigscience-workshop/Megatron-DeepSpeed))
* DeepSpeed ([Github link](https://github.com/microsoft/DeepSpeed))
* PyTorch (pytorch-1.11 w/ CUDA-11.5; see [Github link](https://github.com/pytorch/pytorch))
* apex ([Github link](https://github.com/NVIDIA/apex))
### **Training**
Training logs: [Tensorboard link](https://huggingface.co/bigscience/tr11e-350M-logs)
- Training throughput: About 150 TFLOPs per GPU
- Number of epochs: 1 (*current target*)
- Dates:
- Started 11th March, 2022 11:42am PST
- Ended 5th July, 2022
- Estimated cost of training: Equivalent of $2-5M in cloud computing (including preliminary experiments and other model sizes)
- Server training location: Île-de-France, France
### **Tokenization**
The BLOOM tokenizer ([link](https://huggingface.co/bigscience/tokenizer)) is a learned subword tokenizer trained using:
- A byte-level Byte Pair Encoding (BPE) algorithm
- A simple pre-tokenization rule, no normalization
- A vocabulary size of 250,680
It was trained on a subset of a preliminary version of the corpus using alpha-weighting per language.
## Citation
**Cite as:** BigScience, _BigScience Language Open-science Open-access Multilingual (BLOOM) Language Model_. International, May 2021-May 2022
## Glossary and Calculations
*This section defines common terms and how metrics are calculated.*
- <a name="loss">**Loss:**</a> A calculation of the difference between what the model has learned and what the data shows ("groundtruth"). The lower the loss, the better. The training process aims to minimize the loss.
- <a name="perplexity">**Perplexity:**</a> This is based on what the model estimates the probability of new data is. The lower the perplexity, the better. If the model is 100% correct at predicting the next token it will see, then the perplexity is 1. Mathematically this is calculated using entropy.
- <a name="high-stakes">**High-stakes settings:**</a> Such as those identified as "high-risk AI systems" and "unacceptable risk AI systems" in the European Union's proposed [Artificial Intelligence (AI) Act](https://artificialintelligenceact.eu/annexes/).
- <a name="critical-decisions">**Critical decisions:**</a> Such as those defined in [the United States' proposed Algorithmic Accountability Act](https://www.congress.gov/117/bills/s3572/BILLS-117s3572is.pdf).
- <a name="human-rights">**Human rights:**</a> Includes those rights defined in the [Universal Declaration of Human Rights](https://www.un.org/sites/un2.un.org/files/2021/03/udhr.pdf).
- <a name="personal-data-and-information">**Personal Data and Personal Information:**</a> Personal data and information is defined in multiple data protection regulations, such as "[personal data](https://gdpr-info.eu/issues/personal-data/)" in the [European Union's General Data Protection Regulation](https://gdpr-info.eu); and "personal information" in the Republic of South Africa's [Protection of Personal Information Act](https://www.gov.za/sites/default/files/gcis_document/201409/3706726-11act4of2013popi.pdf), The People's Republic of China's [Personal information protection law](http://en.npc.gov.cn.cdurl.cn/2021-12/29/c_694559.htm).
- <a name="sensitive-characteristics">**Sensitive characteristics:**</a> This includes specifically protected categories in human rights (see [UHDR, Article 2](https://www.un.org/sites/un2.un.org/files/2021/03/udhr.pdf)) and personal information regulation (see GDPR, [Article 9; Protection of Personal Information Act, Chapter 1](https://www.gov.za/sites/default/files/gcis_document/201409/3706726-11act4of2013popi.pdf))
- <a name="deception">**Deception:**</a> Doing something to intentionally mislead individuals to believe something that is false, such as by creating deadbots or chatbots on social media posing as real people, or generating text documents without making consumers aware that the text is machine generated.
## More Information
### Dataset Creation
Blog post detailing the design choices during the dataset creation: https://bigscience.huggingface.co/blog/building-a-tb-scale-multilingual-dataset-for-language-modeling
### Technical Specifications
Blog post summarizing how the architecture, size, shape, and pre-training duration where selected: https://bigscience.huggingface.co/blog/what-language-model-to-train-if-you-have-two-million-gpu-hours
More details on the architecture/optimizer: https://github.com/bigscience-workshop/bigscience/tree/master/train/tr11-176B-ml
Blog post on the hardware/engineering side: https://bigscience.huggingface.co/blog/which-hardware-to-train-a-176b-parameters-model
Details on the distributed setup used for the training: https://github.com/bigscience-workshop/bigscience/tree/master/train/tr11-176B-ml
Tensorboard updated during the training: https://huggingface.co/bigscience/tr11-176B-ml-logs/tensorboard#scalars&tagFilter=loss
Insights on how to approach training, negative results: https://github.com/bigscience-workshop/bigscience/blob/master/train/lessons-learned.md
Details on the obstacles overcome during the preparation on the engineering side (instabilities, optimization of training throughput, so many technical tricks and questions): https://github.com/bigscience-workshop/bigscience/blob/master/train/tr11-176B-ml/chronicles.md
### Initial Results
Initial prompting experiments using interim checkpoints: https://huggingface.co/spaces/bigscience/bloom-book
## Model Card Authors
*Ordered roughly chronologically and by amount of time spent.*
Margaret Mitchell, Giada Pistilli, Yacine Jernite, Ezinwanne Ozoani, Marissa Gerchick, Nazneen Rajani, Sasha Luccioni, Irene Solaiman, Maraim Masoud, Somaieh Nikpoor, Carlos Muñoz Ferrandis, Stas Bekman, Christopher Akiki, Danish Contractor, David Lansky, Angelina McMillan-Major, Tristan Thrush, Suzana Ilić, Gérard Dupont, Shayne Longpre, Manan Dey, Stella Biderman, Douwe Kiela, Emi Baylor, Teven Le Scao, Aaron Gokaslan, Julien Launay, Niklas Muennighoff
## Model Card Contact
**Send Questions to:** [email protected] | [
-0.2479514479637146,
-0.5836013555526733,
0.4350180923938751,
0.27048131823539734,
-0.12169936299324036,
-0.24183975160121918,
-0.5098379850387573,
-0.5694324970245361,
0.07920429110527039,
0.5146728157997131,
-0.444816529750824,
-0.6907485127449036,
-0.6505861282348633,
0.04708753898739815,
-0.3533150255680084,
1.0688599348068237,
0.005180194042623043,
0.20310045778751373,
-0.14402242004871368,
-0.0458342507481575,
-0.19030864536762238,
-0.661781907081604,
-0.39804285764694214,
-0.25493085384368896,
0.5902377367019653,
0.34713995456695557,
0.5646503567695618,
0.5656951069831848,
0.6076205372810364,
0.2282569855451584,
-0.38719508051872253,
-0.2526411712169647,
-0.5709872245788574,
-0.36342552304267883,
-0.2055477797985077,
-0.32121989130973816,
-0.6514344215393066,
0.14502735435962677,
0.8527806401252747,
0.8502396941184998,
-0.17029574513435364,
0.3199302852153778,
-0.00670836353674531,
0.5333489179611206,
-0.40951308608055115,
0.36052384972572327,
-0.33945798873901367,
0.06710600852966309,
-0.2475922852754593,
0.31558266282081604,
-0.32526126503944397,
-0.21996890008449554,
-0.025252612307667732,
-0.5072774887084961,
-0.03133605048060417,
0.0870094746351242,
0.8969874978065491,
0.05222419649362564,
-0.24273449182510376,
-0.11578585207462311,
-0.7264257073402405,
0.8672472238540649,
-0.8858020305633545,
0.5821546316146851,
0.5598681569099426,
0.22492729127407074,
0.0057947710156440735,
-0.6630015969276428,
-0.7166788578033447,
-0.29235315322875977,
0.024974927306175232,
0.2794131934642792,
-0.16644448041915894,
0.019579235464334488,
0.4863194525241852,
0.5738528966903687,
-0.5444260239601135,
0.24037471413612366,
-0.6235806345939636,
-0.09113111346960068,
0.8501105308532715,
0.005376093555241823,
0.26709985733032227,
-0.17668962478637695,
-0.22906021773815155,
-0.29362472891807556,
-0.8230783939361572,
-0.08164456486701965,
0.4097762703895569,
0.5156393647193909,
-0.5769485831260681,
0.8246371746063232,
0.1711873561143875,
0.4927157163619995,
-0.2669064402580261,
-0.2040543407201767,
0.6056912541389465,
-0.5300526022911072,
-0.3373258411884308,
-0.2827688157558441,
0.9472969174385071,
0.29303377866744995,
0.044413063675165176,
-0.006538468413054943,
-0.08223531395196915,
-0.2495592087507248,
-0.06470927596092224,
-0.8012548089027405,
-0.043089933693408966,
0.16751882433891296,
-0.3509557545185089,
-0.13164176046848297,
-0.06136181950569153,
-0.9320343136787415,
-0.15645436942577362,
-0.33577704429626465,
0.16888345777988434,
-0.407569944858551,
-0.5961839556694031,
0.14286601543426514,
0.02626422606408596,
0.17289602756500244,
0.003809307934716344,
-0.75900799036026,
0.2703399658203125,
0.3502865731716156,
0.8799027800559998,
-0.2135455161333084,
-0.4345186650753021,
0.0716884434223175,
0.13438737392425537,
-0.10005705803632736,
0.30428630113601685,
-0.33405372500419617,
-0.6623117923736572,
0.028121868148446083,
0.27031925320625305,
-0.01930251717567444,
-0.40941640734672546,
0.46538621187210083,
-0.2259904146194458,
0.44184860587120056,
-0.3482787311077118,
-0.5923888683319092,
-0.03072749637067318,
0.03520604968070984,
-0.6985160112380981,
1.1557247638702393,
0.21727867424488068,
-0.7348655462265015,
0.27248919010162354,
-0.9298898577690125,
-0.18211448192596436,
-0.020866725593805313,
-0.026283256709575653,
-0.5206794142723083,
-0.2728903889656067,
-0.08537545800209045,
0.3619881570339203,
-0.24076402187347412,
0.5456359386444092,
-0.2624856233596802,
-0.01023327000439167,
0.10289499908685684,
-0.23518210649490356,
1.0143544673919678,
0.26136183738708496,
-0.2781441807746887,
0.09532878547906876,
-0.7410521507263184,
-0.32108065485954285,
0.3569180965423584,
-0.46098247170448303,
-0.09407389909029007,
-0.10650081187486649,
0.42373234033584595,
0.3310636281967163,
0.14476965367794037,
-0.6366373300552368,
0.298692911863327,
-0.5928065776824951,
0.4731733798980713,
0.5537483096122742,
-0.09708429127931595,
0.4149920642375946,
-0.29357969760894775,
0.5225666761398315,
0.2565237283706665,
0.23760958015918732,
-0.040947362780570984,
-0.617131769657135,
-0.6317840218544006,
-0.4853382408618927,
0.35480621457099915,
0.5222689509391785,
-0.46420374512672424,
0.6961514949798584,
-0.3151583969593048,
-0.6917383670806885,
-0.3971001207828522,
0.14693103730678558,
0.5506059527397156,
0.44251981377601624,
0.5118659734725952,
-0.11038569360971451,
-0.5113191604614258,
-0.8776602745056152,
0.10072129219770432,
-0.06848770380020142,
0.1778298020362854,
0.3603508770465851,
0.9253847002983093,
-0.40750575065612793,
0.7629781365394592,
-0.5927761793136597,
-0.051710911095142365,
-0.26365360617637634,
-0.08142560720443726,
0.27680689096450806,
0.4399452805519104,
0.6003521680831909,
-0.862942099571228,
-0.32178622484207153,
-0.09477370232343674,
-0.7246197462081909,
0.06522577255964279,
0.3111080527305603,
-0.08910144865512848,
0.35337260365486145,
0.48886340856552124,
-0.8252602219581604,
0.4037158787250519,
0.750549852848053,
-0.26001688838005066,
0.6681085228919983,
-0.08828809857368469,
-0.2101856768131256,
-1.3067021369934082,
0.43188390135765076,
0.18521399796009064,
0.04342848062515259,
-0.5545478463172913,
0.08991202712059021,
-0.054180700331926346,
-0.34249210357666016,
-0.5907780528068542,
0.8922357559204102,
-0.3437666594982147,
0.03941408917307854,
-0.05736308917403221,
0.05823538452386856,
-0.05445019528269768,
0.2956368625164032,
0.17616645991802216,
0.8605571985244751,
0.5733595490455627,
-0.562396764755249,
0.16826029121875763,
0.3317761719226837,
-0.30009958148002625,
0.21892109513282776,
-0.7939595580101013,
-0.16172562539577484,
-0.16334660351276398,
0.31445983052253723,
-0.756260871887207,
-0.36144936084747314,
0.28996312618255615,
-0.38291844725608826,
0.47027283906936646,
-0.05275101587176323,
-0.7365971207618713,
-0.628113865852356,
-0.1960061490535736,
0.31842243671417236,
0.5747537016868591,
-0.3875683546066284,
0.22382299602031708,
0.491386741399765,
-0.07740673422813416,
-0.5469026565551758,
-0.9013336300849915,
-0.08136994391679764,
-0.30359840393066406,
-0.539597749710083,
0.2864941358566284,
-0.3134009540081024,
-0.22315657138824463,
0.04094202443957329,
0.2897290289402008,
-0.09428364038467407,
0.03811761736869812,
0.3317841589450836,
0.2681814730167389,
-0.14028620719909668,
0.34455519914627075,
-0.28155913949012756,
0.17909163236618042,
0.06901638954877853,
-0.1748410016298294,
0.5194786787033081,
-0.014169569127261639,
-0.3692934215068817,
-0.28271687030792236,
0.3398694396018982,
0.5298085808753967,
-0.17509517073631287,
0.966201663017273,
0.6070623397827148,
-0.5230957269668579,
0.10571978241205215,
-0.477463036775589,
-0.27646616101264954,
-0.41461944580078125,
0.6345078945159912,
0.05043037235736847,
-0.8565084338188171,
0.5782142877578735,
0.0976613461971283,
0.08525273203849792,
0.6389604210853577,
0.7801467180252075,
0.03699127957224846,
0.7960184812545776,
0.8719242811203003,
-0.2278253734111786,
0.5259004831314087,
-0.4101194739341736,
0.37335968017578125,
-0.8652665019035339,
-0.3136433959007263,
-0.5101688504219055,
0.026254238560795784,
-0.6594729423522949,
-0.5225661993026733,
0.172673299908638,
0.1264919936656952,
-0.5034084916114807,
0.34651127457618713,
-0.3171016275882721,
0.2488069385290146,
0.5397282838821411,
-0.026152001693844795,
0.1945042461156845,
0.08288685977458954,
-0.1658322811126709,
-0.14861242473125458,
-0.6287554502487183,
-0.5406766533851624,
1.3246904611587524,
0.7135017514228821,
0.6352055072784424,
0.17243517935276031,
0.5915361046791077,
0.024558449164032936,
0.36394959688186646,
-0.7120031714439392,
0.4489385485649109,
-0.05941353738307953,
-0.983300507068634,
-0.3102343678474426,
-0.5339571237564087,
-1.0755200386047363,
0.020057346671819687,
-0.1826086938381195,
-0.9018712043762207,
0.21389412879943848,
0.11935881525278091,
-0.2064921259880066,
0.5312744379043579,
-0.7928105592727661,
0.8472787737846375,
-0.24847640097141266,
-0.32667484879493713,
-0.04599780589342117,
-0.5780024528503418,
0.4931904971599579,
-0.19981949031352997,
0.507574737071991,
-0.03213803842663765,
0.14773792028427124,
0.8478705883026123,
-0.3579477369785309,
1.1021164655685425,
-0.16852256655693054,
-0.13585834205150604,
0.24309635162353516,
-0.2730826437473297,
0.2867819666862488,
-0.08834582567214966,
-0.15072304010391235,
0.5615572929382324,
-0.013917021453380585,
-0.27289682626724243,
-0.10520051419734955,
0.6961641311645508,
-1.0547394752502441,
-0.47665855288505554,
-0.5336657762527466,
-0.6595740914344788,
-0.02369997277855873,
0.3414634168148041,
0.364547461271286,
0.13779859244823456,
-0.21279697120189667,
0.23708759248256683,
0.6861445903778076,
-0.695469856262207,
0.22583149373531342,
0.4816765785217285,
-0.5978813171386719,
-0.3317374587059021,
0.8950712084770203,
0.19144675135612488,
0.4291040599346161,
0.021725565195083618,
0.32368817925453186,
-0.4514367878437042,
-0.48412373661994934,
-0.2435656040906906,
0.576846718788147,
-0.6516202092170715,
-0.08289788663387299,
-0.6380667686462402,
-0.49573200941085815,
-0.6640996932983398,
0.17808012664318085,
-0.2862449586391449,
-0.32337066531181335,
-0.33977678418159485,
-0.24852034449577332,
0.38533276319503784,
0.616682231426239,
-0.178410604596138,
0.4558795690536499,
-0.589192807674408,
0.09466944634914398,
0.10574112832546234,
0.46982723474502563,
-0.23434455692768097,
-0.6854651570320129,
-0.38566404581069946,
0.3125576376914978,
-0.44525402784347534,
-0.7013905644416809,
0.42536333203315735,
0.11308658868074417,
0.5806287527084351,
0.10403944551944733,
-0.3069758117198944,
0.31505441665649414,
-0.45397332310676575,
1.1142256259918213,
0.4064922630786896,
-0.6621341109275818,
0.5956827402114868,
-0.5953292846679688,
0.2636960446834564,
0.39141035079956055,
0.69922935962677,
-0.5054965615272522,
-0.2551664710044861,
-0.7914742231369019,
-1.0801641941070557,
0.6881905198097229,
0.20094607770442963,
0.24081027507781982,
-0.0444641038775444,
0.32309019565582275,
-0.17976215481758118,
0.26393839716911316,
-1.2235679626464844,
-0.3838847577571869,
-0.1451866328716278,
-0.2660551965236664,
-0.2170182764530182,
-0.3138095736503601,
-0.3877620995044708,
-0.44731661677360535,
0.7676123380661011,
0.08705981820821762,
0.4152311384677887,
0.03631811961531639,
-0.0907626748085022,
-0.29626327753067017,
0.1741914302110672,
0.6717635989189148,
0.7998725175857544,
-0.2603696882724762,
-0.18980003893375397,
0.1993115395307541,
-0.7317736744880676,
-0.018872566521167755,
0.25945982336997986,
-0.16951988637447357,
-0.2136305570602417,
0.3230379819869995,
0.7186259627342224,
0.17200349271297455,
-0.7254900932312012,
0.5981184840202332,
0.1007501557469368,
-0.34470683336257935,
-0.4718366265296936,
-0.030856408178806305,
0.3420753479003906,
0.14689584076404572,
0.14690569043159485,
-0.24597536027431488,
0.02922171913087368,
-0.5675450563430786,
-0.02355707250535488,
0.30847620964050293,
-0.22807788848876953,
-0.3802226185798645,
0.5762024521827698,
0.05673142522573471,
-0.23682188987731934,
0.4698355793952942,
-0.2038038671016693,
-0.2819146513938904,
0.6393507122993469,
0.6731008291244507,
0.5352369546890259,
-0.3219364583492279,
0.09687898308038712,
0.7509877681732178,
0.40285149216651917,
-0.1270418018102646,
0.4056926965713501,
0.42604535818099976,
-0.6491121649742126,
-0.5010520815849304,
-0.7696998715400696,
-0.36760881543159485,
0.47408121824264526,
-0.5664301514625549,
0.41660305857658386,
-0.49408668279647827,
-0.23579995334148407,
0.12141835689544678,
-0.044702548533678055,
-0.7098567485809326,
0.20500397682189941,
0.42572417855262756,
1.0552631616592407,
-1.077803611755371,
0.8626281023025513,
0.7648665904998779,
-0.8374396562576294,
-0.8705252408981323,
-0.11201032996177673,
0.129667729139328,
-0.7213832139968872,
0.8641324043273926,
0.04992952197790146,
0.19607819616794586,
-0.1091829240322113,
-0.8744436502456665,
-1.1079440116882324,
1.0756653547286987,
0.3328426778316498,
-0.676040768623352,
0.004395198076963425,
0.29078197479248047,
0.6635547876358032,
-0.17339758574962616,
0.2777218818664551,
0.4410865008831024,
0.6509281396865845,
0.1685904562473297,
-1.0296283960342407,
0.0021499258000403643,
-0.23519638180732727,
-0.052885085344314575,
0.026388254016637802,
-0.7731835842132568,
0.9849641919136047,
-0.05570156127214432,
-0.1407303512096405,
-0.12715686857700348,
0.5197757482528687,
0.32950446009635925,
0.15021909773349762,
0.24188615381717682,
0.7629669308662415,
0.7704195976257324,
-0.1562955528497696,
1.1671351194381714,
-0.3098030984401703,
0.4684585630893707,
0.9892390966415405,
-0.21622154116630554,
0.7732959985733032,
0.39014390110969543,
-0.5889886021614075,
0.2887367010116577,
0.54916912317276,
-0.19992229342460632,
0.3160582184791565,
0.30931875109672546,
-0.04362378641963005,
0.09944642335176468,
-0.16079585254192352,
-0.6461361050605774,
0.290926992893219,
0.5944629907608032,
-0.49173834919929504,
-0.09369321912527084,
0.11253632605075836,
0.2775949537754059,
-0.08767209947109222,
-0.21463792026042938,
0.48734867572784424,
0.26037174463272095,
-0.4568324387073517,
0.5492047071456909,
0.038244590163230896,
0.6542917490005493,
-0.7313161492347717,
0.011054489761590958,
-0.09852287173271179,
0.09366890043020248,
-0.26797041296958923,
-0.9462365508079529,
0.3191750645637512,
0.03594600409269333,
-0.26815879344940186,
-0.1458376795053482,
0.40506407618522644,
-0.48691675066947937,
-0.7388788461685181,
0.49338069558143616,
0.38152414560317993,
0.2719304859638214,
0.11085335910320282,
-0.8824329972267151,
0.13167570531368256,
-0.13061392307281494,
-0.42923614382743835,
0.3251264691352844,
0.20183596014976501,
0.05715913698077202,
0.7027556300163269,
0.6551225185394287,
0.28232303261756897,
0.05024830251932144,
0.09222083538770676,
1.027278184890747,
-0.7515296339988708,
-0.14429359138011932,
-0.7202610373497009,
0.5504697561264038,
-0.13734646141529083,
-0.4643479883670807,
0.9163390398025513,
0.7287096977233887,
0.8301289081573486,
0.060473572462797165,
0.9344010949134827,
-0.12101425975561142,
0.5491295456886292,
-0.4450291395187378,
0.6388511657714844,
-0.6376199126243591,
0.0011400629300624132,
-0.3429579734802246,
-1.0639355182647705,
-0.4394932985305786,
0.5602526068687439,
-0.5867493748664856,
0.2965168356895447,
0.6033547520637512,
0.7765903472900391,
-0.16845624148845673,
-0.028398098424077034,
0.2301306277513504,
0.5617793798446655,
0.32949110865592957,
0.3341297507286072,
0.7256198525428772,
-0.3843502104282379,
0.26758500933647156,
-0.2861744463443756,
-0.1702873557806015,
-0.27238357067108154,
-0.8859829902648926,
-0.9090882539749146,
-0.6301664710044861,
-0.3800182044506073,
-0.5180608630180359,
-0.10484281182289124,
0.9667812585830688,
0.7351075410842896,
-0.8266593217849731,
-0.4410279393196106,
0.0628848522901535,
-0.1084030270576477,
0.15034881234169006,
-0.21140731871128082,
0.41448718309402466,
-0.07606002688407898,
-0.6152900457382202,
0.2677227258682251,
0.03136632591485977,
0.2238575518131256,
-0.5278500914573669,
-0.0933346375823021,
-0.5106614828109741,
-0.07006148248910904,
0.6689905524253845,
0.5229365229606628,
-0.6229739785194397,
-0.11175069212913513,
0.0641089677810669,
-0.2655692398548126,
0.012664259411394596,
0.26869064569473267,
-0.15087735652923584,
0.2576057016849518,
0.22804738581180573,
0.36909130215644836,
0.6937822699546814,
-0.19604916870594025,
0.24367819726467133,
-0.6821222305297852,
0.40694481134414673,
0.28303012251853943,
0.5183088779449463,
0.4139177203178406,
-0.4195161461830139,
0.5220032930374146,
0.32433775067329407,
-0.6584475636482239,
-0.8614876866340637,
0.16460569202899933,
-0.9953500032424927,
-0.24082337319850922,
1.5718259811401367,
-0.16692891716957092,
-0.40626275539398193,
0.11324851959943771,
-0.0963081642985344,
0.21202120184898376,
-0.2240189015865326,
0.5448982119560242,
0.8833897113800049,
0.12499010562896729,
-0.11474001407623291,
-0.8883654475212097,
0.40248796343803406,
0.10673317313194275,
-0.8989394307136536,
0.15499474108219147,
0.5332840085029602,
0.4994155466556549,
0.24839477241039276,
0.570681631565094,
-0.3299626410007477,
-0.07502596080303192,
-0.24982987344264984,
0.4975202679634094,
0.05057483911514282,
-0.18631170690059662,
-0.4082334637641907,
-0.3213721811771393,
0.18638984858989716,
0.19071298837661743
] |
csebuetnlp/banglabert | csebuetnlp | "2022-12-23T18:49:36Z" | 1,207,089 | 12 | transformers | [
"transformers",
"pytorch",
"electra",
"pretraining",
"bn",
"endpoints_compatible",
"region:us"
] | null | "2022-03-02T23:29:05Z" | ---
language:
- bn
licenses:
- cc-by-nc-sa-4.0
---
# BanglaBERT
This repository contains the pretrained discriminator checkpoint of the model **BanglaBERT**. This is an [ELECTRA](https://openreview.net/pdf?id=r1xMH1BtvB) discriminator model pretrained with the Replaced Token Detection (RTD) objective. Finetuned models using this checkpoint achieve state-of-the-art results on many of the NLP tasks in bengali.
For finetuning on different downstream tasks such as `Sentiment classification`, `Named Entity Recognition`, `Natural Language Inference` etc., refer to the scripts in the official GitHub [repository](https://github.com/csebuetnlp/banglabert).
**Note**: This model was pretrained using a specific normalization pipeline available [here](https://github.com/csebuetnlp/normalizer). All finetuning scripts in the official GitHub repository uses this normalization by default. If you need to adapt the pretrained model for a different task make sure the text units are normalized using this pipeline before tokenizing to get best results. A basic example is given below:
## Using this model as a discriminator in `transformers` (tested on 4.11.0.dev0)
```python
from transformers import AutoModelForPreTraining, AutoTokenizer
from normalizer import normalize # pip install git+https://github.com/csebuetnlp/normalizer
import torch
model = AutoModelForPreTraining.from_pretrained("csebuetnlp/banglabert")
tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/banglabert")
original_sentence = "আমি কৃতজ্ঞ কারণ আপনি আমার জন্য অনেক কিছু করেছেন।"
fake_sentence = "আমি হতাশ কারণ আপনি আমার জন্য অনেক কিছু করেছেন।"
fake_sentence = normalize(fake_sentence) # this normalization step is required before tokenizing the text
fake_tokens = tokenizer.tokenize(fake_sentence)
fake_inputs = tokenizer.encode(fake_sentence, return_tensors="pt")
discriminator_outputs = model(fake_inputs).logits
predictions = torch.round((torch.sign(discriminator_outputs) + 1) / 2)
[print("%7s" % token, end="") for token in fake_tokens]
print("\n" + "-" * 50)
[print("%7s" % int(prediction), end="") for prediction in predictions.squeeze().tolist()[1:-1]]
print("\n" + "-" * 50)
```
## Benchmarks
* Zero-shot cross-lingual transfer-learning
| Model | Params | SC (macro-F1) | NLI (accuracy) | NER (micro-F1) | QA (EM/F1) | BangLUE score |
|----------------|-----------|-----------|-----------|-----------|-----------|-----------|
|[mBERT](https://huggingface.co/bert-base-multilingual-cased) | 180M | 27.05 | 62.22 | 39.27 | 59.01/64.18 | 50.35 |
|[XLM-R (base)](https://huggingface.co/xlm-roberta-base) | 270M | 42.03 | 72.18 | 45.37 | 55.03/61.83 | 55.29 |
|[XLM-R (large)](https://huggingface.co/xlm-roberta-large) | 550M | 49.49 | 78.13 | 56.48 | 71.13/77.70 | 66.59 |
|[BanglishBERT](https://huggingface.co/csebuetnlp/banglishbert) | 110M | 48.39 | 75.26 | 55.56 | 72.87/78.63 | 66.14 |
* Supervised fine-tuning
| Model | Params | SC (macro-F1) | NLI (accuracy) | NER (micro-F1) | QA (EM/F1) | BangLUE score |
|----------------|-----------|-----------|-----------|-----------|-----------|-----------|
|[mBERT](https://huggingface.co/bert-base-multilingual-cased) | 180M | 67.59 | 75.13 | 68.97 | 67.12/72.64 | 70.29 |
|[XLM-R (base)](https://huggingface.co/xlm-roberta-base) | 270M | 69.54 | 78.46 | 73.32 | 68.09/74.27 | 72.82 |
|[XLM-R (large)](https://huggingface.co/xlm-roberta-large) | 550M | 70.97 | 82.40 | 78.39 | 73.15/79.06 | 76.79 |
|[sahajBERT](https://huggingface.co/neuropark/sahajBERT) | 18M | 71.12 | 76.92 | 70.94 | 65.48/70.69 | 71.03 |
|[BanglishBERT](https://huggingface.co/csebuetnlp/banglishbert) | 110M | 70.61 | 80.95 | 76.28 | 72.43/78.40 | 75.73 |
|[BanglaBERT](https://huggingface.co/csebuetnlp/banglabert) | 110M | 72.89 | 82.80 | 77.78 | 72.63/79.34 | **77.09** |
The benchmarking datasets are as follows:
* **SC:** **[Sentiment Classification](https://aclanthology.org/2021.findings-emnlp.278)**
* **NER:** **[Named Entity Recognition](https://multiconer.github.io/competition)**
* **NLI:** **[Natural Language Inference](https://github.com/csebuetnlp/banglabert/#datasets)**
* **QA:** **[Question Answering](https://github.com/csebuetnlp/banglabert/#datasets)**
## Citation
If you use this model, please cite the following paper:
```
@inproceedings{bhattacharjee-etal-2022-banglabert,
title = "{B}angla{BERT}: Language Model Pretraining and Benchmarks for Low-Resource Language Understanding Evaluation in {B}angla",
author = "Bhattacharjee, Abhik and
Hasan, Tahmid and
Ahmad, Wasi and
Mubasshir, Kazi Samin and
Islam, Md Saiful and
Iqbal, Anindya and
Rahman, M. Sohel and
Shahriyar, Rifat",
booktitle = "Findings of the Association for Computational Linguistics: NAACL 2022",
month = jul,
year = "2022",
address = "Seattle, United States",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.findings-naacl.98",
pages = "1318--1327",
abstract = "In this work, we introduce BanglaBERT, a BERT-based Natural Language Understanding (NLU) model pretrained in Bangla, a widely spoken yet low-resource language in the NLP literature. To pretrain BanglaBERT, we collect 27.5 GB of Bangla pretraining data (dubbed {`}Bangla2B+{'}) by crawling 110 popular Bangla sites. We introduce two downstream task datasets on natural language inference and question answering and benchmark on four diverse NLU tasks covering text classification, sequence labeling, and span prediction. In the process, we bring them under the first-ever Bangla Language Understanding Benchmark (BLUB). BanglaBERT achieves state-of-the-art results outperforming multilingual and monolingual models. We are making the models, datasets, and a leaderboard publicly available at \url{https://github.com/csebuetnlp/banglabert} to advance Bangla NLP.",
}
```
If you use the normalization module, please cite the following paper:
```
@inproceedings{hasan-etal-2020-low,
title = "Not Low-Resource Anymore: Aligner Ensembling, Batch Filtering, and New Datasets for {B}engali-{E}nglish Machine Translation",
author = "Hasan, Tahmid and
Bhattacharjee, Abhik and
Samin, Kazi and
Hasan, Masum and
Basak, Madhusudan and
Rahman, M. Sohel and
Shahriyar, Rifat",
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/2020.emnlp-main.207",
doi = "10.18653/v1/2020.emnlp-main.207",
pages = "2612--2623",
abstract = "Despite being the seventh most widely spoken language in the world, Bengali has received much less attention in machine translation literature due to being low in resources. Most publicly available parallel corpora for Bengali are not large enough; and have rather poor quality, mostly because of incorrect sentence alignments resulting from erroneous sentence segmentation, and also because of a high volume of noise present in them. In this work, we build a customized sentence segmenter for Bengali and propose two novel methods for parallel corpus creation on low-resource setups: aligner ensembling and batch filtering. With the segmenter and the two methods combined, we compile a high-quality Bengali-English parallel corpus comprising of 2.75 million sentence pairs, more than 2 million of which were not available before. Training on neural models, we achieve an improvement of more than 9 BLEU score over previous approaches to Bengali-English machine translation. We also evaluate on a new test set of 1000 pairs made with extensive quality control. We release the segmenter, parallel corpus, and the evaluation set, thus elevating Bengali from its low-resource status. To the best of our knowledge, this is the first ever large scale study on Bengali-English machine translation. We believe our study will pave the way for future research on Bengali-English machine translation as well as other low-resource languages. Our data and code are available at https://github.com/csebuetnlp/banglanmt.",
}
```
| [
-0.45374587178230286,
-0.769209086894989,
-0.07506414502859116,
0.41757792234420776,
-0.2560822665691376,
0.05141713097691536,
-0.4727419912815094,
-0.42056113481521606,
0.19191104173660278,
0.14498668909072876,
-0.4285649061203003,
-0.5767320990562439,
-0.5864207148551941,
0.2183058112859726,
-0.05536971613764763,
1.1112779378890991,
0.014699609950184822,
0.09731616079807281,
-0.07211096584796906,
-0.16067174077033997,
-0.5202929973602295,
-0.4907352030277252,
-0.48368769884109497,
-0.3914501368999481,
0.3770875930786133,
0.22390706837177277,
0.4646529257297516,
0.47295865416526794,
0.4720397889614105,
0.3568289875984192,
-0.31123799085617065,
0.1905890852212906,
-0.27683383226394653,
-0.12167729437351227,
0.03757062554359436,
-0.5154452919960022,
-0.43010953068733215,
-0.09933973103761673,
0.6975285410881042,
0.8181279897689819,
0.02463187836110592,
0.14544403553009033,
0.196402445435524,
0.7139982581138611,
-0.49742192029953003,
0.1856377273797989,
-0.49945661425590515,
-0.15596456825733185,
-0.30263960361480713,
0.09761118143796921,
-0.4464285671710968,
-0.5309651494026184,
0.05173935741186142,
-0.48186537623405457,
0.09100712090730667,
0.23154160380363464,
1.369457483291626,
0.3402431905269623,
-0.1810356080532074,
-0.20620645582675934,
-0.3154415190219879,
0.9986205101013184,
-0.9860026240348816,
0.4627317786216736,
0.4370708167552948,
0.08837936073541641,
-0.00081326172221452,
-0.5155643224716187,
-0.5642672181129456,
-0.07663120329380035,
-0.38095298409461975,
0.29776865243911743,
-0.29838934540748596,
0.0011865737615153193,
0.16641198098659515,
0.36049363017082214,
-0.8104365468025208,
0.099184550344944,
-0.451712965965271,
-0.24719589948654175,
0.6836261749267578,
-0.05780213698744774,
0.22435760498046875,
-0.5008153319358826,
-0.30701881647109985,
-0.18528258800506592,
-0.368177205324173,
0.28058844804763794,
0.23090830445289612,
0.42484790086746216,
-0.46686801314353943,
0.4580618441104889,
-0.19315864145755768,
0.9675294756889343,
0.28051841259002686,
-0.10769036412239075,
0.7575088739395142,
-0.47751209139823914,
-0.3274889886379242,
0.022422082722187042,
0.9294200539588928,
0.18285997211933136,
0.24402156472206116,
-0.051140282303094864,
-0.044444937258958817,
-0.0023541308473795652,
-0.10011301189661026,
-0.8349171280860901,
-0.3833242654800415,
0.2538820207118988,
-0.4950917065143585,
-0.08337634801864624,
-0.13107003271579742,
-0.8287467956542969,
-0.05167688429355621,
-0.29219910502433777,
0.3856421411037445,
-0.8889235258102417,
-0.2672189474105835,
0.0019984666723757982,
0.1028556302189827,
0.431769460439682,
0.04367145895957947,
-0.6974590420722961,
0.1712377965450287,
0.30237868428230286,
0.8178865909576416,
-0.07687453925609589,
-0.3321880102157593,
-0.20695734024047852,
-0.24624736607074738,
-0.3279127776622772,
0.7329995036125183,
-0.27125659584999084,
-0.10740641504526138,
-0.14415669441223145,
0.007237188518047333,
-0.4155776798725128,
-0.5011297464370728,
0.6284803748130798,
-0.28844454884529114,
0.2917761504650116,
-0.1877669095993042,
-0.7170385718345642,
-0.30027443170547485,
0.3643406629562378,
-0.46748170256614685,
1.191144347190857,
0.03891008347272873,
-0.9896683096885681,
0.32220572233200073,
-0.5923964381217957,
-0.3682125210762024,
-0.04979417473077774,
0.16285042464733124,
-0.49184665083885193,
-0.11954642087221146,
0.5257624387741089,
0.5517820715904236,
-0.16008050739765167,
0.2965332865715027,
-0.1421218365430832,
-0.3126501142978668,
0.2736884355545044,
-0.2853923738002777,
1.215630054473877,
0.2988499701023102,
-0.3398786187171936,
0.12193956226110458,
-0.9633655548095703,
0.18566575646400452,
0.15173541009426117,
-0.37456047534942627,
-0.13892874121665955,
-0.35338735580444336,
0.16575442254543304,
0.25956711173057556,
0.437761515378952,
-0.5958573222160339,
0.050824929028749466,
-0.6929517984390259,
0.2429664433002472,
0.7328278422355652,
-0.0715726837515831,
0.33064526319503784,
-0.3622201979160309,
0.46779143810272217,
0.0879494845867157,
0.03973954916000366,
-0.08153586089611053,
-0.4916403591632843,
-0.8807576894760132,
-0.555554211139679,
0.6578654050827026,
0.6457236409187317,
-0.593593955039978,
0.8265877962112427,
-0.2901110351085663,
-0.6995042562484741,
-0.8942695260047913,
0.15476234257221222,
0.6864733695983887,
0.40112051367759705,
0.5604345798492432,
-0.09273470938205719,
-0.7131386399269104,
-0.8531237840652466,
-0.2844577431678772,
-0.10161357372999191,
0.19337737560272217,
0.20199234783649445,
0.4702037572860718,
-0.34912222623825073,
1.0209335088729858,
-0.4654042422771454,
-0.1752389669418335,
-0.5343309044837952,
0.2365945428609848,
0.5326455235481262,
0.7325671315193176,
0.628788948059082,
-0.8046405911445618,
-0.7104966640472412,
0.019219111651182175,
-0.774776041507721,
-0.3159961998462677,
0.04927939176559448,
-0.1468425691127777,
0.5351011753082275,
0.45666617155075073,
-0.5321171879768372,
0.35728707909584045,
0.6153074502944946,
-0.3363993167877197,
0.7361206412315369,
-0.1955639123916626,
0.05535129830241203,
-1.1681853532791138,
0.23100800812244415,
-0.04117165505886078,
-0.13236704468727112,
-0.6860834360122681,
-0.08405733108520508,
-0.045636724680662155,
0.1315651535987854,
-0.3873959481716156,
0.8438774943351746,
-0.44903475046157837,
0.1348072737455368,
-0.026972610503435135,
0.2621625065803528,
-0.09022732079029083,
0.7405059337615967,
-0.03329692780971527,
0.6266698241233826,
0.4667757451534271,
-0.4674546718597412,
0.11771466583013535,
0.447749525308609,
-0.4849090874195099,
0.45416268706321716,
-0.7233562469482422,
-0.06522645056247711,
-0.004555902909487486,
0.10738752782344818,
-1.0412859916687012,
-0.2209089994430542,
0.24930833280086517,
-0.7598642706871033,
0.5432305335998535,
-0.05922824516892433,
-0.5084896683692932,
-0.5344156622886658,
-0.2736019492149353,
0.30275043845176697,
0.5431901812553406,
-0.5016698241233826,
0.34700140357017517,
0.20076829195022583,
-0.2570379972457886,
-0.7059118747711182,
-0.8307181000709534,
-0.18277546763420105,
-0.10232259333133698,
-0.6418964266777039,
0.32521671056747437,
-0.22902899980545044,
-0.0512617826461792,
-0.03348439931869507,
0.06366930156946182,
-0.20371893048286438,
-0.035718388855457306,
0.17640778422355652,
0.4187803864479065,
-0.09208539128303528,
0.07723414152860641,
0.02477099373936653,
-0.019321735948324203,
-0.16911855340003967,
0.031468600034713745,
0.757262647151947,
-0.44774308800697327,
-0.053911950439214706,
-0.5893102884292603,
0.04000326991081238,
0.20655161142349243,
-0.33356428146362305,
0.8547423481941223,
0.9954589605331421,
-0.3081664443016052,
0.037790510803461075,
-0.6466172933578491,
-0.0005875946371816099,
-0.4829597771167755,
0.4286859333515167,
-0.36532697081565857,
-0.840376079082489,
0.5642068982124329,
0.04088129103183746,
-0.014794595539569855,
0.49142321944236755,
0.6994401216506958,
-0.12409529089927673,
0.8833814263343811,
0.46599915623664856,
-0.16921153664588928,
0.49544206261634827,
-0.45644184947013855,
0.3811114430427551,
-0.9542589783668518,
-0.2567983865737915,
-0.47329896688461304,
-0.2507476806640625,
-0.8323212265968323,
-0.3199676275253296,
0.03688408434391022,
0.3716157078742981,
-0.33719658851623535,
0.4743856191635132,
-0.6796166300773621,
0.16720400750637054,
0.6103983521461487,
0.13833095133304596,
-0.034670114517211914,
-0.22258929908275604,
-0.30750516057014465,
-0.22120073437690735,
-0.7426281571388245,
-0.4111526310443878,
1.0984519720077515,
0.24801170825958252,
0.5067441463470459,
-0.0943748950958252,
0.8201338648796082,
0.0984213575720787,
0.1860041618347168,
-0.5303913354873657,
0.6678142547607422,
-0.0986434817314148,
-0.8644794225692749,
-0.16107136011123657,
-0.48946070671081543,
-1.0858820676803589,
0.3617663085460663,
-0.23107820749282837,
-0.8353832364082336,
0.2559507191181183,
0.15899914503097534,
-0.29575178027153015,
0.20435532927513123,
-0.8771858215332031,
0.991369366645813,
-0.2023356705904007,
-0.3667779862880707,
0.06647158414125443,
-0.759484052658081,
0.33042111992836,
-0.03252306580543518,
0.3533497750759125,
-0.14209476113319397,
0.2538266181945801,
0.9477869868278503,
-0.3930176794528961,
0.7599719166755676,
-0.29940706491470337,
0.23974214494228363,
0.31975436210632324,
-0.17678146064281464,
0.2879989743232727,
-0.2057352513074875,
-0.20659427344799042,
0.24370114505290985,
0.08654622733592987,
-0.6628106832504272,
-0.30762189626693726,
0.5477443337440491,
-0.7839502692222595,
-0.2499898225069046,
-0.6574513912200928,
-0.7181264162063599,
-0.17656119167804718,
0.3840983211994171,
0.45375367999076843,
0.29962730407714844,
-0.07012376934289932,
0.3283991813659668,
0.42059382796287537,
-0.4785090386867523,
0.48938533663749695,
0.2485048919916153,
-0.21618163585662842,
-0.47042664885520935,
1.11690354347229,
0.09509790688753128,
0.13288335502147675,
0.38274428248405457,
0.244618222117424,
-0.3336595594882965,
-0.6952446699142456,
-0.24333104491233826,
0.45286667346954346,
-0.5226452350616455,
-0.29349473118782043,
-0.6117607951164246,
-0.322660356760025,
-0.6218238472938538,
-0.3069976568222046,
-0.32263296842575073,
-0.37891584634780884,
-0.15810027718544006,
-0.07924780249595642,
0.35809433460235596,
0.5351360440254211,
-0.3149072825908661,
0.2747880220413208,
-0.5959957838058472,
0.1631036251783371,
0.057404033839702606,
0.06627442687749863,
-0.13625885546207428,
-0.7819828987121582,
-0.4165172576904297,
0.142106294631958,
-0.24662990868091583,
-0.6028327941894531,
0.7373157143592834,
0.14294438064098358,
0.5078057050704956,
0.2482403665781021,
0.08180751651525497,
0.7376283407211304,
-0.364147812128067,
0.8452058434486389,
0.2741449475288391,
-0.9356366991996765,
0.5695727467536926,
-0.25786682963371277,
0.4673830270767212,
0.6968622207641602,
0.4739568829536438,
-0.35697048902511597,
-0.3720874488353729,
-0.5050072073936462,
-0.9631425738334656,
0.757357656955719,
0.3433716297149658,
-0.2281254082918167,
0.006381708197295666,
0.1426735818386078,
0.024021295830607414,
0.27268707752227783,
-0.9358351826667786,
-0.4622746407985687,
-0.31618744134902954,
-0.49350908398628235,
-0.14440789818763733,
-0.12036217749118805,
0.18659274280071259,
-0.6187765002250671,
0.8642082214355469,
0.041576988995075226,
0.4742680788040161,
0.19109442830085754,
-0.3361073434352875,
0.27316683530807495,
0.27149757742881775,
0.39594149589538574,
0.5174766182899475,
-0.4821867048740387,
-0.2274179756641388,
0.34465909004211426,
-0.5296818017959595,
-0.02905263379216194,
0.40902942419052124,
-0.32665205001831055,
0.1074332669377327,
0.5232133865356445,
0.8966380953788757,
0.33905062079429626,
-0.6217077374458313,
0.4549141824245453,
0.1285277158021927,
-0.2479017823934555,
-0.1710028350353241,
-0.22405076026916504,
0.057718224823474884,
0.14978758990764618,
0.24304741621017456,
0.08722137659788132,
-0.08503193408250809,
-0.3466556668281555,
0.17192621529102325,
0.2594946622848511,
-0.3670456111431122,
-0.3597494661808014,
0.5544130206108093,
0.09338531643152237,
-0.1429288238286972,
0.49924248456954956,
-0.5040085911750793,
-0.7655288577079773,
0.41318175196647644,
0.5595526695251465,
0.6613991856575012,
-0.3473157584667206,
0.15687470138072968,
0.8061083555221558,
0.3098309338092804,
0.17839516699314117,
0.323523610830307,
0.09543494880199432,
-0.787067174911499,
-0.4171302914619446,
-1.0395461320877075,
-0.14476051926612854,
0.009157644584774971,
-0.6436066031455994,
0.1669231653213501,
-0.3409450054168701,
-0.10726071149110794,
0.10549168288707733,
0.37992942333221436,
-0.7381417155265808,
0.39893612265586853,
0.06993431597948074,
0.8199530839920044,
-0.7189642786979675,
1.0033000707626343,
0.7349186539649963,
-0.6146162748336792,
-0.8936979174613953,
-0.10246148705482483,
-0.12363602221012115,
-0.7547274827957153,
0.8264530301094055,
0.2234300673007965,
0.11220981925725937,
0.05268590897321701,
-0.41089561581611633,
-0.8366233110427856,
0.9962007999420166,
0.29052430391311646,
-0.4516145884990692,
-0.13203492760658264,
0.05178097262978554,
0.6105350255966187,
-0.06870969384908676,
0.38965272903442383,
0.6577005386352539,
0.6678231954574585,
-0.04983849823474884,
-0.9139938950538635,
0.05450057238340378,
-0.45596474409103394,
-0.06121588870882988,
0.06663176417350769,
-0.8225927352905273,
1.0360028743743896,
-0.06556966155767441,
-0.024601873010396957,
0.1006949320435524,
0.7135006785392761,
0.47459885478019714,
0.15108822286128998,
0.4175823926925659,
0.7414917945861816,
0.7956642508506775,
-0.24320398271083832,
0.9924036264419556,
-0.28982555866241455,
0.45483237504959106,
1.0065696239471436,
0.04076579585671425,
0.8843320608139038,
0.31971436738967896,
-0.4556703269481659,
0.6706469655036926,
0.7043915390968323,
-0.05570562183856964,
0.4485621750354767,
0.18600496649742126,
0.010561840608716011,
-0.15247133374214172,
-0.06006742641329765,
-0.3833729028701782,
0.5090727806091309,
0.21846681833267212,
-0.033751972019672394,
0.04828428849577904,
0.1449129730463028,
0.22141501307487488,
0.16531482338905334,
-0.21477170288562775,
0.6221503019332886,
0.05485953018069267,
-0.5335823893547058,
0.9682824015617371,
-0.17945832014083862,
1.1464080810546875,
-0.6062321662902832,
0.23414190113544464,
-0.23398247361183167,
0.40408986806869507,
-0.2698003351688385,
-0.6338362097740173,
0.34280040860176086,
0.0487368181347847,
-0.1218261867761612,
-0.1411719024181366,
0.6506617665290833,
-0.49911248683929443,
-0.634548544883728,
0.5047134757041931,
0.37369033694267273,
0.3083074688911438,
0.1306142657995224,
-1.0205702781677246,
0.14443036913871765,
0.14339213073253632,
-0.36849257349967957,
0.30097100138664246,
0.3514454960823059,
0.21106092631816864,
0.6012301445007324,
0.5701653957366943,
0.18554501235485077,
0.3701731562614441,
-0.05212072283029556,
0.7402244806289673,
-0.6230864524841309,
-0.4021788239479065,
-0.6230952739715576,
0.5420404672622681,
-0.24733886122703552,
-0.44237613677978516,
1.0151972770690918,
0.6776407957077026,
0.9990537166595459,
-0.01861569844186306,
0.7285091280937195,
-0.3235355019569397,
0.7927901744842529,
-0.406411737203598,
0.8646579384803772,
-0.6508731842041016,
-0.12019948661327362,
-0.43676626682281494,
-0.8469754457473755,
-0.41485539078712463,
0.8092545866966248,
-0.4844737648963928,
0.10827019810676575,
0.6662561297416687,
0.766919732093811,
0.12413644045591354,
-0.216756209731102,
0.1595037579536438,
0.5269001126289368,
0.1839616894721985,
0.6767780184745789,
0.4611969590187073,
-0.692240297794342,
0.6878741979598999,
-0.49355363845825195,
-0.24434947967529297,
-0.3273804485797882,
-0.5956454873085022,
-1.0378495454788208,
-0.7322271466255188,
-0.3418331742286682,
-0.2578985095024109,
-0.01390273030847311,
1.0687780380249023,
0.6321603059768677,
-1.0080910921096802,
-0.32837238907814026,
-0.1029386818408966,
0.06338352710008621,
-0.307235449552536,
-0.2813187539577484,
0.6149393916130066,
-0.5177054405212402,
-0.9327592849731445,
0.2735764980316162,
-0.005320088006556034,
-0.05423952266573906,
0.12256315350532532,
-0.23296426236629486,
-0.8189224600791931,
0.08209733664989471,
0.536666214466095,
0.37912866473197937,
-0.737955629825592,
-0.136199489235878,
0.0493139922618866,
-0.09969697147607803,
0.1345919519662857,
0.13039042055606842,
-0.664497971534729,
0.4718853831291199,
0.5472171902656555,
0.685729444026947,
0.649447500705719,
-0.018667493015527725,
0.3231096863746643,
-0.7695488333702087,
0.38676634430885315,
0.2916662395000458,
0.41944918036460876,
0.5069776773452759,
0.000017676104107522406,
0.5989305973052979,
0.241133451461792,
-0.7126132249832153,
-1.0623928308486938,
-0.11314000934362411,
-1.178844928741455,
-0.3011549413204193,
1.0234745740890503,
-0.3057473301887512,
-0.4561989903450012,
-0.10542739927768707,
-0.31652727723121643,
0.4859927296638489,
-0.34090283513069153,
0.523217499256134,
0.6646216511726379,
-0.09392687678337097,
-0.06061502918601036,
-0.3755602538585663,
0.4197090268135071,
0.6333489418029785,
-0.8340104222297668,
-0.006110865157097578,
0.23144766688346863,
0.14878374338150024,
0.32974329590797424,
0.6178753972053528,
-0.03550438955426216,
0.096866674721241,
-0.038028642535209656,
0.33677852153778076,
-0.009281029924750328,
-0.051226068288087845,
-0.29384633898735046,
-0.1028890386223793,
-0.19101499021053314,
-0.3333536386489868
] |
laion/CLIP-ViT-B-32-laion2B-s34B-b79K | laion | "2023-04-18T06:49:43Z" | 1,204,033 | 49 | open_clip | [
"open_clip",
"pytorch",
"clip",
"zero-shot-image-classification",
"arxiv:1910.04867",
"license:mit",
"has_space",
"region:us"
] | zero-shot-image-classification | "2022-09-14T22:49:28Z" | ---
license: mit
widget:
- src: >-
https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
candidate_labels: playing music, playing sports
example_title: Cat & Dog
pipeline_tag: zero-shot-image-classification
---
# Model Card for CLIP ViT-B/32 - LAION-2B
# Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Training Details](#training-details)
4. [Evaluation](#evaluation)
5. [Acknowledgements](#acknowledgements)
6. [Citation](#citation)
7. [How To Get Started With the Model](#how-to-get-started-with-the-model)
# Model Details
## Model Description
A CLIP ViT-B/32 model trained with the LAION-2B English subset of LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/open_clip).
Model training done by Romain Beaumont on the [stability.ai](https://stability.ai/) cluster.
# Uses
As per the original [OpenAI CLIP model card](https://github.com/openai/CLIP/blob/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1/model-card.md), this model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such model.
The OpenAI CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis. Additionally, the LAION-5B blog (https://laion.ai/blog/laion-5b/) and upcoming paper include additional discussion as it relates specifically to the training dataset.
## Direct Use
Zero-shot image classification, image and text retrieval, among others.
## Downstream Use
Image classification and other image task fine-tuning, linear probe image classification, image generation guiding and conditioning, among others.
## Out-of-Scope Use
As per the OpenAI models,
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
Further the above notice, the LAION-5B dataset used in training of these models has additional considerations, see below.
# Training Details
## Training Data
This model was trained with the 2 Billion sample English subset of LAION-5B (https://laion.ai/blog/laion-5b/).
**IMPORTANT NOTE:** The motivation behind dataset creation is to democratize research and experimentation around large-scale multi-modal model training and handling of uncurated, large-scale datasets crawled from publically available internet. Our recommendation is therefore to use the dataset for research purposes. Be aware that this large-scale dataset is uncurated. Keep in mind that the uncurated nature of the dataset means that collected links may lead to strongly discomforting and disturbing content for a human viewer. Therefore, please use the demo links with caution and at your own risk. It is possible to extract a “safe” subset by filtering out samples based on the safety tags (using a customized trained NSFW classifier that we built). While this strongly reduces the chance for encountering potentially harmful content when viewing, we cannot entirely exclude the possibility for harmful content being still present in safe mode, so that the warning holds also there. We think that providing the dataset openly to broad research and other interested communities will allow for transparent investigation of benefits that come along with training large-scale models as well as pitfalls and dangers that may stay unreported or unnoticed when working with closed large datasets that remain restricted to a small community. Providing our dataset openly, we however do not recommend using it for creating ready-to-go industrial products, as the basic research about general properties and safety of such large-scale models, which we would like to encourage with this release, is still in progress.
## Training Procedure
Please see [training notes](https://docs.google.com/document/d/1EFbMLRWSSV0LUf9Du1pWzWqgeiIRPwEWX2s1C6mAk5c) and [wandb logs](https://wandb.ai/rom1504/eval_openclip/reports/B-32-2B--VmlldzoyNDkwNDMy).
# Evaluation
Evaluation done with code in the [LAION CLIP Benchmark suite](https://github.com/LAION-AI/CLIP_benchmark).
## Testing Data, Factors & Metrics
### Testing Data
The testing is performed with VTAB+ (A combination of VTAB (https://arxiv.org/abs/1910.04867) w/ additional robustness datasets) for classification and COCO and Flickr for retrieval.
**TODO** - more detail
## Results
The model achieves a 66.6 zero-shot top-1 accuracy on ImageNet-1k.
An initial round of benchmarks have been performed on a wider range of datasets, currently viewable at https://github.com/LAION-AI/CLIP_benchmark/blob/main/benchmark/results.ipynb
**TODO** - create table for just this model's metrics.
# Acknowledgements
Acknowledging [stability.ai](https://stability.ai/) for the compute used to train this model.
# Citation
**BibTeX:**
In addition to forthcoming LAION-5B (https://laion.ai/blog/laion-5b/) paper, please cite:
OpenAI CLIP paper
```
@inproceedings{Radford2021LearningTV,
title={Learning Transferable Visual Models From Natural Language Supervision},
author={Alec Radford and Jong Wook Kim and Chris Hallacy and A. Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
booktitle={ICML},
year={2021}
}
```
OpenCLIP software
```
@software{ilharco_gabriel_2021_5143773,
author = {Ilharco, Gabriel and
Wortsman, Mitchell and
Wightman, Ross and
Gordon, Cade and
Carlini, Nicholas and
Taori, Rohan and
Dave, Achal and
Shankar, Vaishaal and
Namkoong, Hongseok and
Miller, John and
Hajishirzi, Hannaneh and
Farhadi, Ali and
Schmidt, Ludwig},
title = {OpenCLIP},
month = jul,
year = 2021,
note = {If you use this software, please cite it as below.},
publisher = {Zenodo},
version = {0.1},
doi = {10.5281/zenodo.5143773},
url = {https://doi.org/10.5281/zenodo.5143773}
}
```
# How to Get Started with the Model
Use the code below to get started with the model.
** TODO ** - Hugging Face transformers, OpenCLIP, and timm getting started snippets | [
-0.2775880992412567,
-0.5689245462417603,
0.17562779784202576,
0.06699049472808838,
-0.3972177505493164,
-0.4110003411769867,
-0.16550928354263306,
-0.6360536217689514,
0.023332374170422554,
0.41557443141937256,
-0.4149303734302521,
-0.567352831363678,
-0.5902985334396362,
-0.14873172342777252,
-0.3981838524341583,
0.8949678540229797,
-0.20597252249717712,
-0.019334008917212486,
-0.2577683627605438,
-0.4118072986602783,
-0.5427149534225464,
-0.5258944034576416,
-0.4462466835975647,
0.07508234679698944,
0.11022703349590302,
0.26365363597869873,
0.6031217575073242,
0.7735157608985901,
0.6962467432022095,
0.211685448884964,
-0.09910060465335846,
-0.050662245601415634,
-0.5533120632171631,
-0.5259195566177368,
-0.04930613934993744,
-0.3589613139629364,
-0.656189501285553,
0.14122557640075684,
0.5256898403167725,
0.2759043276309967,
-0.14119380712509155,
0.2431265115737915,
-0.05088452622294426,
0.4048057496547699,
-0.7307823300361633,
0.2517123222351074,
-0.5612801313400269,
-0.012616523541510105,
-0.23172912001609802,
0.23240453004837036,
-0.2922186553478241,
-0.15102535486221313,
0.18236617743968964,
-0.6447831988334656,
0.16361576318740845,
-0.1392155885696411,
1.3573601245880127,
0.19703976809978485,
-0.2664260268211365,
0.19560177624225616,
-0.6301798224449158,
0.7204428315162659,
-0.735599935054779,
0.37445950508117676,
0.3612770140171051,
0.445443719625473,
0.26025986671447754,
-0.8497189879417419,
-0.39739149808883667,
-0.19953055679798126,
0.18608872592449188,
0.2547934949398041,
-0.29702508449554443,
-0.005588244181126356,
0.4495537579059601,
0.13259753584861755,
-0.3365646004676819,
0.01765485852956772,
-0.6908956170082092,
-0.04911864548921585,
0.6819014549255371,
-0.0054666767828166485,
0.3731997311115265,
-0.3282124400138855,
-0.6943542957305908,
-0.42400699853897095,
-0.6027507185935974,
0.4727885127067566,
0.2255639284849167,
-0.040884628891944885,
-0.5357996225357056,
0.45769011974334717,
0.020281916484236717,
0.36654582619667053,
-0.057269152253866196,
-0.31833434104919434,
0.45384711027145386,
-0.37642866373062134,
-0.3232560157775879,
-0.19736087322235107,
1.0407379865646362,
0.6642735600471497,
0.15987113118171692,
0.10430878400802612,
-0.024269698187708855,
-0.08016574382781982,
0.31894806027412415,
-0.9428497552871704,
-0.16320200264453888,
-0.014908676035702229,
-0.5857819318771362,
-0.3124781548976898,
0.4379526674747467,
-0.7080187797546387,
0.1135687604546547,
-0.1274082213640213,
0.5366021990776062,
-0.560839056968689,
-0.24930907785892487,
-0.011631102301180363,
-0.015691375359892845,
0.2370699793100357,
0.29015323519706726,
-0.5408880710601807,
0.15182745456695557,
0.3499722182750702,
1.0716558694839478,
-0.21442987024784088,
-0.39006584882736206,
-0.21208538115024567,
0.20106816291809082,
-0.2753654718399048,
0.47199252247810364,
-0.12618635594844818,
-0.3655078113079071,
-0.10095077753067017,
0.3817886710166931,
-0.09779635816812515,
-0.556391716003418,
0.5884585380554199,
-0.212430939078331,
-0.0029341697227209806,
-0.14740322530269623,
-0.1702088862657547,
-0.5745933055877686,
0.11050672829151154,
-0.6380961537361145,
0.8575979471206665,
0.03670397773385048,
-0.8200861811637878,
0.3205384612083435,
-0.5833118557929993,
-0.1884467899799347,
-0.18902896344661713,
-0.024382509291172028,
-0.5920902490615845,
-0.2408093363046646,
0.46153461933135986,
0.4967784881591797,
-0.24396125972270966,
0.4833533465862274,
-0.6290264129638672,
-0.3006909191608429,
0.24017703533172607,
-0.3980032801628113,
0.9449979066848755,
-0.011053241789340973,
-0.34131965041160583,
0.17888742685317993,
-0.5584751963615417,
-0.12689140439033508,
0.24699553847312927,
0.07235422730445862,
-0.18956193327903748,
-0.24847903847694397,
-0.017026716843247414,
0.2505146861076355,
0.12841223180294037,
-0.5160331130027771,
-0.013729237020015717,
-0.1200822964310646,
0.43591415882110596,
0.6980020403862,
0.11533840745687485,
0.26806581020355225,
-0.45384839177131653,
0.599682629108429,
0.12196476757526398,
0.6212159395217896,
-0.21154972910881042,
-0.5246051549911499,
-0.7265001535415649,
-0.5878207683563232,
0.4086383283138275,
0.5325854420661926,
-0.6222200393676758,
0.3754901885986328,
-0.20840342342853546,
-0.4874197840690613,
-0.40772467851638794,
-0.05461103469133377,
0.48533540964126587,
0.513276994228363,
0.3866824805736542,
-0.4955199658870697,
-0.4680503010749817,
-0.8569026589393616,
0.2899940311908722,
-0.03911951556801796,
-0.05084742233157158,
0.6190230846405029,
0.7287282943725586,
-0.17245888710021973,
0.9337466359138489,
-0.6276965141296387,
-0.4877152144908905,
-0.11617621779441833,
0.06878753006458282,
0.07690415531396866,
0.4548039436340332,
0.9065032005310059,
-0.8326908349990845,
-0.4783608615398407,
-0.123493991792202,
-1.145287275314331,
0.08187559247016907,
0.05224888399243355,
-0.26438790559768677,
0.11860243231058121,
0.5015174150466919,
-0.5918274521827698,
0.6918160915374756,
0.4144367575645447,
0.10970429331064224,
0.5053175091743469,
-0.08026029169559479,
0.009590796194970608,
-1.0889302492141724,
0.3658832907676697,
0.08411341905593872,
-0.2457171231508255,
-0.4914904236793518,
0.04272088035941124,
0.04720365256071091,
-0.3727756142616272,
-0.8904275298118591,
0.5172662138938904,
-0.3039216995239258,
0.1227589100599289,
-0.05151026323437691,
0.04330847039818764,
0.05964231118559837,
0.557366132736206,
0.08497543632984161,
0.8718758225440979,
0.7572120428085327,
-0.6065204739570618,
0.034660566598176956,
0.3620566129684448,
-0.33050665259361267,
0.36441922187805176,
-0.9672147631645203,
0.05129290744662285,
-0.06472786515951157,
0.12385249137878418,
-0.317489892244339,
-0.4171135425567627,
0.4206832945346832,
-0.4358889162540436,
0.3460637629032135,
-0.33023011684417725,
-0.18032187223434448,
-0.4244605302810669,
-0.5797809362411499,
0.49999040365219116,
0.7022656202316284,
-0.5884765386581421,
0.31244200468063354,
0.4898231625556946,
0.0951094925403595,
-0.713137686252594,
-0.621179461479187,
-0.30362826585769653,
-0.36766988039016724,
-0.6843919157981873,
0.3574669063091278,
-0.09779361635446548,
-0.044304266571998596,
0.04887882620096207,
0.09143631160259247,
-0.19979332387447357,
-0.08669623732566833,
0.6705360412597656,
0.5289189219474792,
-0.04509818181395531,
-0.15617580711841583,
-0.09236214309930801,
0.030456217005848885,
0.017249932512640953,
-0.031175127252936363,
0.1943107545375824,
-0.24530640244483948,
-0.2850627303123474,
-0.5985113978385925,
0.17210513353347778,
0.6100407838821411,
-0.4136376976966858,
0.7202454805374146,
0.7198830842971802,
-0.4461047947406769,
0.02406935766339302,
-0.3539276123046875,
-0.06205325201153755,
-0.46526849269866943,
0.44079530239105225,
-0.05200417339801788,
-0.6281760931015015,
0.57570880651474,
0.13592927157878876,
-0.1699005514383316,
0.5296074151992798,
0.3589929938316345,
-0.07264799624681473,
0.881563127040863,
0.8862672448158264,
-0.05001402273774147,
0.6183913946151733,
-0.7358459234237671,
0.12873511016368866,
-0.9509158134460449,
-0.37691813707351685,
-0.132711723446846,
-0.03580820560455322,
-0.495601087808609,
-0.5455424785614014,
0.6529684662818909,
0.4499705731868744,
-0.15603679418563843,
0.4657658636569977,
-0.28826066851615906,
0.25949040055274963,
0.4949532747268677,
0.39042291045188904,
-0.01951022446155548,
-0.09502711147069931,
-0.03887629881501198,
-0.09070277214050293,
-0.6508143544197083,
-0.40458929538726807,
1.1414477825164795,
0.6489853858947754,
0.7674608826637268,
-0.033945947885513306,
0.4340539574623108,
0.1703353077173233,
0.11421134322881699,
-0.6900542378425598,
0.6049084067344666,
-0.3466425836086273,
-0.6237596869468689,
-0.267264723777771,
-0.32539764046669006,
-0.7644311785697937,
-0.029820719733834267,
-0.0896754190325737,
-0.7927000522613525,
0.3736746609210968,
0.04708818346261978,
-0.3123307228088379,
0.444231778383255,
-0.56159907579422,
0.9700623750686646,
-0.4222860336303711,
-0.3210501968860626,
0.07278566807508469,
-0.7314975261688232,
0.5789918899536133,
0.10405676811933517,
0.07093736529350281,
-0.23980170488357544,
0.17606158554553986,
0.9938067197799683,
-0.6089165806770325,
0.951250433921814,
-0.1895366758108139,
0.26990774273872375,
0.6938794851303101,
-0.21472613513469696,
0.13271987438201904,
0.22789809107780457,
0.12713821232318878,
0.7463688254356384,
0.05124654620885849,
-0.14523009955883026,
-0.36822912096977234,
0.4048587381839752,
-0.9118643999099731,
-0.30256012082099915,
-0.41635793447494507,
-0.5156465768814087,
0.17829817533493042,
0.36758914589881897,
0.6063501238822937,
0.5190613269805908,
-0.14083513617515564,
0.3354305028915405,
0.5485647320747375,
-0.28211456537246704,
0.5044048428535461,
0.2619546055793762,
-0.2213665246963501,
-0.6804887056350708,
0.9518104791641235,
0.2810768187046051,
0.2954327464103699,
0.07748952507972717,
0.08042696118354797,
-0.06117437034845352,
-0.38789278268814087,
-0.5180397033691406,
0.3382076025009155,
-0.690466582775116,
-0.42410776019096375,
-0.4295004904270172,
-0.43391886353492737,
-0.4170214533805847,
-0.06796375662088394,
-0.508518397808075,
-0.17175835371017456,
-0.577798068523407,
-0.07467099279165268,
0.358206182718277,
0.5532236099243164,
-0.13534684479236603,
0.33183199167251587,
-0.8304516673088074,
0.29233604669570923,
0.30923718214035034,
0.4153885245323181,
-0.0027735719922930002,
-0.611046552658081,
-0.27842992544174194,
0.21561482548713684,
-0.5420786738395691,
-0.6598304510116577,
0.38495659828186035,
0.27033135294914246,
0.5181635022163391,
0.6788393259048462,
0.1459074467420578,
0.5631362795829773,
-0.3918178677558899,
0.9818419218063354,
0.333504855632782,
-0.8198981285095215,
0.5669277906417847,
-0.5885269045829773,
0.19861336052417755,
0.6140561103820801,
0.75129634141922,
-0.10031354427337646,
0.01567424088716507,
-0.67415452003479,
-0.8928059339523315,
0.9039381146430969,
0.1760367453098297,
0.01637442223727703,
0.1567392200231552,
0.35076069831848145,
-0.0040378263220191,
0.1990821659564972,
-0.9177513122558594,
-0.023948509246110916,
-0.4777810275554657,
-0.01660800352692604,
0.17767593264579773,
-0.26702457666397095,
-0.21588584780693054,
-0.4154946804046631,
0.737570583820343,
-0.23623329401016235,
0.5864144563674927,
0.20312385261058807,
-0.16029924154281616,
-0.09404933452606201,
-0.07210827618837357,
0.47857797145843506,
0.6072258949279785,
-0.5274541974067688,
-0.28292116522789,
0.14422187209129333,
-0.6033707857131958,
-0.10155951976776123,
0.11644706130027771,
-0.6381007432937622,
-0.14880038797855377,
0.39761441946029663,
1.2535443305969238,
0.16952674090862274,
-0.6871250867843628,
0.9137577414512634,
-0.020632896572351456,
-0.33469030261039734,
-0.3341306149959564,
0.10911790281534195,
-0.2629523277282715,
0.19945935904979706,
0.045900966972112656,
0.12185110151767731,
0.10806508362293243,
-0.539461612701416,
0.23733849823474884,
0.46465107798576355,
-0.5161083340644836,
-0.4720406234264374,
0.8703229427337646,
-0.014322039671242237,
-0.1415856033563614,
0.6126223206520081,
-0.10978846997022629,
-0.5120812058448792,
0.6829125285148621,
0.47936713695526123,
0.9226096868515015,
-0.049085840582847595,
0.3739367425441742,
0.6176839470863342,
0.2579282522201538,
-0.2237265706062317,
0.09670831263065338,
0.14156322181224823,
-0.5393841862678528,
-0.06531351804733276,
-0.43113094568252563,
-0.35872504115104675,
0.2593804597854614,
-0.9760085940361023,
0.5527603030204773,
-0.6767926812171936,
-0.4384379982948303,
-0.22346238791942596,
-0.4687211811542511,
-0.5031091570854187,
0.19183388352394104,
0.17923612892627716,
0.8696244359016418,
-0.8611016273498535,
0.7254208922386169,
0.68068927526474,
-0.8202380537986755,
-0.8766899704933167,
0.12162824720144272,
-0.11142659187316895,
-0.47746482491493225,
0.38524675369262695,
0.5097613334655762,
-0.020838094875216484,
-0.37932026386260986,
-0.8944539427757263,
-0.9699142575263977,
1.4044476747512817,
0.5049565434455872,
-0.24852077662944794,
-0.11956159770488739,
0.03412816300988197,
0.40211328864097595,
-0.25328487157821655,
0.3648373782634735,
0.21881431341171265,
0.12663744390010834,
0.13153083622455597,
-1.0710890293121338,
-0.06781768798828125,
-0.26371145248413086,
0.1788506954908371,
-0.030364561825990677,
-1.1074997186660767,
0.9898863434791565,
-0.2524562180042267,
-0.24510446190834045,
0.0625673159956932,
0.6871145367622375,
0.05832592397928238,
0.3978743553161621,
0.3746894299983978,
0.6506853699684143,
0.48956868052482605,
0.030631763860583305,
0.9660537242889404,
-0.1988825798034668,
0.39952194690704346,
1.081727147102356,
-0.14295844733715057,
0.9770113229751587,
0.21705184876918793,
-0.22003288567066193,
0.39197760820388794,
0.37312474846839905,
-0.38955867290496826,
0.6599901914596558,
-0.3468940854072571,
0.13080407679080963,
-0.07419806718826294,
-0.4376729726791382,
-0.3918457329273224,
0.5558003187179565,
0.039611026644706726,
-0.3323555588722229,
0.015283240005373955,
0.38817328214645386,
0.045764848589897156,
-0.2359621524810791,
-0.1766645908355713,
0.5029473900794983,
0.2281300127506256,
-0.39330342411994934,
0.7744585275650024,
0.044802483171224594,
0.6683704853057861,
-0.7087840437889099,
-0.028765734285116196,
-0.05001002177596092,
0.22595994174480438,
-0.12526863813400269,
-0.7029553651809692,
0.2996262311935425,
0.014007136225700378,
-0.14971931278705597,
-0.09074154496192932,
0.6897128820419312,
-0.14576782286167145,
-0.46634793281555176,
0.47816935181617737,
0.027415279299020767,
0.19807904958724976,
0.03604038059711456,
-0.6381763219833374,
0.14145658910274506,
0.021147938445210457,
-0.064079150557518,
0.38444191217422485,
0.11526405811309814,
-0.27191078662872314,
0.6954792141914368,
0.4706541895866394,
-0.16152961552143097,
0.14553189277648926,
-0.09152361005544662,
0.9493805766105652,
-0.3819173276424408,
-0.43067654967308044,
-0.5091671347618103,
0.6261206865310669,
-0.0949975922703743,
-0.3941952884197235,
0.7659426927566528,
0.4869365990161896,
1.054863452911377,
-0.2065219134092331,
0.6869879961013794,
-0.256544828414917,
0.26648828387260437,
-0.6390089392662048,
0.7437399625778198,
-0.6403600573539734,
0.0747770145535469,
-0.4678266644477844,
-0.7005500197410583,
-0.15117989480495453,
0.5836569666862488,
-0.22750447690486908,
0.08534242957830429,
0.6623124480247498,
0.7045623064041138,
-0.28639766573905945,
-0.09239877760410309,
0.2338353544473648,
0.19432272017002106,
0.24608688056468964,
0.4203060567378998,
0.4945957660675049,
-0.7481827735900879,
0.6020293235778809,
-0.8053024411201477,
-0.3029528558254242,
-0.15418241918087006,
-0.7945061326026917,
-1.1363002061843872,
-0.5019753575325012,
-0.402154803276062,
-0.22788523137569427,
0.052881281822919846,
0.6744351387023926,
0.9650729894638062,
-0.7658544778823853,
-0.34493714570999146,
0.18969352543354034,
-0.1883133202791214,
-0.22634480893611908,
-0.2186821699142456,
0.4758402705192566,
0.27472659945487976,
-0.5526827573776245,
0.21179358661174774,
0.1393783688545227,
0.27932509779930115,
-0.0511099249124527,
-0.04325233772397041,
-0.3692513704299927,
-0.08154956251382828,
0.4532041847705841,
0.43707332015037537,
-0.576386034488678,
-0.28169357776641846,
0.14267632365226746,
0.14144280552864075,
0.27127811312675476,
0.48407140374183655,
-0.5196641087532043,
0.43784135580062866,
0.4012434184551239,
0.38599011301994324,
0.6926435232162476,
0.2637791633605957,
0.2454540878534317,
-0.6039680242538452,
0.413791298866272,
0.034320104867219925,
0.3518800735473633,
0.3158625662326813,
-0.3493286073207855,
0.6413830518722534,
0.4056873023509979,
-0.4287722110748291,
-0.8842076063156128,
-0.0486065149307251,
-1.1598104238510132,
-0.0499483160674572,
1.0952329635620117,
-0.4994242489337921,
-0.4830893874168396,
0.3780196011066437,
-0.22360298037528992,
0.38812509179115295,
-0.3693227171897888,
0.4406105577945709,
0.3683982193470001,
-0.045456912368535995,
-0.4100513160228729,
-0.7697249054908752,
0.29314863681793213,
0.14689214527606964,
-0.8296655416488647,
-0.2130109816789627,
0.35979539155960083,
0.4507583677768707,
0.2103273868560791,
0.4713623821735382,
-0.30183687806129456,
0.3508225381374359,
-0.027064664289355278,
0.29542988538742065,
-0.3566587567329407,
-0.6638354659080505,
-0.4573528468608856,
0.04296508803963661,
-0.09897742420434952,
-0.43168532848358154
] |
jonatasgrosman/wav2vec2-large-xlsr-53-russian | jonatasgrosman | "2022-12-14T01:58:43Z" | 1,184,530 | 33 | transformers | [
"transformers",
"pytorch",
"jax",
"wav2vec2",
"automatic-speech-recognition",
"audio",
"hf-asr-leaderboard",
"mozilla-foundation/common_voice_6_0",
"robust-speech-event",
"ru",
"speech",
"xlsr-fine-tuning-week",
"dataset:common_voice",
"dataset:mozilla-foundation/common_voice_6_0",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | automatic-speech-recognition | "2022-03-02T23:29:05Z" | ---
language: ru
license: apache-2.0
datasets:
- common_voice
- mozilla-foundation/common_voice_6_0
metrics:
- wer
- cer
tags:
- audio
- automatic-speech-recognition
- hf-asr-leaderboard
- mozilla-foundation/common_voice_6_0
- robust-speech-event
- ru
- speech
- xlsr-fine-tuning-week
model-index:
- name: XLSR Wav2Vec2 Russian by Jonatas Grosman
results:
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Common Voice ru
type: common_voice
args: ru
metrics:
- name: Test WER
type: wer
value: 13.3
- name: Test CER
type: cer
value: 2.88
- name: Test WER (+LM)
type: wer
value: 9.57
- name: Test CER (+LM)
type: cer
value: 2.24
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Robust Speech Event - Dev Data
type: speech-recognition-community-v2/dev_data
args: ru
metrics:
- name: Dev WER
type: wer
value: 40.22
- name: Dev CER
type: cer
value: 14.8
- name: Dev WER (+LM)
type: wer
value: 33.61
- name: Dev CER (+LM)
type: cer
value: 13.5
---
# Fine-tuned XLSR-53 large model for speech recognition in Russian
Fine-tuned [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) on Russian using the train and validation splits of [Common Voice 6.1](https://huggingface.co/datasets/common_voice) and [CSS10](https://github.com/Kyubyong/css10).
When using this model, make sure that your speech input is sampled at 16kHz.
This model has been fine-tuned thanks to the GPU credits generously given by the [OVHcloud](https://www.ovhcloud.com/en/public-cloud/ai-training/) :)
The script used for training can be found here: https://github.com/jonatasgrosman/wav2vec2-sprint
## Usage
The model can be used directly (without a language model) as follows...
Using the [HuggingSound](https://github.com/jonatasgrosman/huggingsound) library:
```python
from huggingsound import SpeechRecognitionModel
model = SpeechRecognitionModel("jonatasgrosman/wav2vec2-large-xlsr-53-russian")
audio_paths = ["/path/to/file.mp3", "/path/to/another_file.wav"]
transcriptions = model.transcribe(audio_paths)
```
Writing your own inference script:
```python
import torch
import librosa
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
LANG_ID = "ru"
MODEL_ID = "jonatasgrosman/wav2vec2-large-xlsr-53-russian"
SAMPLES = 5
test_dataset = load_dataset("common_voice", LANG_ID, split=f"test[:{SAMPLES}]")
processor = Wav2Vec2Processor.from_pretrained(MODEL_ID)
model = Wav2Vec2ForCTC.from_pretrained(MODEL_ID)
# Preprocessing the datasets.
# We need to read the audio files as arrays
def speech_file_to_array_fn(batch):
speech_array, sampling_rate = librosa.load(batch["path"], sr=16_000)
batch["speech"] = speech_array
batch["sentence"] = batch["sentence"].upper()
return batch
test_dataset = test_dataset.map(speech_file_to_array_fn)
inputs = processor(test_dataset["speech"], sampling_rate=16_000, return_tensors="pt", padding=True)
with torch.no_grad():
logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
predicted_ids = torch.argmax(logits, dim=-1)
predicted_sentences = processor.batch_decode(predicted_ids)
for i, predicted_sentence in enumerate(predicted_sentences):
print("-" * 100)
print("Reference:", test_dataset[i]["sentence"])
print("Prediction:", predicted_sentence)
```
| Reference | Prediction |
| ------------- | ------------- |
| ОН РАБОТАТЬ, А ЕЕ НЕ УДЕРЖАТЬ НИКАК — БЕГАЕТ ЗА КЛЁШЕМ КАЖДОГО БУЛЬВАРНИКА. | ОН РАБОТАТЬ А ЕЕ НЕ УДЕРЖАТ НИКАК БЕГАЕТ ЗА КЛЕШОМ КАЖДОГО БУЛЬБАРНИКА |
| ЕСЛИ НЕ БУДЕТ ВОЗРАЖЕНИЙ, Я БУДУ СЧИТАТЬ, ЧТО АССАМБЛЕЯ СОГЛАСНА С ЭТИМ ПРЕДЛОЖЕНИЕМ. | ЕСЛИ НЕ БУДЕТ ВОЗРАЖЕНИЙ Я БУДУ СЧИТАТЬ ЧТО АССАМБЛЕЯ СОГЛАСНА С ЭТИМ ПРЕДЛОЖЕНИЕМ |
| ПАЛЕСТИНЦАМ НЕОБХОДИМО СНАЧАЛА УСТАНОВИТЬ МИР С ИЗРАИЛЕМ, А ЗАТЕМ ДОБИВАТЬСЯ ПРИЗНАНИЯ ГОСУДАРСТВЕННОСТИ. | ПАЛЕСТИНЦАМ НЕОБХОДИМО СНАЧАЛА УСТАНОВИТЬ С НИ МИР ФЕЗРЕЛЕМ А ЗАТЕМ ДОБИВАТЬСЯ ПРИЗНАНИЯ ГОСУДАРСТВЕНСКИ |
| У МЕНЯ БЫЛО ТАКОЕ ЧУВСТВО, ЧТО ЧТО-ТО ТАКОЕ ОЧЕНЬ ВАЖНОЕ Я ПРИБАВЛЯЮ. | У МЕНЯ БЫЛО ТАКОЕ ЧУВСТВО ЧТО ЧТО-ТО ТАКОЕ ОЧЕНЬ ВАЖНОЕ Я ПРЕДБАВЛЯЕТ |
| ТОЛЬКО ВРЯД ЛИ ПОЙМЕТ. | ТОЛЬКО ВРЯД ЛИ ПОЙМЕТ |
| ВРОНСКИЙ, СЛУШАЯ ОДНИМ УХОМ, ПЕРЕВОДИЛ БИНОКЛЬ С БЕНУАРА НА БЕЛЬ-ЭТАЖ И ОГЛЯДЫВАЛ ЛОЖИ. | ЗЛАЗКИ СЛУШАЮ ОТ ОДНИМ УХАМ ТЫ ВОТИ В ВИНОКОТ СПИЛА НА ПЕРЕТАЧ И ОКЛЯДЫВАЛ БОСУ |
| К СОЖАЛЕНИЮ, СИТУАЦИЯ ПРОДОЛЖАЕТ УХУДШАТЬСЯ. | К СОЖАЛЕНИЮ СИТУАЦИИ ПРОДОЛЖАЕТ УХУЖАТЬСЯ |
| ВСЁ ЖАЛОВАНИЕ УХОДИЛО НА ДОМАШНИЕ РАСХОДЫ И НА УПЛАТУ МЕЛКИХ НЕПЕРЕВОДИВШИХСЯ ДОЛГОВ. | ВСЕ ЖАЛОВАНИЕ УХОДИЛО НА ДОМАШНИЕ РАСХОДЫ И НА УПЛАТУ МЕЛКИХ НЕ ПЕРЕВОДИВШИХСЯ ДОЛГОВ |
| ТЕПЕРЬ ДЕЛО, КОНЕЧНО, ЗА ТЕМ, ЧТОБЫ ПРЕВРАТИТЬ СЛОВА В ДЕЛА. | ТЕПЕРЬ ДЕЛАЮ КОНЕЧНО ЗАТЕМ ЧТОБЫ ПРЕВРАТИТЬ СЛОВА В ДЕЛА |
| ДЕВЯТЬ | ЛЕВЕТЬ |
## Evaluation
1. To evaluate on `mozilla-foundation/common_voice_6_0` with split `test`
```bash
python eval.py --model_id jonatasgrosman/wav2vec2-large-xlsr-53-russian --dataset mozilla-foundation/common_voice_6_0 --config ru --split test
```
2. To evaluate on `speech-recognition-community-v2/dev_data`
```bash
python eval.py --model_id jonatasgrosman/wav2vec2-large-xlsr-53-russian --dataset speech-recognition-community-v2/dev_data --config ru --split validation --chunk_length_s 5.0 --stride_length_s 1.0
```
## Citation
If you want to cite this model you can use this:
```bibtex
@misc{grosman2021xlsr53-large-russian,
title={Fine-tuned {XLSR}-53 large model for speech recognition in {R}ussian},
author={Grosman, Jonatas},
howpublished={\url{https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-russian}},
year={2021}
}
``` | [
-0.49102237820625305,
-0.5980230569839478,
0.20731595158576965,
0.1410287618637085,
-0.3018975555896759,
-0.11786732822656631,
-0.24717485904693604,
-0.4116494953632355,
0.30818966031074524,
0.15552197396755219,
-0.5913642048835754,
-0.541431725025177,
-0.4035887122154236,
-0.11429367959499359,
-0.44159427285194397,
0.9402838349342346,
0.22666460275650024,
0.10025832056999207,
-0.15645012259483337,
-0.11622314155101776,
-0.3839150071144104,
-0.36167919635772705,
-0.5508008003234863,
-0.40970146656036377,
0.37264180183410645,
0.20873714983463287,
0.5121843814849854,
0.37336888909339905,
0.47504308819770813,
0.4526010751724243,
-0.11863107979297638,
0.06914378702640533,
-0.17238172888755798,
0.16961276531219482,
0.2211628258228302,
-0.40212324261665344,
-0.3053893446922302,
-0.06531494855880737,
0.7273430228233337,
0.44552862644195557,
-0.33006182312965393,
0.37398648262023926,
-0.03748064488172531,
0.5277787446975708,
-0.32704266905784607,
-0.006726950407028198,
-0.30638134479522705,
-0.1413222849369049,
-0.11012665927410126,
-0.10573685169219971,
-0.14266562461853027,
-0.4201626777648926,
0.16158297657966614,
-0.40445181727409363,
0.12267673760652542,
0.14340925216674805,
1.1835007667541504,
-0.03805151954293251,
-0.10732437670230865,
-0.1436654031276703,
-0.7451813220977783,
1.0715762376785278,
-0.8319819569587708,
0.4121583104133606,
0.530455470085144,
0.023726224899291992,
-0.11363565176725388,
-0.6966556906700134,
-0.6552618741989136,
-0.12870356440544128,
-0.11786292493343353,
0.34163445234298706,
-0.4193742275238037,
-0.16893206536769867,
0.3815224766731262,
0.16192948818206787,
-0.8110049962997437,
-0.011517842300236225,
-0.6336589455604553,
-0.3619341254234314,
0.6749810576438904,
0.11164045333862305,
0.3071753978729248,
-0.36331039667129517,
-0.08090391755104065,
-0.24927939474582672,
-0.18214242160320282,
0.3215498626232147,
0.42829304933547974,
0.1441430151462555,
-0.4364672303199768,
0.5319925546646118,
-0.3418441116809845,
0.7812067270278931,
0.07716817408800125,
-0.3166508376598358,
0.7645196318626404,
-0.43601593375205994,
-0.428663045167923,
0.0019090722780674696,
1.1706112623214722,
0.2696599066257477,
0.1861465573310852,
0.07186312973499298,
-0.11298929154872894,
0.19698743522167206,
-0.13756345212459564,
-0.8613625764846802,
-0.10468530654907227,
0.4059721529483795,
-0.28643694519996643,
-0.3118288516998291,
0.04655599594116211,
-0.8661677241325378,
0.03888953849673271,
-0.2613023817539215,
0.5206251740455627,
-0.7015026807785034,
-0.15148106217384338,
0.13693878054618835,
-0.0680193305015564,
0.15374386310577393,
0.11891872435808182,
-0.9041873812675476,
0.4433024227619171,
0.4511643052101135,
0.9608660936355591,
0.2551189959049225,
-0.3241158723831177,
-0.4214819371700287,
-0.17547446489334106,
-0.2113964706659317,
0.6703848242759705,
-0.21529267728328705,
-0.2055947333574295,
-0.12874022126197815,
0.006604902446269989,
-0.2236478626728058,
-0.29689881205558777,
0.441934198141098,
-0.22347918152809143,
0.5506733059883118,
-0.025068635120987892,
-0.49859458208084106,
-0.1802365779876709,
0.05314857140183449,
-0.48037809133529663,
1.17283034324646,
-0.09704442322254181,
-0.8854417204856873,
0.11129340529441833,
-0.6329162120819092,
-0.4481237530708313,
-0.12937524914741516,
-0.02360621653497219,
-0.6003431081771851,
-0.11884663999080658,
0.1941089630126953,
0.6123591661453247,
-0.31643202900886536,
0.07371994853019714,
-0.31052401661872864,
-0.38587310910224915,
0.4755672514438629,
-0.224196195602417,
0.9773046970367432,
0.31854066252708435,
-0.46459072828292847,
0.08589383214712143,
-0.9876283407211304,
0.4334573745727539,
0.1600235551595688,
-0.39641907811164856,
-0.10202592611312866,
-0.20813655853271484,
0.13991689682006836,
0.28632137179374695,
0.1308375597000122,
-0.5907660126686096,
-0.15801167488098145,
-0.7608627676963806,
0.6142902374267578,
0.7801496982574463,
-0.025315014645457268,
0.393295019865036,
-0.5468670725822449,
0.39289045333862305,
-0.05113080516457558,
-0.06402893364429474,
-0.13377051055431366,
-0.3334171175956726,
-0.8884355425834656,
-0.3743516206741333,
0.2815540134906769,
0.6294613480567932,
-0.3890436291694641,
0.7985592484474182,
-0.17027468979358673,
-0.8484410047531128,
-0.7290970683097839,
-0.1261245757341385,
0.42958781123161316,
0.38567137718200684,
0.4643312096595764,
0.07734235376119614,
-0.8629693388938904,
-0.8162458539009094,
-0.13948434591293335,
-0.21328040957450867,
-0.02549206279218197,
0.3141978085041046,
0.7702776789665222,
-0.20740735530853271,
0.7894780039787292,
-0.5744918584823608,
-0.20829443633556366,
-0.22233907878398895,
0.0396936796605587,
0.4187721610069275,
0.837234616279602,
0.5209123492240906,
-0.8531934022903442,
-0.639219343662262,
0.06719433516263962,
-0.5796911716461182,
-0.028760163113474846,
0.011099942959845066,
0.005473388824611902,
0.4538815915584564,
0.26440972089767456,
-0.781853199005127,
0.4439232349395752,
0.48129892349243164,
-0.4525584280490875,
0.8468467593193054,
-0.0888533964753151,
0.12222693860530853,
-1.3538684844970703,
0.3944850265979767,
0.10449295490980148,
-0.25067660212516785,
-0.8286754488945007,
-0.2941022515296936,
-0.16579385101795197,
0.15468020737171173,
-0.3691328167915344,
0.6602634191513062,
-0.4749843180179596,
0.04080153629183769,
0.014446595683693886,
0.15945714712142944,
-0.08775751292705536,
0.49892866611480713,
0.023792704567313194,
0.6130014657974243,
0.8261414170265198,
-0.4954375624656677,
0.6538304686546326,
0.2313212901353836,
-0.6701922416687012,
0.3342534899711609,
-0.9009233713150024,
0.18331024050712585,
-0.08468127995729446,
0.051614195108413696,
-1.1658145189285278,
-0.35522231459617615,
0.5182033777236938,
-0.9548289775848389,
0.19804315268993378,
0.010414917953312397,
-0.42692092061042786,
-0.4796243906021118,
-0.26302242279052734,
0.16330786049365997,
0.6280477643013,
-0.23781545460224152,
0.5225228071212769,
0.24514660239219666,
-0.17182989418506622,
-0.8237873315811157,
-0.9159256815910339,
-0.2439649999141693,
-0.17848742008209229,
-0.8732057213783264,
0.2222139984369278,
-0.277626633644104,
-0.2267715334892273,
-0.017097169533371925,
-0.07308174669742584,
-0.07273395359516144,
-0.07639386504888535,
0.36647137999534607,
0.46345487236976624,
-0.14268328249454498,
0.04703136160969734,
-0.26016461849212646,
-0.012762142345309258,
0.09961683303117752,
-0.0785067081451416,
0.8496997952461243,
-0.28633272647857666,
-0.2212040275335312,
-0.8414034247398376,
0.2835227847099304,
0.6695368885993958,
-0.22891803085803986,
0.7025657296180725,
0.9085348844528198,
-0.35457414388656616,
-0.06705824285745621,
-0.5255559086799622,
-0.02828696370124817,
-0.47480008006095886,
0.6654577851295471,
-0.198748379945755,
-0.7667750120162964,
0.6748003363609314,
0.24623996019363403,
-0.1242685541510582,
0.5198314189910889,
0.630044162273407,
-0.22827966511249542,
1.0747519731521606,
0.21988624334335327,
0.025749672204256058,
0.6760978698730469,
-0.7318122386932373,
0.005609291139990091,
-0.7139747142791748,
-0.5677375793457031,
-0.6689943075180054,
-0.2885942757129669,
-0.5401228666305542,
-0.344926118850708,
0.16049477458000183,
-0.14767751097679138,
-0.2987470030784607,
0.2855525314807892,
-0.6780722737312317,
0.27396851778030396,
0.5497892498970032,
0.15902721881866455,
-0.18290649354457855,
0.08818791061639786,
-0.25055649876594543,
0.03718047961592674,
-0.6246436238288879,
-0.36612561345100403,
1.0628174543380737,
0.2045515477657318,
0.7560299634933472,
0.15163420140743256,
0.5732964277267456,
0.12966278195381165,
-0.27468141913414,
-0.9824013710021973,
0.6930786371231079,
0.0058968826197087765,
-0.6909191608428955,
-0.5149067640304565,
-0.37692078948020935,
-0.9380123615264893,
0.37305331230163574,
-0.3349151611328125,
-1.1657614707946777,
0.16642501950263977,
0.034823328256607056,
-0.5080372095108032,
0.20170290768146515,
-0.5947218537330627,
0.8287673592567444,
-0.023308757692575455,
-0.5756872892379761,
-0.18610483407974243,
-0.8119170665740967,
0.25204598903656006,
0.02953035570681095,
0.11879824101924896,
-0.10401570051908493,
0.2957014739513397,
1.250567078590393,
-0.4166029393672943,
0.6091393828392029,
-0.08325541764497757,
0.2651599943637848,
0.3875409960746765,
-0.1292426884174347,
0.5297906994819641,
-0.04507401958107948,
-0.16365453600883484,
0.14157907664775848,
0.3202531039714813,
-0.30815619230270386,
-0.4263431131839752,
0.8365047574043274,
-1.0894001722335815,
-0.5250951647758484,
-0.7771227955818176,
-0.4535386562347412,
0.08405695110559464,
0.4033752977848053,
0.5957564115524292,
0.7127678990364075,
-0.21393556892871857,
0.6055031418800354,
0.5463551878929138,
-0.19785372912883759,
0.5367957949638367,
0.3141964077949524,
-0.14270323514938354,
-0.6780412197113037,
0.698641836643219,
0.28912025690078735,
0.2814883887767792,
0.16332948207855225,
0.32530155777931213,
-0.4003150463104248,
-0.5739315748214722,
-0.0844845101237297,
0.34678441286087036,
-0.6432708501815796,
-0.2613796591758728,
-0.6318134069442749,
-0.18784014880657196,
-0.8910480737686157,
0.04087413102388382,
-0.28300249576568604,
-0.39947956800460815,
-0.4875571131706238,
-0.11378356069326401,
0.510211706161499,
0.5176399350166321,
-0.2937307059764862,
0.1914188414812088,
-0.6733632683753967,
0.2100343108177185,
0.07890651375055313,
0.12493479251861572,
-0.009061617776751518,
-0.8093715906143188,
-0.44863975048065186,
0.2750559151172638,
-0.25754082202911377,
-0.8357601165771484,
0.6593496203422546,
-0.07568758726119995,
0.49056893587112427,
0.378083735704422,
-0.03255784139037132,
0.8265748620033264,
-0.2784343659877777,
0.7658016681671143,
0.5138585567474365,
-1.2003034353256226,
0.7199222445487976,
-0.4216381311416626,
0.4003763794898987,
0.2980867326259613,
0.3035091161727905,
-0.792168140411377,
-0.17258000373840332,
-0.6625354290008545,
-0.7365832924842834,
1.1753509044647217,
0.35507747530937195,
0.01936151273548603,
0.14540264010429382,
0.1400628387928009,
-0.2674058973789215,
0.12416408210992813,
-0.6807887554168701,
-0.638339102268219,
-0.19386115670204163,
-0.24251697957515717,
-0.09041553735733032,
-0.1670779287815094,
-0.21693982183933258,
-0.6266698837280273,
0.9494244456291199,
0.2416408658027649,
0.47499632835388184,
0.46624791622161865,
0.12936517596244812,
-0.15490877628326416,
0.32522696256637573,
0.8364871144294739,
0.6720948815345764,
-0.3617856204509735,
-0.062451738864183426,
0.31548136472702026,
-0.6629868745803833,
0.2007862776517868,
0.11048131436109543,
-0.3460727334022522,
0.18060968816280365,
0.4267648160457611,
1.2187645435333252,
0.04771152138710022,
-0.506391704082489,
0.49337005615234375,
0.0118061238899827,
-0.3116341829299927,
-0.7652453780174255,
0.01792452670633793,
0.14106489717960358,
0.21195407211780548,
0.3784911334514618,
0.3410888612270355,
-0.09169795364141464,
-0.5716375112533569,
0.1582728624343872,
0.48776912689208984,
-0.3068613111972809,
-0.4507107436656952,
0.5721731185913086,
-0.019415905699133873,
-0.4421347379684448,
0.45594459772109985,
0.0586216077208519,
-0.5716760754585266,
0.8036180734634399,
0.6994741559028625,
0.8114100694656372,
-0.562093198299408,
0.07137426733970642,
0.8119703531265259,
0.2066000998020172,
-0.1367524266242981,
0.42525985836982727,
0.1427675187587738,
-0.7494162917137146,
-0.1999378502368927,
-0.7281941771507263,
-0.042069870978593826,
0.4734605848789215,
-0.7580726742744446,
0.27957016229629517,
-0.5641485452651978,
-0.36257052421569824,
0.3405514359474182,
0.2519536018371582,
-0.651206374168396,
0.24082601070404053,
0.23266816139221191,
0.8347105979919434,
-0.9002429246902466,
0.9217566847801208,
0.6763105988502502,
-0.32227250933647156,
-1.0268241167068481,
-0.016840152442455292,
-0.09415017813444138,
-0.6059280037879944,
0.8088194727897644,
0.13597558438777924,
-0.1543169766664505,
-0.0013231527991592884,
-0.5478468537330627,
-1.1729093790054321,
1.3257936239242554,
0.2557503879070282,
-0.6463793516159058,
0.11124779284000397,
0.024121509864926338,
0.45306459069252014,
-0.20774273574352264,
0.3418208360671997,
0.5892707109451294,
0.6345072984695435,
0.22939108312129974,
-1.086824655532837,
0.3608998656272888,
-0.37410104274749756,
-0.20848487317562103,
0.11971554160118103,
-0.8317256569862366,
1.0458813905715942,
-0.33018550276756287,
-0.06887368857860565,
0.3091777563095093,
0.6053030490875244,
0.213786318898201,
0.3077795207500458,
0.47836023569107056,
0.6467708349227905,
0.8108654618263245,
-0.25407299399375916,
0.7666010856628418,
-0.12240918725728989,
0.5667234659194946,
0.800959050655365,
0.0713890865445137,
0.9297237992286682,
0.4581468403339386,
-0.4856201410293579,
0.37356817722320557,
0.4420464336872101,
-0.4279366731643677,
0.5758097171783447,
0.1576978713274002,
-0.4422312080860138,
-0.2978823184967041,
0.05143440514802933,
-0.4163160026073456,
0.6747206449508667,
0.14278006553649902,
-0.3474808931350708,
0.2129606306552887,
0.11229892820119858,
0.19880542159080505,
-0.13890573382377625,
-0.06981390714645386,
0.7175556421279907,
0.03147263452410698,
-0.6803106665611267,
0.8389735817909241,
-0.0568590983748436,
0.6607082486152649,
-0.8977394104003906,
0.19632817804813385,
0.07847018539905548,
0.21092534065246582,
-0.4979657530784607,
-0.7039130926132202,
0.182662695646286,
0.06428860127925873,
-0.28861570358276367,
0.1288708746433258,
0.7697155475616455,
-0.4170939028263092,
-0.7062683701515198,
0.4279838502407074,
0.2240159809589386,
0.26603302359580994,
0.08761326968669891,
-0.7363085150718689,
0.14218419790267944,
0.22919456660747528,
-0.5864750742912292,
0.2519262135028839,
0.31177160143852234,
0.356933057308197,
0.7586387991905212,
0.8559151887893677,
0.3449866771697998,
0.05023329332470894,
-0.1922772377729416,
0.8438295125961304,
-0.8377497792243958,
-0.5817241072654724,
-0.9099428653717041,
0.5681607723236084,
-0.04341656342148781,
-0.25563403964042664,
0.7729791402816772,
0.761161208152771,
0.7208740711212158,
-0.0010402085026726127,
1.0096489191055298,
-0.35379502177238464,
0.6657312512397766,
-0.4955284297466278,
0.8865739703178406,
-0.6494274735450745,
-0.09270381927490234,
-0.3329263925552368,
-0.6787380576133728,
-0.3570241928100586,
0.8427965641021729,
-0.4120830297470093,
0.2176089733839035,
0.6815435886383057,
0.9952502846717834,
0.07886914908885956,
-0.11117690056562424,
0.37073734402656555,
0.4950871765613556,
0.12602771818637848,
0.6014965772628784,
0.6856621503829956,
-0.6729522347450256,
0.8709827065467834,
-0.5859315395355225,
-0.07877375185489655,
-0.2719905972480774,
-0.5324926376342773,
-0.9501672387123108,
-0.8242964744567871,
-0.31313657760620117,
-0.6047490835189819,
-0.06479223072528839,
1.2968686819076538,
0.8328648209571838,
-0.8410218358039856,
-0.3580993711948395,
0.1785905808210373,
0.03961484506726265,
-0.44731807708740234,
-0.276915967464447,
0.5902636647224426,
0.09949303418397903,
-0.9676575064659119,
0.23882079124450684,
-0.15422743558883667,
0.18804199993610382,
-0.06258606910705566,
-0.17887774109840393,
-0.5435605645179749,
0.09999780356884003,
0.36814332008361816,
0.2842945456504822,
-0.8365731239318848,
-0.3540973663330078,
0.01399479154497385,
-0.19356317818164825,
0.1538134217262268,
0.20580066740512848,
-0.6643134355545044,
0.25290676951408386,
0.7319781184196472,
0.11383043229579926,
0.6023097634315491,
-0.03984322026371956,
0.15026338398456573,
-0.46673011779785156,
0.2837247848510742,
0.2646172046661377,
0.5546801090240479,
0.2551979124546051,
-0.37402477860450745,
0.3026549816131592,
0.4546110928058624,
-0.6829884648323059,
-0.9955508708953857,
-0.08741042017936707,
-1.3825571537017822,
-0.18540489673614502,
1.2982640266418457,
-0.12664152681827545,
-0.26496046781539917,
0.15606287121772766,
-0.21929895877838135,
0.5667453408241272,
-0.697708010673523,
0.59651118516922,
0.6826017498970032,
-0.1176961287856102,
-0.005321309436112642,
-0.6265432834625244,
0.5022037625312805,
0.4096212089061737,
-0.6588439345359802,
0.041346773505210876,
0.4415152668952942,
0.5573840737342834,
0.44009098410606384,
0.7543465495109558,
0.1243395209312439,
0.3740617036819458,
0.00924802478402853,
0.20877742767333984,
-0.20535703003406525,
-0.055960580706596375,
-0.4943600594997406,
0.0176076702773571,
-0.4056715667247772,
-0.5518882870674133
] |
laion/CLIP-ViT-H-14-laion2B-s32B-b79K | laion | "2023-04-18T17:45:56Z" | 1,182,059 | 193 | open_clip | [
"open_clip",
"pytorch",
"clip",
"zero-shot-image-classification",
"arxiv:1910.04867",
"license:mit",
"has_space",
"region:us"
] | zero-shot-image-classification | "2022-09-14T22:52:28Z" | ---
license: mit
widget:
- src: >-
https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
candidate_labels: playing music, playing sports
example_title: Cat & Dog
library_name: open_clip
pipeline_tag: zero-shot-image-classification
---
# Model Card for CLIP ViT-H/14 - LAION-2B
# Table of Contents
1. [Model Details](#model-details)
2. [Uses](#uses)
3. [Training Details](#training-details)
4. [Evaluation](#evaluation)
5. [Acknowledgements](#acknowledgements)
6. [Citation](#citation)
7. [How To Get Started With the Model](#how-to-get-started-with-the-model)
# Model Details
## Model Description
A CLIP ViT-H/14 model trained with the LAION-2B English subset of LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/open_clip).
Model training done by Romain Beaumont on the [stability.ai](https://stability.ai/) cluster.
# Uses
As per the original [OpenAI CLIP model card](https://github.com/openai/CLIP/blob/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1/model-card.md), this model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such model.
The OpenAI CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis. Additionally, the LAION-5B blog (https://laion.ai/blog/laion-5b/) and upcoming paper include additional discussion as it relates specifically to the training dataset.
## Direct Use
Zero-shot image classification, image and text retrieval, among others.
## Downstream Use
Image classification and other image task fine-tuning, linear probe image classification, image generation guiding and conditioning, among others.
## Out-of-Scope Use
As per the OpenAI models,
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
Further the above notice, the LAION-5B dataset used in training of these models has additional considerations, see below.
# Training Details
## Training Data
This model was trained with the 2 Billion sample English subset of LAION-5B (https://laion.ai/blog/laion-5b/).
**IMPORTANT NOTE:** The motivation behind dataset creation is to democratize research and experimentation around large-scale multi-modal model training and handling of uncurated, large-scale datasets crawled from publically available internet. Our recommendation is therefore to use the dataset for research purposes. Be aware that this large-scale dataset is uncurated. Keep in mind that the uncurated nature of the dataset means that collected links may lead to strongly discomforting and disturbing content for a human viewer. Therefore, please use the demo links with caution and at your own risk. It is possible to extract a “safe” subset by filtering out samples based on the safety tags (using a customized trained NSFW classifier that we built). While this strongly reduces the chance for encountering potentially harmful content when viewing, we cannot entirely exclude the possibility for harmful content being still present in safe mode, so that the warning holds also there. We think that providing the dataset openly to broad research and other interested communities will allow for transparent investigation of benefits that come along with training large-scale models as well as pitfalls and dangers that may stay unreported or unnoticed when working with closed large datasets that remain restricted to a small community. Providing our dataset openly, we however do not recommend using it for creating ready-to-go industrial products, as the basic research about general properties and safety of such large-scale models, which we would like to encourage with this release, is still in progress.
## Training Procedure
Please see [training notes](https://docs.google.com/document/d/1EFbMLRWSSV0LUf9Du1pWzWqgeiIRPwEWX2s1C6mAk5c) and [wandb logs](https://wandb.ai/rom1504/eval_openclip/reports/H-14--VmlldzoyNDAxODQ3).
# Evaluation
Evaluation done with code in the [LAION CLIP Benchmark suite](https://github.com/LAION-AI/CLIP_benchmark).
## Testing Data, Factors & Metrics
### Testing Data
The testing is performed with VTAB+ (A combination of VTAB (https://arxiv.org/abs/1910.04867) w/ additional robustness datasets) for classification and COCO and Flickr for retrieval.
**TODO** - more detail
## Results
The model achieves a 78.0 zero-shot top-1 accuracy on ImageNet-1k.
An initial round of benchmarks have been performed on a wider range of datasets, currently viewable at https://github.com/LAION-AI/CLIP_benchmark/blob/main/benchmark/results.ipynb
**TODO** - create table for just this model's metrics.
# Acknowledgements
Acknowledging [stability.ai](https://stability.ai/) for the compute used to train this model.
# Citation
**BibTeX:**
LAION-5B
```bibtex
@inproceedings{schuhmann2022laionb,
title={{LAION}-5B: An open large-scale dataset for training next generation image-text models},
author={Christoph Schuhmann and
Romain Beaumont and
Richard Vencu and
Cade W Gordon and
Ross Wightman and
Mehdi Cherti and
Theo Coombes and
Aarush Katta and
Clayton Mullis and
Mitchell Wortsman and
Patrick Schramowski and
Srivatsa R Kundurthy and
Katherine Crowson and
Ludwig Schmidt and
Robert Kaczmarczyk and
Jenia Jitsev},
booktitle={Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
year={2022},
url={https://openreview.net/forum?id=M3Y74vmsMcY}
}
```
OpenAI CLIP paper
```
@inproceedings{Radford2021LearningTV,
title={Learning Transferable Visual Models From Natural Language Supervision},
author={Alec Radford and Jong Wook Kim and Chris Hallacy and A. Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
booktitle={ICML},
year={2021}
}
```
OpenCLIP software
```
@software{ilharco_gabriel_2021_5143773,
author = {Ilharco, Gabriel and
Wortsman, Mitchell and
Wightman, Ross and
Gordon, Cade and
Carlini, Nicholas and
Taori, Rohan and
Dave, Achal and
Shankar, Vaishaal and
Namkoong, Hongseok and
Miller, John and
Hajishirzi, Hannaneh and
Farhadi, Ali and
Schmidt, Ludwig},
title = {OpenCLIP},
month = jul,
year = 2021,
note = {If you use this software, please cite it as below.},
publisher = {Zenodo},
version = {0.1},
doi = {10.5281/zenodo.5143773},
url = {https://doi.org/10.5281/zenodo.5143773}
}
```
# How to Get Started with the Model
Use the code below to get started with the model.
** TODO ** - Hugging Face transformers, OpenCLIP, and timm getting started snippets | [
-0.2912047803401947,
-0.5678616166114807,
0.20812733471393585,
0.02528180554509163,
-0.3768022656440735,
-0.43453097343444824,
-0.19491781294345856,
-0.6510435938835144,
-0.007727808319032192,
0.43786609172821045,
-0.4258979856967926,
-0.5864419937133789,
-0.5891714096069336,
-0.0757661759853363,
-0.39484158158302307,
0.9038341045379639,
-0.2063930183649063,
-0.03606291115283966,
-0.2923300266265869,
-0.41431909799575806,
-0.4825996458530426,
-0.5623615980148315,
-0.4034578502178192,
0.05500178039073944,
0.15975379943847656,
0.2661796808242798,
0.6081527471542358,
0.8419650197029114,
0.7465049028396606,
0.2237924337387085,
-0.09573829919099808,
-0.005041798576712608,
-0.5344600081443787,
-0.46414995193481445,
-0.02749442495405674,
-0.3229048252105713,
-0.624778687953949,
0.1377483308315277,
0.5417147874832153,
0.3262728750705719,
-0.09736503660678864,
0.25287094712257385,
-0.024442365393042564,
0.4114316701889038,
-0.7576582431793213,
0.21073564887046814,
-0.552702009677887,
0.0054245139472186565,
-0.21879331767559052,
0.17592191696166992,
-0.33206793665885925,
-0.13370974361896515,
0.19153648614883423,
-0.6863114237785339,
0.16559626162052155,
-0.11162789911031723,
1.3811589479446411,
0.22406083345413208,
-0.2647300362586975,
0.19596192240715027,
-0.6479268074035645,
0.7331526875495911,
-0.7376034259796143,
0.35838770866394043,
0.34220150113105774,
0.39303621649742126,
0.2358989268541336,
-0.8612411022186279,
-0.4516630470752716,
-0.1663382202386856,
0.16039949655532837,
0.26836472749710083,
-0.280811607837677,
0.02166137844324112,
0.44160324335098267,
0.17471827566623688,
-0.3402903378009796,
0.026774469763040543,
-0.6391935348510742,
-0.016342291608452797,
0.6421633362770081,
-0.017521565780043602,
0.35719960927963257,
-0.3141881227493286,
-0.7054152488708496,
-0.4584069550037384,
-0.5874296426773071,
0.4008738696575165,
0.24750137329101562,
-0.02750144898891449,
-0.5000117421150208,
0.444147527217865,
0.03915680572390556,
0.3884182870388031,
-0.07065477222204208,
-0.2867923676967621,
0.4610084891319275,
-0.40151354670524597,
-0.3295845091342926,
-0.19757547974586487,
1.0747888088226318,
0.6323134303092957,
0.15907898545265198,
0.10459140688180923,
-0.01785212755203247,
-0.0810575857758522,
0.3064924478530884,
-0.9788714647293091,
-0.13645586371421814,
-0.00812932476401329,
-0.6353936791419983,
-0.3249475657939911,
0.42650970816612244,
-0.7408056855201721,
0.03343648463487625,
-0.15235401690006256,
0.5124583840370178,
-0.544486403465271,
-0.24064481258392334,
0.0051512038335204124,
-0.034016162157058716,
0.2447240948677063,
0.279026597738266,
-0.5801464915275574,
0.1985851228237152,
0.33475229144096375,
1.0461573600769043,
-0.22839000821113586,
-0.41980984807014465,
-0.21508048474788666,
0.1761651337146759,
-0.3001115024089813,
0.49112117290496826,
-0.17572103440761566,
-0.28464701771736145,
-0.09382279217243195,
0.35581541061401367,
-0.0741448774933815,
-0.5445540547370911,
0.6016680002212524,
-0.240712508559227,
0.05726907402276993,
-0.1408848613500595,
-0.19590315222740173,
-0.5501141548156738,
0.13620971143245697,
-0.6640211939811707,
0.9163620471954346,
0.010720189660787582,
-0.8499752879142761,
0.2971997857093811,
-0.5689259171485901,
-0.17690324783325195,
-0.2213151901960373,
-0.04923238232731819,
-0.6064720153808594,
-0.24078573286533356,
0.46769213676452637,
0.5257683396339417,
-0.30801355838775635,
0.4544268250465393,
-0.6163079738616943,
-0.3048624098300934,
0.23506256937980652,
-0.41703563928604126,
0.9353948831558228,
0.0026368119288235903,
-0.3422415852546692,
0.19797742366790771,
-0.617746889591217,
-0.12745237350463867,
0.2481551468372345,
0.05550488084554672,
-0.22105756402015686,
-0.2276107370853424,
-0.011200517416000366,
0.2660234868526459,
0.14082269370555878,
-0.5234502553939819,
-0.013344625011086464,
-0.11779963225126266,
0.44621092081069946,
0.7210288047790527,
0.08046646416187286,
0.2824391722679138,
-0.40218034386634827,
0.5548653602600098,
0.1519567221403122,
0.578249454498291,
-0.30287331342697144,
-0.5013754367828369,
-0.7494440674781799,
-0.5475834608078003,
0.40547817945480347,
0.5332502126693726,
-0.6501436829566956,
0.4115101099014282,
-0.24209478497505188,
-0.503149688243866,
-0.401965469121933,
-0.09021083265542984,
0.488305926322937,
0.5225492119789124,
0.4310377240180969,
-0.4611653685569763,
-0.4813885986804962,
-0.8360288739204407,
0.2078157365322113,
-0.023509502410888672,
-0.031572986394166946,
0.5850583910942078,
0.7346606850624084,
-0.1538337916135788,
0.8985038995742798,
-0.6135700941085815,
-0.476130872964859,
-0.1104225441813469,
0.06426618993282318,
0.08414209634065628,
0.4525657892227173,
0.8527295589447021,
-0.8298402428627014,
-0.46162551641464233,
-0.0923234224319458,
-1.1536638736724854,
0.10741106420755386,
0.010119795799255371,
-0.2688312530517578,
0.17780300974845886,
0.5353696346282959,
-0.5784363746643066,
0.6850183010101318,
0.42887890338897705,
0.04980730265378952,
0.4754621386528015,
-0.12626300752162933,
0.0019904589280486107,
-1.1416176557540894,
0.3520510792732239,
0.11137654632329941,
-0.2168678343296051,
-0.5008776783943176,
0.016451982781291008,
0.044453009963035583,
-0.3506326675415039,
-0.8119784593582153,
0.5444485545158386,
-0.36286160349845886,
0.07266499102115631,
-0.04219808056950569,
0.037291910499334335,
0.06740468740463257,
0.599365234375,
0.09825538098812103,
0.8359800577163696,
0.7253354787826538,
-0.6291469931602478,
0.03433189168572426,
0.3762686252593994,
-0.3548857569694519,
0.3821931481361389,
-0.9505467414855957,
0.059901412576436996,
-0.08815064281225204,
0.13222023844718933,
-0.37662020325660706,
-0.42151206731796265,
0.39048755168914795,
-0.468927264213562,
0.32181793451309204,
-0.27557048201560974,
-0.21418803930282593,
-0.42034730315208435,
-0.5573703050613403,
0.5106724500656128,
0.7044829726219177,
-0.6325644850730896,
0.3303956687450409,
0.4600141942501068,
0.09675652533769608,
-0.739229142665863,
-0.6488888263702393,
-0.27063602209091187,
-0.3252887725830078,
-0.6807294487953186,
0.4211367964744568,
-0.07865268737077713,
-0.009066925384104252,
0.055207811295986176,
0.13192379474639893,
-0.21650901436805725,
-0.10029487311840057,
0.6482587456703186,
0.5523942708969116,
-0.05623231455683708,
-0.1165948361158371,
-0.09817548841238022,
-0.006040250416845083,
-0.015397850424051285,
-0.08585755527019501,
0.21566277742385864,
-0.2235451489686966,
-0.2843538224697113,
-0.6209276914596558,
0.16584791243076324,
0.6199268102645874,
-0.415315181016922,
0.7498746514320374,
0.7158332467079163,
-0.4707430601119995,
0.04634983092546463,
-0.32646486163139343,
-0.08107952773571014,
-0.4623955190181732,
0.46119797229766846,
-0.05162781476974487,
-0.642797589302063,
0.5420153737068176,
0.13999971747398376,
-0.1194140687584877,
0.5612099766731262,
0.35903096199035645,
-0.07231373339891434,
0.8920081257820129,
0.9020576477050781,
-0.030449530109763145,
0.6346194744110107,
-0.6741907000541687,
0.15729762613773346,
-0.9278098344802856,
-0.34434396028518677,
-0.2020692378282547,
-0.07637182623147964,
-0.5094873309135437,
-0.5266557335853577,
0.6365094184875488,
0.3778703510761261,
-0.20302461087703705,
0.44181856513023376,
-0.35062745213508606,
0.2728132903575897,
0.5165963172912598,
0.35918813943862915,
0.04320506006479263,
-0.030264627188444138,
-0.027694031596183777,
-0.10064180940389633,
-0.6704075336456299,
-0.42507803440093994,
1.1102110147476196,
0.6488196849822998,
0.7538930773735046,
-0.08097317069768906,
0.42902714014053345,
0.13508054614067078,
0.09116489440202713,
-0.6888349056243896,
0.618836522102356,
-0.3628987669944763,
-0.5950327515602112,
-0.3023098409175873,
-0.3372446298599243,
-0.7975494861602783,
-0.006294062361121178,
-0.11398107558488846,
-0.743385374546051,
0.41127002239227295,
0.05171496421098709,
-0.33281803131103516,
0.47554200887680054,
-0.5436193943023682,
0.9649603366851807,
-0.3655257225036621,
-0.3337523341178894,
0.09144711494445801,
-0.746351420879364,
0.5396884083747864,
0.15825630724430084,
0.061487942934036255,
-0.19677694141864777,
0.1263768970966339,
1.0020360946655273,
-0.6041231155395508,
0.9488115906715393,
-0.17003075778484344,
0.224056676030159,
0.6568189859390259,
-0.25812479853630066,
0.16260504722595215,
0.15970420837402344,
0.09759394079446793,
0.7154799699783325,
0.05391006916761398,
-0.13895872235298157,
-0.3761388957500458,
0.39816004037857056,
-0.9401074647903442,
-0.22972291707992554,
-0.4303748607635498,
-0.4891805052757263,
0.20467053353786469,
0.3971147835254669,
0.6248646378517151,
0.5390549302101135,
-0.12739664316177368,
0.35213369131088257,
0.5850750207901001,
-0.3348340690135956,
0.5283153057098389,
0.21318820118904114,
-0.18777665495872498,
-0.7160987257957458,
0.9699823260307312,
0.28624334931373596,
0.2990361750125885,
0.11183128505945206,
0.06427758932113647,
-0.05585455149412155,
-0.3833923041820526,
-0.5067254304885864,
0.33389729261398315,
-0.7187916040420532,
-0.41412755846977234,
-0.4756605625152588,
-0.42984145879745483,
-0.39596202969551086,
-0.043091513216495514,
-0.4963163435459137,
-0.19262884557247162,
-0.5957552790641785,
-0.05548935756087303,
0.36049628257751465,
0.566840648651123,
-0.07985512912273407,
0.33280226588249207,
-0.8214092254638672,
0.31139540672302246,
0.2410581111907959,
0.4301416277885437,
0.002579417312517762,
-0.6270697712898254,
-0.2890012562274933,
0.16640567779541016,
-0.5336050391197205,
-0.625909149646759,
0.37560877203941345,
0.26819756627082825,
0.4638651907444,
0.6362481117248535,
0.15557192265987396,
0.5470065474510193,
-0.40827471017837524,
0.9831593632698059,
0.33800697326660156,
-0.8085473775863647,
0.5258439183235168,
-0.5863218307495117,
0.19566205143928528,
0.603155255317688,
0.7258833050727844,
-0.17517465353012085,
0.05222007632255554,
-0.6999966502189636,
-0.8869195580482483,
0.928253173828125,
0.1589840203523636,
0.023777026683092117,
0.16583727300167084,
0.36219462752342224,
0.0089544877409935,
0.19673806428909302,
-0.944403886795044,
-0.03593871369957924,
-0.45789843797683716,
-0.08188538253307343,
0.2104482203722,
-0.28834980726242065,
-0.1722562462091446,
-0.42655718326568604,
0.7506880164146423,
-0.2676163613796234,
0.6342251896858215,
0.24092599749565125,
-0.13889382779598236,
-0.07080534100532532,
-0.051241185516119,
0.47124335169792175,
0.5596684813499451,
-0.45906269550323486,
-0.22104407846927643,
0.10150638967752457,
-0.6149722337722778,
-0.07937217503786087,
0.12902575731277466,
-0.6136999130249023,
-0.14993657171726227,
0.44585999846458435,
1.2753374576568604,
0.12357322871685028,
-0.6736946702003479,
0.9035226106643677,
-0.037764810025691986,
-0.3740377724170685,
-0.3166104555130005,
0.07452651858329773,
-0.2680814862251282,
0.1794886440038681,
0.06113355606794357,
0.1487930417060852,
0.08704980462789536,
-0.5428072214126587,
0.19441848993301392,
0.42274653911590576,
-0.5385573506355286,
-0.45267605781555176,
0.8319810628890991,
-0.0170732531696558,
-0.10587015748023987,
0.6295593976974487,
-0.08121610432863235,
-0.4935196042060852,
0.6820345520973206,
0.4914666712284088,
0.9215250015258789,
-0.040227409452199936,
0.3296721875667572,
0.6498310565948486,
0.2589283883571625,
-0.23785856366157532,
0.11616380512714386,
0.16242925822734833,
-0.5578336715698242,
-0.08348409831523895,
-0.413486510515213,
-0.34513482451438904,
0.2738153636455536,
-0.9156727194786072,
0.5606924295425415,
-0.6803324818611145,
-0.3918934166431427,
-0.19933061301708221,
-0.4715288281440735,
-0.47911536693573,
0.21225346624851227,
0.17160451412200928,
0.8803033232688904,
-0.806110680103302,
0.6760256290435791,
0.7025149464607239,
-0.7963671088218689,
-0.8339450359344482,
0.1303437203168869,
-0.16693748533725739,
-0.4424682557582855,
0.38009345531463623,
0.5153984427452087,
-0.016933513805270195,
-0.3405708074569702,
-0.9087972044944763,
-0.9948592782020569,
1.3798471689224243,
0.515975832939148,
-0.24307535588741302,
-0.14587970077991486,
0.05402204021811485,
0.4163862466812134,
-0.2360077202320099,
0.3930371105670929,
0.23329982161521912,
0.1656423956155777,
0.11261788755655289,
-0.9979934096336365,
-0.03825865685939789,
-0.31140032410621643,
0.18556372821331024,
-0.014653608202934265,
-1.0840415954589844,
1.0167644023895264,
-0.24788743257522583,
-0.2613699734210968,
0.08883969485759735,
0.7192210555076599,
0.04102246090769768,
0.35849249362945557,
0.3647357225418091,
0.650779128074646,
0.5419613718986511,
-0.004938004072755575,
1.0024733543395996,
-0.19089265167713165,
0.370039165019989,
1.0891145467758179,
-0.1421080231666565,
0.9665425419807434,
0.232700914144516,
-0.20811331272125244,
0.423511803150177,
0.4168665111064911,
-0.36286139488220215,
0.623156726360321,
-0.354586124420166,
0.14403781294822693,
-0.08974974602460861,
-0.4199668765068054,
-0.3907083570957184,
0.536038875579834,
0.023079166188836098,
-0.39246198534965515,
0.011558451689779758,
0.3728558123111725,
0.044822681695222855,
-0.1922490894794464,
-0.13045372068881989,
0.5362926125526428,
0.20955894887447357,
-0.4459916055202484,
0.805450439453125,
0.06264526396989822,
0.6808289885520935,
-0.6655444502830505,
-0.04348823055624962,
-0.03589019179344177,
0.2723999321460724,
-0.15171018242835999,
-0.6956492066383362,
0.2689446806907654,
0.007728078402578831,
-0.2045566737651825,
-0.11758667975664139,
0.7281858325004578,
-0.17465853691101074,
-0.45506662130355835,
0.4477684795856476,
0.0182908046990633,
0.16135269403457642,
0.02170293591916561,
-0.6133895516395569,
0.1501602828502655,
-0.005447078496217728,
-0.11194494366645813,
0.3701038360595703,
0.18497322499752045,
-0.2563616633415222,
0.6560781002044678,
0.48960360884666443,
-0.19085150957107544,
0.14497755467891693,
-0.09409535676240921,
0.9325844049453735,
-0.42074984312057495,
-0.45099613070487976,
-0.5575312376022339,
0.6135202050209045,
-0.13012537360191345,
-0.43325549364089966,
0.7452019453048706,
0.48600155115127563,
1.0357576608657837,
-0.18810510635375977,
0.734753429889679,
-0.23270340263843536,
0.29067662358283997,
-0.6346526741981506,
0.7403275966644287,
-0.6350545883178711,
0.0686333179473877,
-0.4957295060157776,
-0.7191232442855835,
-0.1851007491350174,
0.5797020196914673,
-0.23926571011543274,
0.11168090999126434,
0.7030416131019592,
0.7076208591461182,
-0.27397412061691284,
-0.06791459769010544,
0.20905782282352448,
0.18862515687942505,
0.255825012922287,
0.4152422547340393,
0.5332342982292175,
-0.783157229423523,
0.5914854407310486,
-0.7357662320137024,
-0.29486575722694397,
-0.13437272608280182,
-0.8205944895744324,
-1.1303892135620117,
-0.5770998001098633,
-0.3760572373867035,
-0.21696096658706665,
0.026933159679174423,
0.7041639685630798,
0.9348670840263367,
-0.7234528660774231,
-0.3258495330810547,
0.13185027241706848,
-0.17611345648765564,
-0.23659038543701172,
-0.20996440947055817,
0.4882245659828186,
0.21833625435829163,
-0.5668532252311707,
0.1665453165769577,
0.1550920009613037,
0.2907343804836273,
-0.06341718137264252,
-0.05288199335336685,
-0.3723023235797882,
-0.07302853465080261,
0.4595789611339569,
0.400523841381073,
-0.559089720249176,
-0.22297979891300201,
0.1731642186641693,
0.10485377907752991,
0.3092646300792694,
0.5172469615936279,
-0.5478495955467224,
0.4144079089164734,
0.4391906261444092,
0.4792877435684204,
0.6428520083427429,
0.2087777853012085,
0.24120233952999115,
-0.593079149723053,
0.3864140808582306,
0.03147437050938606,
0.31818127632141113,
0.33646517992019653,
-0.37408897280693054,
0.6384543180465698,
0.4067288935184479,
-0.4300071895122528,
-0.896785318851471,
-0.07682879269123077,
-1.1075115203857422,
-0.08282940089702606,
1.080155611038208,
-0.4513852298259735,
-0.495354562997818,
0.39232534170150757,
-0.219502791762352,
0.4008632302284241,
-0.34984198212623596,
0.4166506826877594,
0.4122220575809479,
-0.022005848586559296,
-0.4184771478176117,
-0.7564581036567688,
0.3330748379230499,
0.16046330332756042,
-0.9184921383857727,
-0.1489020586013794,
0.38410401344299316,
0.36644187569618225,
0.23314906656742096,
0.4903416037559509,
-0.31053951382637024,
0.32684826850891113,
-0.04419951140880585,
0.3194017708301544,
-0.33613163232803345,
-0.694170355796814,
-0.4552196264266968,
0.03605899214744568,
-0.15375199913978577,
-0.408463716506958
] |
martin-ha/toxic-comment-model | martin-ha | "2022-05-06T02:24:31Z" | 1,172,236 | 32 | transformers | [
"transformers",
"pytorch",
"distilbert",
"text-classification",
"en",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:05Z" | ---
language: en
---
## Model description
This model is a fine-tuned version of the [DistilBERT model](https://huggingface.co/transformers/model_doc/distilbert.html) to classify toxic comments.
## How to use
You can use the model with the following code.
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer, TextClassificationPipeline
model_path = "martin-ha/toxic-comment-model"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
print(pipeline('This is a test text.'))
```
## Limitations and Bias
This model is intended to use for classify toxic online classifications. However, one limitation of the model is that it performs poorly for some comments that mention a specific identity subgroup, like Muslim. The following table shows a evaluation score for different identity group. You can learn the specific meaning of this metrics [here](https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/overview/evaluation). But basically, those metrics shows how well a model performs for a specific group. The larger the number, the better.
| **subgroup** | **subgroup_size** | **subgroup_auc** | **bpsn_auc** | **bnsp_auc** |
| ----------------------------- | ----------------- | ---------------- | ------------ | ------------ |
| muslim | 108 | 0.689 | 0.811 | 0.88 |
| jewish | 40 | 0.749 | 0.86 | 0.825 |
| homosexual_gay_or_lesbian | 56 | 0.795 | 0.706 | 0.972 |
| black | 84 | 0.866 | 0.758 | 0.975 |
| white | 112 | 0.876 | 0.784 | 0.97 |
| female | 306 | 0.898 | 0.887 | 0.948 |
| christian | 231 | 0.904 | 0.917 | 0.93 |
| male | 225 | 0.922 | 0.862 | 0.967 |
| psychiatric_or_mental_illness | 26 | 0.924 | 0.907 | 0.95 |
The table above shows that the model performs poorly for the muslim and jewish group. In fact, you pass the sentence "Muslims are people who follow or practice Islam, an Abrahamic monotheistic religion." Into the model, the model will classify it as toxic. Be mindful for this type of potential bias.
## Training data
The training data comes this [Kaggle competition](https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/data). We use 10% of the `train.csv` data to train the model.
## Training procedure
You can see [this documentation and codes](https://github.com/MSIA/wenyang_pan_nlp_project_2021) for how we train the model. It takes about 3 hours in a P-100 GPU.
## Evaluation results
The model achieves 94% accuracy and 0.59 f1-score in a 10000 rows held-out test set. | [
-0.3922950327396393,
-0.4740905165672302,
0.18749642372131348,
0.1335316151380539,
-0.15836480259895325,
-0.10166865587234497,
0.03602038696408272,
-0.40231478214263916,
0.01824433170258999,
0.23490272462368011,
-0.5330604910850525,
-0.7474910020828247,
-0.9154424667358398,
0.17080052196979523,
-0.34513023495674133,
1.5296317338943481,
0.3028220236301422,
0.23278233408927917,
0.20892038941383362,
-0.18835221230983734,
-0.03562662750482559,
-0.47420379519462585,
-0.6998260617256165,
-0.3084592819213867,
0.5735732913017273,
0.15822063386440277,
0.8282181620597839,
0.5621439218521118,
0.44807547330856323,
0.328388512134552,
-0.5627456307411194,
-0.16113533079624176,
-0.5342180132865906,
-0.3144773542881012,
-0.20975853502750397,
-0.49749770760536194,
-0.46809399127960205,
0.28979548811912537,
0.1415882557630539,
0.414154052734375,
-0.1675373762845993,
0.5320480465888977,
0.12334851175546646,
0.4156440496444702,
-0.5164464116096497,
0.12336020171642303,
-0.5130660533905029,
0.4128054976463318,
0.03612639755010605,
-0.017824217677116394,
-0.4323027431964874,
-0.38678932189941406,
0.29717668890953064,
-0.4880359470844269,
0.19527709484100342,
-0.054862167686223984,
0.9765074253082275,
0.42107829451560974,
-0.6803076267242432,
-0.2208755761384964,
-0.5162120461463928,
0.7922042608261108,
-1.1111828088760376,
-0.09406182914972305,
0.47824904322624207,
0.06295250356197357,
-0.041756853461265564,
-0.6783424019813538,
-0.603206992149353,
-0.10810516774654388,
-0.4546844959259033,
0.23686374723911285,
0.06558773666620255,
0.009321514517068863,
0.7855368256568909,
0.5779648423194885,
-0.5693055391311646,
-0.046488240361213684,
-0.44559532403945923,
-0.2631843090057373,
0.786983072757721,
0.41607019305229187,
0.2855868935585022,
-0.5557516813278198,
-0.37686970829963684,
-0.05783587321639061,
-0.1328461617231369,
0.22264359891414642,
0.1799284964799881,
0.195940300822258,
-0.10001673549413681,
0.3531697690486908,
-0.23742780089378357,
0.531714141368866,
0.13085438311100006,
-0.2006608098745346,
0.5019651055335999,
-0.28818950057029724,
-0.15091943740844727,
-0.05700866878032684,
1.031103253364563,
0.6057356595993042,
0.19995814561843872,
0.2853986620903015,
-0.010180100798606873,
0.35678356885910034,
0.2315746396780014,
-1.237738013267517,
-0.6272415518760681,
0.12967389822006226,
-0.8277032971382141,
-0.6665530204772949,
-0.08526775240898132,
-0.9435122013092041,
-0.22961372137069702,
-0.1470833420753479,
0.5552418231964111,
-0.21574044227600098,
-0.4242549538612366,
-0.05743536725640297,
-0.16438625752925873,
0.03620714694261551,
0.21632735431194305,
-0.8562799692153931,
0.258848637342453,
0.1720620095729828,
0.9146319627761841,
-0.1198345199227333,
-0.07943203300237656,
-0.20453013479709625,
-0.04565609246492386,
-0.025974437594413757,
0.48331916332244873,
-0.64554363489151,
-0.33730995655059814,
-0.18172459304332733,
0.16827940940856934,
0.029950616881251335,
-0.5367835164070129,
0.682142436504364,
-0.38989925384521484,
0.5491915941238403,
-0.41208213567733765,
-0.47718071937561035,
-0.32051968574523926,
0.20939257740974426,
-0.5681043863296509,
1.095834493637085,
0.477362722158432,
-1.3214236497879028,
0.5246165990829468,
-0.7837632894515991,
-0.12462494522333145,
-0.08647351711988449,
0.10812956839799881,
-0.7569708824157715,
-0.26675617694854736,
0.014548427425324917,
0.3054347336292267,
-0.03569912165403366,
0.24432893097400665,
-0.6478948593139648,
-0.5918797850608826,
0.19435372948646545,
-0.26587626338005066,
1.42707359790802,
0.5473900437355042,
-0.5962821841239929,
0.08638415485620499,
-0.8074913620948792,
0.08475770056247711,
0.09162528812885284,
-0.42860347032546997,
-0.30328527092933655,
0.13200829923152924,
0.3435862064361572,
0.6990896463394165,
-0.024347996339201927,
-0.518682599067688,
0.1288277506828308,
-0.26804569363594055,
0.5323262810707092,
0.8724245429039001,
0.14194424450397491,
0.2156475931406021,
-0.4754490256309509,
0.27233731746673584,
0.2811291813850403,
0.5752078294754028,
0.1730469912290573,
-0.4793090224266052,
-1.0015629529953003,
-0.10165402293205261,
0.22516444325447083,
0.5711884498596191,
-0.49511197209358215,
0.7312495708465576,
0.0722266212105751,
-0.73876953125,
-0.24019062519073486,
0.11502079665660858,
0.47981783747673035,
0.5963384509086609,
0.427154004573822,
-0.502065122127533,
-0.46093425154685974,
-0.9914518594741821,
-0.23618823289871216,
-0.352702796459198,
-0.08440089970827103,
0.2147969901561737,
0.8393338918685913,
-0.47275593876838684,
0.6674045324325562,
-0.6663231253623962,
-0.44481125473976135,
0.19536717236042023,
0.25426313281059265,
0.4533591568470001,
0.40966013073921204,
0.6761212944984436,
-0.7555859088897705,
-0.943903386592865,
-0.12014760076999664,
-0.6750510334968567,
-0.1611092984676361,
0.2891677916049957,
-0.27718132734298706,
-0.028409142047166824,
0.24726445972919464,
-0.2880314588546753,
0.6578057408332825,
0.4465939402580261,
-0.5657508373260498,
0.6006343364715576,
0.15694406628608704,
0.006844501476734877,
-1.212647795677185,
0.25789061188697815,
0.22165925800800323,
-0.13567224144935608,
-0.7003173828125,
-0.0038737538270652294,
0.04159374535083771,
0.12001312524080276,
-0.549607515335083,
0.31563133001327515,
-0.16974635422229767,
0.3938227891921997,
-0.2190314680337906,
-0.2999601662158966,
0.006294127553701401,
0.8842812180519104,
0.15911707282066345,
0.6033433675765991,
0.48983776569366455,
-0.7646844983100891,
0.2367088943719864,
0.35527846217155457,
-0.40613889694213867,
0.4959675073623657,
-0.5369576215744019,
0.029038356617093086,
-0.10975030809640884,
0.37815651297569275,
-0.8776906728744507,
-0.34503281116485596,
0.43722963333129883,
-0.3988170027732849,
0.12691041827201843,
-0.068165123462677,
-0.4033675193786621,
-0.6994917392730713,
-0.2961543798446655,
0.4643767774105072,
0.5880473852157593,
-0.41833963990211487,
0.5129673480987549,
0.48786988854408264,
0.00679570809006691,
-0.7792518734931946,
-0.652644693851471,
-0.4501860439777374,
-0.5456830263137817,
-0.2699860632419586,
0.17652006447315216,
-0.23209679126739502,
-0.04913853853940964,
0.0562620684504509,
-0.16032829880714417,
-0.2224612534046173,
0.040191370993852615,
0.20811860263347626,
0.25587207078933716,
0.057344552129507065,
0.058476317673921585,
0.004080138169229031,
-0.0765894278883934,
0.4362216293811798,
0.41038084030151367,
0.46706947684288025,
-0.21220003068447113,
-0.0923590436577797,
-0.5404107570648193,
0.2600112855434418,
0.5043199062347412,
-0.19071350991725922,
0.7051081657409668,
0.631397545337677,
-0.3324565589427948,
-0.19650600850582123,
-0.3199736773967743,
-0.25477951765060425,
-0.5445806384086609,
0.6626272797584534,
0.01814064383506775,
-0.6762875318527222,
0.8493397831916809,
0.01756172440946102,
0.2297888994216919,
0.8840161561965942,
0.7492808699607849,
-0.017171911895275116,
1.5345659255981445,
0.4412279725074768,
-0.1005215123295784,
0.4684581458568573,
-0.356545090675354,
0.09071479737758636,
-0.7508088946342468,
-0.3372311294078827,
-0.40452268719673157,
-0.4088987112045288,
-0.7638692259788513,
-0.22222080826759338,
0.47304368019104004,
-0.2288898378610611,
-0.9143285751342773,
0.28840407729148865,
-0.9516436457633972,
0.5056388974189758,
0.44004300236701965,
0.36104610562324524,
0.28377196192741394,
-0.04659668728709221,
-0.22922565042972565,
-0.18478204309940338,
-0.7527828812599182,
-0.4877835512161255,
1.1066257953643799,
0.6043683886528015,
0.8134257197380066,
0.10972563177347183,
0.43056273460388184,
0.24415451288223267,
0.9901449680328369,
-0.6942707896232605,
0.41759753227233887,
-0.2899608314037323,
-1.3010708093643188,
-0.09417200833559036,
-0.6859894394874573,
-0.5702475905418396,
0.41159629821777344,
-0.19450831413269043,
-0.7096505761146545,
0.24810680747032166,
0.06420154124498367,
-0.4918915629386902,
0.4425390660762787,
-0.6752393841743469,
0.9670557975769043,
-0.30026569962501526,
-0.3050999343395233,
-0.040092214941978455,
-0.7701600193977356,
0.5673118829727173,
-0.24457211792469025,
0.20278941094875336,
-0.1955428421497345,
0.3493877947330475,
1.040194034576416,
-0.5147246718406677,
0.968156099319458,
-0.293099969625473,
0.06821785867214203,
0.2685422897338867,
-0.053544532507658005,
0.20501698553562164,
0.15520071983337402,
-0.21822188794612885,
0.3193588852882385,
0.3012431561946869,
-0.21580761671066284,
-0.40931689739227295,
0.6694188714027405,
-1.0987474918365479,
-0.4717424511909485,
-0.9403930306434631,
-0.4468444585800171,
-0.04245585575699806,
0.310741662979126,
0.530534029006958,
0.05629834905266762,
-0.017733363434672356,
0.045562613755464554,
0.7470483779907227,
-0.519841730594635,
0.250040739774704,
0.6264173984527588,
-0.44172701239585876,
-0.40927767753601074,
0.6222924590110779,
0.12710720300674438,
0.4004906117916107,
-0.02876613475382328,
0.36782240867614746,
-0.26978442072868347,
-0.11787549406290054,
-0.17645856738090515,
0.19271893799304962,
-0.7808802127838135,
-0.3291998505592346,
-0.826609194278717,
-0.7123615145683289,
-0.14375941455364227,
0.3274785578250885,
-0.2638396620750427,
0.00741698918864131,
-0.34663906693458557,
-0.0824960395693779,
0.3726344704627991,
0.8430981040000916,
-0.004832583479583263,
0.4766712784767151,
-0.673836886882782,
0.10232356935739517,
0.2975987493991852,
0.6886117458343506,
0.17961479723453522,
-0.8842390179634094,
-0.10648716986179352,
0.1860315054655075,
-0.6864882707595825,
-1.2623982429504395,
0.4081408381462097,
0.026904430240392685,
0.5003089904785156,
0.8125452995300293,
0.21879123151302338,
0.7296884655952454,
-0.23850242793560028,
0.6756374835968018,
0.2221573293209076,
-0.9196351766586304,
0.5229542255401611,
-0.4003792405128479,
0.12547598779201508,
0.7264767289161682,
0.754480242729187,
-0.7069239616394043,
-0.5326367020606995,
-0.6039618253707886,
-0.7212426066398621,
1.0925815105438232,
0.44934365153312683,
0.08796974271535873,
-0.10041185468435287,
0.330188512802124,
0.006170662585645914,
-0.002049635862931609,
-1.4018067121505737,
-0.644798994064331,
-0.3869096636772156,
-0.25050225853919983,
0.054510220885276794,
-0.31768712401390076,
-0.2812032699584961,
-0.8789666891098022,
0.9005183577537537,
0.12604793906211853,
0.1186048611998558,
0.15697473287582397,
0.07637034356594086,
-0.24631406366825104,
0.09122602641582489,
0.3016277849674225,
0.5822758078575134,
-0.4999324679374695,
-0.005780080333352089,
0.39289143681526184,
-0.5282642245292664,
0.285631388425827,
-0.05928504467010498,
-0.1862310916185379,
0.04098477587103844,
0.08637173473834991,
0.6628661155700684,
-0.1071687638759613,
-0.278505802154541,
0.6115738749504089,
-0.28687843680381775,
-0.3767992854118347,
-0.5233792662620544,
0.25178176164627075,
-0.06500869244337082,
0.07473224401473999,
0.16384047269821167,
0.1815137416124344,
0.4037260413169861,
-0.6125317811965942,
0.264649897813797,
0.37931814789772034,
-0.43162840604782104,
-0.15541884303092957,
0.9336239695549011,
0.17120040953159332,
-0.17830458283424377,
0.7286666035652161,
-0.26522791385650635,
-0.8296734094619751,
0.6938517093658447,
0.38612011075019836,
0.6599120497703552,
-0.5926808714866638,
0.35920900106430054,
0.986190676689148,
0.27600041031837463,
0.03259687498211861,
0.14829227328300476,
0.05332844331860542,
-0.47759392857551575,
-0.35426968336105347,
-1.006052017211914,
-0.14036649465560913,
0.5303215384483337,
-0.8816543221473694,
0.24760931730270386,
-0.5632632374763489,
-0.5305405855178833,
0.09028831869363785,
0.07597233355045319,
-0.6021526455879211,
0.40052977204322815,
0.12021588534116745,
0.9114195108413696,
-1.3578258752822876,
0.6218970417976379,
0.5515853762626648,
-0.5436258316040039,
-1.029822587966919,
-0.13326065242290497,
-0.04955446720123291,
-0.42695388197898865,
0.6293824315071106,
0.47646304965019226,
0.35451361536979675,
-0.29943686723709106,
-0.5510014295578003,
-1.0697693824768066,
0.8977622985839844,
-0.03962380439043045,
-0.6016550064086914,
-0.11521866917610168,
0.27705711126327515,
0.910627543926239,
-0.042168695479631424,
0.7267615795135498,
0.505478024482727,
0.39704230427742004,
0.11678513139486313,
-0.9282621741294861,
0.18783022463321686,
-0.7299829721450806,
0.0853804349899292,
0.061484403908252716,
-0.8892066478729248,
1.0923354625701904,
0.05381619557738304,
-0.10131014883518219,
-0.12292052805423737,
0.39308178424835205,
0.1769721657037735,
0.37795430421829224,
0.8220601677894592,
0.7569754123687744,
0.5440963506698608,
-0.09958364069461823,
0.8409023880958557,
-0.28375887870788574,
0.8364415764808655,
1.105823278427124,
-0.08643226325511932,
0.5797059535980225,
0.20583350956439972,
-0.432406485080719,
0.7606249451637268,
1.0656648874282837,
-0.2631840407848358,
0.6394577622413635,
0.2463301569223404,
-0.292342871427536,
-0.2211526334285736,
0.003265051171183586,
-0.5868266224861145,
0.40325555205345154,
0.31835097074508667,
-0.7587935328483582,
-0.24145029485225677,
-0.24124066531658173,
0.1346399039030075,
-0.202869713306427,
-0.2995223104953766,
0.7444819808006287,
0.11371926218271255,
-0.7163048982620239,
0.542087972164154,
-0.042021170258522034,
0.7130818367004395,
-0.5733758211135864,
-0.031630828976631165,
0.0006404832820408046,
0.4322432577610016,
-0.5144231915473938,
-0.7182812690734863,
0.45710694789886475,
0.05383007973432541,
-0.12111563235521317,
0.07976853847503662,
0.504514217376709,
-0.4724876284599304,
-0.6766419410705566,
0.4331774413585663,
0.044153764843940735,
0.07216347754001617,
0.14924830198287964,
-1.0400956869125366,
-0.2259310781955719,
0.11441521346569061,
-0.4181147515773773,
0.19138255715370178,
0.23096917569637299,
0.02404318004846573,
0.5908293128013611,
0.6617253422737122,
-0.01567721739411354,
0.006016263272613287,
0.025004252791404724,
1.122754693031311,
-0.5893260836601257,
-0.4863048195838928,
-1.043936848640442,
0.5623437762260437,
-0.3148047924041748,
-0.43938714265823364,
0.9068768620491028,
0.6892682313919067,
0.9080817103385925,
0.003884432837367058,
0.6859812140464783,
-0.1796601116657257,
0.5204418301582336,
-0.060524147003889084,
1.1236954927444458,
-0.6626640558242798,
-0.05034136772155762,
-0.517065703868866,
-1.0562611818313599,
-0.25107574462890625,
1.0927271842956543,
-0.35355526208877563,
0.36680868268013,
0.6300140619277954,
0.8881052136421204,
-0.11264883726835251,
0.12103118002414703,
-0.10760394483804703,
0.5124977827072144,
0.3872102200984955,
0.7081038355827332,
0.8449817299842834,
-0.44755828380584717,
0.48854246735572815,
-0.6599085330963135,
-0.38828885555267334,
-0.00527960853651166,
-0.7364586591720581,
-1.1345748901367188,
-0.4432467818260193,
-0.4038296341896057,
-0.7022668123245239,
-0.39771443605422974,
0.8381718397140503,
0.6620358824729919,
-0.963963508605957,
-0.11626049131155014,
-0.0018869361374527216,
-0.1277439147233963,
-0.07557687163352966,
-0.3128618896007538,
0.27105289697647095,
-0.03214690089225769,
-0.7596886157989502,
-0.4970144033432007,
-0.04724432900547981,
-0.05558718740940094,
-0.3711760640144348,
-0.08505411446094513,
-0.2791769802570343,
0.05071943253278732,
0.5196757912635803,
-0.0005396162159740925,
-0.6371341347694397,
-0.3961670398712158,
-0.21972882747650146,
-0.34580716490745544,
0.05969274044036865,
0.1809464544057846,
-0.41274696588516235,
0.5517731308937073,
0.36854010820388794,
0.1905384212732315,
0.6370849013328552,
0.030043872073292732,
0.13130585849285126,
-0.35297226905822754,
0.005073851440101862,
0.3056642711162567,
0.3251052796840668,
0.06395430117845535,
-0.48981839418411255,
0.5422236323356628,
0.15903399884700775,
-0.8403704166412354,
-0.8322097063064575,
0.17101478576660156,
-0.9483347535133362,
-0.2656978368759155,
1.3100591897964478,
-0.1300210803747177,
-0.2919093370437622,
-0.17354850471019745,
-0.39282017946243286,
0.4937525689601898,
-0.33573785424232483,
1.2029236555099487,
0.8533485531806946,
-0.016300616785883904,
0.12371449917554855,
-0.5353867411613464,
0.8067310452461243,
0.4412328600883484,
-0.6079757809638977,
-0.025770459324121475,
0.3685160279273987,
0.8317483067512512,
0.3103942573070526,
0.6535020470619202,
-0.2878401577472687,
0.2941915690898895,
-0.11096801608800888,
-0.015613115392625332,
0.19892464578151703,
0.055837471038103104,
-0.12091449648141861,
-0.058371275663375854,
-0.16590294241905212,
0.05145585536956787
] |
tiiuae/falcon-40b-instruct | tiiuae | "2023-09-29T14:32:27Z" | 1,158,762 | 1,120 | transformers | [
"transformers",
"pytorch",
"falcon",
"text-generation",
"custom_code",
"en",
"dataset:tiiuae/falcon-refinedweb",
"arxiv:2205.14135",
"arxiv:1911.02150",
"arxiv:2005.14165",
"arxiv:2104.09864",
"arxiv:2306.01116",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text-generation | "2023-05-25T10:14:36Z" | ---
datasets:
- tiiuae/falcon-refinedweb
language:
- en
inference: false
license: apache-2.0
---
# ✨ Falcon-40B-Instruct
**Falcon-40B-Instruct is a 40B parameters causal decoder-only model built by [TII](https://www.tii.ae) based on [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b) and finetuned on a mixture of [Baize](https://github.com/project-baize/baize-chatbot). It is made available under the Apache 2.0 license.**
*Paper coming soon 😊.*
🤗 To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost fron HF](https://huggingface.co/blog/falcon)!
## Why use Falcon-40B-Instruct?
* **You are looking for a ready-to-use chat/instruct model based on [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).**
* **Falcon-40B is the best open-source model available.** It outperforms [LLaMA](https://github.com/facebookresearch/llama), [StableLM](https://github.com/Stability-AI/StableLM), [RedPajama](https://huggingface.co/togethercomputer/RedPajama-INCITE-Base-7B-v0.1), [MPT](https://huggingface.co/mosaicml/mpt-7b), etc. See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
* **It features an architecture optimized for inference**, with FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135)) and multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)).
💬 **This is an instruct model, which may not be ideal for further finetuning.** If you are interested in building your own instruct/chat model, we recommend starting from [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).
💸 **Looking for a smaller, less expensive model?** [Falcon-7B-Instruct](https://huggingface.co/tiiuae/falcon-7b-instruct) is Falcon-40B-Instruct's little brother!
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "tiiuae/falcon-40b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
sequences = pipeline(
"Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
max_length=200,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
```
For fast inference with Falcon, check-out [Text Generation Inference](https://github.com/huggingface/text-generation-inference)! Read more in this [blogpost]((https://huggingface.co/blog/falcon).
You will need **at least 85-100GB of memory** to swiftly run inference with Falcon-40B.
# Model Card for Falcon-40B-Instruct
## Model Details
### Model Description
- **Developed by:** [https://www.tii.ae](https://www.tii.ae);
- **Model type:** Causal decoder-only;
- **Language(s) (NLP):** English and French;
- **License:** Apache 2.0;
- **Finetuned from model:** [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).
### Model Source
- **Paper:** *coming soon*.
## Uses
### Direct Use
Falcon-40B-Instruct has been finetuned on a chat dataset.
### Out-of-Scope Use
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
## Bias, Risks, and Limitations
Falcon-40B-Instruct is mostly trained on English data, and will not generalize appropriately to other languages. Furthermore, as it is trained on a large-scale corpora representative of the web, it will carry the stereotypes and biases commonly encountered online.
### Recommendations
We recommend users of Falcon-40B-Instruct to develop guardrails and to take appropriate precautions for any production use.
## How to Get Started with the Model
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "tiiuae/falcon-40b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
sequences = pipeline(
"Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
max_length=200,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
```
## Training Details
### Training Data
Falcon-40B-Instruct was finetuned on a 150M tokens from [Bai ze](https://github.com/project-baize/baize-chatbot) mixed with 5% of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) data.
The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
## Evaluation
*Paper coming soon.*
See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
## Technical Specifications
For more information about pretraining, see [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).
### Model Architecture and Objective
Falcon-40B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
* **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
* **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
* **Decoder-block:** parallel attention/MLP with a single layer norm.
For multiquery, we are using an internal variant which uses independent key and values per tensor parallel degree.
| **Hyperparameter** | **Value** | **Comment** |
|--------------------|-----------|----------------------------------------|
| Layers | 60 | |
| `d_model` | 8192 | |
| `head_dim` | 64 | Reduced to optimise for FlashAttention |
| Vocabulary | 65024 | |
| Sequence length | 2048 | |
### Compute Infrastructure
#### Hardware
Falcon-40B-Instruct was trained on AWS SageMaker, on 64 A100 40GB GPUs in P4d instances.
#### Software
Falcon-40B-Instruct was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
## Citation
*Paper coming soon* 😊. In the meanwhile, you can use the following information to cite:
```
@article{falcon40b,
title={{Falcon-40B}: an open large language model with state-of-the-art performance},
author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Debbah, Merouane and Goffinet, Etienne and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
year={2023}
}
```
To learn more about the pretraining dataset, see the 📓 [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
```
@article{refinedweb,
title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
journal={arXiv preprint arXiv:2306.01116},
eprint={2306.01116},
eprinttype = {arXiv},
url={https://arxiv.org/abs/2306.01116},
year={2023}
}
```
To cite the [Baize](https://github.com/project-baize/baize-chatbot) instruction dataset used for this model:
```
@article{xu2023baize,
title={Baize: An Open-Source Chat Model with Parameter-Efficient Tuning on Self-Chat Data},
author={Xu, Canwen and Guo, Daya and Duan, Nan and McAuley, Julian},
journal={arXiv preprint arXiv:2304.01196},
year={2023}
}
```
## License
Falcon-40B-Instruct is made available under the Apache 2.0 license.
## Contact
[email protected] | [
-0.5245065689086914,
-0.9391388893127441,
0.10132857412099838,
0.37688905000686646,
-0.0656701847910881,
-0.07384902983903885,
-0.19400599598884583,
-0.521453320980072,
0.1596158891916275,
0.3435472548007965,
-0.5734294056892395,
-0.44747111201286316,
-0.668843686580658,
-0.04688718542456627,
-0.3659892976284027,
1.0667016506195068,
0.09378807991743088,
-0.09811383485794067,
0.01929885894060135,
0.08799238502979279,
-0.02416364662349224,
-0.5176883935928345,
-0.9566108584403992,
-0.05339106172323227,
0.3316449820995331,
0.24214333295822144,
0.48673707246780396,
0.766667902469635,
0.6079736351966858,
0.37471041083335876,
-0.19023743271827698,
0.2314172089099884,
-0.5342235565185547,
-0.1908286213874817,
-0.005124810617417097,
-0.3251805901527405,
-0.3325243890285492,
-0.08779396116733551,
0.6758520603179932,
0.45787563920021057,
-0.016985977068543434,
0.23596607148647308,
-0.05308493599295616,
0.4972500205039978,
-0.683914840221405,
0.490203857421875,
-0.5072664618492126,
-0.06916599720716476,
-0.3785182237625122,
0.18962103128433228,
-0.48757579922676086,
0.08236981928348541,
-0.22808033227920532,
-0.7238950133323669,
0.19947315752506256,
0.24598552286624908,
1.3207169771194458,
0.33339571952819824,
-0.41151994466781616,
-0.18756689131259918,
-0.4995361864566803,
0.7725977897644043,
-0.9387543797492981,
0.44832709431648254,
0.27542629837989807,
0.32558825612068176,
-0.2869951128959656,
-1.0803908109664917,
-0.5333601236343384,
-0.16889196634292603,
-0.014567936770617962,
0.2819899618625641,
-0.2652474045753479,
0.038964416831731796,
0.4192182123661041,
0.21259069442749023,
-0.3889690935611725,
0.14671246707439423,
-0.46126630902290344,
-0.21739381551742554,
0.6119436621665955,
0.06040968373417854,
0.18812355399131775,
-0.2058836668729782,
-0.38682428002357483,
-0.3096071779727936,
-0.37154150009155273,
0.3048706650733948,
0.4263361096382141,
0.27821558713912964,
-0.39613664150238037,
0.48693785071372986,
-0.3753792345523834,
0.619292676448822,
0.4192444682121277,
0.01748660020530224,
0.39496713876724243,
-0.38917261362075806,
-0.37949156761169434,
-0.20850852131843567,
1.2557107210159302,
0.19601881504058838,
0.24476218223571777,
-0.10577947646379471,
0.05342220887541771,
-0.10044581443071365,
0.09300516545772552,
-1.0817476511001587,
0.03025098145008087,
0.2901092767715454,
-0.4418402910232544,
-0.2533172369003296,
0.32850295305252075,
-0.7538303136825562,
0.036158487200737,
0.16264404356479645,
0.0715014636516571,
-0.5084398984909058,
-0.30512484908103943,
0.16656020283699036,
-0.14075122773647308,
0.18949933350086212,
-0.12629848718643188,
-0.8665794134140015,
0.265521377325058,
0.4812256991863251,
0.7638702392578125,
0.0806933045387268,
-0.6163492798805237,
-0.6158257126808167,
0.05612514540553093,
-0.23273219168186188,
0.6174234747886658,
-0.4532466232776642,
-0.23807784914970398,
-0.14195750653743744,
0.30645036697387695,
-0.26603928208351135,
-0.16365256905555725,
0.8725341558456421,
-0.43398338556289673,
0.2957295775413513,
-0.2942691147327423,
-0.687907338142395,
-0.3293123245239258,
-0.10557961463928223,
-0.543876588344574,
0.9434807300567627,
-0.034311480820178986,
-1.1263480186462402,
0.1622462123632431,
-0.8674442172050476,
-0.28587621450424194,
-0.15461774170398712,
0.05224378779530525,
-0.543435275554657,
-0.1947093904018402,
0.5118151307106018,
0.6357554793357849,
-0.3551591634750366,
0.4047117829322815,
-0.6443339586257935,
-0.5551058053970337,
-0.020273078233003616,
-0.2150522917509079,
0.954435408115387,
0.577670693397522,
-0.4948265552520752,
0.039170969277620316,
-0.4904059171676636,
-0.025619996711611748,
0.3098043203353882,
-0.05675720423460007,
0.11239749193191528,
-0.00969364121556282,
0.059572137892246246,
0.19828523695468903,
0.17442545294761658,
-0.6667880415916443,
-0.030924228951334953,
-0.4941534996032715,
0.5509637594223022,
0.3409996032714844,
-0.0020423911046236753,
0.3553375005722046,
-0.45664095878601074,
0.47211629152297974,
0.3970079720020294,
0.3002793490886688,
-0.24840442836284637,
-0.5326654314994812,
-0.9395481944084167,
-0.2953886091709137,
0.12188191711902618,
0.46505898237228394,
-0.6199740171432495,
0.3702366054058075,
-0.06094886362552643,
-0.750983476638794,
-0.3889612853527069,
-0.20159801840782166,
0.5120731592178345,
0.5269127488136292,
0.5115928053855896,
0.10277839750051498,
-0.7280298471450806,
-0.7812285423278809,
-0.08414258807897568,
-0.2530214190483093,
0.1668359935283661,
0.3583148717880249,
0.5177936553955078,
-0.3880975544452667,
0.7020033597946167,
-0.4504134953022003,
-0.2102484405040741,
-0.058433618396520615,
0.11347615718841553,
0.26637136936187744,
0.5301587581634521,
0.7683138847351074,
-0.5473472476005554,
-0.35592496395111084,
-0.1603003889322281,
-0.9442492127418518,
-0.07390796393156052,
-0.08757065236568451,
-0.3288761377334595,
0.41051816940307617,
0.6788397431373596,
-0.756817638874054,
0.25112777948379517,
0.4866388142108917,
-0.2903561294078827,
0.5523101091384888,
0.023867979645729065,
0.17131459712982178,
-1.1757818460464478,
0.22257189452648163,
0.1512511670589447,
0.09759315103292465,
-0.488501638174057,
0.2431926280260086,
0.0644288957118988,
-0.06925415992736816,
-0.6314109563827515,
0.7762643098831177,
-0.51947420835495,
0.10647588968276978,
-0.06048581004142761,
-0.045171819627285004,
-0.08125963062047958,
0.6830326914787292,
0.04214349761605263,
0.8019745945930481,
0.5765058994293213,
-0.4516133666038513,
0.10359478741884232,
0.4012376666069031,
-0.05730338767170906,
0.24806705117225647,
-0.8459604382514954,
0.08832988142967224,
-0.07698559015989304,
0.40469563007354736,
-0.773006021976471,
-0.21397165954113007,
0.41000643372535706,
-0.6443374752998352,
0.35054853558540344,
-0.1143839955329895,
-0.3024075925350189,
-0.6432257890701294,
-0.14563463628292084,
0.16128750145435333,
0.38908475637435913,
-0.4266389012336731,
0.41285204887390137,
0.34282198548316956,
0.01661473512649536,
-0.9609130024909973,
-0.715961754322052,
0.051186759024858475,
-0.25322845578193665,
-0.7427941560745239,
0.4368460476398468,
-0.15370717644691467,
-0.012418556027114391,
0.0362992137670517,
0.2030964344739914,
-0.02197418361902237,
0.028866393491625786,
0.5092141032218933,
0.19401836395263672,
-0.2723917067050934,
0.005098320543766022,
0.09283534437417984,
-0.018452610820531845,
0.09816911071538925,
-0.3269641101360321,
0.5470702052116394,
-0.6420254707336426,
-0.27777424454689026,
-0.4530503451824188,
0.3859167993068695,
0.4849601089954376,
-0.38248008489608765,
0.8585180640220642,
1.0488437414169312,
-0.35477033257484436,
0.03827803209424019,
-0.5387322306632996,
-0.2031591832637787,
-0.5077412128448486,
0.5172486901283264,
-0.46911683678627014,
-0.8570172786712646,
0.5721806287765503,
0.2028658539056778,
0.0643707886338234,
0.8049486875534058,
0.4954226613044739,
-0.06741107255220413,
0.941616952419281,
0.40927186608314514,
-0.10079050064086914,
0.5119038224220276,
-0.5163064002990723,
-0.043016429990530014,
-0.7829734683036804,
-0.25156816840171814,
-0.6912344098091125,
-0.08804845064878464,
-0.6716446876525879,
-0.2643173635005951,
-0.059151239693164825,
0.3105807602405548,
-0.8851892948150635,
0.33261919021606445,
-0.4657570421695709,
0.19983404874801636,
0.5675272345542908,
0.0959959477186203,
-0.015660222619771957,
-0.09653884917497635,
-0.2636917531490326,
0.14766106009483337,
-0.8039584159851074,
-0.49574190378189087,
1.1494476795196533,
0.38515788316726685,
0.6536540985107422,
-0.09361163526773453,
0.9226717352867126,
-0.05243026465177536,
0.2522852420806885,
-0.5420295000076294,
0.5326447486877441,
-0.23841260373592377,
-0.6555209159851074,
-0.19370603561401367,
-0.5482687950134277,
-0.9591277241706848,
-0.03144559636712074,
-0.18714551627635956,
-0.8108283281326294,
0.016448093578219414,
-0.17470166087150574,
-0.13280613720417023,
0.3430324196815491,
-0.8765829205513,
0.8807651400566101,
-0.08964698761701584,
-0.30421552062034607,
0.10811599344015121,
-0.6595621109008789,
0.5492669343948364,
-0.09752508252859116,
0.21474958956241608,
0.025346264243125916,
0.035126231610774994,
1.0172964334487915,
-0.5095263719558716,
0.8122618198394775,
-0.38834667205810547,
0.3247177302837372,
0.43859127163887024,
-0.29197049140930176,
0.6839573979377747,
0.02626444399356842,
-0.2421267330646515,
0.4244641363620758,
0.2133040428161621,
-0.45060667395591736,
-0.36353954672813416,
0.7237342000007629,
-1.17872953414917,
-0.58550626039505,
-0.4267674684524536,
-0.621001124382019,
-0.16679181158542633,
0.3039925694465637,
0.42067623138427734,
0.26995736360549927,
-0.050215959548950195,
0.38334953784942627,
0.22833578288555145,
-0.35654503107070923,
0.767348051071167,
0.4298303425312042,
-0.19735632836818695,
-0.3874601125717163,
0.58900386095047,
0.004544940777122974,
0.11369794607162476,
0.41548821330070496,
0.1538218855857849,
-0.5138107538223267,
-0.46637850999832153,
-0.4279610216617584,
0.4569123387336731,
-0.6455413699150085,
-0.24356989562511444,
-1.0206739902496338,
-0.6039496660232544,
-0.4251578152179718,
-0.030538570135831833,
-0.45212507247924805,
-0.24001960456371307,
-0.5686067342758179,
0.02238508127629757,
0.442635178565979,
0.37548160552978516,
0.053109072148799896,
0.45030131936073303,
-0.8205978870391846,
0.08728982508182526,
0.0010593505576252937,
0.17009636759757996,
0.08465176820755005,
-0.6322000026702881,
-0.33862945437431335,
0.5016282796859741,
-0.3413865864276886,
-0.612949013710022,
0.3708055317401886,
0.37877964973449707,
0.7564579844474792,
0.4212300181388855,
0.2205602377653122,
0.7908040881156921,
-0.2735752463340759,
0.767634928226471,
0.1376643031835556,
-0.958143413066864,
0.3200901746749878,
-0.48038768768310547,
0.3251609802246094,
0.3421761691570282,
0.5565327405929565,
-0.4264729917049408,
-0.6197118759155273,
-0.8580523729324341,
-0.5296218991279602,
0.8591286540031433,
0.27479100227355957,
0.051796965301036835,
-0.1433628499507904,
0.32794490456581116,
-0.1764829456806183,
-0.04501704126596451,
-0.5549745559692383,
-0.2601427435874939,
-0.5644463300704956,
-0.30418816208839417,
-0.14736175537109375,
-0.028455376625061035,
0.12514638900756836,
-0.24207863211631775,
0.8048567771911621,
-0.17836244404315948,
0.7207024097442627,
0.05793343856930733,
-0.12690910696983337,
0.03341957926750183,
-0.05004798620939255,
0.6425105333328247,
0.43132656812667847,
-0.3189184367656708,
-0.0735374465584755,
0.14984044432640076,
-0.5982508659362793,
0.017662059515714645,
0.4678877294063568,
-0.14830712974071503,
-0.17259246110916138,
0.41250523924827576,
1.0202556848526,
0.16605201363563538,
-0.44182077050209045,
0.4274923503398895,
-0.09400782734155655,
-0.2201739251613617,
-0.11906225979328156,
0.17831304669380188,
0.3750441074371338,
0.43353739380836487,
0.2926005423069,
-0.0839381143450737,
0.003049477469176054,
-0.24768219888210297,
0.3596963882446289,
0.33059531450271606,
-0.27335861325263977,
-0.1379002183675766,
1.1020147800445557,
0.11066693067550659,
-0.25245004892349243,
0.5775301456451416,
-0.37297123670578003,
-0.3833810091018677,
0.8786181807518005,
0.6228265166282654,
0.8446732759475708,
0.058819085359573364,
0.35024070739746094,
0.7127731442451477,
0.17384807765483856,
-0.03277883678674698,
0.196574866771698,
0.12551762163639069,
-0.7403001189231873,
-0.45832470059394836,
-0.7940635085105896,
-0.3662310838699341,
0.03988253325223923,
-0.5827252268791199,
0.39913827180862427,
-0.4011659622192383,
-0.27531448006629944,
0.2461978644132614,
0.35063475370407104,
-0.7553565502166748,
0.25830915570259094,
-0.06768286973237991,
0.8652398586273193,
-0.5682093501091003,
0.9615509510040283,
0.6781754493713379,
-0.7398295402526855,
-1.0953211784362793,
-0.08926322311162949,
-0.1039644330739975,
-0.8995100259780884,
0.746600329875946,
0.2096000462770462,
0.045550014823675156,
0.28267672657966614,
-0.5030476450920105,
-0.8726024627685547,
1.089637041091919,
0.3282375931739807,
-0.6429569125175476,
-0.12536704540252686,
0.08289379626512527,
0.5134442448616028,
-0.3986624479293823,
0.8133446574211121,
0.2764325737953186,
0.46035805344581604,
0.3447026312351227,
-0.8127323389053345,
0.29032957553863525,
-0.4954231083393097,
-0.018814492970705032,
0.05980951339006424,
-1.0132359266281128,
0.9787658452987671,
-0.40881678462028503,
-0.19610188901424408,
0.019704749807715416,
0.7974782586097717,
0.39155736565589905,
0.18439842760562897,
0.33609336614608765,
0.5423599481582642,
0.6923707127571106,
-0.09353020042181015,
0.9752671122550964,
-0.5842006206512451,
0.6141631603240967,
0.9746543765068054,
0.043421272188425064,
0.8271361589431763,
0.2533515393733978,
-0.18700677156448364,
0.47176018357276917,
0.8236846923828125,
-0.12316923588514328,
0.31557977199554443,
-0.07857595384120941,
0.15834882855415344,
-0.09388595819473267,
0.011914443224668503,
-0.5760101079940796,
0.6292749047279358,
0.1822177618741989,
-0.3243768811225891,
-0.16568708419799805,
-0.03141253814101219,
0.4831314980983734,
-0.3068171441555023,
0.07361993938684464,
0.4807789623737335,
0.13203494250774384,
-0.749614417552948,
1.0653305053710938,
0.22655615210533142,
0.8687629103660583,
-0.641685962677002,
0.25397220253944397,
-0.4164857268333435,
0.21056318283081055,
-0.18715882301330566,
-0.6101411581039429,
0.44593822956085205,
-0.04013063758611679,
-0.03739850968122482,
0.03101516328752041,
0.5614109635353088,
-0.3246423304080963,
-0.6251128911972046,
0.3144461512565613,
0.3337305784225464,
0.266838937997818,
-0.25933292508125305,
-0.8425835967063904,
0.2861970365047455,
-0.09456276893615723,
-0.41560494899749756,
0.16221687197685242,
0.2303883582353592,
-0.0354141965508461,
0.779482364654541,
0.72468501329422,
-0.06150790676474571,
0.07039356231689453,
-0.06649696081876755,
0.7747271656990051,
-0.7601758241653442,
-0.3953515589237213,
-0.6689794659614563,
0.4708174467086792,
-0.14591361582279205,
-0.3979724943637848,
0.7627257704734802,
0.5244543552398682,
0.821248471736908,
-0.03787204623222351,
0.5982595682144165,
-0.20936472713947296,
0.20527848601341248,
-0.3871956467628479,
0.8818795680999756,
-0.5722571015357971,
0.06852170825004578,
-0.3777351379394531,
-0.7427084445953369,
-0.07249128818511963,
0.4618745446205139,
-0.12868452072143555,
0.2982492744922638,
0.8226963877677917,
0.9970118403434753,
-0.012974164448678493,
0.29653510451316833,
0.10813964158296585,
0.35873687267303467,
0.4641106426715851,
0.8704387545585632,
0.6355849504470825,
-0.7648261785507202,
0.734102189540863,
-0.3179403841495514,
-0.24655529856681824,
-0.22293034195899963,
-0.8490201234817505,
-1.079677700996399,
-0.7069103121757507,
-0.3039102554321289,
-0.2850092053413391,
0.06915704160928726,
0.687739372253418,
0.9132286310195923,
-0.6988103985786438,
-0.2687057852745056,
-0.19539880752563477,
-0.13069212436676025,
-0.37365156412124634,
-0.2213698774576187,
0.46402376890182495,
-0.4698992967605591,
-0.8791075944900513,
0.19116905331611633,
-0.09802711009979248,
0.07244539260864258,
-0.11265947669744492,
-0.26906970143318176,
-0.5046079754829407,
0.07249592244625092,
0.4755145013332367,
0.37086719274520874,
-0.699893057346344,
-0.28394678235054016,
0.25381940603256226,
-0.19781644642353058,
-0.06549353152513504,
0.1897137314081192,
-0.5645549297332764,
0.3004964292049408,
0.3879919946193695,
0.6653066873550415,
1.1247996091842651,
-0.12054078280925751,
0.2647472023963928,
-0.3957529067993164,
0.3849514424800873,
-0.03246733546257019,
0.4223555028438568,
0.14975015819072723,
-0.3586697578430176,
0.546720564365387,
0.3425401747226715,
-0.5914981365203857,
-0.6735532283782959,
-0.09173490107059479,
-1.0967134237289429,
-0.2257642149925232,
1.2435030937194824,
-0.3825147747993469,
-0.2983008921146393,
0.18029867112636566,
-0.2925374209880829,
0.5788119435310364,
-0.4829578399658203,
0.5720114707946777,
0.6254259943962097,
0.023527685552835464,
-0.31172388792037964,
-0.3764113783836365,
0.3402547240257263,
0.17425528168678284,
-1.035212516784668,
-0.2434714287519455,
0.26830706000328064,
0.33164048194885254,
-0.039559878408908844,
0.4882996678352356,
0.0036422826815396547,
0.05607841908931732,
0.2686155438423157,
0.05911014974117279,
-0.5954164862632751,
-0.16314123570919037,
0.06035437807440758,
0.14898473024368286,
-0.2933852970600128,
-0.4120848476886749
] |
cardiffnlp/twitter-xlm-roberta-base-sentiment | cardiffnlp | "2023-07-19T20:41:38Z" | 1,128,530 | 152 | transformers | [
"transformers",
"pytorch",
"tf",
"xlm-roberta",
"text-classification",
"multilingual",
"arxiv:2104.12250",
"endpoints_compatible",
"has_space",
"region:us"
] | text-classification | "2022-03-02T23:29:05Z" | ---
language: multilingual
widget:
- text: "🤗"
- text: "T'estimo! ❤️"
- text: "I love you!"
- text: "I hate you 🤮"
- text: "Mahal kita!"
- text: "사랑해!"
- text: "난 너가 싫어"
- text: "😍😍😍"
---
# twitter-XLM-roBERTa-base for Sentiment Analysis
This is a multilingual XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis. The sentiment fine-tuning was done on 8 languages (Ar, En, Fr, De, Hi, It, Sp, Pt) but it can be used for more languages (see paper for details).
- Paper: [XLM-T: A Multilingual Language Model Toolkit for Twitter](https://arxiv.org/abs/2104.12250).
- Git Repo: [XLM-T official repository](https://github.com/cardiffnlp/xlm-t).
This model has been integrated into the [TweetNLP library](https://github.com/cardiffnlp/tweetnlp).
## Example Pipeline
```python
from transformers import pipeline
model_path = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("T'estimo!")
```
```
[{'label': 'Positive', 'score': 0.6600581407546997}]
```
## Full classification example
```python
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
import numpy as np
from scipy.special import softmax
# Preprocess text (username and link placeholders)
def preprocess(text):
new_text = []
for t in text.split(" "):
t = '@user' if t.startswith('@') and len(t) > 1 else t
t = 'http' if t.startswith('http') else t
new_text.append(t)
return " ".join(new_text)
MODEL = f"cardiffnlp/twitter-xlm-roberta-base-sentiment"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
config = AutoConfig.from_pretrained(MODEL)
# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
model.save_pretrained(MODEL)
text = "Good night 😊"
text = preprocess(text)
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
scores = output[0][0].detach().numpy()
scores = softmax(scores)
# # TF
# model = TFAutoModelForSequenceClassification.from_pretrained(MODEL)
# model.save_pretrained(MODEL)
# text = "Good night 😊"
# encoded_input = tokenizer(text, return_tensors='tf')
# output = model(encoded_input)
# scores = output[0][0].numpy()
# scores = softmax(scores)
# Print labels and scores
ranking = np.argsort(scores)
ranking = ranking[::-1]
for i in range(scores.shape[0]):
l = config.id2label[ranking[i]]
s = scores[ranking[i]]
print(f"{i+1}) {l} {np.round(float(s), 4)}")
```
Output:
```
1) Positive 0.7673
2) Neutral 0.2015
3) Negative 0.0313
```
### Reference
```
@inproceedings{barbieri-etal-2022-xlm,
title = "{XLM}-{T}: Multilingual Language Models in {T}witter for Sentiment Analysis and Beyond",
author = "Barbieri, Francesco and
Espinosa Anke, Luis and
Camacho-Collados, Jose",
booktitle = "Proceedings of the Thirteenth Language Resources and Evaluation Conference",
month = jun,
year = "2022",
address = "Marseille, France",
publisher = "European Language Resources Association",
url = "https://aclanthology.org/2022.lrec-1.27",
pages = "258--266"
}
```
| [
-0.21140699088573456,
-0.6133162379264832,
0.19658339023590088,
0.40007078647613525,
-0.20551961660385132,
0.25525936484336853,
-0.427446573972702,
-0.2090844064950943,
0.23859182000160217,
0.13396018743515015,
-0.5945858359336853,
-0.9647396802902222,
-0.721899688243866,
0.16734467446804047,
-0.11273207515478134,
1.0959069728851318,
-0.11384063214063644,
0.25736314058303833,
0.28501394391059875,
-0.4000498652458191,
-0.07521658390760422,
-0.5725218653678894,
-0.8491688370704651,
-0.32498031854629517,
0.48631206154823303,
0.31874436140060425,
0.3879556357860565,
0.22023576498031616,
0.422538697719574,
0.501946210861206,
-0.03768448159098625,
0.08895113319158554,
-0.4410725235939026,
0.0873810201883316,
-0.058161504566669464,
-0.39414310455322266,
-0.6465936899185181,
0.12933094799518585,
0.7188819050788879,
0.6301400065422058,
0.16786520183086395,
0.36671343445777893,
0.11931903660297394,
0.45429617166519165,
-0.3757387399673462,
0.26144126057624817,
-0.27761363983154297,
-0.007154574617743492,
-0.004325265996158123,
-0.1701868325471878,
-0.3405762314796448,
-0.5694225430488586,
-0.01949400082230568,
-0.3243297338485718,
0.09355057030916214,
-0.1317477822303772,
1.1291862726211548,
0.046949006617069244,
-0.2968093752861023,
-0.10085646063089371,
-0.4808739423751831,
1.2059540748596191,
-0.8577559590339661,
0.22818054258823395,
0.134765625,
0.024702444672584534,
0.1660923808813095,
-0.5118368864059448,
-0.45188236236572266,
-0.10059481859207153,
0.03035525046288967,
0.39336642622947693,
-0.19753588736057281,
-0.09953494369983673,
0.14512339234352112,
0.23165448009967804,
-0.49991416931152344,
-0.09242057800292969,
-0.36878156661987305,
-0.1481214314699173,
0.6305244565010071,
0.15424320101737976,
0.22238504886627197,
-0.3392156958580017,
-0.2568058669567108,
-0.17463506758213043,
-0.11292465776205063,
0.06127715855836868,
0.2639371156692505,
0.5649591088294983,
-0.3870678246021271,
0.5818365812301636,
-0.07634904235601425,
0.4851129651069641,
0.046626802533864975,
-0.15594276785850525,
0.7547443509101868,
-0.2522444427013397,
-0.2345740646123886,
-0.11581920087337494,
1.2758064270019531,
0.4693930447101593,
0.3360499143600464,
-0.008255588822066784,
-0.36525726318359375,
0.02443954162299633,
-0.20767877995967865,
-0.862067699432373,
-0.041628170758485794,
0.37885981798171997,
-0.5165911316871643,
-0.5092214941978455,
0.17625562846660614,
-0.701154887676239,
-0.0525527261197567,
-0.15596570074558258,
0.8082596659660339,
-0.5545946955680847,
-0.5353723764419556,
0.09950046986341476,
-0.17249038815498352,
0.09238330274820328,
-0.04034014046192169,
-0.5578198432922363,
0.10669945180416107,
0.46108490228652954,
1.0123671293258667,
-0.02020803466439247,
-0.4664059281349182,
-0.28846195340156555,
-0.10395652055740356,
-0.3291112780570984,
0.5648248195648193,
-0.32825931906700134,
-0.40473470091819763,
0.06060614436864853,
0.08442769944667816,
-0.23512132465839386,
-0.2729601263999939,
0.47776323556900024,
-0.2109673172235489,
0.5124481320381165,
-0.071094810962677,
-0.5617086291313171,
-0.06424631923437119,
0.3544113337993622,
-0.4163801968097687,
1.1510645151138306,
0.293228417634964,
-0.6901645660400391,
0.18176768720149994,
-0.8509239554405212,
-0.33655834197998047,
-0.1362888664007187,
0.24580003321170807,
-0.4943331182003021,
0.016446439549326897,
0.12229667603969574,
0.5628779530525208,
-0.06720755249261856,
0.1597795933485031,
-0.4288521707057953,
-0.17963001132011414,
0.24022699892520905,
-0.20430900156497955,
1.163644790649414,
0.32797637581825256,
-0.44297417998313904,
0.2121490240097046,
-0.7184163331985474,
0.28687989711761475,
0.0967942401766777,
-0.3984312415122986,
-0.1949140429496765,
-0.2826440632343292,
0.3389194905757904,
0.40457606315612793,
0.3530769348144531,
-0.6373339295387268,
0.07198619842529297,
-0.5053777098655701,
0.5447189211845398,
0.695804238319397,
-0.12975235283374786,
0.39754992723464966,
-0.2773667275905609,
0.47062501311302185,
0.23633208870887756,
0.21037648618221283,
0.01307608187198639,
-0.34003713726997375,
-0.8392770290374756,
-0.14026479423046112,
0.3266812562942505,
0.614895224571228,
-0.5709022283554077,
0.5661448836326599,
-0.3946174383163452,
-0.6209946274757385,
-0.5606480836868286,
0.01970316469669342,
0.33326104283332825,
0.5008277893066406,
0.44063326716423035,
0.005178685300052166,
-0.7694173455238342,
-0.6396853923797607,
-0.4160764217376709,
-0.20681753754615784,
0.23232534527778625,
0.22186008095741272,
0.6555764079093933,
-0.41718757152557373,
0.7037633657455444,
-0.49462655186653137,
-0.41050985455513,
-0.5290192365646362,
0.2984638512134552,
0.5852476954460144,
0.68962162733078,
0.7567925453186035,
-0.5851262211799622,
-0.8044030666351318,
-0.17564648389816284,
-0.7528445720672607,
-0.20141522586345673,
0.183563232421875,
-0.2314451038837433,
0.5462777018547058,
0.2971358895301819,
-0.5537047982215881,
0.13640433549880981,
0.4882756769657135,
-0.5608816146850586,
0.36907756328582764,
-0.030860288068652153,
0.3412528932094574,
-1.4865275621414185,
0.016839032992720604,
0.34736138582229614,
-0.13341063261032104,
-0.6184187531471252,
-0.10233746469020844,
0.002653279108926654,
0.08564930409193039,
-0.44019028544425964,
0.7451358437538147,
-0.28030115365982056,
0.33969324827194214,
-0.0024311053566634655,
0.030588265508413315,
0.04975345730781555,
0.5299052596092224,
-0.017809061333537102,
0.5017542839050293,
0.6629428267478943,
-0.3579265773296356,
0.2790105640888214,
0.1138802245259285,
-0.0804705023765564,
0.49753135442733765,
-0.6336488127708435,
-0.136758491396904,
-0.005099413450807333,
0.03740440681576729,
-1.1952807903289795,
-0.12194100767374039,
0.3041418790817261,
-0.8248972296714783,
0.46174004673957825,
-0.27672576904296875,
-0.5305091142654419,
-0.33982470631599426,
-0.5305726528167725,
0.3176606595516205,
0.489239364862442,
-0.3475683629512787,
0.6487494111061096,
0.4011797308921814,
0.03278414160013199,
-0.6902095675468445,
-0.8409504890441895,
0.11691111326217651,
-0.3042522072792053,
-0.6651957035064697,
0.2055535614490509,
-0.22866791486740112,
-0.2523825764656067,
-0.032069288194179535,
0.1194356381893158,
-0.13958464562892914,
-0.03345054015517235,
0.10116128623485565,
0.3521144390106201,
-0.303809255361557,
0.1266152560710907,
-0.135199174284935,
-0.09903024137020111,
0.09744681417942047,
-0.42799055576324463,
0.6616836190223694,
-0.411077082157135,
0.19948947429656982,
-0.5226909518241882,
0.32451730966567993,
0.4294961094856262,
-0.057201068848371506,
1.0134291648864746,
1.048589825630188,
-0.37753546237945557,
-0.16182756423950195,
-0.5287579298019409,
-0.11616503447294235,
-0.49431300163269043,
0.5359712243080139,
-0.34057050943374634,
-0.7655934691429138,
0.6322193741798401,
0.15043704211711884,
0.040741972625255585,
0.8359326720237732,
0.6865260004997253,
-0.09000749886035919,
1.300845980644226,
0.572638988494873,
-0.2299361675977707,
0.5687442421913147,
-0.8061700463294983,
0.13635817170143127,
-0.5142134428024292,
-0.26570749282836914,
-0.58786541223526,
-0.12393714487552643,
-0.8781676292419434,
-0.14927420020103455,
0.17242570221424103,
-0.05425085127353668,
-0.5236569046974182,
0.15036682784557343,
-0.5463877320289612,
0.21580395102500916,
0.44644322991371155,
0.07164395600557327,
-0.13221047818660736,
0.019736437126994133,
-0.18707510828971863,
-0.17780613899230957,
-0.5869829654693604,
-0.5266638994216919,
1.0719019174575806,
0.3753330707550049,
0.6039333939552307,
0.1552073359489441,
0.8556849360466003,
0.10539273172616959,
0.42669618129730225,
-0.8418568968772888,
0.5314672589302063,
-0.37879833579063416,
-0.5462955832481384,
-0.15263940393924713,
-0.6974759697914124,
-0.7162826061248779,
0.1708807647228241,
-0.15453746914863586,
-0.6691449880599976,
-0.01957520842552185,
-0.05049208924174309,
-0.20092788338661194,
0.4030020833015442,
-0.864902675151825,
0.922636866569519,
-0.1724591702222824,
-0.47039419412612915,
0.000514619518071413,
-0.38137540221214294,
0.19879686832427979,
0.07815217226743698,
0.3953113555908203,
-0.24227628111839294,
-0.14381451904773712,
0.9994681477546692,
-0.4874590337276459,
0.8078853487968445,
-0.2764604389667511,
0.08269502967596054,
0.11052272468805313,
-0.021769031882286072,
0.11515482515096664,
0.10229300707578659,
-0.36619362235069275,
0.28803539276123047,
0.0014907463919371367,
-0.46301281452178955,
-0.15193134546279907,
0.9186508655548096,
-1.113193154335022,
-0.41055500507354736,
-0.7133750319480896,
-0.41878294944763184,
-0.1763383001089096,
0.3829788863658905,
0.48471319675445557,
0.5599700808525085,
-0.0416986420750618,
0.19644801318645477,
0.47088906168937683,
-0.33458995819091797,
0.6372272968292236,
0.3646443784236908,
-0.08430133759975433,
-0.5970594882965088,
0.9107322692871094,
0.19886834919452667,
0.03695671260356903,
0.44099846482276917,
0.3565196692943573,
-0.4380568265914917,
-0.29491326212882996,
-0.1356915533542633,
0.40243813395500183,
-0.7126092910766602,
-0.3515031933784485,
-0.7346503138542175,
-0.33998990058898926,
-0.7083954811096191,
-0.02525855228304863,
-0.3332732915878296,
-0.5868924260139465,
-0.37235912680625916,
-0.17845095694065094,
0.41758909821510315,
0.7167980670928955,
-0.3573093116283417,
0.27993741631507874,
-0.7282388806343079,
0.18759670853614807,
-0.06731288880109787,
0.4605501890182495,
-0.09424928575754166,
-0.7401256561279297,
-0.40379345417022705,
0.11062540113925934,
-0.3011775612831116,
-0.8347903490066528,
0.7496595978736877,
0.2787024974822998,
0.4143422245979309,
0.24744483828544617,
-0.010942937806248665,
0.5532064437866211,
-0.2071858048439026,
0.7917084097862244,
0.29808032512664795,
-1.0506541728973389,
0.5539835691452026,
-0.40974822640419006,
0.4735926687717438,
0.4394538104534149,
0.4339160919189453,
-0.6028459668159485,
-0.5905921459197998,
-0.5511397123336792,
-1.0427149534225464,
1.031740427017212,
0.17163033783435822,
0.3392341732978821,
-0.15560689568519592,
0.18044531345367432,
-0.04096139222383499,
0.13311098515987396,
-0.937225878238678,
-0.6315635442733765,
-0.5268641710281372,
-0.5878093242645264,
-0.34706050157546997,
-0.3232646584510803,
-0.01776982471346855,
-0.4938627779483795,
0.9440633058547974,
0.04064203426241875,
0.39473530650138855,
0.07739342749118805,
-0.21833975613117218,
-0.16543900966644287,
0.14332163333892822,
0.48849955201148987,
0.6559497117996216,
-0.4724750220775604,
-0.02867368422448635,
0.28523680567741394,
-0.49031323194503784,
0.034487441182136536,
0.16539432108402252,
-0.04290582239627838,
0.2790490686893463,
0.41227152943611145,
0.688309907913208,
0.17466478049755096,
-0.13457155227661133,
0.4750407338142395,
-0.20624321699142456,
-0.38217994570732117,
-0.44777360558509827,
-0.022689340636134148,
0.008291208185255527,
0.17979642748832703,
0.586453378200531,
0.15477776527404785,
-0.023915184661746025,
-0.5044799447059631,
0.033330123871564865,
0.2644588053226471,
-0.6093077659606934,
-0.45657575130462646,
0.6897139549255371,
0.06800396740436554,
-0.31981420516967773,
0.39166250824928284,
-0.10588240623474121,
-0.8614639043807983,
0.5609707236289978,
0.3100176155567169,
1.069831132888794,
-0.2729487717151642,
0.3953847587108612,
0.8503395915031433,
0.17573215067386627,
-0.0598590224981308,
0.5736342668533325,
0.1648743450641632,
-0.7710272669792175,
-0.22070060670375824,
-0.7907750606536865,
-0.12491480261087418,
0.12258346378803253,
-0.5185874700546265,
0.25319093465805054,
-0.37264740467071533,
-0.5188868641853333,
0.10987921804189682,
0.4115184545516968,
-0.6588269472122192,
0.4651716351509094,
0.12537723779678345,
0.8296552896499634,
-0.8698920607566833,
0.7524366974830627,
0.8833577036857605,
-0.5750505924224854,
-0.9603698253631592,
-0.13078708946704865,
-0.12711432576179504,
-0.5281194448471069,
0.7489910125732422,
0.2666130065917969,
-0.10780617594718933,
0.14662186801433563,
-0.5822344422340393,
-0.8185290694236755,
0.9172439575195312,
0.2036190927028656,
-0.1492505520582199,
0.13977065682411194,
0.30936017632484436,
0.7175225615501404,
-0.3669980764389038,
0.5404611825942993,
0.45838844776153564,
0.5187035202980042,
-0.11804350465536118,
-0.6216317415237427,
0.029383135959506035,
-0.48815691471099854,
-0.1423129439353943,
0.10129066556692123,
-0.9239674806594849,
1.0727206468582153,
-0.09101444482803345,
0.07823202013969421,
-0.016491346061229706,
0.5631201267242432,
0.2942855954170227,
0.1789955496788025,
0.4019603729248047,
0.5145909190177917,
0.5240833759307861,
-0.39535948634147644,
0.8489426374435425,
-0.5362338423728943,
0.8533968329429626,
0.6311284899711609,
0.18343421816825867,
0.7441809177398682,
0.43383944034576416,
-0.1410595327615738,
0.5724684000015259,
0.6785674095153809,
-0.03622888773679733,
0.45199310779571533,
-0.06796126067638397,
-0.10883022844791412,
-0.26882070302963257,
-0.0861557126045227,
-0.3225598931312561,
0.35909727215766907,
0.3243466019630432,
-0.4085876941680908,
-0.22637972235679626,
-0.044061992317438126,
0.3275032043457031,
-0.12066387385129929,
-0.38974347710609436,
0.5421607494354248,
0.26358020305633545,
-0.6841643452644348,
0.6904467940330505,
0.18969574570655823,
0.8978440761566162,
-0.5160340070724487,
0.19340847432613373,
-0.2600918412208557,
0.5472803711891174,
-0.34212514758110046,
-0.9178819060325623,
0.1290721595287323,
0.16569732129573822,
-0.05447452887892723,
-0.40355196595191956,
0.43553197383880615,
-0.4841226637363434,
-0.8838531374931335,
0.6001582145690918,
0.47962263226509094,
0.05434596538543701,
0.21383878588676453,
-1.1496174335479736,
0.08119865506887436,
0.01565670594573021,
-0.7544985413551331,
0.07444518059492111,
0.5276988744735718,
0.18064969778060913,
0.5535451769828796,
0.4380442500114441,
0.13493438065052032,
0.06822655349969864,
0.44089174270629883,
0.7703632116317749,
-0.7110873460769653,
-0.39557084441185,
-1.0477824211120605,
0.5038645267486572,
-0.12250910699367523,
-0.5373953580856323,
0.8986052870750427,
0.7112412452697754,
0.7679455280303955,
-0.0382145494222641,
0.893362283706665,
-0.19320036470890045,
0.5359852910041809,
-0.2736261785030365,
0.8599500060081482,
-0.8179334998130798,
0.024279441684484482,
-0.34434372186660767,
-0.8544191122055054,
-0.39666682481765747,
0.6400688290596008,
-0.3933147192001343,
0.43855470418930054,
0.6427802443504333,
0.7477174997329712,
-0.005283060949295759,
-0.32910796999931335,
0.23061397671699524,
0.5950832366943359,
0.25217172503471375,
0.6062984466552734,
0.5709545016288757,
-0.6361628770828247,
0.70256108045578,
-0.5692933797836304,
-0.14047527313232422,
-0.22131501138210297,
-0.718095600605011,
-1.115867018699646,
-0.6973656415939331,
-0.4307422339916229,
-0.7982936501502991,
-0.07883822172880173,
1.071053147315979,
0.5590367913246155,
-1.0703973770141602,
-0.47259658575057983,
0.18668033182621002,
0.11319122463464737,
0.024156546220183372,
-0.3111989498138428,
0.5302546620368958,
-0.5320877432823181,
-0.9754672050476074,
-0.07599051296710968,
0.024284377694129944,
0.04280753806233406,
-0.09521771967411041,
-0.1537703573703766,
-0.28388988971710205,
0.10788378864526749,
0.548372209072113,
-0.008602959103882313,
-0.4854735732078552,
-0.18878592550754547,
0.15526093542575836,
-0.43399474024772644,
0.1854708045721054,
0.216528981924057,
-0.4572923481464386,
0.15761597454547882,
0.5890854001045227,
0.017264466732740402,
0.4396311342716217,
-0.09884917736053467,
0.4585193693637848,
-0.7073111534118652,
0.14597652852535248,
0.21949072182178497,
0.5227667093276978,
0.5184468626976013,
-0.14728935062885284,
0.47783705592155457,
0.2704123854637146,
-0.4168739318847656,
-0.9287083745002747,
-0.24875059723854065,
-1.0063177347183228,
-0.2708040773868561,
1.2774651050567627,
-0.13638296723365784,
-0.3972128927707672,
0.10888801515102386,
-0.13486967980861664,
0.5865737795829773,
-0.5836151242256165,
0.7976535558700562,
0.6391652226448059,
0.17417170107364655,
-0.0949346199631691,
-0.3736172914505005,
0.5088547468185425,
0.2797802686691284,
-0.4922563135623932,
-0.29070353507995605,
0.06268475949764252,
0.5577444434165955,
0.10698959231376648,
0.6094930768013,
-0.04206301271915436,
0.22370266914367676,
-0.18686074018478394,
0.09341606497764587,
-0.07574768364429474,
0.03598996251821518,
-0.38788169622421265,
0.1757567971944809,
-0.22127360105514526,
-0.1627614051103592
] |
microsoft/layoutlmv2-base-uncased | microsoft | "2022-09-16T03:40:56Z" | 1,115,792 | 39 | transformers | [
"transformers",
"pytorch",
"layoutlmv2",
"en",
"arxiv:2012.14740",
"license:cc-by-nc-sa-4.0",
"endpoints_compatible",
"has_space",
"region:us"
] | null | "2022-03-02T23:29:05Z" | ---
language: en
license: cc-by-nc-sa-4.0
---
# LayoutLMv2
**Multimodal (text + layout/format + image) pre-training for document AI**
The documentation of this model in the Transformers library can be found [here](https://huggingface.co/docs/transformers/model_doc/layoutlmv2).
[Microsoft Document AI](https://www.microsoft.com/en-us/research/project/document-ai/) | [GitHub](https://github.com/microsoft/unilm/tree/master/layoutlmv2)
## Introduction
LayoutLMv2 is an improved version of LayoutLM with new pre-training tasks to model the interaction among text, layout, and image in a single multi-modal framework. It outperforms strong baselines and achieves new state-of-the-art results on a wide variety of downstream visually-rich document understanding tasks, including , including FUNSD (0.7895 → 0.8420), CORD (0.9493 → 0.9601), SROIE (0.9524 → 0.9781), Kleister-NDA (0.834 → 0.852), RVL-CDIP (0.9443 → 0.9564), and DocVQA (0.7295 → 0.8672).
[LayoutLMv2: Multi-modal Pre-training for Visually-Rich Document Understanding](https://arxiv.org/abs/2012.14740)
Yang Xu, Yiheng Xu, Tengchao Lv, Lei Cui, Furu Wei, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha Zhang, Wanxiang Che, Min Zhang, Lidong Zhou, ACL 2021
| [
-0.24813884496688843,
-0.5359470844268799,
0.5049474835395813,
0.2781062722206116,
-0.1691926121711731,
0.019840208813548088,
0.13748787343502045,
-0.2951689064502716,
-0.18741048872470856,
0.3231786787509918,
-0.770416796207428,
-0.47540482878685,
-0.6762189269065857,
-0.26158127188682556,
-0.14264124631881714,
0.8078939318656921,
-0.4014502763748169,
0.41173017024993896,
-0.5692577362060547,
-0.06916594505310059,
-0.4884268045425415,
-0.21409840881824493,
-0.322566956281662,
-0.28634071350097656,
0.39180731773376465,
0.12322057038545609,
0.5743296146392822,
0.3670133054256439,
0.6923928260803223,
0.40114888548851013,
0.04074452817440033,
0.355592280626297,
-0.3122555613517761,
-0.10299159586429596,
0.15955635905265808,
-0.3016793727874756,
-0.7323391437530518,
0.20462262630462646,
0.687886655330658,
0.3459159731864929,
0.14604032039642334,
0.012519932352006435,
0.15999534726142883,
0.7113506197929382,
-0.5588224530220032,
0.40750259160995483,
-0.2188653200864792,
0.23095564544200897,
-0.06902017444372177,
-0.3347413241863251,
-0.7128902673721313,
0.058169495314359665,
0.15647828578948975,
-1.1734358072280884,
0.12118791043758392,
0.3340805768966675,
1.1648870706558228,
0.3588142395019531,
-0.6939293146133423,
-0.23572607338428497,
-0.4613450765609741,
0.888494074344635,
-0.3950972855091095,
0.7695392370223999,
0.5057189464569092,
0.17641139030456543,
0.1400267779827118,
-1.2356680631637573,
-0.5743386149406433,
-0.13584885001182556,
-0.4599534869194031,
0.5834212899208069,
-0.09604053944349289,
0.2168157398700714,
0.3545117974281311,
0.239130899310112,
-0.9331615567207336,
0.08115684986114502,
-0.5594316124916077,
-0.481606662273407,
0.48327821493148804,
0.07663889974355698,
0.4988493323326111,
-0.3434998393058777,
-0.5211990475654602,
-0.3788270354270935,
-0.13930751383304596,
0.12518680095672607,
0.18448764085769653,
-0.38110044598579407,
-0.5540972352027893,
0.3264790177345276,
0.35009080171585083,
0.6630734801292419,
-0.1284865438938141,
-0.4432426393032074,
0.7024376392364502,
-0.6981094479560852,
-0.3837721645832062,
-0.44056767225265503,
0.8436935544013977,
0.25699183344841003,
-0.20775921642780304,
0.09985467046499252,
-0.2134367674589157,
-0.18007688224315643,
0.4731461703777313,
-0.7721483111381531,
-0.3551390469074249,
0.12481503188610077,
-0.8850812315940857,
-0.07225152105093002,
0.19594168663024902,
-0.5535183548927307,
-0.40576106309890747,
-0.702831506729126,
0.4661664664745331,
-0.8549507856369019,
-0.22242151200771332,
-0.10908568650484085,
-0.24139605462551117,
0.5767676830291748,
1.0913575887680054,
-0.6867314577102661,
-0.008387361653149128,
0.6034228801727295,
0.883652925491333,
-0.33640560507774353,
-0.6398422122001648,
-0.5241451263427734,
0.13638705015182495,
-0.17100867629051208,
0.9475909471511841,
-0.34509503841400146,
-0.4812188148498535,
-0.03039291314780712,
0.07643909007310867,
-0.24245552718639374,
-0.3224782347679138,
0.7483436465263367,
-0.45020541548728943,
0.8042639493942261,
-0.04520860314369202,
-0.2965545952320099,
-0.26284563541412354,
0.48652684688568115,
-0.8869179487228394,
1.1832661628723145,
0.3922119438648224,
-0.9957252144813538,
0.29003798961639404,
-0.8451952934265137,
-0.42839300632476807,
-0.021847324445843697,
-0.2755141854286194,
-0.6744904518127441,
-0.15007907152175903,
0.16293029487133026,
0.2354358583688736,
0.046457841992378235,
-0.028598319739103317,
-0.11013353615999222,
-0.22264793515205383,
-0.13786828517913818,
-0.4135488271713257,
0.7952618598937988,
0.31906676292419434,
-0.09016252309083939,
0.6731240749359131,
-0.9307165741920471,
0.03954433649778366,
0.15352901816368103,
-0.40226948261260986,
-0.20319660007953644,
-0.3251645267009735,
0.6141841411590576,
0.5297512412071228,
0.4898046553134918,
-0.26953890919685364,
0.3777324855327606,
-0.2990642488002777,
0.1834137737751007,
0.7121335864067078,
-0.3595423996448517,
0.8587251901626587,
-0.26697787642478943,
0.6061943769454956,
0.11175302416086197,
0.4323498606681824,
-0.5934810042381287,
-0.5004845857620239,
-0.6575076580047607,
-0.40297046303749084,
0.14305037260055542,
0.7747002243995667,
-0.9943463206291199,
0.4017983078956604,
-0.2780117988586426,
-0.524999737739563,
-0.4033982455730438,
0.12569035589694977,
0.7675196528434753,
0.500295877456665,
0.4567546844482422,
-0.45772793889045715,
-0.6665200591087341,
-0.7954138517379761,
0.06617976725101471,
0.007451128214597702,
-0.06360946595668793,
0.2861071825027466,
0.582821249961853,
-0.3709661066532135,
0.7508512735366821,
-0.3374292552471161,
-0.5656632781028748,
-0.3472767472267151,
0.3776361048221588,
-0.12304706871509552,
0.47852638363838196,
0.6795387268066406,
-1.1758917570114136,
-0.5941300988197327,
-0.07904601842164993,
-0.8656542301177979,
0.2855396568775177,
-0.2557481825351715,
-0.23393034934997559,
0.4246687889099121,
0.5493602752685547,
-0.7218995094299316,
0.7312076091766357,
0.6221939325332642,
-0.4841635823249817,
0.5519177317619324,
-0.5501511693000793,
-0.013185975141823292,
-1.4871989488601685,
-0.018239382654428482,
0.11491846293210983,
-0.14143416285514832,
-0.6680076718330383,
-0.009094923734664917,
0.6301235556602478,
-0.1097131222486496,
-0.638375997543335,
0.7659235596656799,
-0.8172063231468201,
-0.1845931112766266,
-0.15354952216148376,
0.04024301841855049,
0.4237807095050812,
0.670703113079071,
-0.004047899506986141,
0.8005204200744629,
0.49448955059051514,
-0.1599193513393402,
0.2905005216598511,
0.706085205078125,
-0.37051576375961304,
0.5300228595733643,
-0.4979912340641022,
0.1666915863752365,
-0.47573423385620117,
0.6598951816558838,
-1.1675611734390259,
-0.2852722406387329,
0.21526788175106049,
-0.45905348658561707,
0.612791895866394,
0.11280947923660278,
-0.5562171936035156,
-0.5346113443374634,
-0.6652434468269348,
0.35741323232650757,
0.3955262303352356,
-0.386822372674942,
1.1492462158203125,
0.16684137284755707,
0.07461809366941452,
-0.5651563405990601,
-0.7396680116653442,
-0.13746339082717896,
0.15419901907444,
-1.0319631099700928,
0.5552448630332947,
-0.22498038411140442,
0.051108721643686295,
-0.17441564798355103,
-0.0543275885283947,
-0.07841373980045319,
0.0006668769055977464,
0.43826502561569214,
0.507509171962738,
-0.10048852115869522,
0.034277137368917465,
0.035050082951784134,
-0.33318138122558594,
-0.10807819664478302,
-0.0762747973203659,
0.7967211008071899,
-0.10120485723018646,
-0.5711804628372192,
-0.7991589903831482,
0.2318296581506729,
0.5935283303260803,
-0.6350663900375366,
0.5603594779968262,
1.2586604356765747,
-0.3834303915500641,
0.1617075353860855,
-0.4628031551837921,
0.14475327730178833,
-0.5203567743301392,
0.7427849173545837,
-0.42026039958000183,
-0.6955153346061707,
0.2788583040237427,
-0.04394310340285301,
0.1153201013803482,
0.5719386339187622,
0.5707671642303467,
-0.24517445266246796,
1.0691581964492798,
0.7078568935394287,
0.16592256724834442,
0.8582683801651001,
-0.5234894156455994,
0.12855438888072968,
-1.0123356580734253,
-0.8586897850036621,
-0.3530184328556061,
-0.32639533281326294,
-0.2612035572528839,
-0.6661931872367859,
0.44530749320983887,
0.18082813918590546,
-0.11001375317573547,
0.251639723777771,
-0.5182904601097107,
0.2120731770992279,
0.7736810445785522,
-0.07506324350833893,
0.12534427642822266,
0.1628871113061905,
-0.17968426644802094,
-0.1888798475265503,
-0.47095564007759094,
-0.49122464656829834,
0.8955638408660889,
0.5322425365447998,
0.9212023019790649,
0.07899034768342972,
0.48861733078956604,
0.22433064877986908,
0.25977224111557007,
-0.8343033790588379,
0.4595409035682678,
-0.07718376815319061,
-0.33469581604003906,
-0.334336519241333,
-0.0795992761850357,
-0.9445065259933472,
0.1598600149154663,
-0.24924075603485107,
-0.647105872631073,
0.050822336226701736,
0.2273208647966385,
-0.09239936619997025,
0.2227906435728073,
-1.0610880851745605,
1.152970552444458,
-0.5170141458511353,
-0.25476375222206116,
-0.038178663700819016,
-0.8119914531707764,
0.24256271123886108,
-0.09406598657369614,
0.1547597050666809,
0.20351403951644897,
0.022789202630519867,
0.7724686861038208,
-0.4540998637676239,
0.6050363183021545,
-0.26147815585136414,
-0.2080647349357605,
0.011919383890926838,
-0.03273404389619827,
0.7206632494926453,
0.06770384311676025,
-0.01746685430407524,
-0.018944021314382553,
0.0496656559407711,
-0.32478436827659607,
-0.7587102055549622,
0.47237327694892883,
-1.0915791988372803,
-0.31445005536079407,
-0.5046399831771851,
-0.7465924024581909,
0.04013045132160187,
0.4355393946170807,
0.5794902443885803,
0.6035521030426025,
-0.10827767103910446,
0.2634468376636505,
0.7237909436225891,
-0.3385627567768097,
0.4944697320461273,
0.3417944610118866,
-0.233628049492836,
-0.48568859696388245,
0.9214791059494019,
-0.029553726315498352,
-0.10675261169672012,
0.6971653699874878,
-0.06764804571866989,
-0.49200955033302307,
-0.5907778143882751,
-0.4884781241416931,
0.12258162349462509,
-0.7790831923484802,
-0.13892215490341187,
-1.043493390083313,
-0.48492300510406494,
-0.5915510654449463,
-0.17694444954395294,
-0.40035903453826904,
-0.22607268393039703,
-0.5207113027572632,
0.031226251274347305,
0.0085345059633255,
0.7618257403373718,
0.1483992636203766,
0.27266231179237366,
-0.8398007750511169,
0.421504944562912,
0.29174911975860596,
0.30631300806999207,
-0.10009215027093887,
-0.7159999012947083,
-0.19067363440990448,
-0.15385651588439941,
-0.7190336585044861,
-0.7078170776367188,
0.3424316346645355,
0.061955492943525314,
0.743614673614502,
0.45048269629478455,
-0.3755033612251282,
0.45430445671081543,
-0.5966019034385681,
0.9478687644004822,
0.5824545621871948,
-0.802851676940918,
0.6016083359718323,
-0.27292391657829285,
0.39603951573371887,
0.25287821888923645,
0.30502814054489136,
-0.48020070791244507,
0.17042237520217896,
-0.623090386390686,
-0.8271946907043457,
1.1401431560516357,
0.22471271455287933,
0.06026860699057579,
0.5611981749534607,
-0.022746849805116653,
0.0983971655368805,
0.10222233831882477,
-0.830690860748291,
-0.42626965045928955,
-0.7930236458778381,
-0.4463442265987396,
0.11692362278699875,
-0.5090060830116272,
-0.06682242453098297,
-0.5689476132392883,
0.6039602160453796,
-0.11044080555438995,
0.5695835947990417,
0.14317266643047333,
-0.44148531556129456,
0.09840806573629379,
0.07136490195989609,
1.1281177997589111,
0.8069899082183838,
-0.24471311271190643,
0.09872854501008987,
0.04878035932779312,
-0.782136082649231,
0.0010273359948769212,
0.48292049765586853,
-0.06445291638374329,
0.038494545966386795,
0.7421058416366577,
1.4722217321395874,
0.0018209378467872739,
-0.4673205018043518,
0.8254187107086182,
-0.23681160807609558,
-0.6692792177200317,
-0.5545845031738281,
-0.1600475311279297,
-0.11945459246635437,
0.10907340049743652,
0.29373905062675476,
0.16488997638225555,
0.053912438452243805,
-0.38852936029434204,
0.15077024698257446,
0.37791284918785095,
-0.5626139640808105,
-0.3613773584365845,
0.8142169713973999,
0.33320343494415283,
-0.5097699165344238,
0.5597907900810242,
-0.4109174609184265,
-0.5209887027740479,
0.5547796487808228,
0.5544102191925049,
0.70196932554245,
-0.09475065767765045,
0.390836238861084,
0.36638936400413513,
0.2810790538787842,
0.22483304142951965,
0.367239385843277,
-0.12111318856477737,
-0.6566372513771057,
-0.2629357874393463,
-0.5743808150291443,
-0.23856385052204132,
0.30959272384643555,
-0.41981688141822815,
0.34650033712387085,
-0.4373399615287781,
0.12192423641681671,
-0.04415372759103775,
0.15118952095508575,
-0.96278977394104,
0.2183031141757965,
0.2542555034160614,
1.1970475912094116,
-0.4692325294017792,
1.0729856491088867,
1.1532237529754639,
-0.5392336845397949,
-0.8641692399978638,
0.05787593498826027,
0.2509040832519531,
-0.8897703289985657,
0.7405014038085938,
0.36765387654304504,
0.10385165363550186,
0.037294864654541016,
-0.4743012487888336,
-0.9210245013237,
1.5397518873214722,
-0.030648870393633842,
-0.39475172758102417,
-0.37228867411613464,
0.03731384500861168,
0.5036473274230957,
-0.20342904329299927,
0.6397876739501953,
0.10300983488559723,
0.7245163321495056,
0.14069503545761108,
-0.8852525949478149,
-0.12114521116018295,
-0.7133024334907532,
0.2836522161960602,
0.023126674816012383,
-0.8144555687904358,
0.9829093813896179,
-0.08982227742671967,
-0.1108117550611496,
0.2598511576652527,
0.8278144598007202,
0.24288448691368103,
0.530750572681427,
0.5895639657974243,
0.6230417490005493,
0.7572411298751831,
-0.21178483963012695,
1.1826595067977905,
-0.22327947616577148,
0.28508132696151733,
1.2657052278518677,
-0.20185640454292297,
0.4540073871612549,
0.37552082538604736,
-0.07357028871774673,
0.5109058618545532,
0.6874113082885742,
-0.24293731153011322,
0.6101593375205994,
-0.22349309921264648,
0.1514030545949936,
-0.16188567876815796,
0.035370659083127975,
-0.5854228734970093,
0.4019719958305359,
0.25829237699508667,
-0.4681722819805145,
-0.16640658676624298,
0.29447609186172485,
-0.007906203158199787,
-0.07510051131248474,
-0.05653763189911842,
0.7964676022529602,
-0.16283799707889557,
-0.4675620496273041,
0.35802364349365234,
0.2554016411304474,
0.7614324688911438,
-0.8738679885864258,
-0.030035721138119698,
-0.18913641571998596,
0.08376114070415497,
-0.2610791027545929,
-0.9235324263572693,
-0.005111148580908775,
-0.4548759162425995,
-0.3635406196117401,
-0.5214130282402039,
1.0367263555526733,
-0.37596607208251953,
-0.5134077668190002,
0.32130587100982666,
0.5125699043273926,
-0.19056084752082825,
0.004148328211158514,
-0.9433723092079163,
0.2369861751794815,
0.005601697135716677,
-0.46056729555130005,
0.35300734639167786,
0.33493494987487793,
-0.22284822165966034,
0.5057359933853149,
0.5699335932731628,
-0.5188078880310059,
0.15650051832199097,
0.37748345732688904,
0.8866553902626038,
-0.33274558186531067,
-0.5333564281463623,
-0.5513148307800293,
0.8396340608596802,
-0.40370920300483704,
-0.48117369413375854,
0.8574597239494324,
0.8582936525344849,
1.0609127283096313,
-0.3476443588733673,
0.8186553120613098,
0.06423601508140564,
0.1265455037355423,
-0.6833746433258057,
0.9440756440162659,
-1.0183100700378418,
-0.20263671875,
-0.3720685541629791,
-0.9701259136199951,
-0.3219746947288513,
0.605690598487854,
-0.25008562207221985,
0.1588074266910553,
1.0620906352996826,
0.8319251537322998,
-0.286662757396698,
-0.2536618113517761,
0.33062082529067993,
0.08295967429876328,
0.5427988767623901,
0.35047632455825806,
0.8703678846359253,
-0.7040151357650757,
0.6749813556671143,
-0.2786102592945099,
-0.17168991267681122,
-0.2652432322502136,
-0.6617389917373657,
-1.0079891681671143,
-0.94233238697052,
-0.20764897763729095,
-0.4069384038448334,
-0.28593409061431885,
0.7884321808815002,
0.9499720931053162,
-0.522087037563324,
0.23931884765625,
0.033947207033634186,
0.016647208482027054,
-0.023514319211244583,
-0.18548311293125153,
0.6698001027107239,
-0.23683151602745056,
-0.7990040183067322,
0.2594810426235199,
0.4412033259868622,
0.35073453187942505,
-0.219544917345047,
-0.5743498206138611,
-0.22601108253002167,
-0.06785851716995239,
0.7760676741600037,
0.08470820635557175,
-0.7533011436462402,
-0.008815002627670765,
-0.13947974145412445,
-0.44180506467819214,
0.2879233956336975,
0.7880795001983643,
-0.45226970314979553,
0.4670725464820862,
0.8089661002159119,
0.426260381937027,
0.5842004418373108,
-0.043677590787410736,
0.21221314370632172,
-0.8127374053001404,
0.6438767910003662,
-0.11914975196123123,
0.5859082341194153,
0.30952948331832886,
-0.25788888335227966,
0.4747432470321655,
0.3636977970600128,
-0.3282032608985901,
-0.6467833518981934,
0.30243363976478577,
-1.441006064414978,
-0.2577732503414154,
1.1665600538253784,
-0.03374341130256653,
-0.2850392758846283,
-0.004358314909040928,
-0.7315593957901001,
0.3730683922767639,
-0.28425249457359314,
0.4440377950668335,
0.5429397225379944,
0.07277785986661911,
-0.5106112957000732,
-0.42737987637519836,
0.6211819052696228,
0.32939577102661133,
-1.2077767848968506,
-0.5562747716903687,
0.5491688251495361,
-0.060492053627967834,
0.45576557517051697,
0.8131886124610901,
-0.1601952463388443,
0.4064968228340149,
-0.16007396578788757,
0.29708877205848694,
-0.5115054249763489,
-0.4955775737762451,
-0.09296736866235733,
0.052912723273038864,
-0.2065039575099945,
-0.20253820717334747
] |
CIDAS/clipseg-rd64-refined | CIDAS | "2023-01-04T11:56:08Z" | 1,115,254 | 64 | transformers | [
"transformers",
"pytorch",
"clipseg",
"vision",
"image-segmentation",
"arxiv:2112.10003",
"license:apache-2.0",
"has_space",
"region:us"
] | image-segmentation | "2022-11-01T14:25:57Z" | ---
license: apache-2.0
tags:
- vision
- image-segmentation
inference: false
---
# CLIPSeg model
CLIPSeg model with reduce dimension 64, refined (using a more complex convolution). It was introduced in the paper [Image Segmentation Using Text and Image Prompts](https://arxiv.org/abs/2112.10003) by Lüddecke et al. and first released in [this repository](https://github.com/timojl/clipseg).
# Intended use cases
This model is intended for zero-shot and one-shot image segmentation.
# Usage
Refer to the [documentation](https://huggingface.co/docs/transformers/main/en/model_doc/clipseg). | [
-0.8298375606536865,
-0.5458164215087891,
0.6076344847679138,
0.10645419359207153,
-0.5790215730667114,
-0.39590778946876526,
0.25823232531547546,
-0.3526495099067688,
0.025415541604161263,
0.38337811827659607,
-0.9556897878646851,
-0.623732328414917,
-0.7718104720115662,
0.014494373463094234,
-0.716687023639679,
0.867525577545166,
-0.11458241194486618,
0.2340688705444336,
-0.3129197061061859,
-0.33976078033447266,
-0.2031048983335495,
-0.23689241707324982,
-0.48594149947166443,
-0.1532190442085266,
0.2565925121307373,
0.41236189007759094,
0.5374078154563904,
0.41282859444618225,
0.719555675983429,
0.3111136257648468,
-0.45211005210876465,
-0.19175057113170624,
-0.41148442029953003,
-0.3350517451763153,
0.0035288750659674406,
-0.39698734879493713,
-0.06446792930364609,
0.025742148980498314,
0.6203001141548157,
0.400597482919693,
0.30727657675743103,
0.3229461908340454,
-0.4501785337924957,
0.5450059175491333,
-0.6901494860649109,
-0.23368582129478455,
-0.30867743492126465,
0.2889243960380554,
-0.061055321246385574,
0.17857636511325836,
-0.21266679465770721,
-0.3517370820045471,
0.2876172363758087,
-0.32905593514442444,
0.6116517782211304,
-0.2789182662963867,
1.3380287885665894,
0.14670215547084808,
-0.13621024787425995,
-0.058376651257276535,
-0.6986367702484131,
0.8336661458015442,
-0.5413123965263367,
0.3086144030094147,
-0.21665562689304352,
0.5259606838226318,
0.3765358626842499,
-0.966344952583313,
-0.2948610782623291,
0.049317553639411926,
0.12807996571063995,
-0.3154883086681366,
-0.3979417085647583,
-0.09278786927461624,
0.6212341785430908,
0.4259342849254608,
-0.4820611774921417,
0.020389221608638763,
-1.0686091184616089,
-0.21771526336669922,
0.5568887591362,
0.27997931838035583,
0.44491004943847656,
-0.28657636046409607,
-1.0035098791122437,
-0.07857976108789444,
-0.6213628053665161,
0.20234254002571106,
0.19660444557666779,
-0.24600304663181305,
-0.3308855891227722,
0.4168756306171417,
0.29256272315979004,
0.5968296527862549,
0.1571807861328125,
-0.30077308416366577,
0.13865181803703308,
0.13504807651042938,
-0.24205395579338074,
-0.118576779961586,
0.7876162528991699,
0.660532534122467,
0.390296995639801,
0.13391274213790894,
-0.1410013735294342,
-0.06659857928752899,
0.40049684047698975,
-1.3903683423995972,
-0.21404454112052917,
-0.11875198036432266,
-0.6976310610771179,
-0.3612685203552246,
0.12773317098617554,
-0.611464262008667,
0.028905143961310387,
-0.17848117649555206,
0.44115009903907776,
-0.8337194323539734,
0.1630612462759018,
0.1388438493013382,
-0.2987504303455353,
0.4714709222316742,
0.46447762846946716,
-0.6933852434158325,
0.35382306575775146,
0.48210299015045166,
1.0454952716827393,
-0.051990021020174026,
-0.2479478418827057,
-0.04945136234164238,
-0.17731773853302002,
-0.1375531107187271,
1.3355845212936401,
-0.41899192333221436,
-0.5683215856552124,
-0.08839038014411926,
0.31249937415122986,
0.09315834194421768,
-0.38994142413139343,
0.8368330597877502,
-0.4572318196296692,
0.13533742725849152,
-0.11436961591243744,
-0.644477903842926,
-0.6396378874778748,
0.3542892634868622,
-0.6816681027412415,
0.5772293210029602,
0.27865028381347656,
-0.6992947459220886,
0.33649149537086487,
-0.6790760159492493,
-0.05400586128234863,
0.026630207896232605,
-0.01983433961868286,
-0.8202447295188904,
0.16842271387577057,
0.40993016958236694,
0.19219709932804108,
-0.3011304438114166,
0.13923953473567963,
-0.34487295150756836,
-0.49665766954421997,
0.10077565908432007,
-0.14586253464221954,
0.8522523641586304,
0.4132149815559387,
0.3040735125541687,
0.30330613255500793,
-0.5474823117256165,
-0.14333438873291016,
0.348612517118454,
0.22744791209697723,
-0.1761777251958847,
-0.2002926915884018,
0.15100310742855072,
-0.05941328406333923,
0.24922692775726318,
-0.8113256692886353,
0.29181453585624695,
0.018011286854743958,
0.44302991032600403,
0.2720162570476532,
0.31060799956321716,
0.5388005971908569,
-0.17151634395122528,
0.6499042510986328,
0.04809955507516861,
0.626979649066925,
-0.5657946467399597,
-0.19538253545761108,
-0.38325271010398865,
-0.3806903064250946,
0.4571484625339508,
0.4422996938228607,
-0.2709837853908539,
0.23940503597259521,
0.09333089739084244,
-0.6664509773254395,
-0.06851600110530853,
-0.24212315678596497,
0.009907443076372147,
0.38553282618522644,
0.24787069857120514,
-0.22265727818012238,
-0.680192232131958,
-1.194523572921753,
0.3148473799228668,
0.08342457562685013,
-0.20917470753192902,
0.2262190282344818,
0.48868581652641296,
-0.2848295271396637,
0.936487078666687,
-0.9132787585258484,
-0.10906019061803818,
-0.2977718412876129,
0.18873676657676697,
0.33095109462738037,
0.5124824047088623,
1.1362863779067993,
-0.9330118298530579,
-0.5313547253608704,
-0.6109498143196106,
-0.6506609916687012,
0.0620417594909668,
-0.026808444410562515,
-0.16747798025608063,
-0.43840840458869934,
0.41417601704597473,
-0.6889997720718384,
0.6139039397239685,
0.44108110666275024,
-0.054841428995132446,
0.7415065169334412,
0.25710082054138184,
0.3403821587562561,
-1.0296697616577148,
-0.04795505106449127,
0.3979548215866089,
-0.5978792905807495,
-0.6887877583503723,
0.04791150614619255,
0.16488762199878693,
-0.6575465202331543,
-0.8970487713813782,
0.23353491723537445,
-0.31093084812164307,
-0.018763670697808266,
-0.3846178948879242,
-0.030796032398939133,
0.35897061228752136,
0.5410066843032837,
0.08064424246549606,
0.8159314393997192,
0.7005203366279602,
-0.6752665638923645,
0.2160245031118393,
0.7273489236831665,
-0.37718212604522705,
0.7865696549415588,
-1.1341733932495117,
0.10405590385198593,
-0.20281970500946045,
0.07566312700510025,
-0.7352038025856018,
-0.2104916125535965,
0.20900139212608337,
-0.2896823585033417,
0.31507164239883423,
-0.25871241092681885,
-0.24442268908023834,
-0.41630819439888,
-0.5362394452095032,
0.7850255370140076,
0.5749287605285645,
-0.5877560973167419,
0.14240649342536926,
0.505321204662323,
0.05759648233652115,
-0.04447261989116669,
-0.5391476154327393,
-0.34162813425064087,
-0.1371472328901291,
-0.9428000450134277,
0.6376613974571228,
-0.28361770510673523,
0.002608736976981163,
0.02310950495302677,
0.09445977956056595,
-0.35808879137039185,
-0.3563467264175415,
0.10346177965402603,
0.3835211396217346,
-0.2294674962759018,
0.14857527613639832,
0.18296073377132416,
-0.19947437942028046,
-0.05294046923518181,
0.2543396055698395,
0.45023852586746216,
-0.22021964192390442,
-0.20310135185718536,
-0.42344003915786743,
0.6453066468238831,
0.5653926134109497,
-0.04259350523352623,
0.5132452249526978,
0.5910425782203674,
-0.48796337842941284,
0.060679126530885696,
-0.3122588098049164,
-0.14444082975387573,
-0.4538246989250183,
0.25052884221076965,
-0.33009371161460876,
-0.9236462116241455,
0.6572209000587463,
-0.27324190735816956,
-0.16391026973724365,
0.7053370475769043,
0.3589886724948883,
0.09546106308698654,
1.0963456630706787,
0.9977436065673828,
0.35128697752952576,
0.7523218989372253,
-0.4942077398300171,
0.27275124192237854,
-1.1332881450653076,
-0.15822409093379974,
-0.49684348702430725,
-0.2912774682044983,
-0.24068590998649597,
-0.3363311290740967,
0.46802571415901184,
0.5397823452949524,
-0.161561518907547,
0.7414420247077942,
-0.6676543354988098,
0.5559592247009277,
0.32725515961647034,
0.3564784526824951,
-0.160677969455719,
-0.24793797731399536,
-0.03505149483680725,
-0.2240384817123413,
-0.4604836404323578,
-0.4940341114997864,
0.37049707770347595,
0.6115943789482117,
0.9671229124069214,
-0.2631433308124542,
0.5781287550926208,
0.31663504242897034,
-0.029481856152415276,
-1.2348337173461914,
0.6312738060951233,
-0.19758938252925873,
-0.7949000000953674,
-0.08709000051021576,
0.026435622945427895,
-0.7354536652565002,
-0.022339265793561935,
-0.13563868403434753,
-0.78098064661026,
0.4131195545196533,
0.054051902145147324,
-0.4374358057975769,
0.4712652862071991,
-0.7596246004104614,
0.8786066174507141,
0.013185648247599602,
0.12236481159925461,
0.11256245523691177,
-0.40447667241096497,
0.5603047609329224,
0.32886192202568054,
-0.22762800753116608,
-0.5488947629928589,
0.2474786639213562,
0.7608667016029358,
-0.6633001565933228,
0.7238441705703735,
-0.24609334766864777,
0.16728481650352478,
0.7209485769271851,
0.05063459277153015,
0.4455960988998413,
0.0018198599573224783,
0.11350119858980179,
0.33295494318008423,
0.4358276426792145,
-0.26278749108314514,
-0.5356109142303467,
0.4020048975944519,
-0.6534380912780762,
-0.3048538863658905,
-0.029072856530547142,
-0.47245487570762634,
0.280565083026886,
0.18595153093338013,
0.7551029324531555,
0.7255278825759888,
-0.39912042021751404,
0.14159555733203888,
0.711544930934906,
-0.2921057641506195,
0.45068228244781494,
0.19654013216495514,
-0.36607739329338074,
-0.43064624071121216,
0.4301893413066864,
0.07515636086463928,
0.0528566837310791,
0.1654634028673172,
0.29835283756256104,
-0.29108598828315735,
-0.5188749432563782,
-0.3282717764377594,
0.3198333978652954,
-0.9229292869567871,
-0.5393899083137512,
-0.43593573570251465,
-0.47812074422836304,
-0.4153498113155365,
-0.3856143057346344,
-0.45389440655708313,
-0.3336217403411865,
-0.6850149035453796,
-0.045259129256010056,
0.6126672029495239,
0.5202115774154663,
-0.05182618275284767,
0.6060833930969238,
-1.3139060735702515,
0.3894340991973877,
0.39678826928138733,
0.524081826210022,
-0.3240823745727539,
-0.5681056976318359,
-0.1314694583415985,
-0.3278277516365051,
-0.6234033703804016,
-1.1316274404525757,
0.47354456782341003,
0.12855105102062225,
0.6052542328834534,
0.5046627521514893,
-0.049666356295347214,
0.4926552474498749,
-0.6338454484939575,
0.9274410605430603,
0.5564215779304504,
-1.0823497772216797,
0.5903465747833252,
-0.2436169534921646,
0.6093622446060181,
0.4259132444858551,
0.5908194184303284,
-0.4774795472621918,
0.1126818060874939,
-0.7946439385414124,
-0.7437782287597656,
0.6082195043563843,
-0.016987120732665062,
0.23372554779052734,
0.026342764496803284,
0.2936174273490906,
0.3560183644294739,
0.09848254919052124,
-0.6344512104988098,
-0.23617255687713623,
-0.1879836469888687,
0.019028877839446068,
0.5951850414276123,
-0.8601005673408508,
-0.021755743771791458,
-0.43576204776763916,
0.47761330008506775,
-0.10908843576908112,
0.7116212248802185,
0.40749409794807434,
-0.22726242244243622,
-0.17281001806259155,
0.14683690667152405,
0.8985183835029602,
0.5813499093055725,
-0.29750362038612366,
-0.04435570165514946,
0.18023614585399628,
-0.2531318962574005,
0.02014879509806633,
-0.10770642012357712,
-0.4733949601650238,
0.26171010732650757,
0.23942863941192627,
1.2212960720062256,
0.3058248460292816,
-0.39947980642318726,
0.5086515545845032,
-0.02789413370192051,
-0.6040176749229431,
-0.3964688777923584,
0.09932611137628555,
-0.1831337809562683,
0.34070542454719543,
0.24915999174118042,
0.3558838963508606,
0.5748531222343445,
-0.043891504406929016,
0.4630507528781891,
0.22895030677318573,
-0.7468870878219604,
-0.39416560530662537,
0.5389776825904846,
0.19062519073486328,
-0.6472468972206116,
0.44500547647476196,
-0.3346179127693176,
-0.7015062570571899,
0.6935356259346008,
0.4958016872406006,
0.9811077117919922,
-0.022028377279639244,
0.5024369955062866,
0.8294857144355774,
0.15202130377292633,
0.0028858499135822058,
0.20480136573314667,
-0.051868390291929245,
-0.5934688448905945,
-0.40656524896621704,
-0.4925670623779297,
-0.6275249123573303,
0.12569350004196167,
-0.7740198969841003,
0.5864008665084839,
-0.4519546329975128,
-0.24117489159107208,
0.1748671531677246,
-0.3015412390232086,
-0.7113436460494995,
0.17051716148853302,
0.3145987391471863,
1.3777824640274048,
-0.6870895624160767,
0.6174383759498596,
0.628234326839447,
-0.42867791652679443,
-0.5531576871871948,
-0.20821870863437653,
-0.22848987579345703,
-0.5715906023979187,
0.2674407660961151,
0.4337271749973297,
-0.05293549969792366,
-0.13856004178524017,
-1.4186455011367798,
-0.8047242760658264,
0.9060520529747009,
0.37974461913108826,
-0.5019529461860657,
0.16684077680110931,
-0.22529979050159454,
0.2931600511074066,
-0.596689760684967,
0.13777966797351837,
0.27275168895721436,
0.25316786766052246,
0.6425762176513672,
-0.29829490184783936,
-0.2463216334581375,
-0.2783350348472595,
0.35721760988235474,
0.41028186678886414,
-0.735490620136261,
1.1600885391235352,
-0.3000861406326294,
-0.2931067943572998,
0.23513948917388916,
0.6971535682678223,
0.11556486040353775,
0.1824711561203003,
0.5706276893615723,
0.5512719750404358,
0.15609827637672424,
-0.13598103821277618,
0.9272971153259277,
-0.011734148487448692,
0.8954850435256958,
0.855038583278656,
-0.10843724012374878,
0.3997776508331299,
0.34256285429000854,
-0.2951326370239258,
0.6543565392494202,
0.7042515277862549,
-0.7009556293487549,
0.653557300567627,
-0.15952228009700775,
-0.06718037277460098,
-0.3018559217453003,
-0.1812664121389389,
-0.10867498815059662,
0.290640652179718,
0.3390968143939972,
-0.517859935760498,
-0.6799933910369873,
0.2019832879304886,
0.03415639325976372,
-0.07300844043493271,
-0.3631470501422882,
0.659726619720459,
0.056046467274427414,
-0.2911899983882904,
0.4826529026031494,
0.023988530039787292,
0.43257594108581543,
-0.46969369053840637,
-0.20570231974124908,
0.06354936957359314,
0.031205562874674797,
-0.06647135317325592,
-1.0659043788909912,
0.7285123467445374,
0.1803339272737503,
-0.3982938528060913,
0.1729988008737564,
0.8965659141540527,
-0.15501318871974945,
-0.6894984245300293,
0.12217611819505692,
-0.20907410979270935,
0.24270926415920258,
-0.10441580414772034,
-0.987154483795166,
0.3193570077419281,
-0.04762951284646988,
-0.12897056341171265,
0.03650398179888725,
0.29761815071105957,
0.2519800364971161,
0.40221521258354187,
0.34829431772232056,
-0.5641669631004333,
-0.0029360393527895212,
0.042451970279216766,
0.9834022521972656,
-0.5873246192932129,
-0.37101560831069946,
-0.7300007343292236,
0.7799650430679321,
-0.2535803020000458,
-0.2805168032646179,
0.3951711356639862,
0.45881643891334534,
0.5365052223205566,
-0.5259726643562317,
0.6543102264404297,
-0.1507296860218048,
0.48044484853744507,
-0.41960468888282776,
0.23464547097682953,
-0.4951414167881012,
-0.32445240020751953,
-0.26385027170181274,
-0.6893219947814941,
-0.47440358996391296,
0.6681772470474243,
-0.344208687543869,
-0.16692206263542175,
0.7207201719284058,
0.6400707960128784,
-0.16799168288707733,
-0.14436395466327667,
0.5679965019226074,
-0.32534050941467285,
0.44733157753944397,
0.17221595346927643,
0.5603954792022705,
-0.8152139782905579,
0.6545701026916504,
-0.5213320851325989,
-0.06804503500461578,
-0.21467602252960205,
-0.8872753977775574,
-1.0452746152877808,
-0.37397500872612,
-0.5030151009559631,
-0.06753833591938019,
-0.3668610751628876,
0.7670437693595886,
1.0312420129776,
-0.8512372374534607,
0.11467389017343521,
-0.09489688277244568,
0.14819857478141785,
0.07901574671268463,
-0.191518172621727,
0.2637811601161957,
-0.2094881683588028,
-0.8288412690162659,
-0.0044155120849609375,
0.45443394780158997,
0.37495166063308716,
-0.367640882730484,
0.11083028465509415,
-0.26423129439353943,
0.3441429138183594,
0.41041329503059387,
0.4094814956188202,
-0.32675862312316895,
-0.5112273097038269,
0.1512727290391922,
-0.08344815671443939,
0.5512353181838989,
1.004446029663086,
-0.37432053685188293,
0.2015809565782547,
0.8077187538146973,
-0.0729459747672081,
0.7629439830780029,
0.12245502322912216,
0.31936490535736084,
-0.7990007996559143,
0.5106898546218872,
0.03582857921719551,
0.5256239175796509,
0.30193209648132324,
-0.36504942178726196,
0.29933518171310425,
0.11844537407159805,
-0.6144378781318665,
-0.39078184962272644,
0.4496972858905792,
-1.1704339981079102,
-0.28679636120796204,
0.8304723501205444,
-0.20585528016090393,
-0.6625626087188721,
0.4677415192127228,
-0.6566805839538574,
0.22340865433216095,
-0.21064968407154083,
0.5291341543197632,
0.4034120738506317,
-0.08494806289672852,
-0.970536470413208,
0.004802394658327103,
0.23191602528095245,
-0.36874276399612427,
-0.7320589423179626,
-0.6655653119087219,
0.3548157215118408,
0.35126906633377075,
0.5162331461906433,
0.2297433316707611,
-0.43625158071517944,
0.4507914185523987,
0.13285912573337555,
0.49971094727516174,
-0.11711879819631577,
-0.3508012890815735,
-0.21505770087242126,
0.3455849587917328,
-0.04230782389640808,
-0.6265477538108826
] |
facebook/wav2vec2-base-960h | facebook | "2022-11-14T21:37:23Z" | 1,103,109 | 175 | transformers | [
"transformers",
"pytorch",
"tf",
"safetensors",
"wav2vec2",
"automatic-speech-recognition",
"audio",
"hf-asr-leaderboard",
"en",
"dataset:librispeech_asr",
"arxiv:2006.11477",
"license:apache-2.0",
"model-index",
"endpoints_compatible",
"has_space",
"region:us"
] | automatic-speech-recognition | "2022-03-02T23:29:05Z" | ---
language: en
datasets:
- librispeech_asr
tags:
- audio
- automatic-speech-recognition
- hf-asr-leaderboard
license: apache-2.0
widget:
- example_title: Librispeech sample 1
src: https://cdn-media.huggingface.co/speech_samples/sample1.flac
- example_title: Librispeech sample 2
src: https://cdn-media.huggingface.co/speech_samples/sample2.flac
model-index:
- name: wav2vec2-base-960h
results:
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: LibriSpeech (clean)
type: librispeech_asr
config: clean
split: test
args:
language: en
metrics:
- name: Test WER
type: wer
value: 3.4
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: LibriSpeech (other)
type: librispeech_asr
config: other
split: test
args:
language: en
metrics:
- name: Test WER
type: wer
value: 8.6
---
# Wav2Vec2-Base-960h
[Facebook's Wav2Vec2](https://ai.facebook.com/blog/wav2vec-20-learning-the-structure-of-speech-from-raw-audio/)
The base model pretrained and fine-tuned on 960 hours of Librispeech on 16kHz sampled speech audio. When using the model
make sure that your speech input is also sampled at 16Khz.
[Paper](https://arxiv.org/abs/2006.11477)
Authors: Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli
**Abstract**
We show for the first time that learning powerful representations from speech audio alone followed by fine-tuning on transcribed speech can outperform the best semi-supervised methods while being conceptually simpler. wav2vec 2.0 masks the speech input in the latent space and solves a contrastive task defined over a quantization of the latent representations which are jointly learned. Experiments using all labeled data of Librispeech achieve 1.8/3.3 WER on the clean/other test sets. When lowering the amount of labeled data to one hour, wav2vec 2.0 outperforms the previous state of the art on the 100 hour subset while using 100 times less labeled data. Using just ten minutes of labeled data and pre-training on 53k hours of unlabeled data still achieves 4.8/8.2 WER. This demonstrates the feasibility of speech recognition with limited amounts of labeled data.
The original model can be found under https://github.com/pytorch/fairseq/tree/master/examples/wav2vec#wav2vec-20.
# Usage
To transcribe audio files the model can be used as a standalone acoustic model as follows:
```python
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
from datasets import load_dataset
import torch
# load model and tokenizer
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
# load dummy dataset and read soundfiles
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
# tokenize
input_values = processor(ds[0]["audio"]["array"], return_tensors="pt", padding="longest").input_values # Batch size 1
# retrieve logits
logits = model(input_values).logits
# take argmax and decode
predicted_ids = torch.argmax(logits, dim=-1)
transcription = processor.batch_decode(predicted_ids)
```
## Evaluation
This code snippet shows how to evaluate **facebook/wav2vec2-base-960h** on LibriSpeech's "clean" and "other" test data.
```python
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
import torch
from jiwer import wer
librispeech_eval = load_dataset("librispeech_asr", "clean", split="test")
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h").to("cuda")
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
def map_to_pred(batch):
input_values = processor(batch["audio"]["array"], return_tensors="pt", padding="longest").input_values
with torch.no_grad():
logits = model(input_values.to("cuda")).logits
predicted_ids = torch.argmax(logits, dim=-1)
transcription = processor.batch_decode(predicted_ids)
batch["transcription"] = transcription
return batch
result = librispeech_eval.map(map_to_pred, batched=True, batch_size=1, remove_columns=["audio"])
print("WER:", wer(result["text"], result["transcription"]))
```
*Result (WER)*:
| "clean" | "other" |
|---|---|
| 3.4 | 8.6 | | [
-0.198020800948143,
-0.6546816229820251,
0.16972270607948303,
0.16908106207847595,
-0.17613594233989716,
-0.15908141434192657,
-0.4845995604991913,
-0.5395611524581909,
-0.05200781673192978,
0.15351442992687225,
-0.6113046407699585,
-0.5992768406867981,
-0.5833753347396851,
-0.40984076261520386,
-0.39383959770202637,
0.94269198179245,
0.2656098008155823,
0.09915278106927872,
0.06139516085386276,
-0.1593712419271469,
-0.4109627604484558,
-0.2769954800605774,
-0.8367401361465454,
-0.4449796974658966,
0.16830025613307953,
0.20150034129619598,
0.20385819673538208,
0.22638891637325287,
0.3390830159187317,
0.3343338966369629,
-0.24011805653572083,
0.07069242745637894,
-0.6874475479125977,
-0.0942637100815773,
0.1438436210155487,
-0.4109055697917938,
-0.30656853318214417,
0.28564831614494324,
0.5362074375152588,
0.5244948863983154,
-0.20593394339084625,
0.5228545069694519,
0.09321568161249161,
0.4667092561721802,
-0.3147113025188446,
0.31728994846343994,
-0.5874531865119934,
-0.2077755182981491,
-0.11671054363250732,
-0.11881224066019058,
-0.6085872054100037,
-0.1344897449016571,
0.11907551437616348,
-0.5235785245895386,
0.20494483411312103,
-0.23680005967617035,
0.9077528119087219,
0.23217640817165375,
-0.31964272260665894,
-0.40770748257637024,
-0.9455919861793518,
0.8521267771720886,
-0.6535735726356506,
0.7438881993293762,
0.4791810214519501,
0.2151724100112915,
-0.05267234891653061,
-1.1219877004623413,
-0.41243302822113037,
-0.031461961567401886,
0.29229915142059326,
0.4648042321205139,
-0.3420424461364746,
0.046506915241479874,
0.38085171580314636,
0.306194007396698,
-0.6383383274078369,
0.060480646789073944,
-0.902378499507904,
-0.5090816617012024,
0.7483033537864685,
-0.3302203416824341,
0.02618473768234253,
-0.0069835009053349495,
-0.37311503291130066,
-0.567741334438324,
-0.2521754503250122,
0.5041860342025757,
0.31524184346199036,
0.1783573031425476,
-0.41107913851737976,
0.4108727276325226,
0.07456246018409729,
0.6162243485450745,
0.09614765644073486,
-0.4153338372707367,
0.7198539972305298,
-0.1809442788362503,
-0.1350223869085312,
0.40291377902030945,
0.8390870690345764,
0.19279149174690247,
0.15497446060180664,
0.11705868691205978,
-0.17246657609939575,
0.2106325924396515,
-0.1799650490283966,
-0.7447366118431091,
-0.5118055939674377,
0.43471258878707886,
-0.4466608464717865,
0.06679949909448624,
0.16902367770671844,
-0.21403375267982483,
-0.045399606227874756,
-0.23294684290885925,
0.9555991888046265,
-0.5612278580665588,
-0.2699267268180847,
0.14781324565410614,
-0.29439616203308105,
0.19662010669708252,
-0.12244931608438492,
-0.8278118371963501,
0.218735009431839,
0.4760880768299103,
0.8304988145828247,
0.11382339894771576,
-0.06765672564506531,
-0.566849946975708,
-0.07816454768180847,
-0.2680928707122803,
0.5040626525878906,
-0.05848962068557739,
-0.5800163149833679,
-0.31069791316986084,
-0.11646659672260284,
0.09937211871147156,
-0.6231491565704346,
0.7255138754844666,
-0.3793661892414093,
0.23986251652240753,
-0.07848075777292252,
-0.6947945952415466,
-0.27969589829444885,
-0.5834799408912659,
-0.5929576754570007,
1.2510548830032349,
0.1761859655380249,
-0.5956591963768005,
0.26146408915519714,
-0.37895405292510986,
-0.6401594877243042,
-0.3322438597679138,
-0.03565811738371849,
-0.5955133438110352,
0.12714852392673492,
0.21684612333774567,
0.42377325892448425,
-0.15016581118106842,
0.004279406741261482,
-0.15452656149864197,
-0.6476988792419434,
0.38706156611442566,
-0.545149564743042,
1.1310080289840698,
0.2964077889919281,
-0.5304310917854309,
0.16298070549964905,
-0.9369403719902039,
0.2064773142337799,
0.03216223046183586,
-0.4803268611431122,
0.1055687814950943,
-0.15139052271842957,
0.36871138215065,
0.226209819316864,
0.13067474961280823,
-0.5638948082923889,
-0.21042683720588684,
-0.7611182928085327,
0.5842946767807007,
0.6832792162895203,
-0.11165136843919754,
0.39300283789634705,
-0.3610387444496155,
-0.044239941984415054,
-0.26785680651664734,
-0.017866594716906548,
0.1263469010591507,
-0.47950461506843567,
-0.6107763051986694,
-0.41971561312675476,
0.33935633301734924,
0.520215630531311,
-0.19189144670963287,
0.6584500670433044,
-0.11747333407402039,
-0.9033787846565247,
-0.9725531339645386,
0.026615861803293228,
0.33748432993888855,
0.5337038040161133,
0.6940072774887085,
-0.242780402302742,
-0.8095542788505554,
-0.7693032622337341,
-0.13910803198814392,
-0.14874663949012756,
-0.21146725118160248,
0.2750468850135803,
0.23233197629451752,
-0.3372673988342285,
0.6474197506904602,
-0.21309931576251984,
-0.3912472426891327,
-0.24429060518741608,
0.1925642043352127,
0.6404243111610413,
0.6756364107131958,
0.26888197660446167,
-0.6458399295806885,
-0.32330745458602905,
-0.36446699500083923,
-0.5052598118782043,
-0.13083255290985107,
-0.07234125584363937,
-0.02558044157922268,
0.13626016676425934,
0.39369848370552063,
-0.47747379541397095,
0.4024852514266968,
0.5276151299476624,
-0.10627061873674393,
0.37641388177871704,
-0.0757436752319336,
-0.016464747488498688,
-0.9786054491996765,
0.00924556702375412,
-0.11047046631574631,
-0.27002212405204773,
-0.5354259014129639,
-0.589277446269989,
-0.12536001205444336,
-0.044702038168907166,
-0.5326212644577026,
0.3773791193962097,
-0.44416093826293945,
-0.29029515385627747,
-0.18097177147865295,
0.13445959985256195,
-0.13368773460388184,
0.48609763383865356,
0.06175471469759941,
0.6651372313499451,
0.6101396679878235,
-0.5565687417984009,
0.5609199404716492,
0.2146431803703308,
-0.5806177258491516,
-0.0013930132845416665,
-0.8353344798088074,
0.45559683442115784,
0.16975976526737213,
0.34682679176330566,
-1.1862436532974243,
-0.061089642345905304,
-0.08945397287607193,
-0.948838472366333,
0.3123038113117218,
0.010310444049537182,
-0.3674732446670532,
-0.37803733348846436,
-0.08808388561010361,
0.38172873854637146,
1.0023969411849976,
-0.6606827974319458,
0.5571433305740356,
0.4493620991706848,
0.18274886906147003,
-0.4634753167629242,
-0.9665126800537109,
-0.49383264780044556,
-0.0036892006173729897,
-0.7195972204208374,
0.420387864112854,
-0.006892469245940447,
-0.01717226766049862,
-0.12669919431209564,
-0.5167874693870544,
0.14698724448680878,
-0.08521177619695663,
0.5607075095176697,
0.23902039229869843,
-0.08590785413980484,
0.11476017534732819,
-0.09788849204778671,
-0.2806382179260254,
0.196435809135437,
-0.5375725626945496,
0.7296074628829956,
-0.1678578108549118,
-0.21961897611618042,
-0.8886670470237732,
-0.04273875057697296,
0.17236369848251343,
-0.29951658844947815,
0.4274822175502777,
1.1267904043197632,
-0.4050382077693939,
-0.26992926001548767,
-0.5302704572677612,
-0.30578380823135376,
-0.5373784899711609,
0.6604866981506348,
-0.26410406827926636,
-0.637381911277771,
0.3530634939670563,
0.04422627389431,
0.12264075130224228,
0.6336976289749146,
0.7718324065208435,
-0.45779240131378174,
0.855421245098114,
0.2677340805530548,
0.03583643212914467,
0.5256081223487854,
-0.8949257135391235,
0.08800950646400452,
-0.6660640835762024,
-0.45987606048583984,
-0.3286961317062378,
-0.4148603677749634,
-0.5492664575576782,
-0.4956949055194855,
0.4670925438404083,
0.0874411016702652,
-0.119226835668087,
0.36958399415016174,
-0.6757380962371826,
0.166718527674675,
0.7243891358375549,
0.32443398237228394,
-0.15119943022727966,
0.2338244765996933,
-0.014797620475292206,
-0.01840071938931942,
-0.4878571331501007,
-0.22356997430324554,
1.2304091453552246,
0.43285104632377625,
0.6999443173408508,
-0.11280898004770279,
0.7799644470214844,
0.19659212231636047,
-0.2650059759616852,
-0.8851271867752075,
0.4324290454387665,
-0.11411068588495255,
-0.6753188371658325,
-0.24198909103870392,
-0.2399914413690567,
-0.8064106702804565,
0.12249590456485748,
-0.3160483241081238,
-0.8081711530685425,
0.13694092631340027,
0.01165794488042593,
-0.307757705450058,
0.17532935738563538,
-0.7527816295623779,
0.5947879552841187,
-0.16824139654636383,
-0.3257141709327698,
-0.29927903413772583,
-0.7146342992782593,
0.04945814982056618,
0.11251726746559143,
0.23077392578125,
-0.14698292315006256,
0.4387032091617584,
1.3506412506103516,
-0.21718783676624298,
0.5088963508605957,
-0.42988279461860657,
0.04127474129199982,
0.6893238425254822,
-0.19948332011699677,
0.2878921627998352,
0.019022773951292038,
-0.22062310576438904,
0.28958216309547424,
0.13305512070655823,
-0.34287381172180176,
-0.38034725189208984,
0.6035301685333252,
-1.0293378829956055,
-0.26091861724853516,
-0.18933390080928802,
-0.4585026502609253,
-0.293881356716156,
0.13365718722343445,
0.814304530620575,
0.7684565186500549,
-0.059811998158693314,
0.46856266260147095,
0.65167236328125,
-0.026860054582357407,
0.44884219765663147,
0.0880163386464119,
-0.07376276701688766,
-0.44918787479400635,
0.9412558078765869,
0.21510878205299377,
0.21924349665641785,
0.12868589162826538,
0.20914721488952637,
-0.5861780047416687,
-0.481962651014328,
-0.048909980803728104,
0.1769810914993286,
-0.7417390942573547,
-0.04849190264940262,
-0.6043375134468079,
-0.3728269338607788,
-0.6691445708274841,
0.061533648520708084,
-0.6993692517280579,
-0.4699099361896515,
-0.4255448579788208,
-0.15382888913154602,
0.34071293473243713,
0.5737758278846741,
-0.5119498372077942,
0.3974810242652893,
-0.5837522149085999,
0.4673449397087097,
0.3095512390136719,
-0.04406150057911873,
-0.16729769110679626,
-1.0069584846496582,
-0.3423731327056885,
0.2599487006664276,
-0.010275590233504772,
-0.9124535322189331,
0.1574966311454773,
0.22055144608020782,
0.4792064428329468,
0.3178759813308716,
-0.09752748906612396,
0.6494072675704956,
-0.28695687651634216,
0.743613064289093,
0.2521505355834961,
-1.0676826238632202,
0.6493494510650635,
-0.04162362962961197,
0.11034196615219116,
0.4887573719024658,
0.1890934407711029,
-0.33525052666664124,
-0.05139143392443657,
-0.7039288878440857,
-1.0061602592468262,
0.8840581774711609,
0.3968740403652191,
-0.021195607259869576,
0.4208085834980011,
0.2641206979751587,
-0.06234348937869072,
-0.08607722073793411,
-0.6428282856941223,
-0.4953034818172455,
-0.399689644575119,
-0.30903008580207825,
-0.30840057134628296,
-0.2567717432975769,
-0.03469352051615715,
-0.5248052477836609,
0.9953798055648804,
0.38333433866500854,
0.5522871613502502,
0.37722650170326233,
-0.19934490323066711,
0.09542649984359741,
0.11686331033706665,
0.34553349018096924,
0.33325624465942383,
-0.38851210474967957,
0.1362612247467041,
0.3152811825275421,
-0.6240503191947937,
0.2177588790655136,
0.23639504611492157,
0.14181609451770782,
0.11312578618526459,
0.7469916939735413,
1.1569119691848755,
-0.027857070788741112,
-0.4227932393550873,
0.5083195567131042,
0.0325210876762867,
-0.2992445230484009,
-0.5473980903625488,
0.21153993904590607,
0.46456483006477356,
0.358358770608902,
0.43557655811309814,
0.046072639524936676,
0.13662788271903992,
-0.39935439825057983,
0.3861521780490875,
0.19986118376255035,
-0.5124027729034424,
-0.322368860244751,
0.906467616558075,
0.044691555202007294,
-0.26395756006240845,
0.6931617259979248,
-0.02514938823878765,
-0.2809058725833893,
0.6369415521621704,
0.6027211546897888,
0.7460192441940308,
-0.3134121000766754,
-0.23128186166286469,
0.5707185864448547,
0.22616437077522278,
-0.01989975944161415,
0.5153007507324219,
-0.20059159398078918,
-0.4945520758628845,
-0.26595017313957214,
-0.6068487167358398,
0.01752731017768383,
0.23076198995113373,
-0.8321216106414795,
0.34780028462409973,
-0.4360499083995819,
-0.42091554403305054,
0.2886215150356293,
0.19839772582054138,
-0.7873989939689636,
0.3686557412147522,
0.2838059961795807,
0.7541793584823608,
-0.8751341700553894,
1.0234163999557495,
0.37215450406074524,
-0.34853610396385193,
-1.2949227094650269,
-0.17845575511455536,
-0.027423957362771034,
-0.7425739765167236,
0.6397783756256104,
0.3493303060531616,
-0.4161083996295929,
0.20480726659297943,
-0.5588690638542175,
-0.811482846736908,
1.076749563217163,
0.3168080747127533,
-0.697138786315918,
0.10396251827478409,
-0.10681381821632385,
0.4712158441543579,
-0.05450703576207161,
0.226304292678833,
0.7434198260307312,
0.43171194195747375,
0.08053760975599289,
-0.9511370658874512,
-0.1372765749692917,
-0.17569206655025482,
-0.24967265129089355,
-0.28325891494750977,
-0.5920746326446533,
0.9829621911048889,
-0.396637499332428,
-0.31704217195510864,
-0.08174652606248856,
1.0154742002487183,
0.27908235788345337,
0.30630165338516235,
0.6258790493011475,
0.5142253041267395,
0.9427953362464905,
-0.24226988852024078,
0.7536465525627136,
-0.03247067704796791,
0.5366820693016052,
1.0887113809585571,
0.07930683344602585,
0.8653022050857544,
0.2763083577156067,
-0.39115673303604126,
0.43472835421562195,
0.6107732653617859,
-0.14849404990673065,
0.753522515296936,
0.20098662376403809,
-0.23707270622253418,
-0.1618051379919052,
0.050000838935375214,
-0.61846524477005,
0.8824052214622498,
0.31734687089920044,
-0.1339280605316162,
0.23787447810173035,
0.14411009848117828,
-0.09944084286689758,
-0.10556753724813461,
-0.07682039588689804,
0.7391167283058167,
0.18088960647583008,
-0.23643791675567627,
0.9504454135894775,
0.061396729201078415,
0.7725102305412292,
-0.6286050081253052,
0.03394068032503128,
0.19455334544181824,
0.30005812644958496,
-0.4142499566078186,
-0.6029196977615356,
0.12162548303604126,
-0.20736657083034515,
-0.2130434364080429,
0.04110216349363327,
0.6396217942237854,
-0.6466687917709351,
-0.46911489963531494,
0.6076636910438538,
0.11068236082792282,
0.2832152843475342,
0.008406800217926502,
-0.6449081301689148,
0.32945165038108826,
0.2729436457157135,
-0.4128958284854889,
-0.1002771258354187,
0.06253241002559662,
0.33476385474205017,
0.26888006925582886,
0.8036242127418518,
0.19077841937541962,
0.1704506278038025,
0.024602772668004036,
0.6013466715812683,
-0.527021586894989,
-0.5551712512969971,
-0.6128172874450684,
0.4117920696735382,
0.09152816236019135,
-0.17989206314086914,
0.5573549866676331,
0.8166748285293579,
1.0587071180343628,
0.04411114379763603,
0.7507163882255554,
-0.015119788236916065,
0.6609742045402527,
-0.7042405605316162,
0.7798120975494385,
-0.6059465408325195,
0.14602354168891907,
-0.1295749545097351,
-0.7963111996650696,
0.08073855191469193,
0.9154830574989319,
-0.11928874254226685,
0.3320261538028717,
0.4951678216457367,
0.8683803677558899,
-0.10209875553846359,
0.019562141969799995,
0.14827997982501984,
0.3232986330986023,
0.3367374539375305,
0.7136211395263672,
0.5677060484886169,
-0.8113296031951904,
0.7199040055274963,
-0.6322614550590515,
-0.1925516128540039,
-0.08144509792327881,
-0.23572638630867004,
-0.8716234564781189,
-0.8000214099884033,
-0.22230806946754456,
-0.7009316682815552,
-0.0401095449924469,
1.0502092838287354,
0.8297685980796814,
-0.8827279806137085,
-0.39863088726997375,
0.24208331108093262,
-0.14625701308250427,
-0.430399626493454,
-0.1913260668516159,
0.7502797842025757,
0.014870157465338707,
-0.8570103049278259,
0.7726421356201172,
-0.07768608629703522,
0.07747743278741837,
0.05675331503152847,
-0.182057723402977,
-0.2783641219139099,
-0.024186473339796066,
0.3641272187232971,
0.1983378529548645,
-0.6750832796096802,
-0.20320448279380798,
-0.12669968605041504,
-0.1718333512544632,
0.1547876000404358,
0.41545355319976807,
-0.6739168763160706,
0.5894032120704651,
0.6177323460578918,
0.31390947103500366,
1.0172111988067627,
-0.2036592662334442,
0.11187668144702911,
-0.6887055039405823,
0.4760664105415344,
0.2683507204055786,
0.32840481400489807,
0.2900906205177307,
-0.18891368806362152,
0.28367000818252563,
0.35044342279434204,
-0.5304590463638306,
-0.7863852381706238,
-0.08879317343235016,
-1.3286139965057373,
-0.2207411229610443,
1.2472676038742065,
0.04483087360858917,
-0.2480420023202896,
0.15716318786144257,
-0.3467716574668884,
0.9988487362861633,
-0.4710935652256012,
0.34454435110092163,
0.38914167881011963,
-0.2020663022994995,
0.1770971119403839,
-0.5560198426246643,
0.5523940324783325,
0.45054200291633606,
-0.29345938563346863,
-0.12241335213184357,
0.39521175622940063,
0.5764482617378235,
0.07635920494794846,
0.9148364067077637,
-0.1425965577363968,
0.3898433446884155,
0.30325230956077576,
0.265604704618454,
-0.3021830916404724,
-0.2763961851596832,
-0.45276233553886414,
0.06800527125597,
-0.12354814261198044,
-0.5230730175971985
] |
google/mt5-base | google | "2023-01-24T16:37:25Z" | 1,068,223 | 115 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"mt5",
"text2text-generation",
"multilingual",
"af",
"am",
"ar",
"az",
"be",
"bg",
"bn",
"ca",
"ceb",
"co",
"cs",
"cy",
"da",
"de",
"el",
"en",
"eo",
"es",
"et",
"eu",
"fa",
"fi",
"fil",
"fr",
"fy",
"ga",
"gd",
"gl",
"gu",
"ha",
"haw",
"hi",
"hmn",
"ht",
"hu",
"hy",
"ig",
"is",
"it",
"iw",
"ja",
"jv",
"ka",
"kk",
"km",
"kn",
"ko",
"ku",
"ky",
"la",
"lb",
"lo",
"lt",
"lv",
"mg",
"mi",
"mk",
"ml",
"mn",
"mr",
"ms",
"mt",
"my",
"ne",
"nl",
"no",
"ny",
"pa",
"pl",
"ps",
"pt",
"ro",
"ru",
"sd",
"si",
"sk",
"sl",
"sm",
"sn",
"so",
"sq",
"sr",
"st",
"su",
"sv",
"sw",
"ta",
"te",
"tg",
"th",
"tr",
"uk",
"und",
"ur",
"uz",
"vi",
"xh",
"yi",
"yo",
"zh",
"zu",
"dataset:mc4",
"arxiv:2010.11934",
"license:apache-2.0",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"text-generation-inference",
"region:us"
] | text2text-generation | "2022-03-02T23:29:05Z" | ---
language:
- multilingual
- af
- am
- ar
- az
- be
- bg
- bn
- ca
- ceb
- co
- cs
- cy
- da
- de
- el
- en
- eo
- es
- et
- eu
- fa
- fi
- fil
- fr
- fy
- ga
- gd
- gl
- gu
- ha
- haw
- hi
- hmn
- ht
- hu
- hy
- ig
- is
- it
- iw
- ja
- jv
- ka
- kk
- km
- kn
- ko
- ku
- ky
- la
- lb
- lo
- lt
- lv
- mg
- mi
- mk
- ml
- mn
- mr
- ms
- mt
- my
- ne
- nl
- no
- ny
- pa
- pl
- ps
- pt
- ro
- ru
- sd
- si
- sk
- sl
- sm
- sn
- so
- sq
- sr
- st
- su
- sv
- sw
- ta
- te
- tg
- th
- tr
- uk
- und
- ur
- uz
- vi
- xh
- yi
- yo
- zh
- zu
datasets:
- mc4
license: apache-2.0
---
[Google's mT5](https://github.com/google-research/multilingual-t5)
mT5 is pretrained on the [mC4](https://www.tensorflow.org/datasets/catalog/c4#c4multilingual) corpus, covering 101 languages:
Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bulgarian, Burmese, Catalan, Cebuano, Chichewa, Chinese, Corsican, Czech, Danish, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Korean, Kurdish, Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Nepali, Norwegian, Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scottish Gaelic, Serbian, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Sotho, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Uzbek, Vietnamese, Welsh, West Frisian, Xhosa, Yiddish, Yoruba, Zulu.
**Note**: mT5 was only pre-trained on mC4 excluding any supervised training. Therefore, this model has to be fine-tuned before it is useable on a downstream task.
Pretraining Dataset: [mC4](https://www.tensorflow.org/datasets/catalog/c4#c4multilingual)
Other Community Checkpoints: [here](https://huggingface.co/models?search=mt5)
Paper: [mT5: A massively multilingual pre-trained text-to-text transformer](https://arxiv.org/abs/2010.11934)
Authors: *Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, Colin Raffel*
## Abstract
The recent "Text-to-Text Transfer Transformer" (T5) leveraged a unified text-to-text format and scale to attain state-of-the-art results on a wide variety of English-language NLP tasks. In this paper, we introduce mT5, a multilingual variant of T5 that was pre-trained on a new Common Crawl-based dataset covering 101 languages. We describe the design and modified training of mT5 and demonstrate its state-of-the-art performance on many multilingual benchmarks. All of the code and model checkpoints used in this work are publicly available. | [
-0.5287659168243408,
-0.17020736634731293,
0.29125913977622986,
0.411001056432724,
-0.2939440906047821,
0.36009055376052856,
-0.38297703862190247,
-0.4471434950828552,
0.17177559435367584,
0.3612290918827057,
-0.7018294930458069,
-0.8553211092948914,
-0.9299465417861938,
0.7416996955871582,
-0.2503918707370758,
1.0841466188430786,
-0.37709149718284607,
0.2013067752122879,
0.233460932970047,
-0.5431137681007385,
-0.42154890298843384,
-0.6196607351303101,
-0.49560022354125977,
-0.1249396800994873,
0.8160201907157898,
0.4453313648700714,
0.3333050012588501,
0.4619409441947937,
0.5839908123016357,
0.26146456599235535,
0.1784922331571579,
0.22893574833869934,
-0.4870876669883728,
-0.3450133502483368,
0.0006749290623702109,
-0.3941822946071625,
-0.41489458084106445,
-0.14310669898986816,
0.5393335819244385,
0.6068596839904785,
-0.13685527443885803,
0.4702296555042267,
-0.10950390249490738,
0.5276477932929993,
-0.49017658829689026,
0.0010665410663932562,
-0.5381154417991638,
0.09321016818284988,
-0.46708229184150696,
-0.006121326237916946,
-0.39827680587768555,
-0.08440545201301575,
-0.10739824920892715,
-0.7024151086807251,
0.1903952956199646,
0.030630508437752724,
1.0908089876174927,
0.23771516978740692,
-0.6577680706977844,
-0.32248014211654663,
-0.448163241147995,
0.9834946990013123,
-0.4281518757343292,
0.9373108744621277,
0.5267671346664429,
0.3711853623390198,
0.17135311663150787,
-1.0179470777511597,
-0.719574511051178,
0.24352215230464935,
-0.033016905188560486,
0.2380836308002472,
-0.05137020722031593,
-0.1915089339017868,
0.1494176834821701,
0.2620703876018524,
-0.6665552854537964,
0.027179181575775146,
-0.7649306058883667,
-0.12463881820440292,
0.3247493505477905,
-0.14510692656040192,
0.48713189363479614,
-0.1410367488861084,
-0.2749324142932892,
-0.054494068026542664,
-0.7521618008613586,
0.11277471482753754,
0.4091085195541382,
0.3508078157901764,
-0.48851823806762695,
0.3054908812046051,
0.1536911278963089,
0.617260217666626,
-0.07916209846735,
-0.4438342750072479,
0.7383081912994385,
-0.4628865122795105,
-0.10182414203882217,
-0.018812289461493492,
1.0781339406967163,
0.21695268154144287,
0.3720126450061798,
-0.5303317904472351,
-0.03675054386258125,
0.028104456141591072,
0.24528531730175018,
-0.9077159762382507,
-0.26190662384033203,
0.337196946144104,
-0.2603209614753723,
0.0781635195016861,
-0.14798690378665924,
-0.44928357005119324,
0.042243700474500656,
-0.22894272208213806,
0.24792592227458954,
-0.6811641454696655,
-0.3962561786174774,
0.07872182130813599,
-0.007933221757411957,
0.07379433512687683,
0.061126697808504105,
-1.2433538436889648,
0.05642888695001602,
0.32577332854270935,
0.8866039514541626,
-0.37863367795944214,
-0.7934433817863464,
-0.3704870343208313,
0.3213329017162323,
-0.2909301519393921,
0.5987313985824585,
-0.5577380061149597,
-0.3396054804325104,
-0.06448886543512344,
0.5372231006622314,
-0.1494760513305664,
-0.30321094393730164,
0.7759956121444702,
-0.48253610730171204,
0.6751986145973206,
-0.4226829707622528,
-0.014642245136201382,
-0.40093794465065,
0.49358734488487244,
-0.8695905804634094,
1.3061367273330688,
0.1075855940580368,
-0.9730050563812256,
0.6218177676200867,
-0.9446143507957458,
-0.6707247495651245,
-0.15319156646728516,
0.05843881517648697,
-0.4698597490787506,
-0.30862656235694885,
0.5947718620300293,
0.43700987100601196,
-0.06394857913255692,
0.3019412159919739,
-0.12600278854370117,
-0.36386391520500183,
-0.21558751165866852,
-0.19274906814098358,
0.7320467829704285,
0.3503572642803192,
-0.46093273162841797,
0.13628186285495758,
-0.9538672566413879,
-0.04966265335679054,
-0.05629965290427208,
-0.5391768217086792,
-0.00539505947381258,
-0.25826430320739746,
0.1851993054151535,
0.5636165142059326,
0.2741197347640991,
-0.668843686580658,
0.0020309784449636936,
-0.2551964521408081,
0.5535432696342468,
0.5767301917076111,
-0.5031907558441162,
0.36773109436035156,
-0.18313507735729218,
0.6604729890823364,
0.503402590751648,
-0.0866805762052536,
-0.43422931432724,
-0.4117165207862854,
-0.7768277525901794,
-0.4961828291416168,
0.6132076382637024,
0.7016400098800659,
-1.3041877746582031,
0.01942051388323307,
-0.7436871528625488,
-0.27334505319595337,
-1.0370312929153442,
0.25037094950675964,
0.36030298471450806,
0.3688487708568573,
0.7425279021263123,
-0.1268485188484192,
-0.8475779294967651,
-0.6615553498268127,
-0.3061140477657318,
0.29886674880981445,
0.043941061943769455,
-0.04599253460764885,
0.5514217019081116,
-0.45294690132141113,
0.6218560934066772,
0.007242871914058924,
-0.4499889612197876,
-0.43327248096466064,
0.05215882882475853,
0.3375226855278015,
0.4223688244819641,
0.7315600514411926,
-0.8157497644424438,
-0.7407147288322449,
0.16866041719913483,
-0.6790167689323425,
0.11069446802139282,
0.24593839049339294,
-0.03597297891974449,
0.5673356056213379,
0.3469583988189697,
-0.3317081034183502,
-0.011137834750115871,
1.201148509979248,
-0.09011775255203247,
0.23519457876682281,
-0.42298728227615356,
0.36899375915527344,
-1.7931002378463745,
0.33070114254951477,
-0.20526567101478577,
-0.359225332736969,
-0.4989354610443115,
-0.05739780515432358,
0.23968711495399475,
-0.1154259443283081,
-0.6969247460365295,
0.6136739253997803,
-0.8283565044403076,
0.032796308398246765,
-0.01425987295806408,
0.07404185086488724,
-0.11625229567289352,
0.602687418460846,
0.0833018496632576,
0.9612457156181335,
0.38035455346107483,
-0.699108362197876,
0.13591046631336212,
0.3032442331314087,
-0.33176565170288086,
0.5019882917404175,
-0.5114981532096863,
0.23450423777103424,
-0.1579664945602417,
0.24953824281692505,
-0.930966854095459,
-0.1544271558523178,
0.0585230328142643,
-0.6611976027488708,
0.20170128345489502,
-0.40039119124412537,
-0.6786841154098511,
-0.45652443170547485,
-0.15560515224933624,
0.41120168566703796,
0.277851939201355,
-0.6900840401649475,
0.5321743488311768,
0.33436986804008484,
-0.03843673691153526,
-0.9914758205413818,
-1.0641822814941406,
0.46611496806144714,
-0.46618011593818665,
-0.6319088339805603,
0.3407834470272064,
-0.16937457025051117,
0.4097568988800049,
-0.3407660722732544,
0.32931575179100037,
-0.23202894628047943,
0.09782688319683075,
0.024084853008389473,
0.14285989105701447,
-0.12604838609695435,
-0.17087191343307495,
0.026469990611076355,
-0.15748755633831024,
-0.24765105545520782,
-0.4371405243873596,
0.7564414739608765,
-0.06430723518133163,
-0.13733607530593872,
-0.37914636731147766,
0.37554001808166504,
0.6542646884918213,
-0.6270845532417297,
0.8409300446510315,
1.2901355028152466,
-0.2119925320148468,
0.1629558950662613,
-0.4792739450931549,
0.07094677537679672,
-0.47434985637664795,
0.4491400420665741,
-0.9592604041099548,
-1.151069164276123,
0.7058587670326233,
-0.13314026594161987,
0.30834850668907166,
0.5176830887794495,
0.6321477293968201,
0.0346347950398922,
1.1055060625076294,
0.8187008500099182,
-0.07179781049489975,
0.41239601373672485,
-0.27425700426101685,
0.25427404046058655,
-0.8040446639060974,
-0.13379395008087158,
-0.5563840866088867,
-0.36101794242858887,
-1.0504859685897827,
-0.3499913513660431,
0.36288413405418396,
-0.22823061048984528,
-0.21674710512161255,
0.620980441570282,
-0.3160799741744995,
0.4560352563858032,
0.4783059060573578,
-0.2283833771944046,
0.3253903090953827,
0.20438429713249207,
-0.6522554159164429,
-0.3612130582332611,
-0.7851532697677612,
-0.5988466143608093,
1.37196946144104,
0.18600989878177643,
0.16767975687980652,
0.5375699996948242,
0.6286550164222717,
-0.14014257490634918,
0.47488704323768616,
-0.4303051233291626,
0.14159666001796722,
-0.45681336522102356,
-0.8769563436508179,
-0.13362360000610352,
-0.48711374402046204,
-1.357116937637329,
0.3321720063686371,
-0.15711148083209991,
-0.6238225102424622,
-0.08815564960241318,
0.011559044942259789,
-0.03912781551480293,
0.3300091028213501,
-0.9517790675163269,
1.1002323627471924,
-0.14256243407726288,
-0.18317310512065887,
0.07317455857992172,
-0.7927442193031311,
0.39723318815231323,
-0.29171323776245117,
0.6317844390869141,
0.03746059536933899,
0.10418853163719177,
0.7392600774765015,
-0.09551015496253967,
0.6568905115127563,
-0.07776723802089691,
-0.12318800389766693,
-0.25159627199172974,
-0.10532240569591522,
0.40380504727363586,
-0.1627073734998703,
0.094655841588974,
0.44436052441596985,
0.2892536222934723,
-0.6929686069488525,
-0.25355279445648193,
0.6008222699165344,
-1.0814783573150635,
-0.1778792291879654,
-0.4498145282268524,
-0.39943423867225647,
-0.30924278497695923,
0.7304308414459229,
0.431020587682724,
0.2955959439277649,
-0.058849070221185684,
0.3279271721839905,
0.4033306837081909,
-0.34143710136413574,
0.7791664004325867,
0.7706696391105652,
-0.3597799241542816,
-0.766698956489563,
0.9662474393844604,
0.23188358545303345,
0.19958281517028809,
0.43633222579956055,
-0.04261572286486626,
-0.4376998543739319,
-0.6298442482948303,
-0.8614603281021118,
0.3502766191959381,
-0.6007193922996521,
0.05864763259887695,
-0.919839084148407,
0.2155265063047409,
-0.6349590420722961,
-0.09910214692354202,
-0.41111505031585693,
-0.21660135686397552,
-0.1335645616054535,
-0.2630540728569031,
0.01441748533397913,
0.6115430593490601,
0.13842764496803284,
0.46571090817451477,
-0.9893643856048584,
0.46233367919921875,
-0.11932939291000366,
0.458600252866745,
-0.4163858890533447,
-0.5680332779884338,
-0.49585041403770447,
0.21119649708271027,
-0.3719986379146576,
-0.4644934833049774,
0.7027912735939026,
0.19659066200256348,
0.5432195067405701,
0.30147284269332886,
-0.17544160783290863,
0.7952086329460144,
-0.8344060778617859,
0.9091435670852661,
0.4162577688694,
-0.9274218678474426,
0.1868680864572525,
-0.5123159885406494,
0.5250188708305359,
0.6977477073669434,
0.9372514486312866,
-0.8755215406417847,
-0.2561313211917877,
-0.6237018704414368,
-0.8375683426856995,
0.82485431432724,
0.11265309900045395,
0.18973413109779358,
0.00018765052664093673,
-0.12572409212589264,
0.29442092776298523,
0.46483129262924194,
-1.0616823434829712,
-0.27443817257881165,
-0.5293055772781372,
-0.505473256111145,
-0.4548480808734894,
-0.1046137586236,
-0.05650261417031288,
-0.28054311871528625,
0.5703848600387573,
-0.31117457151412964,
0.24573327600955963,
0.03838396072387695,
-0.45084095001220703,
0.24666832387447357,
0.17924349009990692,
0.9861765503883362,
0.8622106909751892,
-0.1602829545736313,
0.2880496680736542,
0.44466063380241394,
-0.8782057166099548,
0.14755971729755402,
-0.007578167598694563,
0.17733994126319885,
0.12396609038114548,
0.4099837839603424,
1.0205258131027222,
0.11638376116752625,
-0.4331338703632355,
0.4043425917625427,
-0.26727980375289917,
-0.36383339762687683,
-0.35138139128685,
-0.36726275086402893,
0.34009888768196106,
-0.14341294765472412,
0.28885483741760254,
-0.030717061832547188,
-0.07858560234308243,
-0.6260740160942078,
-0.009769432246685028,
0.02309575490653515,
-0.4774013161659241,
-0.6337123513221741,
0.7922592163085938,
0.35876980423927307,
-0.10694814473390579,
0.5711290240287781,
-0.0842171460390091,
-0.7176315188407898,
0.22684334218502045,
0.6391227841377258,
0.6801597476005554,
-0.45517611503601074,
0.00793757475912571,
0.5777884721755981,
0.5627527236938477,
0.021393105387687683,
0.5436402559280396,
0.04880637675523758,
-0.8405326008796692,
-0.674691379070282,
-0.6822894811630249,
-0.29730224609375,
-0.06407823413610458,
-0.3042038083076477,
0.5192024111747742,
-0.19690565764904022,
-0.14777997136116028,
0.05359819158911705,
0.05831018462777138,
-0.8615012168884277,
0.4932311177253723,
0.05733971670269966,
0.6303519606590271,
-0.6045839786529541,
1.233332633972168,
1.0422524213790894,
-0.3756653070449829,
-0.8894405961036682,
-0.31064215302467346,
-0.3095158040523529,
-0.902118444442749,
0.8121190667152405,
0.3223210275173187,
-0.1644868403673172,
0.3351759612560272,
-0.19636373221874237,
-0.9433985352516174,
1.2483566999435425,
0.6632682085037231,
-0.23297348618507385,
0.013228795491158962,
0.5801844596862793,
0.47728994488716125,
-0.22455942630767822,
0.5424948334693909,
0.36656343936920166,
0.6203643083572388,
0.18886607885360718,
-1.3154655694961548,
-0.19903184473514557,
-0.5416865348815918,
-0.15333420038223267,
0.28453129529953003,
-0.7407222390174866,
0.8317265510559082,
-0.10828938335180283,
-0.14328458905220032,
-0.3416690230369568,
0.7080010175704956,
0.2380385398864746,
0.11631142348051071,
0.3939049243927002,
0.8186377286911011,
0.8854539394378662,
-0.2680427134037018,
1.2117173671722412,
-0.6718098521232605,
0.3022853434085846,
0.8178414106369019,
0.01104947179555893,
0.818304717540741,
0.515703558921814,
-0.20489366352558136,
0.49942660331726074,
0.8636016249656677,
0.2159908264875412,
0.48946666717529297,
-0.1670786291360855,
-0.18714933097362518,
0.034118764102458954,
0.04852790758013725,
-0.33394500613212585,
0.4439990520477295,
0.1765223890542984,
-0.2728848457336426,
-0.0031714767683297396,
0.2525383532047272,
0.5351459383964539,
-0.399167001247406,
-0.10198657214641571,
0.6213628053665161,
0.1193554624915123,
-0.8544584512710571,
0.9874345064163208,
0.3968648612499237,
0.9662649631500244,
-0.7656703591346741,
0.3745875954627991,
-0.2681361734867096,
0.2484251707792282,
-0.2905694246292114,
-0.6541614532470703,
0.32984626293182373,
0.11575943231582642,
-0.21538294851779938,
-0.5997592210769653,
0.2916458547115326,
-0.7382734417915344,
-0.5240622758865356,
0.3179537355899811,
0.3680780529975891,
0.1998799592256546,
0.024756621569395065,
-0.6064215302467346,
-0.035204362124204636,
0.14907579123973846,
-0.08204180747270584,
0.33621567487716675,
0.6291259527206421,
-0.11498280614614487,
0.7489094138145447,
0.841687798500061,
0.008987843059003353,
0.3649600148200989,
0.1409621685743332,
0.6745909452438354,
-0.7002363801002502,
-0.7039597630500793,
-0.7050954103469849,
0.6209516525268555,
0.2151772528886795,
-0.5685336589813232,
0.8781348466873169,
0.7451289296150208,
1.0908070802688599,
-0.1922798454761505,
0.9017711281776428,
0.19259300827980042,
0.7394611239433289,
-0.5474283695220947,
0.7572113871574402,
-0.6845682859420776,
-0.21166741847991943,
-0.2808333933353424,
-0.903901219367981,
-0.39878877997398376,
0.4294191002845764,
-0.2828361690044403,
0.19922567903995514,
1.1276311874389648,
0.4926869571208954,
-0.35459235310554504,
-0.2877543270587921,
0.485175758600235,
0.1299462765455246,
0.4405063986778259,
0.6024217009544373,
0.4567566514015198,
-0.6544706225395203,
0.8316437602043152,
-0.1433122605085373,
0.23053857684135437,
0.15577249228954315,
-0.8950599431991577,
-1.0837681293487549,
-0.7682431936264038,
-0.0521000437438488,
-0.1899171620607376,
0.011117689311504364,
0.8159913420677185,
0.7809998989105225,
-0.8205469846725464,
-0.36233505606651306,
0.1356893926858902,
-0.10675473511219025,
0.17011408507823944,
-0.1006232276558876,
0.33687180280685425,
-0.45265868306159973,
-1.090272068977356,
0.3384522497653961,
0.07182008028030396,
0.11058253049850464,
-0.16134589910507202,
-0.09910276532173157,
-0.4186778664588928,
-0.25391337275505066,
0.6964258551597595,
0.053171101957559586,
-0.4209804832935333,
-0.07002682238817215,
0.1497775763273239,
-0.17367088794708252,
0.3485918939113617,
0.44819700717926025,
-0.5089111924171448,
0.3399408161640167,
0.27448874711990356,
0.7908571362495422,
0.7610477209091187,
-0.23969148099422455,
0.6703029870986938,
-0.8493480682373047,
0.31890153884887695,
-0.07160995155572891,
0.3767238259315491,
0.6275140643119812,
0.02499430999159813,
0.5326479077339172,
0.4028984010219574,
-0.3918558657169342,
-0.7621126770973206,
-0.03662792965769768,
-0.9603796005249023,
-0.013652957044541836,
1.1882683038711548,
-0.3071388006210327,
-0.27989861369132996,
-0.19385460019111633,
-0.15969614684581757,
0.3171995282173157,
-0.2513239085674286,
0.6288974285125732,
1.0635126829147339,
0.40678876638412476,
-0.509302020072937,
-0.8429936766624451,
0.5306645631790161,
0.4696614146232605,
-0.94880610704422,
-0.4624483287334442,
0.052200425416231155,
0.517101526260376,
0.11662833392620087,
0.6500497460365295,
-0.05660310015082359,
0.054811056703329086,
-0.30575478076934814,
0.49592992663383484,
-0.12962570786476135,
-0.3381270170211792,
-0.05017726123332977,
0.12090030312538147,
-0.1793854832649231,
-0.3405901789665222
] |
neuralmind/bert-base-portuguese-cased | neuralmind | "2022-06-14T14:37:09Z" | 997,572 | 102 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"bert",
"fill-mask",
"pt",
"dataset:brWaC",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | fill-mask | "2022-03-02T23:29:05Z" | ---
language: pt
license: mit
tags:
- bert
- pytorch
datasets:
- brWaC
---
# BERTimbau Base (aka "bert-base-portuguese-cased")
![Bert holding a berimbau](https://imgur.com/JZ7Hynh.jpg)
## Introduction
BERTimbau Base is a pretrained BERT model for Brazilian Portuguese that achieves state-of-the-art performances on three downstream NLP tasks: Named Entity Recognition, Sentence Textual Similarity and Recognizing Textual Entailment. It is available in two sizes: Base and Large.
For further information or requests, please go to [BERTimbau repository](https://github.com/neuralmind-ai/portuguese-bert/).
## Available models
| Model | Arch. | #Layers | #Params |
| ---------------------------------------- | ---------- | ------- | ------- |
| `neuralmind/bert-base-portuguese-cased` | BERT-Base | 12 | 110M |
| `neuralmind/bert-large-portuguese-cased` | BERT-Large | 24 | 335M |
## Usage
```python
from transformers import AutoTokenizer # Or BertTokenizer
from transformers import AutoModelForPreTraining # Or BertForPreTraining for loading pretraining heads
from transformers import AutoModel # or BertModel, for BERT without pretraining heads
model = AutoModelForPreTraining.from_pretrained('neuralmind/bert-base-portuguese-cased')
tokenizer = AutoTokenizer.from_pretrained('neuralmind/bert-base-portuguese-cased', do_lower_case=False)
```
### Masked language modeling prediction example
```python
from transformers import pipeline
pipe = pipeline('fill-mask', model=model, tokenizer=tokenizer)
pipe('Tinha uma [MASK] no meio do caminho.')
# [{'score': 0.14287759363651276,
# 'sequence': '[CLS] Tinha uma pedra no meio do caminho. [SEP]',
# 'token': 5028,
# 'token_str': 'pedra'},
# {'score': 0.06213393807411194,
# 'sequence': '[CLS] Tinha uma árvore no meio do caminho. [SEP]',
# 'token': 7411,
# 'token_str': 'árvore'},
# {'score': 0.05515013635158539,
# 'sequence': '[CLS] Tinha uma estrada no meio do caminho. [SEP]',
# 'token': 5675,
# 'token_str': 'estrada'},
# {'score': 0.0299188531935215,
# 'sequence': '[CLS] Tinha uma casa no meio do caminho. [SEP]',
# 'token': 1105,
# 'token_str': 'casa'},
# {'score': 0.025660505518317223,
# 'sequence': '[CLS] Tinha uma cruz no meio do caminho. [SEP]',
# 'token': 3466,
# 'token_str': 'cruz'}]
```
### For BERT embeddings
```python
import torch
model = AutoModel.from_pretrained('neuralmind/bert-base-portuguese-cased')
input_ids = tokenizer.encode('Tinha uma pedra no meio do caminho.', return_tensors='pt')
with torch.no_grad():
outs = model(input_ids)
encoded = outs[0][0, 1:-1] # Ignore [CLS] and [SEP] special tokens
# encoded.shape: (8, 768)
# tensor([[-0.0398, -0.3057, 0.2431, ..., -0.5420, 0.1857, -0.5775],
# [-0.2926, -0.1957, 0.7020, ..., -0.2843, 0.0530, -0.4304],
# [ 0.2463, -0.1467, 0.5496, ..., 0.3781, -0.2325, -0.5469],
# ...,
# [ 0.0662, 0.7817, 0.3486, ..., -0.4131, -0.2852, -0.2819],
# [ 0.0662, 0.2845, 0.1871, ..., -0.2542, -0.2933, -0.0661],
# [ 0.2761, -0.1657, 0.3288, ..., -0.2102, 0.0029, -0.2009]])
```
## Citation
If you use our work, please cite:
```bibtex
@inproceedings{souza2020bertimbau,
author = {F{\'a}bio Souza and
Rodrigo Nogueira and
Roberto Lotufo},
title = {{BERT}imbau: pretrained {BERT} models for {B}razilian {P}ortuguese},
booktitle = {9th Brazilian Conference on Intelligent Systems, {BRACIS}, Rio Grande do Sul, Brazil, October 20-23 (to appear)},
year = {2020}
}
```
| [
-0.18304821848869324,
-0.4717995524406433,
0.10968445241451263,
0.5005441308021545,
-0.513286828994751,
-0.008465152233839035,
-0.16737939417362213,
0.012110767886042595,
0.5818616151809692,
0.3750711977481842,
-0.4980522394180298,
-0.6814043521881104,
-0.7359874844551086,
-0.054128505289554596,
-0.357075572013855,
1.1581233739852905,
0.19002211093902588,
0.42248648405075073,
0.2820739448070526,
0.05625810846686363,
-0.34336861968040466,
-0.6217754483222961,
-0.9053794145584106,
-0.37091803550720215,
0.5451169610023499,
0.2041357159614563,
0.44183921813964844,
0.39552363753318787,
0.3891107738018036,
0.4077005684375763,
-0.09117460995912552,
-0.10869219899177551,
-0.47492170333862305,
-0.013679972849786282,
0.10854143649339676,
-0.6694868803024292,
-0.698367178440094,
-0.2105202078819275,
0.6602936387062073,
0.6330110430717468,
0.04971746355295181,
0.2411780059337616,
-0.0962960496544838,
0.48708027601242065,
-0.2133808135986328,
0.4999658763408661,
-0.5694097280502319,
0.07738468050956726,
-0.12960229814052582,
-0.11966751515865326,
-0.3051025867462158,
-0.43053963780403137,
0.21419233083724976,
-0.593635082244873,
0.23870055377483368,
-0.020430928096175194,
1.2667028903961182,
0.23819349706172943,
-0.10814119875431061,
-0.06732458621263504,
-0.3478924632072449,
0.8719760775566101,
-0.8018901944160461,
0.15597309172153473,
0.48047110438346863,
0.22399605810642242,
-0.2912723124027252,
-0.7400251030921936,
-0.3949654996395111,
0.08930166065692902,
0.05944616720080376,
0.09423477947711945,
-0.1729206144809723,
-0.16096824407577515,
0.3516724407672882,
0.1885460615158081,
-0.5000337958335876,
-0.023542456328868866,
-0.7005031704902649,
-0.3240361511707306,
0.6275324821472168,
0.01900930143892765,
0.2449193298816681,
-0.26994413137435913,
-0.33157673478126526,
-0.40333685278892517,
-0.5762581825256348,
0.06786056607961655,
0.5995058417320251,
0.4142322540283203,
-0.3404903709888458,
0.6563849449157715,
-0.2129640132188797,
0.6534640192985535,
0.03306809440255165,
0.11684291809797287,
0.7194051742553711,
0.06567804515361786,
-0.5347855091094971,
0.021810008212924004,
1.0103696584701538,
0.1808345466852188,
0.4464495778083801,
-0.04189055413007736,
-0.09468939155340195,
-0.06654522567987442,
0.03934195265173912,
-0.6682407855987549,
-0.4318141043186188,
0.25054383277893066,
-0.5455935001373291,
-0.4125210642814636,
0.42505747079849243,
-0.7350886464118958,
-0.0871475338935852,
0.007680568378418684,
0.7502036094665527,
-0.6737461686134338,
-0.21256954967975616,
0.23814137279987335,
-0.4167826771736145,
0.5405594110488892,
0.08878007531166077,
-0.9312734603881836,
0.17175418138504028,
0.41747933626174927,
0.7975383400917053,
0.4068984091281891,
-0.1807410567998886,
-0.11631377041339874,
-0.07615979015827179,
-0.202460378408432,
0.6216407418251038,
-0.1186055913567543,
-0.581935703754425,
-0.09183739125728607,
0.2523041367530823,
-0.14973415434360504,
-0.21457470953464508,
0.6910656690597534,
-0.37572401762008667,
0.34995797276496887,
-0.17133891582489014,
-0.27839821577072144,
-0.49618011713027954,
0.25713008642196655,
-0.5802305936813354,
1.1264865398406982,
0.2846887707710266,
-0.6910338401794434,
0.4062582552433014,
-0.9186200499534607,
-0.4219939708709717,
0.09667441248893738,
-0.06038135290145874,
-0.46051985025405884,
-0.015502122230827808,
0.3426276743412018,
0.5131723880767822,
-0.20033331215381622,
0.2663426101207733,
-0.403467059135437,
-0.2916695475578308,
0.28652381896972656,
-0.37159040570259094,
1.3690147399902344,
0.23312924802303314,
-0.2966596484184265,
0.22800394892692566,
-0.845262885093689,
0.13586381077766418,
0.2824162542819977,
-0.26325905323028564,
0.02193625643849373,
-0.18687230348587036,
0.19978290796279907,
0.06740452349185944,
0.5325824618339539,
-0.7131198048591614,
0.4264031946659088,
-0.42787814140319824,
0.7251313924789429,
0.8478223085403442,
-0.08565487712621689,
0.10784516483545303,
-0.3890763223171234,
0.41790249943733215,
0.12613283097743988,
0.00842647347599268,
0.12670302391052246,
-0.6935684680938721,
-0.8513041734695435,
-0.595719575881958,
0.5994468927383423,
0.6258926391601562,
-0.5788185596466064,
0.9801834225654602,
-0.2927738130092621,
-0.8275499939918518,
-0.5467910766601562,
-0.2504606544971466,
0.20235233008861542,
0.451401025056839,
0.3270421624183655,
-0.42094025015830994,
-0.9309897422790527,
-0.7662349939346313,
-0.0324464775621891,
-0.16248804330825806,
-0.18408744037151337,
0.27568596601486206,
0.7946543097496033,
-0.3313842713832855,
0.8086104989051819,
-0.5642662048339844,
-0.4502444565296173,
-0.05957205221056938,
0.2413441389799118,
0.8260568380355835,
0.9036661982536316,
0.7880972027778625,
-0.5608503222465515,
-0.5673003196716309,
-0.3072274923324585,
-0.9117579460144043,
0.045064862817525864,
0.1871355026960373,
-0.23710335791110992,
0.14192919433116913,
0.17731143534183502,
-0.6521243453025818,
0.6230942010879517,
0.19688451290130615,
-0.6556723713874817,
0.4041779041290283,
-0.5056508779525757,
0.12510895729064941,
-1.0835778713226318,
0.23193636536598206,
-0.20008082687854767,
-0.18829715251922607,
-0.4751286804676056,
-0.22117599844932556,
-0.09300915896892548,
-0.0009779839310795069,
-0.5978734493255615,
0.5496534109115601,
-0.42649614810943604,
-0.019893018528819084,
0.16244666278362274,
-0.37657952308654785,
-0.17439651489257812,
0.6814061403274536,
0.08989482372999191,
0.41954419016838074,
1.0196746587753296,
-0.425748348236084,
0.5828425884246826,
0.5807286500930786,
-0.43720752000808716,
0.355769544839859,
-0.9949660897254944,
0.05709303915500641,
-0.06343645602464676,
0.20809023082256317,
-1.0870733261108398,
-0.3036890923976898,
0.40139660239219666,
-0.7688047289848328,
0.17316459119319916,
-0.3587026596069336,
-0.6771548390388489,
-0.5069055557250977,
-0.3797752261161804,
0.5673804879188538,
0.6602997183799744,
-0.3887525498867035,
0.46454527974128723,
0.31491750478744507,
-0.06976833939552307,
-0.8043298125267029,
-0.8643950819969177,
-0.1323021799325943,
-0.2856939733028412,
-0.5843667984008789,
0.36738625168800354,
-0.02909429371356964,
0.10818082094192505,
-0.07676371186971664,
0.07918837666511536,
-0.24785202741622925,
-0.04824969917535782,
0.3486481010913849,
0.43150755763053894,
-0.288110613822937,
-0.14460058510303497,
-0.07212977856397629,
-0.09869060665369034,
0.2232610285282135,
-0.24220089614391327,
1.0978152751922607,
-0.23618242144584656,
-0.028723983094096184,
-0.36462461948394775,
0.18089859187602997,
0.6370859146118164,
-0.06076740473508835,
0.7418648600578308,
0.8436127305030823,
-0.7057039737701416,
0.002284410409629345,
-0.2836763262748718,
-0.10637146234512329,
-0.49385592341423035,
0.37280556559562683,
-0.5633432269096375,
-0.47650766372680664,
0.9367732405662537,
0.3759474456310272,
-0.14494957029819489,
0.8471218943595886,
0.8360812664031982,
-0.25580283999443054,
0.9795847535133362,
0.4026099145412445,
-0.16701602935791016,
0.6441248655319214,
-0.751530647277832,
0.1766950637102127,
-0.8522607088088989,
-0.6240477561950684,
-0.4185166656970978,
-0.4249962568283081,
-0.4055250883102417,
-0.2336343377828598,
0.2236124724149704,
0.07200399786233902,
-0.6345183253288269,
0.6861838102340698,
-0.5989116430282593,
0.31571200489997864,
0.9725284576416016,
0.5603693723678589,
-0.3001430034637451,
-0.1525135636329651,
-0.25882768630981445,
0.033959850668907166,
-0.708729088306427,
-0.3130132555961609,
1.5301121473312378,
0.3876107335090637,
0.7533055543899536,
0.16830474138259888,
0.7789112329483032,
0.3159039616584778,
0.08085320889949799,
-0.6603598594665527,
0.5308604836463928,
-0.11507532745599747,
-0.992286741733551,
-0.40874582529067993,
-0.19496935606002808,
-1.3027828931808472,
0.2723618447780609,
-0.35393744707107544,
-0.9065343737602234,
0.19536587595939636,
-0.1430680900812149,
-0.6445373296737671,
0.2881729006767273,
-0.6882280707359314,
1.058007836341858,
-0.4200930893421173,
-0.16578710079193115,
0.026083683595061302,
-0.7788299918174744,
0.05890846252441406,
0.1720159500837326,
-0.0986972525715828,
-0.1636335253715515,
0.19699423015117645,
1.1052531003952026,
-0.5039934515953064,
0.9657960534095764,
-0.2836994230747223,
0.19993096590042114,
0.2578432261943817,
-0.1300850659608841,
0.17654931545257568,
0.2540978789329529,
-0.0391557514667511,
0.26967892050743103,
0.12895698845386505,
-0.7578514218330383,
-0.12433701008558273,
0.6581640243530273,
-1.0561925172805786,
-0.2692468464374542,
-0.8088871240615845,
-0.5816255211830139,
0.11815520375967026,
0.5491628646850586,
0.7061023116111755,
0.5930253863334656,
-0.14463366568088531,
0.365596204996109,
0.6020773649215698,
-0.19216789305210114,
0.7657371163368225,
0.2754761278629303,
-0.09115494042634964,
-0.5586231350898743,
0.80563884973526,
0.2547970116138458,
-0.34531643986701965,
0.30184510350227356,
0.07903555780649185,
-0.59953373670578,
-0.4968219995498657,
-0.2593669593334198,
0.38074126839637756,
-0.5188477039337158,
-0.43591031432151794,
-0.49599015712738037,
-0.36816829442977905,
-0.7542217969894409,
-0.03421631455421448,
-0.2726958692073822,
-0.45897212624549866,
-0.6676813960075378,
-0.15814217925071716,
0.45308786630630493,
0.4997897446155548,
-0.32622164487838745,
0.5570406913757324,
-0.6823486089706421,
0.23322613537311554,
0.16718365252017975,
0.4626653790473938,
-0.27813225984573364,
-0.838371753692627,
-0.0719170868396759,
-0.03208891674876213,
-0.1494557410478592,
-1.0572830438613892,
0.920063853263855,
0.10331588983535767,
0.7061774134635925,
0.5010514855384827,
-0.05173265188932419,
0.5969484448432922,
-0.36186715960502625,
0.628313422203064,
0.1492759734392166,
-0.9673852324485779,
0.6836260557174683,
-0.5382047295570374,
0.013143890537321568,
0.4586600661277771,
0.4556138515472412,
-0.159531831741333,
-0.05787013843655586,
-1.2149624824523926,
-1.0494351387023926,
0.8204197883605957,
0.26778313517570496,
0.03065812587738037,
0.043589066714048386,
0.03412047401070595,
0.10357309132814407,
0.43151751160621643,
-1.1088429689407349,
-0.5314942598342896,
-0.41826218366622925,
-0.46292737126350403,
0.07618271559476852,
-0.14151152968406677,
-0.23419584333896637,
-0.6234058737754822,
0.8909897804260254,
0.14093966782093048,
0.7677541375160217,
0.1364753395318985,
-0.19552873075008392,
0.16827136278152466,
-0.21492856740951538,
0.7279554605484009,
0.4672655761241913,
-0.7167847156524658,
-0.1682663857936859,
0.057744402438402176,
-0.43324604630470276,
-0.0260508731007576,
0.21256890892982483,
-0.05275721102952957,
0.2037903070449829,
0.3318362236022949,
0.7796518802642822,
0.23785120248794556,
-0.4024350941181183,
0.4562191367149353,
0.13201899826526642,
-0.3595890700817108,
-0.8054903745651245,
0.05325573310256004,
-0.14123308658599854,
0.22624938189983368,
0.48270735144615173,
0.3111450970172882,
-0.01326922606676817,
-0.4696457087993622,
0.24886488914489746,
0.42401018738746643,
-0.518925130367279,
-0.2926560342311859,
0.7061221599578857,
0.1484306901693344,
-0.5190789103507996,
0.7157042622566223,
-0.04812958836555481,
-0.6663300395011902,
0.9814803600311279,
0.4759105145931244,
0.9428683519363403,
0.04201606288552284,
0.15005429089069366,
0.5967345833778381,
0.2811388373374939,
-0.10690800845623016,
0.7467964887619019,
0.18610887229442596,
-0.9479418396949768,
-0.110539011657238,
-0.5345025658607483,
-0.07829256355762482,
0.16670747101306915,
-0.7934819459915161,
0.4724252223968506,
-0.7049022316932678,
-0.3677125573158264,
0.005770809017121792,
0.05742179974913597,
-0.8206153512001038,
0.42954301834106445,
0.23691408336162567,
0.9663574695587158,
-1.0300251245498657,
1.196114420890808,
0.7500388622283936,
-0.6937112212181091,
-0.6737269759178162,
-0.5510973930358887,
-0.34592723846435547,
-1.2802314758300781,
0.711963951587677,
0.1673523485660553,
0.2766284644603729,
0.19989705085754395,
-0.7462908029556274,
-1.003296136856079,
1.0920469760894775,
0.32951298356056213,
-0.19354331493377686,
-0.0884028971195221,
-0.16224640607833862,
0.5447303652763367,
-0.23668992519378662,
0.6102152466773987,
0.5341807007789612,
0.5304355025291443,
-0.0354745052754879,
-0.6461543440818787,
-0.12464774399995804,
-0.3747819662094116,
-0.169794499874115,
0.14736643433570862,
-0.8098915219306946,
1.134395956993103,
-0.09699900448322296,
0.10166741907596588,
0.14549458026885986,
0.7662313580513,
0.15794365108013153,
-0.16804513335227966,
0.38318753242492676,
0.7860661149024963,
0.6682520508766174,
-0.5713409185409546,
0.6003501415252686,
-0.2583843767642975,
0.7604560256004333,
0.7060755491256714,
0.17507456243038177,
0.8082541227340698,
0.6231590509414673,
-0.3607330322265625,
0.8888579607009888,
0.8550986647605896,
-0.45496055483818054,
0.758164644241333,
0.2538861632347107,
-0.012984885834157467,
-0.06929328292608261,
0.2677709460258484,
-0.5616054534912109,
0.5922985076904297,
0.4996982514858246,
-0.4880428910255432,
-0.1768028438091278,
-0.16974100470542908,
0.18438678979873657,
-0.14070484042167664,
-0.43410250544548035,
0.4737800061702728,
-0.010444178245961666,
-0.6060231328010559,
0.5811583995819092,
0.12285848706960678,
0.9275229573249817,
-0.7198991179466248,
0.09409753233194351,
-0.0685870349407196,
0.2934333384037018,
-0.09706665575504303,
-0.8662203550338745,
0.12785008549690247,
-0.08162640780210495,
-0.1795777529478073,
-0.23401771485805511,
0.5918628573417664,
-0.36868202686309814,
-0.7171362042427063,
0.20407715439796448,
0.2758890986442566,
0.3538017272949219,
-0.05037179961800575,
-0.939889132976532,
-0.1769656538963318,
0.101102314889431,
-0.32348310947418213,
0.09898863732814789,
0.39515021443367004,
0.24568983912467957,
0.6341269612312317,
0.7804872393608093,
0.11819920688867569,
0.3583161532878876,
-0.22895117104053497,
0.7248647809028625,
-0.9344944953918457,
-0.6732024550437927,
-0.9831979274749756,
0.5310512185096741,
-0.09508359432220459,
-0.8545441627502441,
0.5148192644119263,
0.7513440847396851,
0.7017157077789307,
-0.45599326491355896,
0.6942089796066284,
-0.4949028789997101,
0.3617497384548187,
-0.32829827070236206,
0.9644941687583923,
-0.2867352366447449,
-0.11918307840824127,
-0.11224815994501114,
-0.8816392421722412,
-0.42350608110427856,
1.0466318130493164,
-0.23758481442928314,
0.04070470482110977,
0.5466862916946411,
0.6200880408287048,
0.1392926573753357,
-0.26304352283477783,
0.20974531769752502,
0.3195808231830597,
0.2184077948331833,
0.8768591284751892,
0.4157507121562958,
-0.7936532497406006,
0.40245237946510315,
-0.34493324160575867,
-0.20250003039836884,
-0.3974684476852417,
-0.9828495383262634,
-1.0122431516647339,
-0.4370195269584656,
-0.26959899067878723,
-0.6099845767021179,
-0.17846785485744476,
1.0665990114212036,
0.7248888611793518,
-1.169359564781189,
-0.42318347096443176,
-0.11537311226129532,
0.09623372554779053,
-0.1648729294538498,
-0.23793303966522217,
0.5985175967216492,
-0.18403683602809906,
-1.0499231815338135,
0.14065857231616974,
-0.10049591213464737,
0.2996933162212372,
-0.06659954786300659,
0.03912818431854248,
-0.5388035178184509,
-0.05781393125653267,
0.3051980435848236,
0.5315601825714111,
-0.6829596161842346,
-0.37464943528175354,
-0.026691121980547905,
-0.2231488972902298,
0.2174072265625,
0.24921433627605438,
-0.8028339743614197,
0.30156460404396057,
0.7252368927001953,
0.38337674736976624,
0.7133792042732239,
-0.19067679345607758,
0.6550810933113098,
-0.8427262902259827,
0.6019473671913147,
0.3855317234992981,
0.7735854983329773,
0.238798126578331,
-0.16305704414844513,
0.7260250449180603,
0.4878939092159271,
-0.41336163878440857,
-0.9473515152931213,
-0.2418973296880722,
-1.4224673509597778,
-0.042397163808345795,
0.9024600982666016,
-0.21940752863883972,
-0.54526287317276,
0.12421324849128723,
-0.43602585792541504,
0.5384995341300964,
-0.48242807388305664,
0.7359278202056885,
0.7747266888618469,
-0.049486104398965836,
0.11556306481361389,
-0.19998371601104736,
0.34769317507743835,
0.6720029711723328,
-0.5215134024620056,
-0.5723446011543274,
-0.02036973647773266,
0.40043872594833374,
0.17598536610603333,
0.5597168207168579,
-0.2573098838329315,
0.24163538217544556,
0.290873259305954,
0.3278829753398895,
-0.04970359802246094,
-0.22192412614822388,
-0.33711573481559753,
0.011134997941553593,
-0.15546339750289917,
-0.8686502575874329
] |
facebook/bart-base | facebook | "2022-11-16T23:23:10Z" | 992,862 | 113 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"bart",
"feature-extraction",
"en",
"arxiv:1910.13461",
"license:apache-2.0",
"endpoints_compatible",
"has_space",
"region:us"
] | feature-extraction | "2022-03-02T23:29:05Z" | ---
license: apache-2.0
language: en
---
# BART (base-sized model)
BART model pre-trained on English language. It was introduced in the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Lewis et al. and first released in [this repository](https://github.com/pytorch/fairseq/tree/master/examples/bart).
Disclaimer: The team releasing BART did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
BART is a transformer encoder-decoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text.
BART is particularly effective when fine-tuned for text generation (e.g. summarization, translation) but also works well for comprehension tasks (e.g. text classification, question answering).
## Intended uses & limitations
You can use the raw model for text infilling. However, the model is mostly meant to be fine-tuned on a supervised dataset. See the [model hub](https://huggingface.co/models?search=bart) to look for fine-tuned versions on a task that interests you.
### How to use
Here is how to use this model in PyTorch:
```python
from transformers import BartTokenizer, BartModel
tokenizer = BartTokenizer.from_pretrained('facebook/bart-base')
model = BartModel.from_pretrained('facebook/bart-base')
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state
```
### BibTeX entry and citation info
```bibtex
@article{DBLP:journals/corr/abs-1910-13461,
author = {Mike Lewis and
Yinhan Liu and
Naman Goyal and
Marjan Ghazvininejad and
Abdelrahman Mohamed and
Omer Levy and
Veselin Stoyanov and
Luke Zettlemoyer},
title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
Generation, Translation, and Comprehension},
journal = {CoRR},
volume = {abs/1910.13461},
year = {2019},
url = {http://arxiv.org/abs/1910.13461},
eprinttype = {arXiv},
eprint = {1910.13461},
timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
``` | [
-0.5895666480064392,
-1.041480541229248,
0.16506583988666534,
0.2032175362110138,
-0.3447984755039215,
-0.006318152416497469,
-0.23662404716014862,
-0.3935691714286804,
0.3891613483428955,
0.42154982686042786,
-0.5027112364768982,
-0.3990526497364044,
-0.49174830317497253,
0.3377784490585327,
-0.2905976474285126,
1.3396968841552734,
0.07398276776075363,
-0.1388225108385086,
-0.24680645763874054,
-0.009319663979113102,
-0.35177162289619446,
-0.7493004202842712,
-0.7204391360282898,
-0.30683621764183044,
0.3722483217716217,
0.06462621688842773,
0.5511412024497986,
0.17178595066070557,
0.5577449202537537,
0.3407159745693207,
-0.33747345209121704,
-0.06278660893440247,
-0.5618502497673035,
0.03016217239201069,
-0.03050021268427372,
-0.3859231770038605,
-0.8126305937767029,
0.008081135340034962,
0.8386332988739014,
0.8944434523582458,
-0.03060196526348591,
0.31959810853004456,
-0.03224880248308182,
0.7155047655105591,
-0.40949007868766785,
0.1272682249546051,
-0.4065530002117157,
-0.23359599709510803,
-0.16058959066867828,
0.03425579145550728,
-0.48334768414497375,
-0.3860761523246765,
0.0724770575761795,
-0.5894033908843994,
0.43043336272239685,
0.12956565618515015,
1.3200851678848267,
0.1430772840976715,
-0.28787314891815186,
-0.0321524478495121,
-0.4855099618434906,
0.6443921327590942,
-0.9066966772079468,
0.3715550899505615,
0.3418952524662018,
0.030276332050561905,
-0.17578613758087158,
-1.0552953481674194,
-0.6985270977020264,
-0.0570223368704319,
-0.3983473479747772,
0.14351502060890198,
-0.49648693203926086,
0.3013816773891449,
0.5564489364624023,
0.5398221015930176,
-0.8475648164749146,
-0.3763671815395355,
-0.5613178610801697,
-0.11883098632097244,
0.6105790138244629,
-0.019253738224506378,
0.08767946809530258,
-0.3429403305053711,
-0.3209780156612396,
-0.339577317237854,
-0.4275003671646118,
0.22757135331630707,
0.3172394037246704,
0.2338806539773941,
-0.3036506474018097,
0.46427443623542786,
-0.22638246417045593,
0.7018366456031799,
0.2747317850589752,
-0.007548883557319641,
0.6925327777862549,
-0.3397277295589447,
-0.3375099301338196,
-0.1352561116218567,
1.0306458473205566,
0.16572366654872894,
0.322707861661911,
0.09002657234668732,
-0.27271705865859985,
-0.01629677787423134,
0.26231908798217773,
-1.0175929069519043,
-0.2653771936893463,
-0.045616429299116135,
-0.5251270532608032,
-0.3348093032836914,
0.1830376833677292,
-0.43625083565711975,
0.15172883868217468,
-0.1593376249074936,
0.5066657066345215,
-0.3832986056804657,
-0.3374083936214447,
0.08791974186897278,
-0.039474617689847946,
-0.07960133254528046,
0.03401375189423561,
-0.6936182379722595,
0.36808913946151733,
0.2939414083957672,
0.772037148475647,
0.16266541182994843,
-0.20993374288082123,
-0.35056009888648987,
-0.2164442241191864,
-0.5007286071777344,
0.42305853962898254,
-0.2699817419052124,
-0.17549867928028107,
-0.19307929277420044,
0.37321189045906067,
0.049077827483415604,
-0.3117334842681885,
0.2799370586872101,
-0.6001638174057007,
0.4242525100708008,
-0.19484774768352509,
-0.4839989244937897,
-0.4888842701911926,
0.12600591778755188,
-0.6870943903923035,
1.1735880374908447,
0.16735932230949402,
-0.9275225400924683,
0.2149762660264969,
-0.7629559636116028,
-0.5202165246009827,
-0.02070838399231434,
0.3561280071735382,
-0.5868453979492188,
0.21770493686199188,
0.34014445543289185,
0.539395272731781,
-0.07946866005659103,
0.48275136947631836,
-0.2728399336338043,
-0.33069172501564026,
0.11381130665540695,
-0.4399177134037018,
1.0230658054351807,
0.32278117537498474,
0.04474758729338646,
0.22790251672267914,
-0.761296808719635,
-0.11564059555530548,
0.39959004521369934,
-0.3304538130760193,
-0.4102237820625305,
-0.3237937092781067,
0.06612972170114517,
-0.0021354227792471647,
0.38711315393447876,
-0.4530041813850403,
0.13351905345916748,
-0.6951046586036682,
0.4701365530490875,
0.3437667489051819,
0.19868294894695282,
0.5263720154762268,
-0.5352001190185547,
0.5732442736625671,
-0.12198926508426666,
0.025851018726825714,
-0.4723791480064392,
-0.586593747138977,
-0.5510390996932983,
-0.3557789623737335,
0.42729970812797546,
0.3798810541629791,
-0.4641358256340027,
0.6484218239784241,
-0.37143802642822266,
-0.5655133128166199,
-0.5995670557022095,
-0.13008996844291687,
0.3765804171562195,
0.5804226398468018,
0.532231867313385,
-0.6577630639076233,
-0.7721509337425232,
-0.6441022753715515,
-0.16560344398021698,
-0.26382553577423096,
0.12912294268608093,
0.060373757034540176,
0.4343661069869995,
-0.4241567850112915,
1.1010868549346924,
-0.20162217319011688,
0.07157223671674728,
-0.4886772334575653,
0.2620244324207306,
0.45558661222457886,
0.592522382736206,
0.5843830108642578,
-0.4484196603298187,
-0.5843077898025513,
-0.23704437911510468,
-0.65296471118927,
-0.2017417699098587,
-0.18025711178779602,
-0.19957566261291504,
0.4490237236022949,
0.4784519672393799,
-0.6750459671020508,
0.6327071189880371,
0.5286493897438049,
-0.32582271099090576,
0.4943278431892395,
-0.21817173063755035,
-0.08616959303617477,
-1.2718502283096313,
0.4319803714752197,
-0.2076137512922287,
-0.62301105260849,
-0.6761988401412964,
-0.016863461583852768,
0.05314018577337265,
-0.09950738400220871,
-0.16102387011051178,
0.7428540587425232,
-0.6388619542121887,
0.006667996756732464,
-0.07265220582485199,
0.1348852962255478,
0.2593560516834259,
0.5662940144538879,
0.10742659121751785,
0.40309756994247437,
0.323603093624115,
-0.519774317741394,
0.22689302265644073,
0.5347362756729126,
-0.29719278216362,
0.31885460019111633,
-0.8690491318702698,
0.10041740536689758,
-0.2569844424724579,
0.4208821952342987,
-1.0960947275161743,
-0.11493567377328873,
0.34979358315467834,
-0.568193793296814,
0.5426690578460693,
-0.20456349849700928,
-0.4216349720954895,
-0.6932107210159302,
-0.14111880958080292,
0.44919249415397644,
0.6563141345977783,
-0.42036911845207214,
0.4136938452720642,
0.10614396631717682,
-0.3730727732181549,
-0.7851315140724182,
-0.7328619360923767,
-0.1553439050912857,
-0.040690045803785324,
-0.5194982290267944,
0.5071570873260498,
-0.30743786692619324,
0.02532860077917576,
0.15211710333824158,
-0.09491010755300522,
0.05137506499886513,
0.00944781769067049,
0.2644060552120209,
0.3392229974269867,
-0.19462305307388306,
0.1248590499162674,
0.35344356298446655,
-0.12685474753379822,
0.016604868695139885,
0.1915229707956314,
0.7666705250740051,
-0.4373761713504791,
-0.1154048964381218,
-0.6083412766456604,
0.13515137135982513,
0.5341134071350098,
-0.22459173202514648,
0.6598408222198486,
0.7420656681060791,
-0.2955473065376282,
0.13678871095180511,
-0.581441342830658,
-0.5016478300094604,
-0.47818586230278015,
0.5370780825614929,
-0.4423506557941437,
-0.750170886516571,
0.5769970417022705,
0.03176344186067581,
0.15702559053897858,
0.5080717206001282,
0.5690819621086121,
-0.07959887385368347,
0.7267076373100281,
0.5878843069076538,
-0.07051151990890503,
0.7447144389152527,
-0.48737889528274536,
0.2792116403579712,
-0.8212188482284546,
0.06383119523525238,
-0.10420765727758408,
-0.32991623878479004,
-0.429596483707428,
-0.1688927263021469,
0.1069958284497261,
0.48676833510398865,
-0.5518470406532288,
0.57352614402771,
-0.5985792875289917,
0.2409566044807434,
0.7509735226631165,
-0.10073798149824142,
0.2791699171066284,
0.15185071527957916,
-0.08885511010885239,
0.05451381206512451,
-0.7848610281944275,
-0.39152875542640686,
1.2827141284942627,
0.4596520662307739,
0.6203945875167847,
-0.15857990086078644,
0.8684810400009155,
0.13698183000087738,
0.2803044617176056,
-0.6992173790931702,
0.5037704110145569,
0.1331193596124649,
-1.0286611318588257,
-0.3036740720272064,
-0.407150536775589,
-1.217136263847351,
0.232792928814888,
-0.34916022419929504,
-0.4268384277820587,
0.18597371876239777,
0.09595145285129547,
-0.3012831509113312,
0.22885888814926147,
-0.594186007976532,
0.9901633262634277,
-0.04834303632378578,
-0.13409759104251862,
-0.20537909865379333,
-0.9596925377845764,
0.2496948391199112,
0.06850586086511612,
0.2534933090209961,
0.0625283420085907,
0.3732832670211792,
0.8921359777450562,
-0.48845556378364563,
0.9646718502044678,
-0.1607634276151657,
0.12620578706264496,
0.4410587251186371,
0.17348012328147888,
0.47606512904167175,
0.032617997378110886,
0.18368391692638397,
0.4562864601612091,
0.28473955392837524,
-0.3672204911708832,
-0.2335715889930725,
0.24313363432884216,
-0.7624730467796326,
-0.4210193157196045,
-0.4669237434864044,
-0.5948057174682617,
0.017705043777823448,
0.48033180832862854,
0.5204194784164429,
0.5648921132087708,
-0.4025343060493469,
0.16113951802253723,
0.2923455536365509,
-0.32184895873069763,
0.7434430718421936,
0.3913023769855499,
-0.4937194287776947,
-0.6796587109565735,
0.7855113744735718,
-0.0806708112359047,
0.3146144449710846,
0.35207730531692505,
0.1226935014128685,
-0.2807720899581909,
-0.24321895837783813,
-0.2670918107032776,
0.7113214731216431,
-0.5086000561714172,
-0.32497528195381165,
-0.5188161730766296,
-0.3610420525074005,
-0.5761978030204773,
-0.28314727544784546,
-0.48857608437538147,
-0.49971306324005127,
-0.2619011104106903,
-0.0808950886130333,
0.3829735517501831,
0.7364574074745178,
-0.3938269317150116,
0.5775269269943237,
-0.7171655297279358,
0.3527076542377472,
0.0367082804441452,
0.15661734342575073,
-0.05951083451509476,
-0.7272359728813171,
-0.3134019374847412,
0.17578111588954926,
-0.28421568870544434,
-0.8292160630226135,
0.7050479054450989,
0.09932749718427658,
0.5362135767936707,
0.5798832178115845,
0.22705000638961792,
0.6036590933799744,
-0.32661041617393494,
0.6149895191192627,
0.4301754832267761,
-0.8955451250076294,
0.508548378944397,
-0.12639766931533813,
0.06515111029148102,
0.38987427949905396,
0.35523781180381775,
-0.6413788199424744,
-0.2884294092655182,
-0.9145746827125549,
-0.935700535774231,
0.8866726160049438,
0.05935797467827797,
0.31290099024772644,
-0.1547171175479889,
0.2523902952671051,
0.13960480690002441,
0.5037401914596558,
-1.0669447183609009,
-0.48057207465171814,
-0.38511407375335693,
-0.389053076505661,
-0.159401997923851,
-0.4916591942310333,
-0.04153299331665039,
-0.582344651222229,
0.7635810971260071,
0.23033691942691803,
0.5644549131393433,
0.32385018467903137,
-0.38988298177719116,
-0.16172485053539276,
0.10202167183160782,
0.446081280708313,
0.3460949659347534,
-0.4963020384311676,
-0.09896904230117798,
0.08364962786436081,
-0.5888835191726685,
-0.1302497386932373,
0.253859281539917,
-0.2255028635263443,
0.2898983061313629,
0.450669527053833,
1.1505323648452759,
0.017146719619631767,
-0.44804543256759644,
0.7069492340087891,
0.2139091193675995,
-0.4188573658466339,
-0.3234083652496338,
-0.22061428427696228,
-0.06392758339643478,
0.20337535440921783,
0.2009604424238205,
0.17833201587200165,
-0.05207284912467003,
-0.4762546420097351,
0.024246307089924812,
0.4262184202671051,
-0.23294813930988312,
-0.5562524199485779,
0.7148661613464355,
0.06872624903917313,
-0.18479831516742706,
0.6109373569488525,
-0.4501866400241852,
-0.47888457775115967,
0.3892289400100708,
0.7670406699180603,
0.7067630887031555,
-0.15804092586040497,
0.20511062443256378,
0.8258642554283142,
0.39665520191192627,
-0.13532938063144684,
0.2464798241853714,
-0.13375447690486908,
-0.851654589176178,
-0.39017215371131897,
-0.7027058005332947,
-0.11238560825586319,
0.24723871052265167,
-0.7726719975471497,
0.16543151438236237,
-0.49972638487815857,
-0.4815535843372345,
-0.3111385703086853,
0.18298327922821045,
-0.687743067741394,
0.20061667263507843,
0.148707777261734,
0.6618425846099854,
-0.7727788090705872,
0.7275183796882629,
0.9432177543640137,
-0.6558350324630737,
-0.7180936932563782,
-0.22520162165164948,
-0.3855050206184387,
-0.6917698383331299,
0.6188223958015442,
0.06147019937634468,
0.22230073809623718,
0.2933097779750824,
-0.6061285138130188,
-0.9880934953689575,
0.9168184399604797,
0.32427698373794556,
-0.6475086212158203,
-0.2683131694793701,
-0.08465604484081268,
0.47421446442604065,
-0.14773401618003845,
0.4189579486846924,
0.31608569622039795,
0.42173609137535095,
-0.05041853338479996,
-0.9927466511726379,
0.2617284655570984,
-0.4142364263534546,
0.03056497313082218,
0.0027795489877462387,
-0.5414735078811646,
1.0492300987243652,
-0.3451760709285736,
-0.17067910730838776,
0.1569565087556839,
0.5455118417739868,
0.24304132163524628,
0.41906797885894775,
0.36245623230934143,
0.7738510370254517,
0.9035430550575256,
-0.04887676239013672,
0.9152823686599731,
-0.28512856364250183,
0.5906407833099365,
0.9297533631324768,
0.2860824465751648,
0.7813875675201416,
0.3648994266986847,
-0.38760823011398315,
0.8827462196350098,
0.590517520904541,
-0.05206508934497833,
0.6474626064300537,
0.021690577268600464,
0.1397421509027481,
-0.17211458086967468,
0.37936311960220337,
-0.6612861156463623,
0.10961686074733734,
0.34365367889404297,
-0.4430001974105835,
-0.002155221765860915,
0.04595887288451195,
0.22520358860492706,
-0.19426709413528442,
-0.1348014920949936,
0.7262557148933411,
0.12311241775751114,
-0.4726950526237488,
0.940449059009552,
-0.08103843778371811,
0.6863397359848022,
-0.5359272956848145,
0.20726309716701508,
-0.3370201289653778,
0.08683264255523682,
-0.10998134315013885,
-0.42306429147720337,
0.2923153042793274,
-0.054813869297504425,
-0.3201879560947418,
-0.19509795308113098,
0.6015715003013611,
-0.39459463953971863,
-0.49165719747543335,
0.18724381923675537,
0.49747735261917114,
0.3784598112106323,
-0.17019478976726532,
-0.6783480048179626,
-0.0882231816649437,
-0.028249971568584442,
-0.7026131749153137,
0.05986849591135979,
0.43922004103660583,
0.024267861619591713,
0.5264506340026855,
0.7667344808578491,
0.03473331779241562,
0.09566966444253922,
0.05427030846476555,
0.7189005017280579,
-0.6636797785758972,
-0.5435442328453064,
-0.6644733548164368,
0.7185649871826172,
-0.040729373693466187,
-0.3183342516422272,
0.5221969485282898,
0.5333410501480103,
0.9905965328216553,
-0.18101364374160767,
0.8203774690628052,
-0.3125685155391693,
0.6558735966682434,
-0.12549160420894623,
0.8628738522529602,
-0.7706697583198547,
-0.009358437731862068,
-0.523575484752655,
-0.9520073533058167,
-0.4081082046031952,
1.092983603477478,
-0.3695862293243408,
0.18758976459503174,
0.7920483946800232,
0.7596359848976135,
-0.041082967072725296,
-0.15821045637130737,
0.2522929012775421,
0.4742400050163269,
0.09817536175251007,
0.2558770477771759,
0.602543294429779,
-0.6958516836166382,
0.5382416844367981,
-0.415043443441391,
-0.10193333774805069,
-0.44224730134010315,
-0.6797792911529541,
-1.22110116481781,
-0.6988416910171509,
-0.25709468126296997,
-0.44341129064559937,
-0.04983537271618843,
0.951604425907135,
0.6541222929954529,
-0.8673725128173828,
-0.151938796043396,
-0.4370078146457672,
-0.010947105474770069,
-0.2963517904281616,
-0.24316856265068054,
0.37712880969047546,
-0.5133716464042664,
-0.7009497284889221,
0.21155095100402832,
-0.1991432160139084,
0.1838284581899643,
0.17135754227638245,
-0.2129828929901123,
-0.05195288732647896,
0.08423387259244919,
0.6500211358070374,
0.31201454997062683,
-0.6775511503219604,
-0.04646158218383789,
0.07221692055463791,
-0.11892098188400269,
0.0417928509414196,
0.3315039873123169,
-0.8733569979667664,
0.5153343677520752,
0.5344941020011902,
0.43444740772247314,
0.8111107349395752,
0.1927054077386856,
0.4255020320415497,
-0.8030322194099426,
0.30259543657302856,
0.10378758609294891,
0.48595836758613586,
0.3287513554096222,
-0.05973708629608154,
0.5206725001335144,
0.6405264735221863,
-0.5676489472389221,
-1.015001654624939,
-0.025005154311656952,
-1.1753590106964111,
-0.28550946712493896,
1.0709673166275024,
-0.054122861474752426,
-0.06395016610622406,
0.09873911738395691,
-0.3375883400440216,
0.6477642059326172,
-0.44646501541137695,
0.4869495928287506,
0.5332242250442505,
0.1538616120815277,
-0.11612191796302795,
-0.376954048871994,
0.4097450077533722,
0.3294767439365387,
-0.3783307373523712,
0.02844380959868431,
0.3680915832519531,
0.3988538980484009,
0.14635750651359558,
0.7936105132102966,
-0.0345708504319191,
0.03458842635154724,
0.08734571188688278,
0.6056424975395203,
-0.1987829953432083,
-0.2221873253583908,
-0.2513051927089691,
-0.026137279346585274,
-0.11879424005746841,
-0.21293945610523224
] |
deepset/roberta-base-squad2 | deepset | "2023-09-26T11:36:30Z" | 977,030 | 498 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"rust",
"safetensors",
"roberta",
"question-answering",
"en",
"dataset:squad_v2",
"license:cc-by-4.0",
"model-index",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | question-answering | "2022-03-02T23:29:05Z" | ---
language: en
license: cc-by-4.0
datasets:
- squad_v2
model-index:
- name: deepset/roberta-base-squad2
results:
- task:
type: question-answering
name: Question Answering
dataset:
name: squad_v2
type: squad_v2
config: squad_v2
split: validation
metrics:
- type: exact_match
value: 79.9309
name: Exact Match
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMDhhNjg5YzNiZGQ1YTIyYTAwZGUwOWEzZTRiYzdjM2QzYjA3ZTUxNDM1NjE1MTUyMjE1MGY1YzEzMjRjYzVjYiIsInZlcnNpb24iOjF9.EH5JJo8EEFwU7osPz3s7qanw_tigeCFhCXjSfyN0Y1nWVnSfulSxIk_DbAEI5iE80V4EKLyp5-mYFodWvL2KDA
- type: f1
value: 82.9501
name: F1
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMjk5ZDYwOGQyNjNkMWI0OTE4YzRmOTlkY2JjNjQ0YTZkNTMzMzNkYTA0MDFmNmI3NjA3NjNlMjhiMDQ2ZjJjNSIsInZlcnNpb24iOjF9.DDm0LNTkdLbGsue58bg1aH_s67KfbcmkvL-6ZiI2s8IoxhHJMSf29H_uV2YLyevwx900t-MwTVOW3qfFnMMEAQ
- type: total
value: 11869
name: total
verified: true
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGFkMmI2ODM0NmY5NGNkNmUxYWViOWYxZDNkY2EzYWFmOWI4N2VhYzY5MGEzMTVhOTU4Zjc4YWViOGNjOWJjMCIsInZlcnNpb24iOjF9.fexrU1icJK5_MiifBtZWkeUvpmFISqBLDXSQJ8E6UnrRof-7cU0s4tX_dIsauHWtUpIHMPZCf5dlMWQKXZuAAA
- task:
type: question-answering
name: Question Answering
dataset:
name: squad
type: squad
config: plain_text
split: validation
metrics:
- type: exact_match
value: 85.289
name: Exact Match
- type: f1
value: 91.841
name: F1
- task:
type: question-answering
name: Question Answering
dataset:
name: adversarial_qa
type: adversarial_qa
config: adversarialQA
split: validation
metrics:
- type: exact_match
value: 29.500
name: Exact Match
- type: f1
value: 40.367
name: F1
- task:
type: question-answering
name: Question Answering
dataset:
name: squad_adversarial
type: squad_adversarial
config: AddOneSent
split: validation
metrics:
- type: exact_match
value: 78.567
name: Exact Match
- type: f1
value: 84.469
name: F1
- task:
type: question-answering
name: Question Answering
dataset:
name: squadshifts amazon
type: squadshifts
config: amazon
split: test
metrics:
- type: exact_match
value: 69.924
name: Exact Match
- type: f1
value: 83.284
name: F1
- task:
type: question-answering
name: Question Answering
dataset:
name: squadshifts new_wiki
type: squadshifts
config: new_wiki
split: test
metrics:
- type: exact_match
value: 81.204
name: Exact Match
- type: f1
value: 90.595
name: F1
- task:
type: question-answering
name: Question Answering
dataset:
name: squadshifts nyt
type: squadshifts
config: nyt
split: test
metrics:
- type: exact_match
value: 82.931
name: Exact Match
- type: f1
value: 90.756
name: F1
- task:
type: question-answering
name: Question Answering
dataset:
name: squadshifts reddit
type: squadshifts
config: reddit
split: test
metrics:
- type: exact_match
value: 71.550
name: Exact Match
- type: f1
value: 82.939
name: F1
---
# roberta-base for QA
This is the [roberta-base](https://huggingface.co/roberta-base) model, fine-tuned using the [SQuAD2.0](https://huggingface.co/datasets/squad_v2) dataset. It's been trained on question-answer pairs, including unanswerable questions, for the task of Question Answering.
## Overview
**Language model:** roberta-base
**Language:** English
**Downstream-task:** Extractive QA
**Training data:** SQuAD 2.0
**Eval data:** SQuAD 2.0
**Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
**Infrastructure**: 4x Tesla v100
## Hyperparameters
```
batch_size = 96
n_epochs = 2
base_LM_model = "roberta-base"
max_seq_len = 386
learning_rate = 3e-5
lr_schedule = LinearWarmup
warmup_proportion = 0.2
doc_stride=128
max_query_length=64
```
## Using a distilled model instead
Please note that we have also released a distilled version of this model called [deepset/tinyroberta-squad2](https://huggingface.co/deepset/tinyroberta-squad2). The distilled model has a comparable prediction quality and runs at twice the speed of the base model.
## Usage
### In Haystack
Haystack is an NLP framework by deepset. You can use this model in a Haystack pipeline to do question answering at scale (over many documents). To load the model in [Haystack](https://github.com/deepset-ai/haystack/):
```python
reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2")
# or
reader = TransformersReader(model_name_or_path="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2")
```
For a complete example of ``roberta-base-squad2`` being used for Question Answering, check out the [Tutorials in Haystack Documentation](https://haystack.deepset.ai/tutorials/first-qa-system)
### In Transformers
```python
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
model_name = "deepset/roberta-base-squad2"
# a) Get predictions
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
QA_input = {
'question': 'Why is model conversion important?',
'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
}
res = nlp(QA_input)
# b) Load model & tokenizer
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
```
## Performance
Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
```
"exact": 79.87029394424324,
"f1": 82.91251169582613,
"total": 11873,
"HasAns_exact": 77.93522267206478,
"HasAns_f1": 84.02838248389763,
"HasAns_total": 5928,
"NoAns_exact": 81.79983179142137,
"NoAns_f1": 81.79983179142137,
"NoAns_total": 5945
```
## Authors
**Branden Chan:** [email protected]
**Timo Möller:** [email protected]
**Malte Pietsch:** [email protected]
**Tanay Soni:** [email protected]
## About us
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/deepset-logo-colored.png" class="w-40"/>
</div>
<div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
<img alt="" src="https://raw.githubusercontent.com/deepset-ai/.github/main/haystack-logo-colored.png" class="w-40"/>
</div>
</div>
[deepset](http://deepset.ai/) is the company behind the open-source NLP framework [Haystack](https://haystack.deepset.ai/) which is designed to help you build production ready NLP systems that use: Question answering, summarization, ranking etc.
Some of our other work:
- [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
- [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
- [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
## Get in touch and join the Haystack community
<p>For more info on Haystack, visit our <strong><a href="https://github.com/deepset-ai/haystack">GitHub</a></strong> repo and <strong><a href="https://docs.haystack.deepset.ai">Documentation</a></strong>.
We also have a <strong><a class="h-7" href="https://haystack.deepset.ai/community">Discord community open to everyone!</a></strong></p>
[Twitter](https://twitter.com/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Discord](https://haystack.deepset.ai/community) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
By the way: [we're hiring!](http://www.deepset.ai/jobs)
| [
-0.409990131855011,
-0.6528233289718628,
0.41005268692970276,
0.0615079328417778,
-0.04213952273130417,
0.10646788775920868,
-0.10608834028244019,
-0.3803134262561798,
0.30146458745002747,
0.29229697585105896,
-0.8476130962371826,
-0.6700934767723083,
-0.27746444940567017,
0.08169548958539963,
-0.32452714443206787,
0.9709030389785767,
0.18689584732055664,
-0.011532832868397236,
-0.22461360692977905,
-0.01432191114872694,
-0.49591562151908875,
-0.4689757227897644,
-0.7001208066940308,
-0.14052103459835052,
0.224648579955101,
0.34152787923812866,
0.642146110534668,
0.3042135536670685,
0.5371134877204895,
0.3274485468864441,
-0.09254644066095352,
0.181657612323761,
-0.4462875425815582,
0.24707123637199402,
-0.05493146926164627,
-0.4014301300048828,
-0.4288623631000519,
-0.06054230406880379,
0.5054655075073242,
0.4013127386569977,
-0.15384243428707123,
0.5286742448806763,
-0.15137334167957306,
0.7453644871711731,
-0.5311859846115112,
0.1051316112279892,
-0.6827167272567749,
-0.2553279399871826,
0.19321943819522858,
0.2038283348083496,
-0.13632717728614807,
-0.1621111035346985,
0.20087748765945435,
-0.61965012550354,
0.3379668891429901,
-0.166494682431221,
1.1766915321350098,
0.29162922501564026,
-0.09132111817598343,
-0.15254656970500946,
-0.4622533917427063,
0.894140899181366,
-1.0650252103805542,
-0.015558471903204918,
0.579274594783783,
0.42222803831100464,
0.11749919503927231,
-0.8450239300727844,
-0.6435805559158325,
0.033861905336380005,
-0.32952752709388733,
0.2343941032886505,
-0.16447065770626068,
-0.3214528262615204,
0.10879399627447128,
0.33559107780456543,
-0.7729602456092834,
0.07200111448764801,
-0.5190159678459167,
0.015025664120912552,
0.897585391998291,
0.23474925756454468,
0.2390543669462204,
-0.31791213154792786,
-0.3027283549308777,
-0.27064797282218933,
-0.43893980979919434,
0.22098760306835175,
0.11769963055849075,
0.4190652072429657,
-0.28450196981430054,
0.4665106236934662,
-0.4366932809352875,
0.5685099363327026,
0.250459223985672,
0.35277479887008667,
0.45454123616218567,
-0.7306158542633057,
-0.2510184943675995,
-0.23506954312324524,
0.9792621731758118,
0.4190811216831207,
0.009460036642849445,
0.005299989599734545,
-0.2922646105289459,
-0.17716093361377716,
0.23157534003257751,
-0.8859958648681641,
-0.16472919285297394,
0.5319305062294006,
-0.3247358500957489,
-0.438866525888443,
0.10233999788761139,
-0.7746936082839966,
-0.3094061315059662,
0.0679258480668068,
0.48484140634536743,
-0.4105324447154999,
-0.43296369910240173,
0.2924287021160126,
-0.23572301864624023,
0.5905026197433472,
0.13384132087230682,
-0.8006239533424377,
0.16285666823387146,
0.6105595827102661,
0.7856334447860718,
0.25299692153930664,
-0.2668168246746063,
-0.39022839069366455,
-0.13712334632873535,
-0.1616465151309967,
0.6887245774269104,
-0.29476606845855713,
-0.14529819786548615,
-0.015345660969614983,
0.21211612224578857,
-0.10850612074136734,
-0.36499008536338806,
0.1778164654970169,
-0.6211837530136108,
0.5473299622535706,
-0.16116473078727722,
-0.4988445043563843,
-0.21290723979473114,
0.3812515139579773,
-0.6843282580375671,
1.0632635354995728,
0.39378243684768677,
-0.5288236141204834,
0.12842270731925964,
-0.7519400715827942,
-0.25722262263298035,
0.08815303444862366,
0.10130548477172852,
-0.4543953239917755,
-0.2772652208805084,
0.37136608362197876,
0.44069036841392517,
-0.3214820623397827,
0.11815682798624039,
-0.29018324613571167,
-0.3941524922847748,
0.26310378313064575,
0.008812411688268185,
1.243164300918579,
0.10191112011671066,
-0.4044840931892395,
-0.029365982860326767,
-0.6912264823913574,
0.39807501435279846,
0.1929856389760971,
-0.19341565668582916,
-0.029147112742066383,
-0.1407371610403061,
0.09306219220161438,
0.2807103395462036,
0.5572050213813782,
-0.36795249581336975,
0.16982896625995636,
-0.6175820231437683,
0.623213529586792,
0.5914890170097351,
0.06771758943796158,
0.40726763010025024,
-0.37776094675064087,
0.6821783781051636,
-0.0900745689868927,
0.12714242935180664,
0.06765127927064896,
-0.3434418737888336,
-0.8639663457870483,
-0.16325660049915314,
0.4524923861026764,
0.6756508946418762,
-0.6794878840446472,
0.800642728805542,
-0.17516380548477173,
-0.6239414215087891,
-0.8143545389175415,
0.07581575214862823,
0.3951118290424347,
0.36804330348968506,
0.5467861294746399,
0.012849444523453712,
-0.8019997477531433,
-0.9987571239471436,
-0.04215904325246811,
-0.21401700377464294,
-0.17467612028121948,
0.24030256271362305,
0.710229218006134,
-0.3152311146259308,
0.8595923781394958,
-0.6423200368881226,
-0.29352158308029175,
-0.2362843155860901,
-0.1395384669303894,
0.562545657157898,
0.7049142718315125,
0.6653979420661926,
-0.8304620385169983,
-0.5600913166999817,
-0.22860226035118103,
-0.750905454158783,
0.263445645570755,
-0.07901716977357864,
-0.3076450228691101,
0.13252578675746918,
0.3514275550842285,
-0.7900621294975281,
0.33119475841522217,
0.4795483946800232,
-0.5870694518089294,
0.4319654405117035,
0.05076627433300018,
0.12934593856334686,
-1.4933604001998901,
0.30593550205230713,
-0.01966140978038311,
-0.24462030827999115,
-0.4826330542564392,
0.2729041278362274,
-0.19540204107761383,
-0.0753965750336647,
-0.4502735435962677,
0.5884323716163635,
-0.40485572814941406,
0.07928218692541122,
0.17610682547092438,
0.1115684062242508,
0.25853848457336426,
0.5002648830413818,
-0.23311540484428406,
1.0991895198822021,
0.6356205344200134,
-0.4740297198295593,
0.5807991623878479,
0.6098180413246155,
-0.44333118200302124,
0.3265360891819,
-0.9663856029510498,
0.19642208516597748,
0.0534164197742939,
0.20961953699588776,
-1.0248067378997803,
-0.22152873873710632,
0.17135201394557953,
-0.764066219329834,
0.10840225219726562,
-0.19264359772205353,
-0.6061599254608154,
-0.40973082184791565,
-0.49399712681770325,
0.2676297426223755,
0.8040620684623718,
-0.2993781268596649,
0.2841425836086273,
0.40977349877357483,
-0.04302038997411728,
-0.6006613969802856,
-0.8828462958335876,
0.011883878149092197,
-0.11301738023757935,
-0.6635769605636597,
0.2674868106842041,
-0.13888107240200043,
-0.1700453907251358,
0.1476292610168457,
0.03304200619459152,
-0.5122607946395874,
0.2227255254983902,
0.1700092852115631,
0.4414941966533661,
-0.4334251880645752,
0.28734445571899414,
-0.21932871639728546,
-0.14642126858234406,
-0.03341801092028618,
-0.3066231906414032,
0.668790340423584,
-0.7089393734931946,
0.014952601864933968,
-0.6026061773300171,
0.37826716899871826,
0.5112976431846619,
-0.4096122086048126,
0.858642578125,
0.6358662843704224,
-0.3625475764274597,
-0.044749967753887177,
-0.5048329830169678,
-0.25447314977645874,
-0.47553616762161255,
0.447689950466156,
-0.2561807632446289,
-0.801548957824707,
0.6441038250923157,
0.3600846827030182,
0.13155029714107513,
1.0013012886047363,
0.45540887117385864,
-0.458667129278183,
0.9946874976158142,
0.4491826593875885,
-0.004618366248905659,
0.3556238114833832,
-0.8698328733444214,
0.03461061045527458,
-0.9669920206069946,
-0.22306601703166962,
-0.586298942565918,
-0.47789809107780457,
-0.6305418014526367,
-0.4014248251914978,
0.24237239360809326,
0.17888204753398895,
-0.4674451947212219,
0.5319828391075134,
-0.7395045161247253,
0.4857281744480133,
0.689786434173584,
0.18725764751434326,
0.060432542115449905,
-0.08917240053415298,
0.24565158784389496,
0.24977032840251923,
-0.7224624156951904,
-0.4722582697868347,
1.1218980550765991,
0.08135192841291428,
0.4889672100543976,
0.18031859397888184,
0.8454185724258423,
0.23060008883476257,
-0.2149728238582611,
-0.5948337316513062,
0.5360304117202759,
-0.12670479714870453,
-0.975295901298523,
-0.5991955399513245,
-0.3758075535297394,
-1.040628433227539,
0.021746134385466576,
-0.24197299778461456,
-0.6136134266853333,
0.2992188632488251,
-0.028251124545931816,
-0.6689695119857788,
0.18587389588356018,
-0.6959439516067505,
0.9201079607009888,
-0.13577206432819366,
-0.1896435022354126,
-0.1625869870185852,
-0.7995033860206604,
0.20708699524402618,
0.16774755716323853,
0.015607540495693684,
-0.17704129219055176,
-0.039506737142801285,
0.6994699835777283,
-0.6353855729103088,
0.8674660325050354,
-0.14257881045341492,
0.06086167320609093,
0.48385846614837646,
-0.006026924587786198,
0.4093918204307556,
0.32387012243270874,
-0.38594427704811096,
0.22719070315361023,
0.4105561673641205,
-0.6107987761497498,
-0.5711089372634888,
0.693666398525238,
-0.8762813806533813,
-0.4399055540561676,
-0.46309375762939453,
-0.4136430025100708,
-0.09334144741296768,
0.3690676987171173,
0.24487753212451935,
0.36706799268722534,
-0.1409814953804016,
0.5322213172912598,
0.5891191959381104,
-0.08981917798519135,
0.4066392779350281,
0.43774113059043884,
-0.12701281905174255,
-0.3786628544330597,
0.7389291524887085,
-0.07462909072637558,
0.2153717279434204,
0.41616740822792053,
0.06566756963729858,
-0.46716299653053284,
-0.47349172830581665,
-0.5403818488121033,
0.20679070055484772,
-0.535588264465332,
-0.4413802921772003,
-0.5164692401885986,
-0.48826560378074646,
-0.7176237106323242,
-0.049076419323682785,
-0.3759227693080902,
-0.623645007610321,
-0.5384467840194702,
-0.10886900126934052,
0.704547643661499,
0.5420774221420288,
-0.018295172601938248,
0.18501026928424835,
-0.615940272808075,
0.33026573061943054,
0.4384480118751526,
0.3883321285247803,
-0.16114677488803864,
-0.5421662926673889,
-0.229075625538826,
0.5197092890739441,
0.013035059906542301,
-0.6400973200798035,
0.28089261054992676,
0.176768496632576,
0.28322485089302063,
-0.12179561704397202,
0.1505797803401947,
0.6600592732429504,
-0.27338311076164246,
0.9062150120735168,
0.1515386402606964,
-0.7697060704231262,
0.6845654845237732,
-0.37824735045433044,
0.4191116392612457,
1.09230637550354,
0.19629791378974915,
-0.5524370074272156,
-0.25859132409095764,
-0.7729934453964233,
-0.9660484790802002,
0.6381587386131287,
0.3257225453853607,
0.18806640803813934,
-0.012766346335411072,
0.3079735040664673,
-0.07519777119159698,
0.26795509457588196,
-0.5118087530136108,
-0.26901480555534363,
-0.24176491796970367,
-0.29772844910621643,
-0.028253845870494843,
-0.13720934092998505,
-0.17181944847106934,
-0.3977375328540802,
0.9353134632110596,
-0.052668388932943344,
0.17362092435359955,
0.31829705834388733,
-0.18983325362205505,
0.17413905262947083,
0.14847637712955475,
0.46219804883003235,
0.8368726372718811,
-0.3947904109954834,
-0.20763856172561646,
0.20801377296447754,
-0.27897122502326965,
0.0193365216255188,
0.20913708209991455,
-0.5247495174407959,
0.10647643357515335,
0.40615805983543396,
0.7709190249443054,
0.0796012282371521,
-0.6241158843040466,
0.613468587398529,
-0.11011355370283127,
-0.40848299860954285,
-0.5841725468635559,
0.19129827618598938,
0.262583464384079,
0.40919601917266846,
0.4232461154460907,
-0.06826436519622803,
0.14119504392147064,
-0.5037307739257812,
0.17409031093120575,
0.548790693283081,
-0.404100239276886,
-0.1017274409532547,
0.4548484683036804,
0.2831912934780121,
-0.458603173494339,
0.7302504777908325,
-0.2289721518754959,
-0.5761311650276184,
0.9951871633529663,
0.2544775605201721,
0.9767778515815735,
0.20936906337738037,
0.40042176842689514,
0.6256483197212219,
0.2892134487628937,
0.07252109795808792,
0.2908640205860138,
0.11020094156265259,
-0.5325999855995178,
-0.26630181074142456,
-0.7170947790145874,
-0.11620789766311646,
0.3329557776451111,
-0.7758503556251526,
0.17005987465381622,
-0.5580487847328186,
-0.16508755087852478,
0.009824947454035282,
0.33743080496788025,
-0.9419922828674316,
0.23058612644672394,
-0.20043693482875824,
0.8401878476142883,
-0.50180983543396,
0.4079948365688324,
0.8347028493881226,
-0.7932019233703613,
-0.8888865113258362,
-0.09351126849651337,
-0.26326432824134827,
-0.9935724139213562,
0.4350145161151886,
0.15837682783603668,
-0.07672582566738129,
0.2944832444190979,
-0.8221586346626282,
-1.000215768814087,
1.3275470733642578,
-0.012695093639194965,
-0.4230569899082184,
-0.2554561197757721,
-0.07991117984056473,
0.5904984474182129,
-0.3280196785926819,
0.318938285112381,
0.5205674171447754,
0.46250301599502563,
-0.004577835090458393,
-0.8356173038482666,
0.3051519989967346,
-0.4689793884754181,
0.008490737527608871,
-0.026569398120045662,
-0.8564283847808838,
0.8214649558067322,
-0.20873787999153137,
-0.20202933251857758,
0.3654977083206177,
0.4794563055038452,
0.21559372544288635,
0.09766992181539536,
0.4717297852039337,
0.555790901184082,
0.7547662854194641,
-0.031629323959350586,
0.9816562533378601,
-0.22324799001216888,
0.7508158087730408,
1.180677890777588,
-0.10117734968662262,
0.9423656463623047,
0.3904624581336975,
-0.4385240077972412,
0.8155406713485718,
0.6607664227485657,
-0.35757723450660706,
0.4467947781085968,
0.1410999894142151,
-0.021890636533498764,
-0.35891732573509216,
0.06712739169597626,
-0.7464562654495239,
0.5116439461708069,
0.06106404960155487,
-0.23185478150844574,
-0.20589156448841095,
-0.4019896686077118,
-0.18022869527339935,
0.031014788895845413,
-0.03274335339665413,
0.8928049206733704,
-0.10634662210941315,
-0.5378324389457703,
0.9845414757728577,
-0.16493602097034454,
0.7116156220436096,
-0.6637072563171387,
-0.02209441363811493,
-0.28367185592651367,
0.10627968609333038,
-0.19475457072257996,
-0.8971067667007446,
0.12152275443077087,
-0.0011531590716913342,
-0.4959447383880615,
-0.13503125309944153,
0.5368831753730774,
-0.46975260972976685,
-0.8847713470458984,
0.030622487887740135,
0.5687847137451172,
0.19367623329162598,
-0.022555069997906685,
-0.9805352687835693,
-0.22205759584903717,
0.00850214995443821,
-0.31954455375671387,
0.14851641654968262,
0.36830559372901917,
0.323710560798645,
0.6059452891349792,
0.7884136438369751,
0.034700796008110046,
-0.03833552449941635,
-0.03486635535955429,
0.8939589262008667,
-0.7151781916618347,
-0.40413138270378113,
-0.7629507780075073,
0.7416698336601257,
-0.35740187764167786,
-0.514129638671875,
0.6691197156906128,
0.6997873783111572,
0.8154016733169556,
-0.17469918727874756,
0.8111214637756348,
-0.2761729061603546,
0.6459982991218567,
-0.462814599275589,
0.9734265804290771,
-0.8321166038513184,
0.12043854594230652,
0.0319799967110157,
-0.6302223205566406,
-0.10189305990934372,
0.7431319952011108,
-0.09907931834459305,
0.15707091987133026,
0.6775091290473938,
0.8606497645378113,
0.07990175485610962,
-0.31120729446411133,
-0.01463648397475481,
0.3209261894226074,
0.18710605800151825,
0.8475513458251953,
0.7115437984466553,
-0.8118743300437927,
0.6242323517799377,
-0.35456565022468567,
-0.029905756935477257,
-0.2903471887111664,
-0.5877329707145691,
-0.8510860800743103,
-0.6428155303001404,
-0.24867583811283112,
-0.6989129781723022,
0.06707912683486938,
0.8185049295425415,
0.8387024402618408,
-0.9561519622802734,
-0.1901777982711792,
-0.10316406190395355,
0.22150763869285583,
-0.27441707253456116,
-0.3189149498939514,
0.42193785309791565,
-0.3050304353237152,
-0.6240957379341125,
0.3495599925518036,
-0.07678420841693878,
-0.0023185620084404945,
-0.26938849687576294,
0.017004789784550667,
-0.719102144241333,
-0.17810767889022827,
0.39356887340545654,
0.35445642471313477,
-0.6408133506774902,
-0.12370020896196365,
0.18628710508346558,
-0.28093916177749634,
0.0349428653717041,
0.3762879967689514,
-0.9093056917190552,
0.20446349680423737,
0.5983260869979858,
0.7351424098014832,
0.5466117858886719,
0.1008138433098793,
0.5096210241317749,
-0.6292043328285217,
0.13362763822078705,
0.5106164216995239,
0.1717502772808075,
0.32436224818229675,
-0.554405152797699,
0.7538978457450867,
0.08296136558055878,
-0.44282495975494385,
-0.8959802389144897,
0.004522313363850117,
-0.9111106395721436,
-0.4080958664417267,
1.2294530868530273,
-0.022321078926324844,
-0.2769511640071869,
0.17026978731155396,
-0.13751791417598724,
0.20104631781578064,
-0.46213972568511963,
0.6979863047599792,
0.6923766136169434,
0.15923002362251282,
0.08717220276594162,
-0.5886341333389282,
0.4771091043949127,
0.529163658618927,
-0.8537402749061584,
-0.07679799199104309,
0.44302526116371155,
0.35507771372795105,
0.1897183358669281,
0.6033921241760254,
0.14537547528743744,
0.44661104679107666,
-0.1169886589050293,
0.08355116844177246,
-0.18468470871448517,
-0.06388229131698608,
-0.3918313980102539,
-0.07502423226833344,
-0.2969180941581726,
-0.4329349994659424
] |
dslim/bert-base-NER-uncased | dslim | "2023-05-09T16:37:36Z" | 974,454 | 22 | transformers | [
"transformers",
"pytorch",
"tf",
"jax",
"safetensors",
"bert",
"token-classification",
"license:mit",
"autotrain_compatible",
"endpoints_compatible",
"has_space",
"region:us"
] | token-classification | "2022-03-02T23:29:05Z" | ---
license: mit
--- | [
-0.12853388488292694,
-0.18616782128810883,
0.6529127359390259,
0.4943625330924988,
-0.19319313764572144,
0.23607465624809265,
0.36071982979774475,
0.05056332051753998,
0.5793652534484863,
0.740013837814331,
-0.6508103013038635,
-0.2378396987915039,
-0.710224986076355,
-0.04782581701874733,
-0.3894752264022827,
0.8470761775970459,
-0.09598272293806076,
0.024004854261875153,
0.047120071947574615,
-0.14317826926708221,
-0.6121037602424622,
-0.04771740734577179,
-1.0524537563323975,
-0.06787490844726562,
0.3002279996871948,
0.5120972990989685,
0.8275896310806274,
0.39602896571159363,
0.5030564069747925,
1.7515558004379272,
-0.08836919069290161,
-0.22754427790641785,
-0.45892032980918884,
0.4223068356513977,
-0.33277371525764465,
-0.42133718729019165,
-0.2624166011810303,
-0.07449338585138321,
0.32380399107933044,
0.790371298789978,
-0.38104110956192017,
0.19328099489212036,
-0.22438454627990723,
1.008224368095398,
-0.8202074766159058,
0.22630876302719116,
-0.16698351502418518,
0.14053204655647278,
0.042308706790208817,
-0.14591927826404572,
-0.1326323002576828,
-0.6440033912658691,
0.06469469517469406,
-0.899596095085144,
0.1027495265007019,
-0.04461126774549484,
0.8789561986923218,
0.21909058094024658,
-0.5102370977401733,
-0.0459773913025856,
-0.6883594989776611,
1.0972508192062378,
-0.17556026577949524,
0.7615712881088257,
0.4507811963558197,
0.45288562774658203,
-0.5849329829216003,
-1.178217887878418,
-0.4441864490509033,
-0.13579002022743225,
0.14722809195518494,
0.30556100606918335,
-0.3453029692173004,
-0.022343844175338745,
0.10801105946302414,
0.5610314011573792,
-0.5003758072853088,
-0.311959445476532,
-0.9579929113388062,
-0.18164916336536407,
0.6820483207702637,
0.319308340549469,
0.834044337272644,
0.1873151659965515,
-0.7347195744514465,
0.12866291403770447,
-1.3239703178405762,
0.07650735974311829,
0.6465023756027222,
0.239467591047287,
-0.554598867893219,
0.8594784736633301,
-0.28587982058525085,
0.626249372959137,
0.2728465497493744,
-0.1164526641368866,
0.2784252464771271,
-0.23030735552310944,
-0.2735062837600708,
0.033087607473134995,
0.34597301483154297,
0.8204491138458252,
0.16248634457588196,
-0.019984982907772064,
-0.22123965620994568,
0.0020717978477478027,
0.2684449553489685,
-0.7935096025466919,
-0.4712669551372528,
0.1926696002483368,
-0.558952808380127,
-0.0910850465297699,
0.4327022135257721,
-1.0976827144622803,
-0.4812980592250824,
-0.1879846155643463,
0.05468139797449112,
-0.5451693534851074,
-0.3697946071624756,
0.07273250073194504,
-0.79254150390625,
-0.1243419200181961,
0.570950984954834,
-0.6230252981185913,
0.43974608182907104,
0.533625602722168,
0.7861635684967041,
0.2330387681722641,
-0.23613610863685608,
-0.6695019602775574,
0.48848265409469604,
-0.8661867380142212,
0.36860740184783936,
-0.3073781132698059,
-0.8298640251159668,
-0.09631050378084183,
0.5393159985542297,
0.20664852857589722,
-0.6653256416320801,
0.7074045538902283,
-0.5496984720230103,
-0.07806532829999924,
-0.4308285415172577,
-0.2432200014591217,
0.17460417747497559,
0.11115431040525436,
-0.6238909363746643,
0.9402233362197876,
0.5551108121871948,
-0.584109902381897,
0.31701239943504333,
-0.4869506359100342,
-0.6865583658218384,
0.26748135685920715,
-0.008750975131988525,
-0.047152332961559296,
0.3279528021812439,
-0.15983973443508148,
-0.0020511597394943237,
0.10505761206150055,
0.008299741894006729,
-0.21891699731349945,
-0.4786304235458374,
0.06349936127662659,
0.151650071144104,
1.25368332862854,
0.4083622097969055,
-0.3771882951259613,
-0.13140122592449188,
-1.0526149272918701,
0.025432661175727844,
0.0505015105009079,
-0.42306768894195557,
-0.2504565119743347,
-0.14882194995880127,
-0.20381587743759155,
0.4307260811328888,
0.2118472456932068,
-0.813115119934082,
0.22643625736236572,
-0.2064024657011032,
0.364496648311615,
0.8222091794013977,
0.2703101634979248,
0.39760565757751465,
-0.6625286340713501,
0.6563138365745544,
0.2076188325881958,
0.49590179324150085,
0.35404202342033386,
-0.3845822811126709,
-0.9641586542129517,
-0.442161500453949,
-0.10117404907941818,
0.2975531220436096,
-0.7744957804679871,
0.5847322940826416,
0.012979604303836823,
-0.5836705565452576,
-0.4465281367301941,
-0.15488101541996002,
0.2755330502986908,
-0.06606576591730118,
0.03334902226924896,
-0.4049779176712036,
-0.7394417524337769,
-1.0127898454666138,
-0.13788150250911713,
-0.5021388530731201,
-0.21892830729484558,
0.3160586357116699,
0.2617739737033844,
-0.34290042519569397,
0.7610747814178467,
-0.6059278249740601,
-0.704064130783081,
-0.13973554968833923,
-0.0995984673500061,
0.6187719702720642,
0.9297672510147095,
0.749138355255127,
-0.7224893569946289,
-0.8973818421363831,
-0.056230708956718445,
-0.5420039892196655,
-0.020044349133968353,
0.038149889558553696,
-0.18260693550109863,
-0.10514980554580688,
0.22352531552314758,
-0.6100803017616272,
0.8851073980331421,
0.43224984407424927,
-0.681546688079834,
0.5210590958595276,
-0.4444413483142853,
0.6073803901672363,
-0.8642839193344116,
-0.2911490201950073,
-0.16823577880859375,
-0.1976117193698883,
-0.7090160846710205,
0.19411544501781464,
-0.3002234101295471,
-0.33029863238334656,
-0.7474032044410706,
0.5274897813796997,
-0.9497010707855225,
-0.18781527876853943,
-0.33672773838043213,
-0.03423111140727997,
0.25807833671569824,
0.19490505754947662,
-0.23560254275798798,
0.8900529742240906,
0.9160482287406921,
-0.7121306657791138,
0.5487277507781982,
0.3930906653404236,
-0.1920013427734375,
0.7131237387657166,
-0.3887738585472107,
0.05161993205547333,
-0.12344931066036224,
0.14374595880508423,
-1.126388430595398,
-0.561158299446106,
0.13677382469177246,
-0.712703287601471,
0.17686958611011505,
-0.16556859016418457,
-0.09428537636995316,
-0.6608465313911438,
-0.33806395530700684,
0.25910091400146484,
0.48612290620803833,
-0.47969940304756165,
0.6188148260116577,
0.5728040337562561,
0.02651876211166382,
-0.5307406783103943,
-0.7206818461418152,
0.20418110489845276,
0.039646461606025696,
-0.5569695830345154,
0.3011690080165863,
0.006543457508087158,
-0.6622446775436401,
-0.371124804019928,
-0.26354190707206726,
-0.6043857336044312,
-0.2267974615097046,
0.7826986312866211,
0.1199423298239708,
-0.09012264013290405,
-0.20310267806053162,
-0.3199536204338074,
-0.06167525798082352,
0.30487415194511414,
-0.07575298100709915,
0.7232834696769714,
-0.33623749017715454,
-0.17850083112716675,
-0.887734055519104,
0.652754545211792,
0.9970465302467346,
0.09446714073419571,
0.806644082069397,
0.46324217319488525,
-0.35647475719451904,
-0.1304660439491272,
-0.3535459041595459,
-0.15120601654052734,
-0.685774564743042,
-0.1806798279285431,
-0.5322476625442505,
-0.5411434769630432,
0.40530654788017273,
0.10101459175348282,
-0.0021042972803115845,
0.5167046785354614,
0.2533605694770813,
-0.28806859254837036,
0.7550324201583862,
1.034340739250183,
0.1391797959804535,
0.3602915108203888,
-0.2854715585708618,
0.6341594457626343,
-0.8329949378967285,
-0.34052175283432007,
-0.4548071026802063,
-0.2563585042953491,
-0.31214389204978943,
-0.10750849545001984,
0.5791022181510925,
0.2818215489387512,
-0.4463467597961426,
0.1250680536031723,
-0.5994209051132202,
0.6587361693382263,
0.6273988485336304,
0.5719727873802185,
0.1997303068637848,
-0.46199458837509155,
0.19982971251010895,
0.04816687852144241,
-0.45745599269866943,
-0.4009109139442444,
0.7711143493652344,
0.2399624139070511,
0.8364022374153137,
0.20927050709724426,
0.4957774877548218,
0.33375421166419983,
0.2528058588504791,
-0.6318977475166321,
0.2009797990322113,
-0.22282809019088745,
-1.245961308479309,
-0.206426739692688,
-0.16551318764686584,
-1.0080583095550537,
-0.11792082339525223,
-0.18288995325565338,
-0.8406620025634766,
0.2665729820728302,
-0.19225634634494781,
-0.6640645265579224,
0.5206149220466614,
-0.5103875398635864,
0.69347083568573,
-0.23555898666381836,
-0.2817087769508362,
0.11930079013109207,
-0.6889920830726624,
0.5254612565040588,
0.3667147755622864,
0.29168397188186646,
-0.37968993186950684,
-0.3192872405052185,
0.5068994760513306,
-0.881224513053894,
0.44081127643585205,
-0.10564978420734406,
0.19428130984306335,
0.5358879566192627,
0.4153591990470886,
0.3823971152305603,
0.28699052333831787,
-0.2459377944469452,
-0.23415414988994598,
0.2250344604253769,
-0.7581346035003662,
-0.27754613757133484,
0.9095459580421448,
-0.7519428730010986,
-0.8586915731430054,
-0.6954255700111389,
-0.30644941329956055,
0.28865277767181396,
0.02781464159488678,
0.7154772281646729,
0.6456884145736694,
-0.18821057677268982,
0.23776991665363312,
0.7208225727081299,
-0.0146945184096694,
0.7235562801361084,
0.29411184787750244,
-0.4056646227836609,
-0.6169787645339966,
0.7182320356369019,
0.2627044916152954,
0.05162655562162399,
0.028327951207756996,
0.3058736026287079,
-0.17546698451042175,
-0.15078596770763397,
-0.6318323612213135,
-0.06395323574542999,
-0.7465729117393494,
-0.0927949845790863,
-0.7541396617889404,
-0.2507742643356323,
-0.7114590406417847,
-0.8068137764930725,
-0.7080163955688477,
-0.45604395866394043,
-0.43011948466300964,
-0.23352204263210297,
0.5163108706474304,
1.1627086400985718,
-0.2613152861595154,
0.8011051416397095,
-0.8900954723358154,
0.41936296224594116,
0.4969540238380432,
0.7519731521606445,
-0.11061006784439087,
-0.6746935844421387,
-0.07836239039897919,
-0.5338755249977112,
-0.29485058784484863,
-1.0156972408294678,
0.31774646043777466,
-0.03688591718673706,
0.40537136793136597,
0.42938894033432007,
0.25190269947052,
0.49392756819725037,
-0.30073118209838867,
1.1130688190460205,
0.7274302244186401,
-0.803381085395813,
0.519527792930603,
-0.7635002136230469,
0.16122324764728546,
0.9363659620285034,
0.54477459192276,
-0.4417075514793396,
-0.15113934874534607,
-1.025976538658142,
-0.843137264251709,
0.5963036417961121,
0.15439945459365845,
0.016843896359205246,
0.01821417547762394,
0.03168272227048874,
0.29466384649276733,
0.3591304123401642,
-0.7847291231155396,
-0.8240220546722412,
-0.13851122558116913,
0.25803306698799133,
0.31456053256988525,
-0.1648542582988739,
-0.3003871440887451,
-0.611615777015686,
0.8711391091346741,
0.18286482989788055,
0.3546231985092163,
0.12073354423046112,
0.04369349032640457,
-0.35506919026374817,
0.14787021279335022,
0.5522999167442322,
1.2529057264328003,
-0.40983331203460693,
0.3673911392688751,
0.1751260608434677,
-0.6540069580078125,
0.6494997143745422,
-0.3036349415779114,
-0.021784601733088493,
0.6203135251998901,
0.17760884761810303,
0.28528398275375366,
0.315599262714386,
-0.3621427118778229,
0.6047801971435547,
-0.029422052204608917,
-0.17758512496948242,
-0.7005696296691895,
0.15866968035697937,
0.029350608587265015,
0.27507954835891724,
0.4392024278640747,
0.24443313479423523,
0.08246771991252899,
-1.0602877140045166,
0.5711055397987366,
0.24493910372257233,
-0.8676618337631226,
-0.3011006712913513,
0.7047957181930542,
0.4075389802455902,
-0.47599563002586365,
0.38749054074287415,
0.012702330946922302,
-0.6710241436958313,
0.5987741351127625,
0.5510413646697998,
0.7569674253463745,
-0.4702427089214325,
0.3088020086288452,
0.6245602965354919,
0.06711331009864807,
0.20550549030303955,
0.6923202872276306,
0.03149382025003433,
-0.44738656282424927,
0.23022446036338806,
-0.5986733436584473,
-0.1468990594148636,
0.13735318183898926,
-0.8047426342964172,
0.351533442735672,
-0.9312615394592285,
-0.24089956283569336,
0.08751589059829712,
0.11761097609996796,
-0.6130945086479187,
0.6674696207046509,
-0.008524954319000244,
0.9280490875244141,
-0.8549083471298218,
0.9626278281211853,
0.8559581637382507,
-0.31830817461013794,
-0.7709448337554932,
-0.33556753396987915,
0.02013934776186943,
-0.6660526990890503,
0.7108278274536133,
-0.18973003327846527,
-0.41207411885261536,
-0.09323947876691818,
-0.622982919216156,
-1.0003730058670044,
0.030618250370025635,
0.017415650188922882,
-0.4625031054019928,
0.4454794228076935,
-0.5157257318496704,
0.3289681673049927,
-0.19169732928276062,
0.30509495735168457,
0.7719469666481018,
0.7958452701568604,
0.22960808873176575,
-0.6354780197143555,
-0.4466685652732849,
-0.010276071727275848,
-0.16682815551757812,
0.4545809030532837,
-1.0710972547531128,
0.967736542224884,
-0.4652574360370636,
-0.34733209013938904,
0.2706642150878906,
0.797762393951416,
0.2538500428199768,
0.3524126708507538,
0.6219537258148193,
0.9016807079315186,
0.36450111865997314,
-0.31178343296051025,
0.7276745438575745,
0.2426338493824005,
0.4152539074420929,
0.7364203333854675,
-0.22712187469005585,
0.5403846502304077,
0.8906413316726685,
-0.786162257194519,
0.5381765365600586,
0.7879031896591187,
0.16047371923923492,
0.7758157253265381,
0.5944145917892456,
-0.611952543258667,
-0.1185941994190216,
-0.1464141309261322,
-0.6171560287475586,
0.1979752480983734,
0.052926212549209595,
-0.11974738538265228,
-0.2846010625362396,
-0.13567376136779785,
0.12295057624578476,
0.2836454212665558,
-0.5959328413009644,
0.606866717338562,
0.34341585636138916,
-0.6328282356262207,
0.21025103330612183,
-0.25779569149017334,
0.6709501147270203,
-0.5978154540061951,
0.02733636647462845,
-0.226993590593338,
0.41810402274131775,
-0.4618742763996124,
-1.007582426071167,
0.47138404846191406,
-0.2920241355895996,
-0.40551304817199707,
-0.26942431926727295,
0.8072363138198853,
-0.22133907675743103,
-0.5572860240936279,
0.37486034631729126,
0.13466592133045197,
0.41473662853240967,
0.40145981311798096,
-0.548729419708252,
0.047790080308914185,
0.13760165870189667,
-0.20061805844306946,
0.3601190149784088,
0.2973729372024536,
0.25488772988319397,
0.7100128531455994,
0.5052477717399597,
0.22198708355426788,
0.25694364309310913,
-0.18668605387210846,
0.8387458324432373,
-0.9102796316146851,
-0.8167635202407837,
-0.9497333765029907,
0.3849896192550659,
0.025727711617946625,
-0.880144476890564,
0.7920305728912354,
0.7652608156204224,
0.5113964080810547,
-0.4877890348434448,
0.4755283296108246,
-0.326479434967041,
0.5047136545181274,
-0.13870958983898163,
1.001089096069336,
-0.760762631893158,
-0.29587265849113464,
-0.030554059892892838,
-0.9216439723968506,
-0.2533753216266632,
0.5375741720199585,
0.1540832668542862,
-0.14608067274093628,
0.4385907053947449,
0.44216376543045044,
0.022173406556248665,
0.25223150849342346,
0.32861006259918213,
0.06042787432670593,
0.14508451521396637,
0.5510438680648804,
1.0931141376495361,
-0.43394410610198975,
0.18694786727428436,
-0.4923475384712219,
-0.4536249041557312,
-0.4153490662574768,
-0.9548057913780212,
-0.6640313863754272,
-0.48185449838638306,
-0.2973935008049011,
-0.5915579199790955,
0.11726461350917816,
0.9300885796546936,
0.9018137454986572,
-0.6256728172302246,
-0.41243645548820496,
0.25713539123535156,
0.30293411016464233,
-0.2295418381690979,
-0.146267831325531,
0.2736492455005646,
-0.006407544948160648,
-0.7211178541183472,
0.3930943012237549,
0.807976245880127,
0.3887130320072174,
0.08444006741046906,
-0.07217127084732056,
-0.4407080411911011,
0.026101574301719666,
0.5373561382293701,
0.5729561448097229,
-0.6281182169914246,
-0.4099644422531128,
-0.5328317880630493,
-0.21386730670928955,
0.15529435873031616,
0.48077550530433655,
-0.5166378617286682,
0.32661110162734985,
0.8128959536552429,
0.17017659544944763,
0.7187885642051697,
-0.0022492259740829468,
0.6678642630577087,
-0.8970246315002441,
0.4446259140968323,
0.3953385353088379,
0.5681870579719543,
0.08998038619756699,
-0.7339164614677429,
0.9820241928100586,
0.49674350023269653,
-0.6334057450294495,
-1.0034242868423462,
0.03079957515001297,
-1.193113923072815,
-0.3788175582885742,
0.9890843629837036,
-0.09595765173435211,
-0.9597458839416504,
-0.36448943614959717,
-0.3677716851234436,
0.07989637553691864,
-0.33809733390808105,
0.35498204827308655,
0.8268195986747742,
-0.2538071274757385,
-0.2204185128211975,
-0.9505581855773926,
0.4752943515777588,
0.3102525472640991,
-0.5886632204055786,
-0.05114369094371796,
0.329391211271286,
0.45236870646476746,
0.3009701371192932,
0.5239557027816772,
0.10428227484226227,
0.8970529437065125,
0.25200390815734863,
0.30491405725479126,
-0.04526621103286743,
-0.590078592300415,
-0.0160664189606905,
0.2621477246284485,
0.04487839341163635,
-0.6869441270828247
] |