Skip to content

Commit

Permalink
Move load and save word2vec_format out of word2vec class to KeyedVect…
Browse files Browse the repository at this point in the history
…ors (#1107)
  • Loading branch information
tmylk authored Jan 27, 2017
1 parent 34759be commit 41ff1f4
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 207 deletions.
84 changes: 29 additions & 55 deletions docs/notebooks/FastText_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -99,9 +97,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -140,9 +136,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -176,9 +170,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -224,9 +216,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"ename": "KeyError",
Expand Down Expand Up @@ -258,9 +248,7 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -295,9 +283,7 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -314,8 +300,8 @@
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand All @@ -336,9 +322,7 @@
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -356,8 +340,8 @@
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand All @@ -368,9 +352,7 @@
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -379,8 +361,8 @@
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand All @@ -390,9 +372,7 @@
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -401,8 +381,8 @@
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand All @@ -412,9 +392,7 @@
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -432,8 +410,8 @@
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand All @@ -443,9 +421,7 @@
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -539,8 +515,8 @@
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand All @@ -550,9 +526,7 @@
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -561,8 +535,8 @@
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result",
"metadata": {}
}
],
"source": [
Expand Down Expand Up @@ -592,7 +566,7 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
Expand All @@ -604,4 +578,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
2 changes: 1 addition & 1 deletion gensim/models/doc2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

from gensim.utils import call_on_class_only
from gensim import utils, matutils # utility fnc for pickling, common scipy operations etc
from gensim.models.word2vec import Word2Vec, Vocab, train_cbow_pair, train_sg_pair, train_batch_sg
from gensim.models.word2vec import Word2Vec, train_cbow_pair, train_sg_pair, train_batch_sg
from six.moves import xrange, zip
from six import string_types, integer_types, itervalues

Expand Down
Loading

0 comments on commit 41ff1f4

Please sign in to comment.