From d4407d8e2fe02a34e325e2207d2a3dfc8b51c030 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 23 Jul 2015 09:45:15 +0200 Subject: [PATCH] Py3 compatibility tweak --- bin/init_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/init_model.py b/bin/init_model.py index 792ce21ca..155ac6907 100644 --- a/bin/init_model.py +++ b/bin/init_model.py @@ -124,7 +124,7 @@ def setup_vocab(src_dir, dst_dir): probs[word] = min_prob lexicon = [] - for word, prob in reversed(sorted(probs.items(), key=lambda item: item[1])): + 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: entry['prob'] = float(prob)