Fix affiliation missing when using DL affiliation-address model #1166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).grobid/grobid-core/src/main/java/org/grobid/core/engines/AffiliationAddressParser.java
Line 81 in a95d253
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:
grobid/grobid-core/src/test/java/org/grobid/core/engines/AffiliationAddressParserTest.java
Line 262 in bd93a61
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.