Fix is_http for segmentation model to use token-based detection#669
Fix is_http for segmentation model to use token-based detection#669de-code wants to merge 1 commit into
Conversation
part of eLifePathways/ScienceBeam2.0#88 The segmentation model's FeatureDef called get_str_is_http(), which reads self.is_http. However, SegmentationLineFeaturesProvider reuses a single SegmentationLineFeatures instance and never sets is_http in its line loop, so the feature always returned '0'. Switched to get_str_is_http_token_based() (token_text.lower().startswith ('http')), which matches GROBID's Pattern.compile("http(s)?").find() check on the first token of each line. This affects 11 docs with 287 total Δlabels in the segmentation model, 142 of which cascade into header detection and downstream affiliation extraction.
ScienceBeam Parser EvaluationOverall (280 docs across 6 corpora)grobid 0.9.0-crf (default): 280 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 280 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 280 docs
biorxiv (47 docs)grobid 0.9.0-crf (default): 47 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 47 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 47 docs
ore (49 docs)grobid 0.9.0-crf (default): 49 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 49 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 49 docs
pkp (50 docs)grobid 0.9.0-crf (default): 50 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 50 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 50 docs
scielo_br (50 docs)grobid 0.9.0-crf (default): 50 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 50 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 50 docs
scielo_mx (34 docs)grobid 0.9.0-crf (default): 34 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 34 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 34 docs
scielo_preprints-jats (50 docs)grobid 0.9.0-crf (default): 50 docs | sciencebeam-parser:main-dc866983-20260616.1044 (grobid_crf): 50 docs | sciencebeam-parser:pr-669-fd92fdfd-20260616.1814 (grobid_crf): 50 docs
|
|
For some reasons this actually caused more regressions |
part of https://github.com/eLifePathways/ScienceBeam2.0/issues/102
The segmentation model's FeatureDef called get_str_is_http(), which reads self.is_http. However, SegmentationLineFeaturesProvider reuses a single SegmentationLineFeatures instance and never sets is_http in its line loop, so the feature always returned '0'.
Switched to get_str_is_http_token_based() (token_text.lower().startswith ('http')), which matches GROBID's Pattern.compile("http(s)?").find() check on the first token of each line. This affects 11 docs with 287 total Δlabels in the segmentation model, 142 of which cascade into header detection and downstream affiliation extraction.