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

Configure crowdsourcing instructions through UI + add them to config #62

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

kasnerz
Copy link
Collaborator

@kasnerz kasnerz commented Aug 5, 2024

Automatically configures the crowdsourcing page based on the instructions entered when creating the campaign.

We include three text segments:

  • instructions
  • prompt for the annotator
  • final message

The instructions are saved in the YAML config and in the campaign metadata.

Additionally, we allow the user to configure checkboxes that the user can check for each example.

Resolves #58
Resolves #9
Helps with #18

@kasnerz kasnerz requested a review from oplatek August 5, 2024 13:27
instructions_html = markdown.markdown(config["annotator_instructions"])
annotator_prompt = config["annotator_prompt"]
final_message_html = markdown.markdown(config["final_message"])
display_overlay = config.get("display_overlay", True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to name it is_display_overlay

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed it to has_display_overlay

final_message_html = markdown.markdown(config["final_message"])
display_overlay = config.get("display_overlay", True)

content = content.replace("{ FACTGENIE_PLACEHOLDER: instructions }", instructions_html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like jinja2 should handle that. Just use {{ something|safe }} so it does not escape it.

Copy link
Collaborator Author

@kasnerz kasnerz Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that first, but there were also Jinja variables to be filled later and these turned out to be problematic.
But the variable were only in the header and the footer, so I solved it by splitting the template into three parts. I guess it's a bit cleaner now.

Copy link
Member

@oplatek oplatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. I am looking forward to test it out (Please go ahead and merge it).

I had only minor remarks - please consider them before merging.

@kasnerz kasnerz merged commit 8525539 into main Aug 7, 2024
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

Successfully merging this pull request may close these issues.

Configure instructions for human annotators through the web interface Extra annotation attributes
2 participants