* Fix init_model

This commit is contained in:
Matthew Honnibal 2015-07-25 23:33:02 +02:00
parent fd525f0675
commit 5c04dcd7c1
1 changed files with 2 additions and 2 deletions

View File

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