Repository navigation
Check generated POS tagset against the expected POS tagset in CI #35
Copy link
Copy link
Open
Description
Summary
In the future it would be good to have a step in the CI pipeline that checks the POS tags within a language's generated POS tagset (generated_pos_tagset.tsv) against the expected POS tags given within that language's pos resource, and fails the CI if any generated tag is not in the pos resource.
Background
- The
posresource type in language_resources.json points to a user created POS tagset file, which states the POS tagset that the language's lexicon files are expected to use. See the POS tagset file format section (TagandDefinitioncolumns). create_pos_tagsets.pycreatesgenerated_pos_tagset.tsvper language folder from the POS tags actually used within the language's single and MWE lexicon files (POSandCountcolumns). See the Generated POS Tagsets section.- At the moment the
posresource files are not used to check the lexicon files, nor the generated POS tagsets, andcreate_pos_tagsets.pyis not run in CI. Therefore a lexicon file can use a POS tag that is not in the stated tagset and nothing will flag it.
Proposal
Add a script and CI step that, for each language that has a pos resource in language_resources.json:
- Reads the expected POS tags from the
Tagcolumn of theposresource file. - Reads the POS tags from the
POScolumn of the language'sgenerated_pos_tagset.tsv. - Fails the CI (non-zero exit code) if any generated POS tag is not within the expected POS tags, printing the offending tags.
Matching rules
- One direction only: the CI only fails when a tag in the generated POS tagset is missing from the
posresource. Tags that are in theposresource but not in the generated POS tagset (not used by any lexicon file) do not fail the CI. - Wildcard tag
*: this is a valid implicit POS value (see the Implicit POS section), it is allowed to be in the generated POS tagset without being in theposresource. - Case sensitive: tags are compared exactly. As
create_pos_tagsets.pylower cases all POS tags before saving them, this script would have to be adjusted so that it can compare case sensitive tags while also maintaining it's current function.
Prerequisites
This issue is blocked by issue #34 , which has to be resolved first.
Points to decide
- Regenerating in CI: should CI run
create_pos_tagsets.pyto get fresh generated files before comparing, rather than trusting the committedgenerated_pos_tagset.tsvfiles?
Acceptance criteria
- Issue Add a
posresource to every language and addtagset name/tagset urlmeta data #34 is resolved. - A script exists that performs the comparison for all languages.
- The CI fails when a generated POS tag is not in the
posresource, with a clear message of the offending tags. - The CI passes when all generated POS tags (other than
*) are in theposresource, even if theposresource has additional tags. - The README documents the check.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
posresource to every language and addtagset name/tagset urlmeta data #34