lara-martin commited on
Commit
67c54f6
·
verified ·
1 Parent(s): b0876fa

Update FIREBALL.py

Browse files
Files changed (1) hide show
  1. FIREBALL.py +83 -54
FIREBALL.py CHANGED
@@ -82,60 +82,89 @@ class NewDataset(datasets.GeneratorBasedBuilder):
82
  DEFAULT_CONFIG_NAME = "first_domain" # It's not mandatory to have a default configuration. Just use one if it make sense.
83
 
84
  def _info(self):
85
- # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
86
- if self.config.name == "first_domain": # This is the name of the configuration selected in BUILDER_CONFIGS above
87
- features = datasets.Features(
88
- {
89
- "speaker_id": datasets.Value('int64'),
90
- "before_utterances": datasets.Sequence(datasets.Value('string')),
91
- 'combat_state_before': datasets.Dataset.from_pandas(pd.DataFrame(data=data)), #list of dictionaries
92
- 'current_actor': datasets.Sequence( #dictionary
93
- 'name': datasets.Value(dtype='string'),
94
- 'hp': datasets.Value(dtype='string'),
95
- 'class': datasets.Value(dtype='string'),
96
- 'race': datasets.Value(dtype='string'),
97
- 'attacks': datasets.Value(dtype='string'),
98
- 'spells': datasets.Value(dtype='string'),
99
- 'actions': datasets.Value(dtype='string'),
100
- 'effects': datasets.Value(dtype='string'),
101
- 'description': datasets.Value(dtype='string'),
102
- 'controller_id': datasets.Value(dtype='string')
103
- ),
104
- 'commands_norm': datasets.value('string'),
105
- 'automation_results': datasets.value('string'),
106
- 'caster_after': datasets.Sequence( #dictionary
107
- 'name': datasets.Value(dtype='string'),
108
- 'hp': datasets.Value(dtype='string'),
109
- 'class': datasets.Value(dtype='string'),
110
- 'race': datasets.Value(dtype='string'),
111
- 'attacks': datasets.Value(dtype='string'),
112
- 'spells': datasets.Value(dtype='string'),
113
- 'actions': datasets.Value(dtype='string'),
114
- 'effects': datasets.Value(dtype='string'),
115
- 'description': datasets.Value(dtype='string'),
116
- 'controller_id': datasets.Value(dtype='string')
117
- ),
118
- 'targets_after': datasets.Dataset.from_pandas(pd.DataFrame(data=data)), #list of dictionaries
119
- 'combat_state_after': datasets.Dataset.from_pandas(pd.DataFrame(data=data)), #list of dictionaries
120
- 'after_utterances': datasets.Sequence(datasets.Value('string')),
121
- 'utterance_history': datasets.Sequence(datasets.Value('string')),
122
- 'before_idxs': datasets.Sequence(datasets.Value('int16')),
123
- 'before_state_idx': datasets.Value('int16'),
124
- 'command_idxs': datasets.Sequence(datasets.Value('int16')),
125
- 'after_state_idx': datasets.Value('int16'),
126
- 'after_idxs': datasets.Sequence(datasets.Value('int16')),
127
- 'embed_idxs': datasets.Sequence(datasets.Value('int16'))
128
- }
129
- )
130
- else: # This is an example to show how to have different features for "first_domain" and "second_domain"
131
- features = datasets.Features(
132
- {
133
- "sentence": datasets.Value("string"),
134
- "option2": datasets.Value("string"),
135
- "second_domain_answer": datasets.Value("string")
136
- # These are the features of your dataset like images, labels ...
137
- }
138
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  return datasets.DatasetInfo(
140
  # This is the description that will appear on the datasets page.
141
  description=_DESCRIPTION,
 
82
  DEFAULT_CONFIG_NAME = "first_domain" # It's not mandatory to have a default configuration. Just use one if it make sense.
83
 
84
  def _info(self):
85
+
86
+ features = datasets.Features(
87
+ {
88
+ "speaker_id": datasets.Value('int64'),
89
+ "before_utterances": datasets.Sequence(datasets.Value('string')),
90
+ 'combat_state_before': datasets.Sequence(
91
+ {
92
+ 'name': datasets.Value(dtype='string'),
93
+ 'hp': datasets.Value(dtype='string'),
94
+ 'class': datasets.Value(dtype='string'),
95
+ 'race': datasets.Value(dtype='string'),
96
+ 'attacks': datasets.Value(dtype='string'),
97
+ 'spells': datasets.Value(dtype='string'),
98
+ 'actions': datasets.Value(dtype='string'),
99
+ 'effects': datasets.Value(dtype='string'),
100
+ 'description': datasets.Value(dtype='string'),
101
+ 'controller_id': datasets.Value(dtype='string')
102
+ }
103
+ ), #list of dictionaries
104
+ 'current_actor': {
105
+ 'name': datasets.Value(dtype='string'),
106
+ 'hp': datasets.Value(dtype='string'),
107
+ 'class': datasets.Value(dtype='string'),
108
+ 'race': datasets.Value(dtype='string'),
109
+ 'attacks': datasets.Value(dtype='string'),
110
+ 'spells': datasets.Value(dtype='string'),
111
+ 'actions': datasets.Value(dtype='string'),
112
+ 'effects': datasets.Value(dtype='string'),
113
+ 'description': datasets.Value(dtype='string'),
114
+ 'controller_id': datasets.Value(dtype='string')
115
+ }, #dictionary
116
+ 'commands_norm': datasets.value('string'),
117
+ 'automation_results': datasets.value('string'),
118
+ 'caster_after': {
119
+ 'name': datasets.Value(dtype='string'),
120
+ 'hp': datasets.Value(dtype='string'),
121
+ 'class': datasets.Value(dtype='string'),
122
+ 'race': datasets.Value(dtype='string'),
123
+ 'attacks': datasets.Value(dtype='string'),
124
+ 'spells': datasets.Value(dtype='string'),
125
+ 'actions': datasets.Value(dtype='string'),
126
+ 'effects': datasets.Value(dtype='string'),
127
+ 'description': datasets.Value(dtype='string'),
128
+ 'controller_id': datasets.Value(dtype='string')
129
+ }, #dictionary
130
+ 'targets_after': datasets.Sequence(
131
+ {
132
+ 'name': datasets.Value(dtype='string'),
133
+ 'hp': datasets.Value(dtype='string'),
134
+ 'class': datasets.Value(dtype='string'),
135
+ 'race': datasets.Value(dtype='string'),
136
+ 'attacks': datasets.Value(dtype='string'),
137
+ 'spells': datasets.Value(dtype='string'),
138
+ 'actions': datasets.Value(dtype='string'),
139
+ 'effects': datasets.Value(dtype='string'),
140
+ 'description': datasets.Value(dtype='string'),
141
+ 'controller_id': datasets.Value(dtype='string')
142
+ }
143
+ ), #list of dictionaries
144
+ 'combat_state_after': datasets.Sequence(
145
+ {
146
+ 'name': datasets.Value(dtype='string'),
147
+ 'hp': datasets.Value(dtype='string'),
148
+ 'class': datasets.Value(dtype='string'),
149
+ 'race': datasets.Value(dtype='string'),
150
+ 'attacks': datasets.Value(dtype='string'),
151
+ 'spells': datasets.Value(dtype='string'),
152
+ 'actions': datasets.Value(dtype='string'),
153
+ 'effects': datasets.Value(dtype='string'),
154
+ 'description': datasets.Value(dtype='string'),
155
+ 'controller_id': datasets.Value(dtype='string')
156
+ }
157
+ ), #list of dictionaries
158
+ 'after_utterances': datasets.Sequence(datasets.Value('string')),
159
+ 'utterance_history': datasets.Sequence(datasets.Value('string')),
160
+ 'before_idxs': datasets.Sequence(datasets.Value('int16')),
161
+ 'before_state_idx': datasets.Value('int16'),
162
+ 'command_idxs': datasets.Sequence(datasets.Value('int16')),
163
+ 'after_state_idx': datasets.Value('int16'),
164
+ 'after_idxs': datasets.Sequence(datasets.Value('int16')),
165
+ 'embed_idxs': datasets.Sequence(datasets.Value('int16'))
166
+ }
167
+ )
168
  return datasets.DatasetInfo(
169
  # This is the description that will appear on the datasets page.
170
  description=_DESCRIPTION,