Skip to content
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

Implement editing of more complex forms of span annotation: dependencies, co-references #3

Closed
proycon opened this issue Aug 24, 2014 · 9 comments
Assignees
Milestone

Comments

@proycon
Copy link
Owner

proycon commented Aug 24, 2014

No description provided.

@proycon proycon self-assigned this Aug 24, 2014
@proycon proycon added bug and removed bug labels Aug 24, 2014
@proycon
Copy link
Owner Author

proycon commented Mar 28, 2015

Viewing implemented (in branch globviz), editing pending...

@proycon
Copy link
Owner Author

proycon commented Oct 27, 2016

Various of these annotations are implemented using span roles, we need a way of presenting these in the editor, analogous to higher-order annotations (they can be considered a form of that), but with the added complexity that each has a span of its own, whilst the parent span element may also still have wrefs that do not fall under the scope of any role (consider e.g. predicate).

We have several sub issues:

  • a) Implement a select span mechanism per span role
  • b) Enable/disable select span mechanism for the parent span annotation (we may need an extra foliaspec property here)
  • c) Submission of span roles to the back-end, and block creation of the span annotation when required span roles are not provided
  • d) Automatically add annotation fields for required span roles when adding a span annotation (for example a dependency needs a head and a dependent).
  • e) Semantic roles are not span roles but first-order span annotations nested in predicates. How to represent nesting in the editor?
  • f) Syntactic units are not span roles but may be nested to form trees. Same question as e.

@proycon
Copy link
Owner Author

proycon commented Oct 27, 2016

sub-issues a and b have been implemented now.

@proycon
Copy link
Owner Author

proycon commented Nov 4, 2016

Complication regarding subissue c. Span annotation elements have their targets property set to everything in the span, recursing into span roles.
Solution: implemented a scope property that contains all targets with recursion, the targets property now only contains explicit targets.

A mechanism is needed for proper adding of span annotation prior to adding the span roles. Solution: FQL now supports the somewhat patchy ADD.. RESPAN NONE FOR SPAN ID x & ID y & ID z syntax that adds an entity but respans it immediately, even to an empty span if needed.

@proycon
Copy link
Owner Author

proycon commented Nov 7, 2016

Subissue c: Query is formulated with subqueries now but fails in backend:

Query failed: error Forbidden: FoLiA Document Server error: FoLiA error in proycon/example: [ValueError] Unable to add object of type Word to Dependency . Type not allowed as child.

Query was: ADD dependency OF alpino-set WITH class "blah" annotator "proycon" annotatortype "manual" datetime now confidence NONE RESPAN NONE (ADD dep ID "undefined" SPAN  ID WR-P-E-J-0000000001.p.1.s.2.w.6) (ADD hd ID "undefined" SPAN  ID WR-P-E-J-0000000001.p.1.s.2.w.7) FOR SPAN  ID WR-P-E-J-0000000001.p.1.s.2.w.6 & ID WR-P-E-J-0000000001.p.1.s.2.w.7 FORMAT flat RETURN ancestor-target

Traceback:

 File "/home/proycon/lamachine/lib/python3.5/site-packages/foliadocserve-0.5-py3.5.egg/foliadocserve/foliadocserve.py", line 575, in query
    result =  query(doc,False,self.debug >= 2)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/fql.py", line 1884, in __call__
    focusselection, targetselection = self.action(self, targetselector, debug) #selecting focus elements further constrains the target selection (if any), return values will be lists
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/fql.py", line 1655, in __call__
    focusselection.append( target[0].add(action.focus.Class, *target, **action.assignments) ) #handles span annotation too
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 1594, in add
    return layer.append(child,*args,**kwargs)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 4216, in append
    return super(AbstractAnnotationLayer, self).append(child, *args, **kwargs)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 1413, in append
    child = Class(self.doc, *args, **kwargs)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 649, in __init__
    self.append(child)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 4071, in append
    return super(AbstractSpanAnnotation,self).append(child, *args, **kwargs)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 1438, in append
    elif Class or (isinstance(child, AbstractElement) and child.__class__.addable(self, set)): #(prevents calling addable again if already done above)
  File "/home/proycon/lamachine/lib/python3.5/site-packages/PyNLPl-1.1.0-py3.5.egg/pynlpl/formats/folia.py", line 1278, in addable
    raise ValueError("Unable to add object of type " + Class.__name__ + " to " + parent.__class__.__name__ + " " + extra + ". Type not allowed as child.")
[QUERY FAILED] FoLiA Error in proycon/example: [ValueError] Unable to add object of type Word to Dependency . Type not allowed as child.

@proycon
Copy link
Owner Author

proycon commented Nov 7, 2016

Above problem is resolved by proycon/pynlpl@17589ac

@proycon
Copy link
Owner Author

proycon commented Nov 8, 2016

Submission works mostly now, but response+update after submission is not complete yet

@proycon
Copy link
Owner Author

proycon commented Nov 8, 2016

Submission works, resolved by latest foliadocserve update, subissue c should be done now. d was already solved earlier as well. e and f remain.

@proycon
Copy link
Owner Author

proycon commented Dec 5, 2016

Nested span annotation (subissue e/f) mostly works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant