Seq2Seq best loss function for bag of sentence output

I am currently experimenting with a seq2seq task for entity and relation extraction.
Given a text, the desired output looks like this:

[name of person] : SKILL : [name of skill] ; [name of other person] : PROJECT : [name of project] ; …

It doesn’t matter how the relations are arranged in the output, it is just important that the relations are correct. So the two elements in the example can also be listed the other way around.
I’m wondering which loss function is the most suitable for that task. Any ideas? Thank you!