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

Could you guys make a choice to support no NER labels? #34

Open
NaiveOtaku opened this issue Jan 20, 2023 · 0 comments
Open

Could you guys make a choice to support no NER labels? #34

NaiveOtaku opened this issue Jan 20, 2023 · 0 comments

Comments

@NaiveOtaku
Copy link

some thing like the following?
some nlp tasks do not have labels but only want to detect the keyword and their importance.
if I passed label='' there is still a span, and have some extra spaces.
`
color_style = {}
if color:
color_style['color'] = color
if not background:
label_sum = sum(ord(c) for c in label)
background_color = PALETTE[label_sum % len(PALETTE)]
background_opacity = OPACITIES[label_sum % len(OPACITIES)]
background = background_color + background_opacity

if label:

    return (
        span(
            style=styles(
                background=background,
                border_radius=rem(0.33),
                padding=(rem(0.125), rem(0.5)),
                overflow="hidden",
                **color_style,
                **style,
            ))(

            html.escape(body),

            span(
                style=styles(
                    padding_left=rem(0.5),
                    text_transform="uppercase",
                ))(
                span(
                    style=styles(
                        font_size=em(0.67),
                        opacity=0.5,
                    ))(
                    html.escape(label),
                ),
            ),
        )
    )
else:
    return (
        span(
            style=styles(
                background=background,
                border_radius=rem(0.33),
                padding=(rem(0.125), rem(0.5)),
                overflow="hidden",
                **color_style,
                **style,
            ))(

            html.escape(body),

        )
    )`

currently I need modify the original code to achieve this function.
so I hope you guys could add this features to support non label keyword notations. and if there could be a color gradient by just passing point end color and gradient coefficient will be more nice.

another issue.
I don't think the *args support too many items. so I would recommend to passes a list instread of *args.

*args usually used when the args are different but have a limited size. in this case it is not, if we wan't passed a large context it will fail.

when the text is so much the speed will be really slow.

hope you guys could take a look at those issues.

Sincerely.

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

No branches or pull requests

1 participant