Skip to content

return configuration processing parameters in response header#1274

Merged
lfoppiano merged 7 commits intomasterfrom
feature/add-processing-parameters-in-response-header
Apr 16, 2025
Merged

return configuration processing parameters in response header#1274
lfoppiano merged 7 commits intomasterfrom
feature/add-processing-parameters-in-response-header

Conversation

@lfoppiano
Copy link
Copy Markdown
Member

@lfoppiano lfoppiano commented Apr 3, 2025

This PR proposes to add part of the configuration parameters that have been sent to the server for processing (see comment in #1253), in the response header, information such as sentenceSegmentation? True/False, model flavor, coordinates, etc..

The proposal for the header would be

            <appInfo>
                <application version="0.8.2-SNAPSHOT" ident="GROBID" when="2025-04-11T07:00+0000">
                    <desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
                    <label type="revision">123456</desc>
                    <label type="parameters">startPage=-1, endPage=-1, consolidateCitations=0, consolidateHeader=0, consolidateFunders=0, includeRawAffiliations=false, includeRawCitations=false, includeRawCopyrights=false, generateTeiIds=false, generateTeiCoordinates=[], flavor=null</desc>
                    <ref target="https://github.com/kermitt2/grobid"/>
                </application>
            </appInfo>

@kermitt2 Would this be an acceptable approach?
@laurentromary any comment or suggestions on TEI side?

UPDATE: I've removed @revision and moved under label @type=revision to be compliant with the TEI guidelines.

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 3, 2025

Coverage Status

coverage: 40.558% (+0.05%) from 40.506%
when pulling 3070362 on feature/add-processing-parameters-in-response-header
into 7fa0582 on master.

@lfoppiano lfoppiano marked this pull request as draft April 5, 2025 23:36
@lfoppiano
Copy link
Copy Markdown
Member Author

lfoppiano commented Apr 11, 2025

The git revision is not always available, for example when grobid is run in intellij idea calling directly the main class, we've return unknown for both version and revision.

            <appInfo>
                <application version="unknown" ident="GROBID" when="2025-04-11T07:46+0000">
                    <desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
                    <label type="revision">unknown</label>
                    <label type="parameters">startPage=-1, endPage=-1, consolidateCitations=0, consolidateHeader=0, consolidateFunders=0, includeRawAffiliations=false, includeRawCitations=false, includeRawCopyrights=false, generateTeiIds=false, generateTeiCoordinates=[], flavor=null</label>
                    <ref target="https://github.com/kermitt2/grobid"/>
                </application>
            </appInfo>

When we run with ./gradlew run we've got:

          <appInfo>
                <application version="0.8.2-SNAPSHOT" ident="GROBID" when="2025-04-11T07:14+0000">
                    <desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
                    <label type="revision">812314141</label>
                    <desc type="parameters">startPage=-1, endPage=-1, consolidateCitations=0, consolidateHeader=0, consolidateFunders=0, includeRawAffiliations=false, includeRawCitations=false, includeRawCopyrights=false, generateTeiIds=false, generateTeiCoordinates=[], flavor=null</desc>
                    <ref target="https://github.com/kermitt2/grobid"/>
                </application>
            </appInfo>

However the revision is not working when running ./gradlew run from intellij

@lfoppiano lfoppiano marked this pull request as ready for review April 11, 2025 07:50
@lfoppiano lfoppiano force-pushed the feature/add-processing-parameters-in-response-header branch 7 times, most recently from 61d5b3b to 4381cb8 Compare April 11, 2025 13:04
@lfoppiano lfoppiano force-pushed the feature/add-processing-parameters-in-response-header branch from 4381cb8 to 3070362 Compare April 11, 2025 13:21
@lfoppiano lfoppiano merged commit b631fd7 into master Apr 16, 2025
10 checks passed
@lfoppiano lfoppiano deleted the feature/add-processing-parameters-in-response-header branch April 16, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants