Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a bug here? #6

Open
freesunshine0316 opened this issue Sep 12, 2019 · 6 comments
Open

Is there a bug here? #6

freesunshine0316 opened this issue Sep 12, 2019 · 6 comments

Comments

@freesunshine0316
Copy link

antecedent_offsets = tf.expand_dims(top_span_range, 1) - tf.expand_dims(top_span_range, 0) # [k, k]

Hi, I guess an offset can only be the first term, not the subtraction.

@mandarjoshi90
Copy link
Owner

Apologies for the late response. IIRC, I don't think I changed that part of the code from e2e-coref. You could be right, though. At a quick glance, it would seem that it's computing distances between indices of the span pairs. That should still be fine for the mask in the following line but less so for the distances.

@freesunshine0316
Copy link
Author

freesunshine0316 commented Sep 16, 2019

Hi,

Thanks for the reply.

I was worried about the negative values in antecedent_offsets.
Maybe we only need to consider the positive ones (they are real distances), and the negative ones will be masked out later on?

@mandarjoshi90
Copy link
Owner

Right. The bucket_distance function will mask out the negative values.

@freesunshine0316
Copy link
Author

freesunshine0316 commented Sep 24, 2019

Hi,

I'm still confused after taking another close look. My understanding is that top_antecedent_offsets will contains negative values, since antecedent_offsets has negative values.
As a result, there will be some unexpected behavior within bucket_distance function, as it calculates the log value of top_antecedent_offsets.

@freesunshine0316
Copy link
Author

Also, I think maybe the top_fast_antecedent_scores in
https://github.com/mandarjoshi90/coref/blob/master/independent.py#L324 needs to be updated along with the loop, since top_span_emb gets updated after every iteration.

@mandarjoshi90
Copy link
Owner

Maybe? I suspect it doesn't matter since the slow scores are doing the heavy lifting. Happy to accept a PR though if you're seeing an improvement with that change :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants