Coder Social home page Coder Social logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 12, 2024
I noticed this problem myself. In the file wordvectors.py on line 171 they read 
an extra character after each vector. This just sends the first letter to 
nowhere. If you comment this line out then it works i.e. 

171: #fin.read(1)  # newline

Original comment by [email protected] on 31 Mar 2015 at 3:00

from word2vec.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 12, 2024
I noticed this problem myself. In the file wordvectors.py on line 171 they read 
an extra character after each vector. This just sends the first letter to 
nowhere. If you comment this line out then it works i.e. 

171: #fin.read(1)  # newline


The suggestion above worked for me. Note that you have to undo this if you were 
to read binary files other than the google news one. If you continue with 
commenting out the new line you will get corrupt vocabs like this :

vocab
-->
array([u'\nthe', u'\nof', u'\nand', u'\nto', u'\nin', u'\nor', u'\na',
       u'\nfor', u'\nany', u'\nby', u'\nas', u'\nThe', u'\nbe', u'\nsuch',
       u'\nshall', u'\nCompany', u'\nis', u'\non', u'\n._.'], 
      dtype='<U78')

Original comment by [email protected] on 4 Jun 2015 at 2:40

from word2vec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.