File size: 2,564 Bytes
64e591b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e06b8a8
64e591b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d05b99
 
 
 
eb50fc4
 
64e591b
 
 
 
 
 
 
 
 
 
 
 
eb50fc4
64e591b
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
language: 
  - "eng"
thumbnail: "URL to a thumbnail used in social sharing"
tags:
- "PyTorch"
- "tensorflow"
license: "apache-2.0"

---


# viniLM-2021-from-large

### Model Info:
<ul>
<li> Authors: R&D AI Lab, VMware Inc.
<li> Model date: Jun 2022
<li> Model version: 2021-distilled-from-large
<li> Model type: Pretrained language model
<li> License: Apache 2.0
</ul>

#### Motivation
Based on [MiniLMv2 distillation](https://arxiv.org/pdf/2012.15828.pdf), we have distilled vBERT-2021-large into a smaller minilmv2 model for faster inference times without a significant loss of performance. 

#### Intended Use
The model functions as a VMware-specific Language Model.


#### How to Use
Here is how to use this model to get the features of a given text in PyTorch:

```
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('VMware/vinilm-2021-from-large')
model = BertModel.from_pretrained("VMware/vinilm-2021-from-large")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
```

and in TensorFlow:

```
from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('VMware/vinilm-2021-from-large')
model = TFBertModel.from_pretrained('VMware/vinilm-2021-from-large')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)

```

### Training

The model is distilled from [vBERT-2021-large](https://huggingface.co/VMware/vbert-2021-large)</li> <br>
Weights were initialized using [nreimers/MiniLMv2-L6-H768-distilled-from-BERT-Large](https://huggingface.co/nreimers/MiniLMv2-L6-H768-distilled-from-BERT-Large/tree/main)</li>



#### - Datasets
Publically available VMware text data such as VMware Docs, Blogs, etc. were used for distilling the teacher vBERT-2021-large model into vinilm-2021-from-large model. Sourced in May 2021. (~320,000 Documents)
#### - Preprocessing
<ul>
<li>Decoding HTML
<li>Decoding Unicode
<li>Stripping repeated characters
<li>Splitting compound word
<li>Spelling correction
</ul>

#### - Model performance measures
We benchmarked vinilm on various VMware-specific NLP downstream tasks (IR, classification, etc).

### Limitations and bias
Since the model is distilled from a vBERT model based on the BERT model, it may have the same biases embedded within the original BERT model.

The data needs to be preprocessed using our internal vNLP Preprocessor (not available to the public) to maximize its performance.