Can't get the flagging button in the UI with ner.manual interface

to-be-released
usage
solved

#1

I am running a ner.make-gold recipe in combination with a pretrained model to help with the already learned Labels. I am also using a custom theme (with altered colours of the labels highlights to make annotation even faster as seeing colors is faster than reading the labels )

Now when I tried to add the flagging option in the PRODIGY.JSON, it doesnt seem to show in the UI (nor does the shortcut ‘f’ works). I have tried to put “show_flag”: true in different places, but no luck.

Is it possible to have the flagging option with ner.make-gold while using a custom pretrained model to suggest labels during annotation?

bellow is my PRODIGY.JSON

{
    "theme": "basic",
    "custom_theme": {
        "show_flag": true,
        "labels": {
            "L1": "#ffecb3",
            "L2": "#ffdf80",
            "L3": "#ffc61a",
            "L4": "#e6e600",
            "L5": "#ccffd9",
            "L6": "#80ff9f",
            "L7": "#ccddff",
        }
    }
}

(Ines Montani) #2

Hi! I think there might be a small typo in your JSON config: you’ve added the "show_flag": true in the "custom_theme" object, which is only really for theme/color customisations. To be recognised by Prodigy, the setting needs to be at the root level. Could you edit your config and try again?


#3

Hi, thanks for the fast reply!

yes I’ve already tried different places within the hierarchy of the prodigy.json and it didn’t worked

i just tried again without success the following

{
    "show_flag": true,
    "theme": "basic",
    "custom_theme": {
        "labels": {
            "L1": "#ffecb3",
            "L2": "#ffdf80",
            "L3": "#ffc61a",
            "L4": "#e6e600",
            "L5": "#ccffd9",
            "L6": "#80ff9f",
            "L7": "#ccddff",
        }
    }
}

p.s. and thanks for the hint for handy json formatter in posts

p.p.s I also tried to force flagging through the ner.make-gold recipe, by editing the original recipe and adding “show_flag”: True in the config return part of the recipe, but didnt worked as well.


(Ines Montani) #4

Do you have any other prodigy.json or .prodigy.json config files that set "show_flag": false, e.g. in your home directory or your project directory?

Your local config in your working directory will overwrite the global config, and that combined config will then overwrite the pre-defined recipe config. The idea behind it is that you can set custom personal preferences on your machine (like, a theme), project-specific settings (like, the batch size or UI behaviour) for the current directory, and the more generic defaults in the recipes themselves.


#5

Do you have any other prodigy.json or .prodigy.json config files that set "show_flag": false , e.g. in your home directory or your project directory?

Just searched my environment, and this is the only prodigy.json file, it is located in C:\Users\ivo\.prodigy
so seems no override.

However just a guess… since the manual recipe contains a div which holds the label names (the top purple block). Perhaps the flag button is below them in the html? Although the shortcut ‘f’ should have worked.


(Ines Montani) #6

Thanks for checking! And hmm, this is definitely strange :thinking:

Yeah, I was wondering this, too. It might be related to a small fix I made to make the header sticky for very large tasks. I’ll need to investigate this and try to reproduce it. At least, if the suspicion is correct, I should be able to give you one small line to add to the "global_css" setting that fixes it.

So you pressed f, saved and then checked the examples in the dataset and they didn’t have "flagged": true? If so, then yes, that’s confusing, yes…


#7

It just doesn’t respond to f, doesn’t give next examples


(Ines Montani) #8

Ohh, ok – the f should only set "flagged": true on the task, and not do anything else. Sorry if this was confusing or misleading. In addition, you’d still have to accept/reject/ignore the task. This allows you to flag any task, regardless of the answer (e.g. to investigate it further, export it as a nice example for your annotation manual or to show your colleague etc.)

The visual indicator in the UI is that the flag icon turns red – but in this case, it’s not happening because the flag icon is covered by the title bar.


#9

thanks for the clarification

now I pressed f during anotating, and exported the example.

{“text”:“xxxxxxx”,"_input_hash":1348581759,"_task_hash":-1734402925,“tokens”:[{“text”:“xxxxxxx”,“start”:0,“end”:7,“id”:0}],“spans”:[],"flagged":true,“answer”:“accept”}

so It looks like it is flagged indeed, and it is just not visible due to the div holder for the labels


(Ines Montani) #10

Ok, this was definitely the explanation then. I found the problem and already fixed it for the next release. In the meantime, try adding the following at the root of your prodigy.json:

"global_css": ".c0126 { z-index: 110 }",

#11

i just added it and no improvement. The flagg button is still not visible

here is the JSON

{
	"global_css": ".c0126 { z-index: 110 }",
	"show_flag": true,
	"theme": "basic",
	"custom_theme": {
        "labels": {
			"L1": "#ffecb3",
			"L2": "#ffdf80",
			"L3": "#ffc61a",
			"L4": "#e6e600",
			"L5": "#ccffd9",
			"L6": "#80ff9f",
			"L7": "#ccddff",
        }
    }
}

(Ines Montani) #12

Hmm, are you on the latest version of Prodigy? Here’s how it should look:


#13

Prodigy 1.7.1
OS: Windows


#14

I have also reduced the labels to make room for the flag , but it doesn’t show


(Ines Montani) #15

That’s very mysterious! I really don’t see how this wouldn’t work :thinking:

Could you do me a favour and go into your browser’s developer console, right-click on <html> and copy the markup of the whole page to a .html file? (In Firefox, this should be called “Edit as HTML”).

It’ll be quite large, but you should be able to drag and drop the file into the reply text field here, just like images. Alternatively, you can also email it over.


#16

html_dump.html (25.4 KB)
here. I hope i did it right

btw I am using Chrome browser, but just tried it with Firefox, and the flag is not visible there as well


(Ines Montani) #17

Thanks so much! Here’s are more stable fix for you:

"global_css": "button[title=\"Flag task\"] { z-index: 110 }"

(I assume the class names would be consistent at runtime, but turns out they’re not. So the class I gave you worked for my setup, but not for yours.)


#18

Thanks a lot! that fix worked indeed.