Skip to content

Commit

Permalink
Add appendix
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaran-regan-ie committed Feb 1, 2024
1 parent 1102522 commit 3dc7ad0
Show file tree
Hide file tree
Showing 177 changed files with 2,537 additions and 0 deletions.
2,291 changes: 2,291 additions & 0 deletions docs/appendix.html

Large diffs are not rendered by default.

Binary file added docs/figs/panas_results/Anger-0-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-0-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-0-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-0-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-0-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-1-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-1-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-2-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-2-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-2-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-3-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-3-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-3-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-3-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-4-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-4-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-4-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anger-4-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anxiety-0-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/figs/panas_results/Anxiety-0-2.png
Binary file added docs/figs/panas_results/Anxiety-0-3.png
Binary file added docs/figs/panas_results/Anxiety-0-4.png
Binary file added docs/figs/panas_results/Anxiety-0-5.png
Binary file added docs/figs/panas_results/Anxiety-1-1.png
Binary file added docs/figs/panas_results/Anxiety-1-2.png
Binary file added docs/figs/panas_results/Anxiety-1-3.png
Binary file added docs/figs/panas_results/Anxiety-1-4.png
Binary file added docs/figs/panas_results/Anxiety-1-5.png
Binary file added docs/figs/panas_results/Anxiety-2-1.png
Binary file added docs/figs/panas_results/Anxiety-2-2.png
Binary file added docs/figs/panas_results/Anxiety-2-3.png
Binary file added docs/figs/panas_results/Anxiety-2-4.png
Binary file added docs/figs/panas_results/Anxiety-2-5.png
Binary file added docs/figs/panas_results/Anxiety-3-1.png
Binary file added docs/figs/panas_results/Anxiety-3-2.png
Binary file added docs/figs/panas_results/Anxiety-3-3.png
Binary file added docs/figs/panas_results/Anxiety-3-4.png
Binary file added docs/figs/panas_results/Anxiety-3-5.png
Binary file added docs/figs/panas_results/Depression-0-1.png
Binary file added docs/figs/panas_results/Depression-0-2.png
Binary file added docs/figs/panas_results/Depression-0-3.png
Binary file added docs/figs/panas_results/Depression-0-4.png
Binary file added docs/figs/panas_results/Depression-0-5.png
Binary file added docs/figs/panas_results/Depression-1-1.png
Binary file added docs/figs/panas_results/Depression-1-2.png
Binary file added docs/figs/panas_results/Depression-1-3.png
Binary file added docs/figs/panas_results/Depression-1-4.png
Binary file added docs/figs/panas_results/Depression-1-5.png
Binary file added docs/figs/panas_results/Depression-2-1.png
Binary file added docs/figs/panas_results/Depression-2-2.png
Binary file added docs/figs/panas_results/Depression-2-3.png
Binary file added docs/figs/panas_results/Depression-2-4.png
Binary file added docs/figs/panas_results/Depression-2-5.png
Binary file added docs/figs/panas_results/Depression-3-1.png
Binary file added docs/figs/panas_results/Depression-3-2.png
Binary file added docs/figs/panas_results/Depression-3-3.png
Binary file added docs/figs/panas_results/Depression-3-4.png
Binary file added docs/figs/panas_results/Depression-3-5.png
Binary file added docs/figs/panas_results/Depression-4-1.png
Binary file added docs/figs/panas_results/Depression-4-2.png
Binary file added docs/figs/panas_results/Depression-4-3.png
Binary file added docs/figs/panas_results/Depression-4-4.png
Binary file added docs/figs/panas_results/Depression-5-1.png
Binary file added docs/figs/panas_results/Depression-5-2.png
Binary file added docs/figs/panas_results/Depression-5-3.png
Binary file added docs/figs/panas_results/Depression-5-4.png
Binary file added docs/figs/panas_results/Depression-5-5.png
Binary file added docs/figs/panas_results/Embarrassment-0-1.png
Binary file added docs/figs/panas_results/Embarrassment-0-2.png
Binary file added docs/figs/panas_results/Embarrassment-0-3.png
Binary file added docs/figs/panas_results/Embarrassment-0-4.png
Binary file added docs/figs/panas_results/Embarrassment-0-5.png
Binary file added docs/figs/panas_results/Embarrassment-1-1.png
Binary file added docs/figs/panas_results/Embarrassment-1-2.png
Binary file added docs/figs/panas_results/Embarrassment-1-3.png
Binary file added docs/figs/panas_results/Embarrassment-1-4.png
Binary file added docs/figs/panas_results/Embarrassment-1-5.png
Binary file added docs/figs/panas_results/Embarrassment-2-1.png
Binary file added docs/figs/panas_results/Embarrassment-2-2.png
Binary file added docs/figs/panas_results/Embarrassment-2-3.png
Binary file added docs/figs/panas_results/Embarrassment-2-4.png
Binary file added docs/figs/panas_results/Embarrassment-2-5.png
Binary file added docs/figs/panas_results/Embarrassment-3-1.png
Binary file added docs/figs/panas_results/Embarrassment-3-2.png
Binary file added docs/figs/panas_results/Embarrassment-3-3.png
Binary file added docs/figs/panas_results/Embarrassment-3-4.png
Binary file added docs/figs/panas_results/Embarrassment-3-5.png
Binary file added docs/figs/panas_results/Fear-0-1.png
Binary file added docs/figs/panas_results/Fear-0-2.png
Binary file added docs/figs/panas_results/Fear-0-3.png
Binary file added docs/figs/panas_results/Fear-0-4.png
Binary file added docs/figs/panas_results/Fear-0-5.png
Binary file added docs/figs/panas_results/Fear-1-1.png
Binary file added docs/figs/panas_results/Fear-1-2.png
Binary file added docs/figs/panas_results/Fear-1-3.png
Binary file added docs/figs/panas_results/Fear-1-4.png
Binary file added docs/figs/panas_results/Fear-1-5.png
Binary file added docs/figs/panas_results/Fear-2-1.png
Binary file added docs/figs/panas_results/Fear-2-2.png
Binary file added docs/figs/panas_results/Fear-2-3.png
Binary file added docs/figs/panas_results/Fear-2-4.png
Binary file added docs/figs/panas_results/Fear-2-5.png
Binary file added docs/figs/panas_results/Fear-3-1.png
Binary file added docs/figs/panas_results/Fear-3-2.png
Binary file added docs/figs/panas_results/Fear-3-3.png
Binary file added docs/figs/panas_results/Fear-3-4.png
Binary file added docs/figs/panas_results/Fear-3-5.png
Binary file added docs/figs/panas_results/Fear-4-1.png
Binary file added docs/figs/panas_results/Fear-4-2.png
Binary file added docs/figs/panas_results/Fear-4-3.png
Binary file added docs/figs/panas_results/Fear-4-4.png
Binary file added docs/figs/panas_results/Fear-4-5.png
Binary file added docs/figs/panas_results/Frustration-0-1.png
Binary file added docs/figs/panas_results/Frustration-0-2.png
Binary file added docs/figs/panas_results/Frustration-0-3.png
Binary file added docs/figs/panas_results/Frustration-0-4.png
Binary file added docs/figs/panas_results/Frustration-0-5.png
Binary file added docs/figs/panas_results/Frustration-1-1.png
Binary file added docs/figs/panas_results/Frustration-1-2.png
Binary file added docs/figs/panas_results/Frustration-1-3.png
Binary file added docs/figs/panas_results/Frustration-1-4.png
Binary file added docs/figs/panas_results/Frustration-1-5.png
Binary file added docs/figs/panas_results/Frustration-2-1.png
Binary file added docs/figs/panas_results/Frustration-2-2.png
Binary file added docs/figs/panas_results/Frustration-2-3.png
Binary file added docs/figs/panas_results/Frustration-2-4.png
Binary file added docs/figs/panas_results/Frustration-2-5.png
Binary file added docs/figs/panas_results/Frustration-3-1.png
Binary file added docs/figs/panas_results/Frustration-3-2.png
Binary file added docs/figs/panas_results/Frustration-3-3.png
Binary file added docs/figs/panas_results/Frustration-3-4.png
Binary file added docs/figs/panas_results/Frustration-3-5.png
Binary file added docs/figs/panas_results/Guilt-0-1.png
Binary file added docs/figs/panas_results/Guilt-0-2.png
Binary file added docs/figs/panas_results/Guilt-0-3.png
Binary file added docs/figs/panas_results/Guilt-0-4.png
Binary file added docs/figs/panas_results/Guilt-0-5.png
Binary file added docs/figs/panas_results/Guilt-1-1.png
Binary file added docs/figs/panas_results/Guilt-1-2.png
Binary file added docs/figs/panas_results/Guilt-1-3.png
Binary file added docs/figs/panas_results/Guilt-1-4.png
Binary file added docs/figs/panas_results/Guilt-1-5.png
Binary file added docs/figs/panas_results/Guilt-2-1.png
Binary file added docs/figs/panas_results/Guilt-2-2.png
Binary file added docs/figs/panas_results/Guilt-2-3.png
Binary file added docs/figs/panas_results/Guilt-2-4.png
Binary file added docs/figs/panas_results/Guilt-2-5.png
Binary file added docs/figs/panas_results/Guilt-3-1.png
Binary file added docs/figs/panas_results/Guilt-3-2.png
Binary file added docs/figs/panas_results/Guilt-3-3.png
Binary file added docs/figs/panas_results/Guilt-3-4.png
Binary file added docs/figs/panas_results/Guilt-3-5.png
Binary file added docs/figs/panas_results/Jealousy-0-1.png
Binary file added docs/figs/panas_results/Jealousy-0-2.png
Binary file added docs/figs/panas_results/Jealousy-0-3.png
Binary file added docs/figs/panas_results/Jealousy-0-4.png
Binary file added docs/figs/panas_results/Jealousy-0-5.png
Binary file added docs/figs/panas_results/Jealousy-1-1.png
Binary file added docs/figs/panas_results/Jealousy-1-2.png
Binary file added docs/figs/panas_results/Jealousy-1-3.png
Binary file added docs/figs/panas_results/Jealousy-1-4.png
Binary file added docs/figs/panas_results/Jealousy-1-5.png
Binary file added docs/figs/panas_results/Jealousy-2-1.png
Binary file added docs/figs/panas_results/Jealousy-2-2.png
Binary file added docs/figs/panas_results/Jealousy-3-1.png
Binary file added docs/figs/panas_results/Jealousy-3-2.png
Binary file added docs/figs/panas_results/Jealousy-3-3.png
Binary file added docs/figs/panas_results/factor.zip
Binary file not shown.
70 changes: 70 additions & 0 deletions docs/generate_appendix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import pandas as pd
import re
from pathlib import Path
import os

def create_html_with_images_and_memories(csv_path, image_folder_path, output_html_path):
# Read the CSV file into a DataFrame
df = pd.read_csv(csv_path, delimiter='|')

# Start writing the HTML content
html_content = [
'<!DOCTYPE html>',
'<html lang="en">',
' <head>',
' <meta charset="UTF-8">',
' <title>Can Generative Agents Predict Emotion?</title>',
' <link rel="stylesheet" type="text/css" href="styles.css">',
' </head>',
' <body>',
' <div class="container">',
' <h1 style="margin-top: 50px;"><span class="highlighted-title">Can Generative Agents Predict Emotion?</span><br><br>Appendix</h1>',
' <hp>In this appendix we detail each of the 5-part scenes created from the EmotionBench situations, as well as the emotional response of the agents.</p>',
' </div>',
' <div id="imageContainer" class="container">'
]

# Create a mapping from ID to image filenames
id_to_image = {i: f"{row['Emotion']}-{row['Factor'].split('-')[-1]}-{i%5+1}.png" for i, row in df.iterrows()}

# Iterate over each row in the DataFrame to add the images and memories
for index, row in df.iterrows():
# Get the corresponding image filename
image_filename = id_to_image.get(index)
image_src = f"{image_folder_path}/{image_filename}"
filename_without_extension, _ = os.path.splitext(image_filename)
html_content.append(f' <h3>{filename_without_extension}</h3>')
html_content.append(f' <h4>{row["Situation"]}</h4>')
html_content.append(f' <div class="figure">')
html_content.append(f' <img src="{image_src}" alt="{row["Emotion"]}" style="width:50%;">')
html_content.append(f' </div>')
# Split the memories into a list

memories = row['Memories'].split("~")

html_content.append('<ol>')
for i, memory in enumerate(memories):
html_content.append(f'<li>{memory}</li>')
html_content.append('</ol>')
html_content.append('<br>')

# Close the container div
html_content.append(' </div>')

# Continue with the closing tags for the HTML content
html_content.extend([
' </body>',
'</html>'
])

# Write the HTML content to the specified output file
with open(output_html_path, 'w') as output_file:
output_file.write('\n'.join(html_content))

# Usage example:
csv_file_path = 'situations.csv' # Replace with your actual CSV file path
image_folder = 'figs/panas_results' # Replace with your actual image folder path
output_html = 'appendix.html' # Replace with your actual output HTML file path

# Call the function
create_html_with_images_and_memories(csv_file_path, image_folder, output_html)
176 changes: 176 additions & 0 deletions docs/situations.csv

Large diffs are not rendered by default.

0 comments on commit 3dc7ad0

Please sign in to comment.