Closed yuhangjiang22 closed 1 year ago
Sorry for the late response! Hmm, I think this should work fine, but any special tokens ("@predicate@"
) would need to be added to the vocabulary. You can just follow the existing configs to set this up. The steps are:
ent_tokens
listrel_tokens
list with your list of special relation type tokensThe @@UNKNOWN@@
token comes from AllenNLP, and it gets used anytime the model tries to generate/copy a token outside the vocabulary.
Thanks for helping me on that! I think it works now. I also need to save the last epoch model to output directory, is there anywhere to mention in the config file?
If I remember correctly this is controlled by the arguments to "trainer"
and "checkpointer"
in the config. Right now, our configs will save the single best model evaluated during training
and evaluation frequency is controlled by the "should_validate_callback"
I think by modifying the arguments to "trainer"
, "checkpointer"
and "should_validate_callback"
you should be able to achieve what you want. The AllenNLP documentation might be helpful here :)
Closing! Please feel free to re-open if you are still having trouble.
I am using Seq2rel on a dataset that only has a unique entity type. So, I'm thinking if I can remove the @entity_type@ token, to make the output to be like
entity1 ; entity2 ; entity3 @predicate@
The problem I've found is that after training, the output sometimes contains
unknown
token.For example of what I've got,
Could you please let me know if there's a way of solving this?