You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# Reinforcement Learning-based Persuasion for a Conversational Agent to Support Behavior Change
2
2
3
-
This is the code for the conversational agent Sam that suggests preparatory activities for smoking cessation and becoming more physically active in 5 separate sessions. This conversational agent was used in a longitudinal study with more than 500 participants with the goal of gathering data for and testing a personalized reinforcement learning (RL)-based persuasion algorithm.
3
+
This is the code for the conversational agent Sam that suggests preparatory activities for smoking cessation and becoming more physically active in five separate sessions. This conversational agent was used in a longitudinal study with more than 500 participants with the goal of gathering data for and testing a personalized reinforcement learning (RL)-based persuasion algorithm. The study was run on the online platform Prolific.
4
4
5
5
6
6
## Experiment Flow
7
7
8
8
- Recruitment in Prolific
9
9
- Pre-screening
10
10
- Pre-qeusttionnaire
11
-
-5 conversational sessions
11
+
-Five conversational sessions
12
12
- Sessions 1-2: People are persuaded based on a randomly chosen persuasion type.
13
13
- Sessions 3-5: After session 2, participants are assigned to one of four groups or experimental conditions. Based on their group, they are then subsequently persuaded by:
14
14
1) a persuasion type with the highest effort score,
@@ -22,7 +22,7 @@ Please refer to our [OSF pre-registration](https://osf.io/k2uac) for more detail
22
22
23
23
## Dialog Flow
24
24
25
-
The figure below visualizes the structure of the 5 conversational sessions.
25
+
The figure below visualizes the structure of the five conversational sessions.
@@ -97,6 +97,25 @@ The preparatory activities are provided in the files "Activities.csv"/"Activitie
97
97
In our experiment, we hosted the conversational agent on a Google compute instance with Rasa X 0.33.2 and Docker containers. As the required setup differs slightly from running the agent locally, the corresponding files are provided in the "server_stuff"-folder. This includes, for example, a Dockerfile for running the custom action code in a separate Docker container.
98
98
99
99
100
+
## Running the Agent
101
+
102
+
### Locally
103
+
104
+
To run the conversational agent locally:
105
+
106
+
1) Install the python package Rasa 2.0.2.
107
+
2) Navigate to the folder this Readme-file is in, and type `rasa run --cors "*"` in a command window.
108
+
3) Create the database by running the file "init_db.py." Make sure to adapt the database path to "chatbot.db" in the "init_db.py"-file before running the database intialization script.
109
+
4) Open a separate command window and type `rasa run actions --actions actions -vv` to start the custom action server.
110
+
5) Open the frontend ("index.html") with specifying a userid in the URL as described in the section on the frontend.
111
+
6) Chat with the conversational agent. By default, the agent will start with session 1. You can proceed to session 2 by changing the starting intent in "index.html." To proceed to session 3, you need to create several files such as the file "assignment.csv" that contains people's assignment to experimental conditions.
112
+
113
+
114
+
### On a server
115
+
116
+
The agent can also be run on a server with Rasa X, as done in our experiment. Necessarily files for this can be found in the folder "server_stuff."
117
+
118
+
100
119
## License
101
120
102
121
Copyright (C) 2021 Delft University of Technology.
0 commit comments