-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Outline
We have some annotations in the document metadata that we want to access. But the project view does not include them and gives an empty result.
Description:
We have a layer for answer preference where the user chooses between 2 answers and gives a reason. The layer is of type Document metadata since the annotation is document-level.
All our other layers are span-level and the library can read those out.
For this specific case,
preference_layer = "webanno.custom.Answerpreferencev1"
print(f'Features: {project.features(preference_layer)}')
feature = 'Reason'
feature_path = f'{preference_layer}>{feature}'
# select reduced view
reduced_pref_annos = project.select(
annotation=feature_path,
annotators=['jim', 'jam'],
source_files=["x.txt", "y.txt"]
)
print('# pref. annotations in view:', reduced_pref_annos.count())
print('# annotations per file per annotator', reduced_pref_annos.count(grouped_by=['source_file', 'annotator']))
And the result is:
# pref. annotations in view: 0
# annotations per file per annotator Series([], Name: annotation, dtype: int64)
Metadata
Metadata
Assignees
Labels
No labels