-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vrt-augment-name-attrs
: Add ne
structures based on NER attributes
#19
Open
janiemi
wants to merge
18
commits into
master
Choose a base branch
from
dev-vrt-augment-name-attrs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Handle intra-name tags and comments so that they are kept inside the name. However, cases such as "<tag> nameword1 </tag> nameword2" are tagged as "<tag> <ne> nameword1 </tag> nameword2 </ne>" and "nameword1 <tag> nameword2 </tag>" as "<ne> nameword1 <tag> nameword2 </ne> </tag>", which is not optimal nesting.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Add options --word, --lemma and --nertag for specifying the names of the corresponding positional attributes.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Warn on invalid NER tags and NER end tags without a start tags. - Fix not to crash on an empty NER tag value.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Add nested <ne> structures for NER tags listed in positional attribute nertags2 (name can be specified with --multi-nertag), unless --maximal-only is specified.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Fix not to crash when a nested name ended at the last word of a maximal name.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - VrtNameAttrAugmenter.main: Extract nested function set_attrnums to make the main loop code more compact.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Treat a completely empty nertag attribute value in the same way as "_" (no NER tag).
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Check the validity of NER tag values more precisely: they must match the regexp "(Ena|Nu|Ti)mex[A-Z][a-z]+[A-Z][a-z]+-[BEF](-[0-9]+)?".
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Warn if a name has no end tag within a sentence. - Warn if a name is open at the end of input (which means that the input is incomplete, as a sentence is open, too).
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Allow input without a lemma attribute, in which case the word form is used instead. Nevertheless, warn if the input has no lemma, unless --lemma="" is specified.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Fix the warning "No NER end tag for ... within sentence" to mention the NER tag that is currently open. (Previously, it indicated the value of the nertag attribute of the last word of the sentence.)
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Reword the warning for a missing end tag to 'NER start tag without end tag within sentence: "..."' to be more consistent with other similar warnings. Also change the line number in the warning to refer to the line of the start tag.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Check that NER start and end tag types match, output <ne> structures only if they match and warn on mismatches. This is done for both maximal and nested NER tags. - For nested NER tags, also warn if a tag is already open at the same level as a new start tag.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Show the line number of the actual tag in nested tag warning messages, instead of the last line number of the maximal name.
vrt-tools/libvrt/tools/vrt_augment_name_attrs.py: - Do not output double quotation marks around tag names in warning messages.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
vrt-augment-name-attrs
, a VRT tool to addne
structures (elements) and their attributes (annotations) based on positional NER attributes (nertag2
,nertags2
,nerbio2
) as produced byvrt-finnish-nertag
.Usage:
Tests are included for the tool.