diff options
Diffstat (limited to 'gi')
-rwxr-xr-x | gi/pyp-topics/scripts/spans2labels.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gi/pyp-topics/scripts/spans2labels.py b/gi/pyp-topics/scripts/spans2labels.py index 7cbc521c..402bcd63 100755 --- a/gi/pyp-topics/scripts/spans2labels.py +++ b/gi/pyp-topics/scripts/spans2labels.py @@ -40,6 +40,6 @@ for line in sys.stdin: right_context = reduce(lambda x, y: x+y+" ", target[t2:t2+order], "").strip() context = "%s<PHRASE> %s" % (left_context, right_context) - label = phrase_context_index[(phrase,context)] + label = phrase_context_index.get((phrase,context, "<UNK>") print "%s-%s:X%s" % (t1-order,t2-order,label), print |