Skip to content
Discussion options

You must be logged in to vote

Hi @MaticBernik,

It's likely that the current implementation of the REL component needs to be further improved for more realistic use-cases other than the simplistic case that the example project & video dealt with.

Now I have problem with get_loss function, as the sizes of truths and scores do not match and therefore gradient can't be calculated.

I think this is due to how the function _examples_to_truth is implemented.
Where it says

for (e1, e2) in self.model.attrs["get_instances"](eg.reference):

(L190 in the original code),
you should try changing this to getting the instances from eg.predicted instead of eg.reference. I would assume that that will resolve your dimension shape issue…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@polm
Comment options

@MaticBernik
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MaticBernik
Comment options

@svlandeg
Comment options

Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / ner Feature: Named Entity Recognizer feat / rel Feature: Relation Extractor
3 participants