Skip to content

Commit 0985a9a

Browse files
committed
describe how to run locally in readme
1 parent 5a78ee0 commit 0985a9a

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Reinforcement Learning-based Persuasion for a Conversational Agent to Support Behavior Change
22

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.
44

55

66
## Experiment Flow
77

88
- Recruitment in Prolific
99
- Pre-screening
1010
- Pre-qeusttionnaire
11-
- 5 conversational sessions
11+
- Five conversational sessions
1212
- Sessions 1-2: People are persuaded based on a randomly chosen persuasion type.
1313
- 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:
1414
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
2222

2323
## Dialog Flow
2424

25-
The figure below visualizes the structure of the 5 conversational sessions.
25+
The figure below visualizes the structure of the five conversational sessions.
2626

2727
<img src = "Images/Dialog_Flow.jpg" width = "400" title="Dialog Flow">
2828

@@ -97,6 +97,25 @@ The preparatory activities are provided in the files "Activities.csv"/"Activitie
9797
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.
9898

9999

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+
100119
## License
101120

102121
Copyright (C) 2021 Delft University of Technology.

0 commit comments

Comments
 (0)