Skip to content

Commit

Permalink
reformulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xu Yunqiu authored and Xu Yunqiu committed Oct 16, 2020
1 parent e41e486 commit fef869f
Show file tree
Hide file tree
Showing 139 changed files with 29,763 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# SHA-KG
Stacked hierarchical attention for text-based games

This repository contains code for the paper "Deep Reinforcement Learning with Stacked Hierarchical Attention for Text-based Games" by Yunqiu Xu, Meng Fang, Ling Chen, Yali Du, Joey Tianyi Zhou and Chengqi Zhang

## Dependencies

+ Python 3.7
+ pytorch 1.3.1
+ gym 0.17.2
+ jericho 2.4.0
+ networkx 2.4
+ redis 3.4.1
+ Redis 4.0.14
+ Standford CoreNLP 3.9.2


## How to train

+ Modify the port number for redis (default 6381) and corenlp (default 9010) in ``env.py``, ``openie.py`` and ``vec_env.py``
+ Modify the path of corenlp in ``train_shakg.py``
+ Launch redis and corenlp
+ Run the code
```python

python train_shakg.py
```

## Citation

Coming soon


## Acknowledgement

We thank [rajammanabrolu/KG-A2C](https://github.com/rajammanabrolu/KG-A2C) for providing the excellent codebase.

## License

[MIT License]()
143 changes: 143 additions & 0 deletions data/905_entity2id.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
0
luxurious 1
you 2
now_browned 3
dirty_laundry 4
moment 5
las_mesas_*** 6
door 7
get 8
more_slip-ups_on_job 9
clothing_here 10
place 11
house 12
bed 13
our_presentation 14
tougher 15
north 16
south 17
soiled_clothing_here 18
bedroom_to_west 19
dresser 20
driveway 21
car 22
trace 23
driver 24
nicer 25
new_man 26
thing 27
radio 28
dead_of_injuries 29
in_which_driver_'s_license 30
soon_your_rear-view_mirror 31
dead_of_internal_injuries 32
driver_'s_license 33
browned 34
bathroom_this 35
blocked_anyway 36
nine_o'clock_sharp 37
counter 38
bedroom_rings 39
quit 40
man 41
saved_game 42
id_card_here 43
dirty_ones 44
clean_clothing_here 45
v1_.00 46
bathroom_with 47
water 48
east 49
absolute 50
freeway_onramp 51
pop-tart_here 52
toaster 53
dirty_laundry_scattered 54
now_nicely_browned 55
clothing 56
parked_here 57
building 58
your_rear-view_mirror 59
cleaner_clothing 60
in_which_id_card 61
telephone 62
shower 63
extremely_spare 64
soon_'ll_able 65
license 66
have_asleep 67
scattered 68
game 69
soiled_clothing 70
laundry 71
gold_watch 72
this 73
even_tougher 74
very_bad 75
corpse 76
bedroom_bedroom 77
keys_here 78
nicely_browned 79
stop 80
sort_of_maintenance_work 81
gold_watch_here 82
he 83
adam_cadre 84
exit_to_west 85
laundry_scattered 86
kitchenette 87
sort 88
pop-tart 89
that 90
most_of_those_in_neighborhood 91
printers 92
bedroom 93
closed 94
living_room 95
watch 96
'll_able 97
freeway 98
id_card 99
end_table 100
absolute_toilet 101
west 102
wallet 103
can_found 104
bedroom_door 105
restart 106
front_door 107
engine 108
card 109
original_release 110
can_found_in_dresser 111
seedy 112
exit 113
road 114
phone 115
freeway_onramp_approaching 116
liza_daly 117
dead 118
which 119
*** 120
corpse_of_guy 121
driver_'s_license_here 122
toilet 123
how_long_have_asleep 124
looks 125
floor 126
driving 127
bathroom 128
ramp 129
long_have_asleep 130
license_here 131
parked 132
get_first 133
blocked 134
ones 135
spare 136
loungent_building 137
useful 138
stop_here 139
clean_clothing 140
nine_sharp 141
keys 142
86 changes: 86 additions & 0 deletions data/905_relation2id.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
take_off 0
is_spare_with 1
restore 2
pick_up 3
can 4
license_'s 5
put_clothing_into 6
get_out_of 7
is_extremely_spare_with 8
is 9
can_see_gold_watch 10
is_in 11
can_see_keys_in 12
put_keys_on 13
have 14
lies_to 15
once_'s_done_with 16
is_on 17
is_parked_here_in 18
lies 19
take_off_clothing_on 20
was_blocked 21
get_into 22
see 23
wait 24
license_in 25
put_clothing_on 26
can_see_wallet_in 27
is_with 28
put_gold_watch_into 29
take_off_clothing_in 30
bedroom_to 31
can_see_gold_watch_in 32
feel_like 33
crank_up 34
notice 35
put 36
vanish_without 37
put_wallet_on 38
can_also_see_gold_watch 39
get_back_into 40
written_by 41
turn_on 42
put_pop-tart_on 43
first_taking 44
haphazardly_all_over 45
step_into 46
drop 47
get_first_out_of 48
can_see_id_card_in 49
can_see_clothing_in 50
can_see_here 51
open 52
was_blocked_anyway 53
put_keys_into 54
card_in 55
start_up 56
making 57
all_over 58
is_nicer_than 59
would_like 60
is_parked_in 61
's_license_is 62
can_also_see_here 63
tested_by 64
was_at 65
see_corpse_under 66
cruise_down 67
can_also_see 68
suddenly_drop 69
'll 70
put_on 71
put_id_card_into 72
was 73
are_on 74
keep 75
have_died 76
can_see 77
put_wallet_into 78
merge_onto 79
has 80
put_id_card_on 81
taking 82
put_gold_watch_on 83
revealing 84
'll_have 85
Loading

0 comments on commit fef869f

Please sign in to comment.