facebookresearch / clevr-dataset-gen

A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning
Other
577 stars 204 forks source link

Question classification #7

Closed manoja328 closed 6 years ago

manoja328 commented 6 years ago

Is there a way to know which category does a question belong to ? i.e count , exist , compare numbers etc. Thanks.

JensNevens commented 6 years ago

Hello @manoja328

In de dataset, every question has a key question_family_index. However, I have yet to find out in what order the question templates are numbered. It would indeed be great to have this information (e.g. in the question generation README file)

manoja328 commented 6 years ago

I think i figured it out. The paper says that in each entries in the JSON files the categories are the last

entries of the ground truth program. set([ ent['program'][-1].get('function') for ent in js['questions']])

I made a dict of classes based on that:

categories = {'count': ['count'], 'compare-attribute':[ 'equal_color', 'equal_material', 'equal_shape', 'equal_size'],

'exist': ['exist'],

'compare-numbers':[ 'greater_than', 'less_than', 'equal_integer'],

'query-attribute':[ 'query_color', 'query_material', 'query_shape', 'query_size'] }

jcjohnson commented 6 years ago

@manoja328 This is correct - the final element of the program in the JSON file determines the type of the question.

@JensNevens The question_family_index is even more fine-grained; it determines which of the question templates was used to generate the question. There are potentially many templates for each question type, and in general questions from the same template will have the same type.