neon.data.questionanswer.QA

class neon.data.questionanswer.QA(story, query, answer)[source]

Bases: neon.data.dataiterator.NervanaDataIterator

A general QA container to take Q&A dataset, which has already been vectorized and create a data iterator to feed data to training.

__init__(story, query, answer)[source]

Methods

__init__(story, query, answer)
gen_class(pdict)
get_description([skip]) Returns a dict that contains all necessary information needed to serialize this object.
nbatches() Return the number of minibatches in this dataset.
recursive_gen(pdict, key) helper method to check whether the definition
reset() For resetting the starting index of this dataset back to zero.
be = None
classnm

Returns the class name.

gen_class(pdict)
get_description(skip=[], **kwargs)

Returns a dict that contains all necessary information needed to serialize this object.

Parameters:skip (list) – Objects to omit from the dictionary.
Returns:Dictionary format for object information.
Return type:(dict)
modulenm

Returns the full module path.

nbatches()

Return the number of minibatches in this dataset.

recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object

reset()[source]

For resetting the starting index of this dataset back to zero. Relevant for when one wants to call repeated evaluations on the dataset but don’t want to wrap around for the last uneven minibatch Not necessary when ndata is divisible by batch size