* Fix init_model

This commit is contained in:
Matthew Honnibal 2015-07-25 23:33:02 +02:00
parent fd525f0675
commit 5c04dcd7c1

View File

@ -80,13 +80,13 @@ def _read_clusters(loc):
def _read_probs(loc):
if not loc.exists():
print("Warning: Probabilities file not found")
return {}
return {}, 0.0
probs = {}
for i, line in enumerate(codecs.open(str(loc), 'r', 'utf8')):
prob, word = line.split()
prob = float(prob)
probs[word] = prob
return probs
return probs, probs['-OOV-']
def _read_freqs(loc):