Comments (1)
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.
-
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)
- undefined reference to `cblas_sgemm' error when make HOT 2
- Sokal Michener definition HOT 2
- undefined reference to cblas_sgemm HOT 1
- Problem when testing your solution HOT 3
- Could you train on Glove.42B.300d.txt HOT 4
- Invalid pointer when binarize wiki-news-300d-1M.vec HOT 1
- binarize.c:(.text+0xe1c): undefined reference to `cblas_sgemm' HOT 2
- Small Embeddings HOT 1
- Cannot reproduce results using FastText embeddings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from near-lossless-binarization.