ヘルプ センターヘルプ センター
ファイルからの単語埋め込みの読み取り
emb = readWordEmbedding(filename)
例
emb = readWordEmbedding(filename) は、テキスト ファイルまたは zip ファイル filename に格納されている事前学習済みの単語埋め込みを読み取ります。入力ファイルは、word2vec または GloVe のテキスト埋め込み形式の UTF-8 エンコードのテキスト ファイル、またはこの形式のテキスト ファイルを含む zip ファイルでなければなりません。
emb
filename
単語埋め込みファイルに重複する単語が含まれている場合、ソフトウェアは最後の重複エントリに対応する単語ベクトルを使用します。
すべて折りたたむ
単語の埋め込みの例を読み取ります。このモデルは、Wikipedia のテキストを解析して派生させました。
filename = "exampleWordEmbedding.vec"; emb = readWordEmbedding(filename)
emb = wordEmbedding with properties: Dimension: 50 Vocabulary: ["utc" "first" "new" "two" "time" "up" "school" "article" "world" "years" "university" "talk" "many" "national" "later" "state" "made" "born" "city" "de" ... ] (1x9999 string)
word2vec と vec2word を使用して単語埋め込みを調査します。
word2vec
vec2word
king = word2vec(emb,"king"); man = word2vec(emb,"man"); woman = word2vec(emb,"woman"); word = vec2word(emb,king - man + woman)
word = "queen"
ファイルの名前。string スカラー、文字ベクトル、または文字ベクトルを含む 1 行 1 列の cell 配列として指定します。
データ型: string | char | cell
string
char
cell
出力の単語埋め込み。wordEmbedding オブジェクトとして返されます。
wordEmbedding
R2017b で導入
fastTextWordEmbedding | doc2sequence | wordEmbeddingLayer | wordEncoding | word2vec | vec2word | trainWordEmbedding | writeWordEmbedding | wordEmbedding | tokenizedDocument
fastTextWordEmbedding
doc2sequence
wordEmbeddingLayer
wordEncoding
trainWordEmbedding
writeWordEmbedding
tokenizedDocument
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office