Skip to content

Commit

Permalink
Add empathy example (#27)
Browse files Browse the repository at this point in the history
* Add empathy example

* Add empathy example

* Edit readme
  • Loading branch information
naitian authored Dec 22, 2022
1 parent 258905e commit 94b300c
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ Potato aims to improve the replicability of data annotation and reduce the cost

![plot](./images/gif_reply.gif)

### Empathy as Appraisal (paired texts + likert)
[yaml config](https://github.com/davidjurgens/potato/tree/master/example-projects/empathy) | [Paper](https://aclanthology.org/2020.emnlp-main.45.pdf)

[launch] python3 potato/flask_server.py example-projects/empathy/configs/empathy.yaml -p 8000
[Annotate] http://localhost:8000/
![plot](./images/empathy.png)


## Design Team and Support

Potato is run by a small and engergetic team of academics doing the best they can. For support, please leave a issue on this git repo. Feature requests and issues are both welcomed!
Expand Down
80 changes: 80 additions & 0 deletions example-projects/empathy/configs/empathy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"annotation_task_name": "Empathy Annotation",

# Potato will write the annotation file for all annotations to this
# directory, as well as per-annotator output files and state information
# necessary to restart annotation.
"output_annotation_dir": "annotation_output/empathy/",

# The output format for the all-annotator data. Allowed formats are:
# * jsonl
# * json (same output as jsonl)
# * csv
# * tsv
#
"output_annotation_format": "csv",

# If annotators are using a codebook, this will be linked at the top to the
# instance for easy access
"annotation_codebook_url": "",

"data_files": [
"example-projects/empathy/data_files/empathy.json"
],

# Both the target and observer comments are elements in a list referenced by the "text" key.
# See `example-projects/empathy/data_files/empathy.json` for details
"item_properties": {
"id_key": "id",
"text_key": "text",
},

# To convert the list into a string, we use `list_as_text` as shown below.
"list_as_text": {
"text_list_prefix_type": 'none',
},


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


"annotation_schemes": [
{
"annotation_type": "likert",
"name": "rating",
"description": "To what extent does the observer's appraisal of the situation match that of the target speaker?",
"min_label": "Not at all",
"max_label": "Completely",
"size": 5,
"sequential_key_binding": True,
}
],

# The html that changes the visualiztation for your task. Change this file
# to influence the layout and description of your task. This is not a full
# HTML page, just the piece that does lays out your task's pieces
"html_layout": "templates/examples/plain_layout.html",

# The core UI files for Potato. You should not need to change these normally.
#
# Exceptions to this might include:
# 1) You want to add custom CSS/fonts to style your task
# 2) Your layout requires additional JS/assets to render
# 3) You want to support additional keybinding magic
#
"base_html_template": "templates/base_template.html",
"header_file": "templates/header.html",


# How many seconds do you want the annotators spend on each instance, after
# that, an alert will be sent per alert_time_each_instance seconds.
"alert_time_each_instance": 10000000,


# This is where the actual HTML files will be generated
"site_dir": "potato/templates/",

}
2 changes: 2 additions & 0 deletions example-projects/empathy/data_files/empathy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{ "id": "0", "text": [ "<strong>Target: </strong>My cat died, and I feel very sad about it.", "<strong>Observer: </strong>Oh my gosh, I'm so sorry to hear that. When my cat died it really affected me, too."] }
{ "id": "1", "text": [ "<strong>Target: </strong>I just can't beat the third level of Super Mario Brothers and it's totally ruining my day.", "<strong>Observer: </strong>Ugh yeah, that's so frustrating."] }
Binary file added images/empathy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94b300c

Please sign in to comment.