Skip to content

Error in ipyannotations.text.MulticlassLabeller when used with Superintendent #42

Description

@morenobonaventura

Versions

  • ipyannotations==0.5.1
  • superintendent==0.6.0
  • voila==0.4.0

Minimal script to reproduce (running via voila==0.4.0)

from superintendent import Superintendent
from IPython.display import display
from ipyannotations.text import MulticlassLabeller

label_classes = ['one', 'two', 'three']
labelling_widget = MulticlassLabeller(options=label_classes, allow_freetext=False)

if __name__ == '__main__':
    widget = Superintendent(labelling_widget=labelling_widget)
    a = [123, 123, 123]
    widget.add_features([a, a, a])
    display(widget)

Getting the following error with this minimal script

AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_997/63846817.py in <module>
      4 
      5 label_classes = ['one', 'two', 'three']
----> 6 labelling_widget = MulticlassLabeller(options=label_classes, allow_freetext=False)
      7 
      8 if __name__ == '__main__':

/opt/conda/lib/python3.7/site-packages/ipyannotations/text/classification.py in __init__(self, options, max_buttons, allow_freetext, *args, **kwargs)
     79             display_function=_text_display_function,
     80             *args,
---> 81             **kwargs,
     82         )  # type: ignore
     83 

/opt/conda/lib/python3.7/site-packages/ipyannotations/generic/multiclassification.py in __init__(self, options, allow_freetext, display_function, *args, **kwargs)
     67         self._fixed_options = [option for option in self.options]
     68         self._freetext_timestamp = 0.0
---> 69         self.freetext_widget.on_submit(self.freetext_submission)
     70 
     71         self.children = [

AttributeError: 'HBox' object has no attribute 'on_submit'

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions