spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Default Color in displacy

Open yanaiela opened this issue 4 years ago • 10 comments

Currently there's a default background color for entities in displacy It would be nice to be able to provide with a different default color.

It seems like a pretty easy change as there's already a colors variable being passed to the function. So a potential fix can simply provide it with another variable (e.g. default_color) and if it exists, use this as the color instead of the default one.

yanaiela avatar Sep 12 '21 10:09 yanaiela

Thanks for the suggestion! I think we'd be happy to take a PR for that.

polm avatar Sep 13 '21 04:09 polm

There is a bg option when rendering POS dependencies (eg displacy.render(doc, style="dep", options={"bg":"ivory"}) but this option does not seem to be available when visualising named entities (displacy.render(doc, style="ent")).

psychemedia avatar Sep 24 '21 10:09 psychemedia

Hi, can I work on this issue ?

Kaustbh avatar Mar 18 '24 13:03 Kaustbh

Sure, we would welcome a PR!

FYI - here is some relevant help for getting start with contributing to the code base: https://github.com/explosion/spaCy/blob/master/CONTRIBUTING.md#contributing-to-the-code-base

svlandeg avatar Mar 19 '24 09:03 svlandeg

I tried changing the background color for entities , take a look at pictures below ,

before -: before

after -: after

please guide i am doing the right thing , or it is something different.

Kaustbh avatar Apr 29 '24 06:04 Kaustbh