luheng / deep_srl

Code and pre-trained model for: Deep Semantic Role Labeling: What Works and What's Next
Apache License 2.0
330 stars 77 forks source link

Transistion from one I-label to the same I-label, for consecutive tim… #2

Closed utkrist closed 7 years ago

utkrist commented 7 years ago

Transistion from one I-label to the same I-label, for consecutive time steps, should be allowed.

For example, the following tag sequence is a valid one.

s1, s2, s3 = B-A0, I-A0, I-A0

The existing function produces the following transition matrix:

A = [[  0.   0.   0.]
     [  0.   0. -inf]
     [  0. -inf   0.]]

The entry A_12 should be 0 because the transition

 s1 = I-A0 to s2 = I-A0 

is a valid one. By symmetry entry A_21 should also be 0

The correct transistion matrix should be the following

 A = [[ 0.  0.  0.]
      [ 0.  0.  0.]
      [ 0.  0.  0.]]

Please let me know if I am mistaken.

utkrist commented 7 years ago

Never mind, your implementation is correct. I confused it with something else.