-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
factgenie/utils.py
Outdated
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
factgenie/utils.py
Outdated
final_message_html = markdown.markdown(config["final_message"]) | ||
display_overlay = config.get("display_overlay", True) | ||
|
||
content = content.replace("{ FACTGENIE_PLACEHOLDER: instructions }", instructions_html) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
…ndering the template
Automatically configures the crowdsourcing page based on the instructions entered when creating the campaign.
We include three text segments:
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