File size: 1,704 Bytes
a02c788
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-


class Models:
    BertBaseUncased = 'bert-base-uncased'
    BertBaseCased = 'bert-base-cased'
    BertLargeUncased = 'bert-large-uncased'
    BertLargeCased = 'bert-large-cased'

    RobertaBaseCased = 'roberta-base'
    RobertaLargeCased = 'roberta-large'

    XLNetBaseCased = 'xlnet-base-cased'
    XLNetLargeCased = 'xlnet-large-cased'

    DistilBertBaseUncased = 'distilbert-base-uncased'
    DistilBertBaseMultilingualCased = 'distilbert-base-multilingual-cased'

    AlbertBaseCased = 'albert-base-v1'
    AlbertLargeCased = 'albert-large-v1'
    AlbertXLargeCased = 'albert-xlarge-v1'
    AlbertXXLargeCased = 'albert-xxlarge-v1'

    AlbertBaseCased2 = 'albert-base-v2'
    AlbertLargeCased2 = 'albert-large-v2'
    AlbertXLargeCased2 = 'albert-xlarge-v2'
    AlbertXXLargeCased2 = 'albert-xxlarge-v2'


class ModelsByFamily:
    Bert = set([Models.BertBaseUncased, Models.BertBaseCased,
               Models.BertLargeUncased, Models.BertLargeCased])
    Roberta = set([Models.RobertaBaseCased, Models.RobertaLargeCased])
    XLNet = set([Models.XLNetBaseCased, Models.XLNetLargeCased])
    DistilBert = set([Models.DistilBertBaseUncased,
                     Models.DistilBertBaseMultilingualCased])
    Albert = set([
        Models.AlbertBaseCased,
        Models.AlbertLargeCased,
        Models.AlbertXLargeCased,
        Models.AlbertXXLargeCased,
        Models.AlbertBaseCased2,
        Models.AlbertLargeCased2,
        Models.AlbertXLargeCased2,
        Models.AlbertXXLargeCased2
    ])
    Supported = set([
        getattr(Models, model_type) for model_type
        in filter(lambda x: x[:2] != '__', Models.__dict__.keys())
    ])