mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
* Remove probability cap on lexicon
This commit is contained in:
parent
c62eb110c0
commit
5b6bf4d4a6
|
@ -158,14 +158,12 @@ def setup_vocab(src_dir, dst_dir):
|
|||
lexicon = []
|
||||
for word, prob in reversed(sorted(list(probs.items()), key=lambda item: item[1])):
|
||||
entry = get_lex_props(word)
|
||||
if word in clusters or float(prob) >= -17:
|
||||
if word in clusters:
|
||||
entry['prob'] = float(prob)
|
||||
cluster = clusters.get(word, '0')
|
||||
# Decode as a little-endian string, so that we can do & 15 to get
|
||||
# the first 4 bits. See _parse_features.pyx
|
||||
entry['cluster'] = int(cluster[::-1], 2)
|
||||
orth_senses = set()
|
||||
lemmas = []
|
||||
vocab[word] = entry
|
||||
vocab.dump(str(dst_dir / 'lexemes.bin'))
|
||||
vocab.strings.dump(str(dst_dir / 'strings.txt'))
|
||||
|
|
Loading…
Reference in New Issue
Block a user