-
Notifications
You must be signed in to change notification settings - Fork 327
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 text annotation component to API #227
Comments
Good UX can be selecting highlight text first, then tag. |
@lo5 this came up as a customer feature request again with Prodigy given as a comparison. How feasible is this? |
I can start implementing this once the API is agreed. http://doccano.herokuapp.com/demo/named-entity-recognition/# - seems very neat as of UX. We could maybe also include |
How about this? ui.annotator(
name='foo',
tags=[
ui.annotator_tag(name='p', label='Person', color='$red'),
ui.annotator_tag(name='o', label='Org', color='$green'),
],
items=[
ui.annotator_item(text='Killer Mike', tag='p'),
ui.annotator_item(text=' is a member of the hip hop supergroup '), # no tag
ui.annotator_item(text='Run the Jewels', tag='o'),
],
)` This way, the component can be initialized with annotated text, and the return path can contain an identical data structure:
Note: No |
@mturoci tagged 0.15 for now, but we can ship with 0.14 if ready. |
The http://doccano.herokuapp.com/demo/named-entity-recognition/# example requires a user to first highlight text and click on the entity every time after the selection. It might better to first allow a user to click on an entity eg "ORG" and then select one or more orgs in the text. That way they dont have to keep specifying what the entity is. |
@tkmaker If I understand correctly, you're suggesting that a tag works more like a highlighter? |
Yes similar to what Prodigy does: https://prodi.gy/demo |
OK. @shivam5992 @mtanco? |
@lo5 the proposed solution looks good and will be helpful. |
@mturoci Excellent! Is this available in nightly? Any doc on how to use it? doesnt have to be formal docs. |
@mturoci example is good. Works on nightly |
This is cool. Thanks a lot @mturoci |
Goal
Create a component that allows users to highlight phrases in text content and annotate them.
Intended use
NER tagging. See https://prodi.gy/docs/named-entity-recognition#manual-patterns
Specifics
The component can have two major properties:
tags: List[str]
andcontent: str
. Thecontent
(markdown allowed, like inui.text()
) is rendered as a block of text. Thetags
are rendered as clickable elements that tag the highlighted text.On submit, the component can send this array:
TBD
ui.annotator()
?The text was updated successfully, but these errors were encountered: