Fix affiliation missing when using DL affiliation-address model by lfoppiano · Pull Request #1166 · grobidOrg/grobid (original) (raw)
This PR propose a fix for the affiliation, that are lost when processing them with a DL model.
The issue seems to be in the method: getAffiliationBlocksFromSegments() where new \n are added (in general they should be added if there is a misalignment, however they are added for sure at the beginning).
I patched quickly by checking that end is not zero. However this \n does not work well with the DL models, at contrary with the CRF models that they are ignoring it.
I've left two tests which are showing the problem from both CRF and DL: https://github.com/kermitt2/grobid/blob/bd93a61f4542f218299e2c34a82c37b75bc727ef/grobid-core/src/test/java/org/grobid/core/engines/AffiliationAddressParserTest.java#L262
The DL test is still failing, as I'm not sure really where to fix the issue.
After this is fix we would need to rebuild the grobid-full image.