Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # update theta
- for (n, (f, e)) in enumerate(bitext):
- for f_i in f:
- z = 0
- for e_j in e:
- z += theta[(f_i,e_j)]
- for e_j in e:
- c = theta[(f_i,e_j)] / z
- count[(f_i,e_j)] += c
- single_count[e_j] += c
- for (f_i,e_j) in count.iterkeys():
- theta[(f_i,e_j)] = count[(f_i,e_j)] / single_count[e_j]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement