Giter Site home page Giter Site logo

Comments (1)

tca19 avatar tca19 commented on June 25, 2024

Hi,

1. getc_unlocked() does not care if the file is UTF-8 or not. It reads one byte at a time, so if a file contains words encoded in UTF-16 (each character is encoded on 16 bits), it will read the word bytes by bytes until it finds a space character and store them in memory without doing any modifications. It does not matter if each character is encoded with one or two bytes.

1. I do not agree that having MAXWORDLEN = 256 is too small. In the worst case (with UTF-32 characters, 4 bytes per character) it represents a word with a length of 64 characters which is more than enough. I have never seen examples of words longer than 64 characters that are absolutely required in an NLP task. Moreover, some word embedding files contain garbage words. In glove.42B.300d.txt one can find at the line 426358 the word: 12345678910111213[...]83693 which is the contatenation of "one", "two", "three", "four"... until 368. Its length is 1000 characters, so it will be truncated but I don't think it is a significant information loss to modify the value of MAXWORDLEN to handle this very special case.

  1. it is just because the file contains space word like \t,space

I have no idea of what a space word is. By definition, a space or a <TAB> (\t) is not a word. So if the program finds a line that starts with whitespaces, it is the correct behaviour to keep reading characters until it finds a valid one (like a letter or a digit).
I was able to binarize fasttext English vectors (both wiki-news-300d-1M.vec and crawl-300d-2M.vec) without any troubles (after the problem here #5 (comment) was fixed) so this line is definitively not faulty.

from near-lossless-binarization.

Related Issues (10)

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.