forked from lilyguibessette/bwh-pharmacoepi-roybal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActions.py
41 lines (31 loc) · 1.52 KB
/
Actions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# <Dependencies>
from azure.cognitiveservices.personalizer import PersonalizerClient
from azure.cognitiveservices.personalizer.models import RankableAction, RewardRequest, RankRequest
from msrest.authentication import CognitiveServicesCredentials
import datetime, json, os, time, uuid
# Framing Actions
def get_framing_actions():
posFrame = RankableAction(id='posFrame', features=[{"frame": "positive"}])
negFrame = RankableAction(id='negFrame', features=[{"frame": "negative"}])
neutFrame = RankableAction(id='neutFrame', features=[{"frame": "neutral"}])
return [posFrame, negFrame, neutFrame]
# History Actions
def get_history_actions():
yesHistory = RankableAction(id='yesHistory', features=[{"history": 1}])
noHistory = RankableAction(id='noHistory', features=[{"history": 0}])
return [yesHistory, noHistory]
# Social Actions
def get_social_actions():
yesSocial = RankableAction(id='yesSocial', features=[{"social": 1}])
noSocial = RankableAction(id='noSocial', features=[{"social": 0}])
return [yesSocial, noSocial]
# Content Actions
def get_content_actions():
yesContent = RankableAction(id='yesContent', features=[{"content": 1}])
noContent = RankableAction(id='noContent', features=[{"content": 0}])
return [yesContent, noContent]
# Reflective Actions
def get_reflective_actions():
yesReflective = RankableAction(id='yesReflective', features=[{"reflective": 1}])
noReflective = RankableAction(id='noReflective', features=[{"reflective": 0}])
return [yesReflective, noReflective]