What is the correct use of GATE NLP Python's 'RemoveAnn' action? #190
-
Can anyone help me with the correct use of GATE NLP Python's RemoveAnn' action (gatenlp.pam.pampac.actions RemoveAnn - Whilst adding annotations with PAMPAC is ok, I can't seem to then remove the annotation. For example, here I add an annotation to the word 'cat', then try to remove the annotation:
Output:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I ended up writing this, but am I just doing it wrong in the beginning?
|
Beta Was this translation helpful? Give feedback.
-
Thank you for spotting this, this is a bug! Still needs investigation, but it has to do with Annotation ownership. The pampac API is still work in progress and will get changed based on feedback and requirements from the users. |
Beta Was this translation helpful? Give feedback.
-
One of the reasons why this did not work was because the annotation in the input annotation list used by Pampac was a shallow copy of the original annotation and since those instances were different, the remove did not work. A shallow copy was used because the annotation specification This has now been changed/fixed on the development trunk by making two changes:
Your example should now work with the latest development code (after changing We will create a bugfix release for this soon! Thanks again for reporting this! |
Beta Was this translation helpful? Give feedback.
One of the reasons why this did not work was because the annotation in the input annotation list used by Pampac was a shallow copy of the original annotation and since those instances were different, the remove did not work. A shallow copy was used because the annotation specification
annspec=[("", "Token")]
could contain annotations with identical ids from different sets.This has now been changed/fixed on the development trunk by making two changes:
annspec
must only use a single setannset
parameter of actions has been replaced byannset_name
so that the set actually used is always derived from the document being processed.Your example should now work with the latest develop…