@@ -10,13 +10,12 @@ their page. To load the model, call:
10
10
>>> import shorttext
11
11
>>> wvmodel = shorttext.utils.load_word2vec_model(' /path/to/GoogleNews-vectors-negative300.bin.gz' )
12
12
13
- It is a binary file, and the default is set to be `binary=True `. In fact, it is equivalent to calling,
14
- if you have `gensim ` version before 1.0.0:
13
+ It is a binary file, and the default is set to be `binary=True `.
15
14
16
- >>> import gensim
17
- >>> wvmodel = gensim.models.Word2Vec.load_word2vec_format( ' /path/to/GoogleNews-vectors-negative300.bin.gz ' , binary = True )
15
+ .. automodule :: shorttext.utils.wordembed
16
+ :members: load_word2vec_model
18
17
19
- Or beyond version 1.0.0 ,
18
+ It is equivalent to calling ,
20
19
21
20
>>> import gensim
22
21
>>> wvmodel = gensim.models.KeyedVectors.load_word2vec_format(' /path/to/GoogleNews-vectors-negative300.bin.gz' , binary = True )
@@ -87,6 +86,9 @@ To load a pre-trained FastText model, run:
87
86
88
87
And it is used exactly the same way as Word2Vec.
89
88
89
+ .. automodule :: shorttext.utils.wordembed
90
+ :members: load_fasttext_model
91
+
90
92
Poincaré Embeddings
91
93
-------------------
92
94
@@ -98,6 +100,8 @@ pre-trained model, run:
98
100
99
101
For preloaded word-embedding models, please refer to :doc: `tutorial_wordembed `.
100
102
103
+ .. automodule :: shorttext.utils.wordembed
104
+ :members: load_poincare_model
101
105
102
106
BERT
103
107
----
@@ -120,6 +124,20 @@ The default BERT models and tokenizers are `bert-base_uncase`.
120
124
If you want to use others, refer to `HuggingFace's model list
121
125
<https://huggingface.co/models> `_ .
122
126
127
+ .. autoclass :: shorttext.utils.transformers.BERTObject
128
+ :members:
129
+
130
+ .. autoclass :: shorttext.utils.transformers.WrappedBERTEncoder
131
+ :members:
132
+
133
+
134
+ Other Functions
135
+ ---------------
136
+
137
+ .. automodule :: shorttext.utils.wordembed
138
+ :members: shorttext_to_avgvec
139
+
140
+
123
141
Links
124
142
-----
125
143
0 commit comments