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

Dynamic Highlighting #83

Open
Naman-Bhrgv opened this issue Jun 15, 2024 · 13 comments
Open

Dynamic Highlighting #83

Naman-Bhrgv opened this issue Jun 15, 2024 · 13 comments

Comments

@Naman-Bhrgv
Copy link

Hi,
I am using Potato for my research, however, I haven't been ale to setup Dynamic Highlighting task.

Reproduction

I tried to include dynamic highlighting for dialogue_analysis task. Added dynamic_key.tsv file path to dialogue-analysis.yaml . Both keyword.tsv and dialogue-analysis.yaml files are present here.

I have attached the snippet of annotation_schemes part of dialogue-analysis.yaml where I have added the path of dynamic_key.tsv file.

"annotation_schemes": [
        {
          "annotation_type": "highlight",
          "name": "certainty",
          "description": "Highlight which phrases make the sentence more or less certain",
          "labels": [
            "certain", "uncertain"
          ],

          # If true, numbers [1-len(labels)] will be bound to each
          # label. Highlight selection annotations with more than 10 are not supported
          # with this simple keybinding and will need to use the full item
          # specification to bind all labels to keys.
          "sequential_key_binding": True,
        },
        {
            "annotation_type": "radio",
            "name": "sentiment",
            "description": "What kind of sentiment does the given text hold?",
            "labels": [
               "positive", "neutral", "negative",
            ],

            # If true, numbers [1-len(labels)] will be bound to each
            # label. Aannotations with more than 10 are not supported with this
            # simple keybinding and will need to use the full item specification
            # to bind all labels to keys.
            "sequential_key_binding": True,     
           "keyword_highlights_file":"dynamic_key.tsv"                      
        },
        
           
    ]

Error Description

From what I understood from documentation, the keywords provided in tsv file will be highlighted automatically. However, even after adding the tsv file, the annotation task doesn't change. Can you tell me how to setup dynamic highlighting.
Thanks in advance!

@Jiaxin-Pei
Copy link
Collaborator

Hi @Naman-Bhrgv,

There are two issues in your current setup.
(1) "keyword_highlights_file":"dynamic_key.tsv" should be added outside "annotation_schemes", for example:

"user_config": {
      "allow_all_users": True,
      "users": [  ],
    },

 "keyword_highlights_file": "dynamic_key.tsv",

(2) In the .tsv file, the column name should be Label instead of labels.

Please fix these two issues and try again.
You can also check our this example project to see how dynamic highlight is configured.

@Naman-Bhrgv
Copy link
Author

Thanks @Jiaxin-Pei it worked for me, btw I am also studying at University of Michigan and this tool has helped me a lot in my research.

@Naman-Bhrgv
Copy link
Author

Hi @Jiaxin-Pei ,
Is there a way to edit the annotation for keywords specified in dynamic highlighting?

@Naman-Bhrgv Naman-Bhrgv reopened this Jun 25, 2024
@davidjurgens
Copy link
Owner

davidjurgens commented Jun 25, 2024 via email

@Naman-Bhrgv
Copy link
Author

No, I meant to edit the label pre-specified for words in the tsv file (which was input of dynamic highlighting).

@Jiaxin-Pei
Copy link
Collaborator

@Naman-Bhrgv Do you mean that you want to do span annotation for the dynamically highlighted words?

@Naman-Bhrgv
Copy link
Author

Yes exactly

@Jiaxin-Pei
Copy link
Collaborator

@Naman-Bhrgv We don't currently support doing span annotations for the dynamically highlighted words. However, if you could describe your task in more detail, I can take a look and see if there are other ways to make it work! We do have some other relevant features that can potentially help!

@davidjurgens
Copy link
Owner

davidjurgens commented Jun 25, 2024 via email

@Jiaxin-Pei
Copy link
Collaborator

@davidjurgens Yes! I think we can either extend the label suggestions or the Dynamic highlighting to support this. Happy to take a look after @Naman-Bhrgv describes his exact use case.

@Naman-Bhrgv
Copy link
Author

@Jiaxin-Pei I am following a two step approach for data annotation. These steps are-

  1. We use spacy to label all the entities in text.
  2. Then we load the text in potato and edit the entities labelled by spacy (incase they are incorrect) and label additional entities in the text.
    Please provide some suggestions for it.

@Jiaxin-Pei
Copy link
Collaborator

Thanks a lot for sharing the details!
I think this is aligned with our development plan on label suggestions. I can prioritize this feature and try to get this up early next week. Would this work for you? @Naman-Bhrgv

@Naman-Bhrgv
Copy link
Author

Naman-Bhrgv commented Jun 26, 2024 via email

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

3 participants