summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/train_pr_global.py
diff options
context:
space:
mode:
Diffstat (limited to 'gi/posterior-regularisation/train_pr_global.py')
-rw-r--r--gi/posterior-regularisation/train_pr_global.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gi/posterior-regularisation/train_pr_global.py b/gi/posterior-regularisation/train_pr_global.py
index 6ce7290d..8b80c6bc 100644
--- a/gi/posterior-regularisation/train_pr_global.py
+++ b/gi/posterior-regularisation/train_pr_global.py
@@ -263,7 +263,9 @@ for iteration in range(20):
scores[t] = conditionals[t] * exp(-lamba[li + t] - lamba[omega_offset + li + t])
z += count * sum(scores)
- tagCounts[p] += count * scores
+ for t in range(num_tags):
+ tagCounts[p][t] += count * scores[t]
+
for i in range(4):
for t in range(num_tags):
contextWordCounts[i][t][types[context[i]]] += count * scores[t]