Load pre-trained word embedding vectors into CNTK
Hi
Is there any tutorial about loading pre-trained word embedding model, such as Glove or word2vec, into CNTK?
Thank you for the link. I read it and found that it requires to write Python code.
Is it possible to set the load of embedding info in the configuration file without programming?
I read from here EmbeddingLayer, it has parameter 'embeddingPath' to a file. But I didn't find any information about the format of this file.
The format is a plain-text file with numbers in the shape of your embedding matrix. So, if your embedding expects a 4x5 matrix, your file should look like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
William
From: Bing Cheng [mailto:[email protected]] Sent: Wednesday, September 14, 2016 9:18 AM To: Microsoft/CNTK [email protected] Subject: Re: [Microsoft/CNTK] Load pre-trained word embedding vectors into CNTK (#842)
I read from here EmbeddingLayerhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fMicrosoft%2fCNTK%2fwiki%2fLayers-Reference%23embeddinglayer&data=02%7c01%7cwdarling%40064d.mgd.microsoft.com%7c5bfba3350a944a820d2108d3dc6f41b2%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c636094342803428206&sdata=yro%2bvce5kijmQkI56iEOOt8Ui%2bBXN5VP5tBxQFqjNS4%3d, it has parameter 'embeddingPath' to a file. But I didn't find any information about the format of this file.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fMicrosoft%2fCNTK%2fissues%2f842%23issuecomment-246926997&data=02%7c01%7cwdarling%40064d.mgd.microsoft.com%7c5bfba3350a944a820d2108d3dc6f41b2%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c636094342803428206&sdata=d%2f42Lk5JF%2f%2b4aQAGaLGk5ET8%2fbF8NXahWOJWq6fox7c%3d, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fnotifications%2funsubscribe-auth%2fAChl39iow9F4ArIIAwMdWWXgauJiTToYks5qp5-kgaJpZM4J8XPm&data=02%7c01%7cwdarling%40064d.mgd.microsoft.com%7c5bfba3350a944a820d2108d3dc6f41b2%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c636094342803428206&sdata=IDZ5iwhfX5C%2bd2zPWIBT6IbxdBqfgZFvzdJUxZO8F8A%3d.
I got it. It seems work.
Thank you for the link.
As mentioned by Willliam, the file format follows the shape of the embedding matrix. The example file shown in https://github.com/Microsoft/CNTK/blob/3b7dcc1ac84debf2128d97064a7e3c41b7437de1/bindings/python/doc/examples.rst demonstrates the file format.