lara-martin
commited on
Update FIREBALL.py
Browse files- FIREBALL.py +64 -63
FIREBALL.py
CHANGED
@@ -21,6 +21,7 @@ import jsonlines
|
|
21 |
import os
|
22 |
|
23 |
import datasets
|
|
|
24 |
|
25 |
|
26 |
# TODO: Add BibTeX citation
|
@@ -78,86 +79,86 @@ class Fireball(datasets.GeneratorBasedBuilder):
|
|
78 |
|
79 |
def _info(self):
|
80 |
|
81 |
-
features =
|
82 |
{
|
83 |
-
# "speaker_id":
|
84 |
-
"before_utterances": datasets.Sequence(
|
85 |
'combat_state_before': datasets.Sequence(
|
86 |
{
|
87 |
-
'name':
|
88 |
-
'hp':
|
89 |
-
'class':
|
90 |
-
'race':
|
91 |
-
'attacks':
|
92 |
-
'spells':
|
93 |
-
'actions':
|
94 |
-
'effects':
|
95 |
-
'description':
|
96 |
-
'controller_id':
|
97 |
}
|
98 |
), #list of dictionaries
|
99 |
# 'current_actor': {
|
100 |
-
# 'name':
|
101 |
-
# 'hp':
|
102 |
-
# 'class':
|
103 |
-
# 'race':
|
104 |
-
# 'attacks':
|
105 |
-
# 'spells':
|
106 |
-
# 'actions':
|
107 |
-
# 'effects':
|
108 |
-
# 'description':
|
109 |
-
# 'controller_id':
|
110 |
# }, #dictionary
|
111 |
-
'commands_norm':
|
112 |
-
'automation_results':
|
113 |
'caster_after': {
|
114 |
-
'name':
|
115 |
-
'hp':
|
116 |
-
'class':
|
117 |
-
'race':
|
118 |
-
'attacks':
|
119 |
-
'spells':
|
120 |
-
'actions':
|
121 |
-
'effects':
|
122 |
-
'description':
|
123 |
-
'controller_id':
|
124 |
}, #dictionary
|
125 |
'targets_after': datasets.Sequence(
|
126 |
{
|
127 |
-
'name':
|
128 |
-
'hp':
|
129 |
-
'class':
|
130 |
-
'race':
|
131 |
-
'attacks':
|
132 |
-
'spells':
|
133 |
-
'actions':
|
134 |
-
'effects':
|
135 |
-
'description':
|
136 |
-
'controller_id':
|
137 |
}
|
138 |
), #list of dictionaries
|
139 |
'combat_state_after': datasets.Sequence(
|
140 |
{
|
141 |
-
'name':
|
142 |
-
'hp':
|
143 |
-
'class':
|
144 |
-
'race':
|
145 |
-
'attacks':
|
146 |
-
'spells':
|
147 |
-
'actions':
|
148 |
-
'effects':
|
149 |
-
'description':
|
150 |
-
'controller_id':
|
151 |
}
|
152 |
), #list of dictionaries
|
153 |
-
'after_utterances': datasets.Sequence(
|
154 |
-
'utterance_history': datasets.Sequence(
|
155 |
-
'before_idxs': datasets.Sequence(
|
156 |
-
'before_state_idx':
|
157 |
-
'command_idxs': datasets.Sequence(
|
158 |
-
'after_state_idx':
|
159 |
-
'after_idxs': datasets.Sequence(
|
160 |
-
'embed_idxs': datasets.Sequence(
|
161 |
}
|
162 |
)
|
163 |
return datasets.DatasetInfo(
|
|
|
21 |
import os
|
22 |
|
23 |
import datasets
|
24 |
+
from datasets import Features
|
25 |
|
26 |
|
27 |
# TODO: Add BibTeX citation
|
|
|
79 |
|
80 |
def _info(self):
|
81 |
|
82 |
+
features = Features(
|
83 |
{
|
84 |
+
# "speaker_id": Value('int64'),
|
85 |
+
"before_utterances": datasets.Sequence(Value('string')),
|
86 |
'combat_state_before': datasets.Sequence(
|
87 |
{
|
88 |
+
'name': Value(dtype='string'),
|
89 |
+
'hp': Value(dtype='string'),
|
90 |
+
'class': Value(dtype='string'),
|
91 |
+
'race': Value(dtype='string'),
|
92 |
+
'attacks': Value(dtype='string'),
|
93 |
+
'spells': Value(dtype='string'),
|
94 |
+
'actions': Value(dtype='string'),
|
95 |
+
'effects': Value(dtype='string'),
|
96 |
+
'description': Value(dtype='string'),
|
97 |
+
'controller_id': Value(dtype='string')
|
98 |
}
|
99 |
), #list of dictionaries
|
100 |
# 'current_actor': {
|
101 |
+
# 'name': Value(dtype='string'),
|
102 |
+
# 'hp': Value(dtype='string'),
|
103 |
+
# 'class': Value(dtype='string'),
|
104 |
+
# 'race': Value(dtype='string'),
|
105 |
+
# 'attacks': Value(dtype='string'),
|
106 |
+
# 'spells': Value(dtype='string'),
|
107 |
+
# 'actions': Value(dtype='string'),
|
108 |
+
# 'effects': Value(dtype='string'),
|
109 |
+
# 'description': Value(dtype='string'),
|
110 |
+
# 'controller_id': Value(dtype='string')
|
111 |
# }, #dictionary
|
112 |
+
'commands_norm': Value('string'),
|
113 |
+
'automation_results': Value('string'),
|
114 |
'caster_after': {
|
115 |
+
'name': Value(dtype='string'),
|
116 |
+
'hp': Value(dtype='string'),
|
117 |
+
'class': Value(dtype='string'),
|
118 |
+
'race': Value(dtype='string'),
|
119 |
+
'attacks': Value(dtype='string'),
|
120 |
+
'spells': Value(dtype='string'),
|
121 |
+
'actions': Value(dtype='string'),
|
122 |
+
'effects': Value(dtype='string'),
|
123 |
+
'description': Value(dtype='string'),
|
124 |
+
'controller_id': Value(dtype='string')
|
125 |
}, #dictionary
|
126 |
'targets_after': datasets.Sequence(
|
127 |
{
|
128 |
+
'name': Value(dtype='string'),
|
129 |
+
'hp': Value(dtype='string'),
|
130 |
+
'class': Value(dtype='string'),
|
131 |
+
'race': Value(dtype='string'),
|
132 |
+
'attacks': Value(dtype='string'),
|
133 |
+
'spells': Value(dtype='string'),
|
134 |
+
'actions': Value(dtype='string'),
|
135 |
+
'effects': Value(dtype='string'),
|
136 |
+
'description': Value(dtype='string'),
|
137 |
+
'controller_id': Value(dtype='string')
|
138 |
}
|
139 |
), #list of dictionaries
|
140 |
'combat_state_after': datasets.Sequence(
|
141 |
{
|
142 |
+
'name': Value(dtype='string'),
|
143 |
+
'hp': Value(dtype='string'),
|
144 |
+
'class': Value(dtype='string'),
|
145 |
+
'race': Value(dtype='string'),
|
146 |
+
'attacks': Value(dtype='string'),
|
147 |
+
'spells': Value(dtype='string'),
|
148 |
+
'actions': Value(dtype='string'),
|
149 |
+
'effects': Value(dtype='string'),
|
150 |
+
'description': Value(dtype='string'),
|
151 |
+
'controller_id': Value(dtype='string')
|
152 |
}
|
153 |
), #list of dictionaries
|
154 |
+
'after_utterances': datasets.Sequence(Value('string')),
|
155 |
+
'utterance_history': datasets.Sequence(Value('string')),
|
156 |
+
'before_idxs': datasets.Sequence(Value('int16')),
|
157 |
+
'before_state_idx': Value('int16'),
|
158 |
+
'command_idxs': datasets.Sequence(Value('int16')),
|
159 |
+
'after_state_idx': Value('int16'),
|
160 |
+
'after_idxs': datasets.Sequence(Value('int16')),
|
161 |
+
'embed_idxs': datasets.Sequence(Value('int16'))
|
162 |
}
|
163 |
)
|
164 |
return datasets.DatasetInfo(
|