Oracle¶
-
class
tupa.oracle.
Oracle
(passage)[source]¶ Bases:
object
Oracle to produce gold transition parses given UCCA passages To be used for creating training data for a transition-based UCCA parser :param passage gold passage to get the correct edges from
Methods Summary
action
(edge[, kind, direction])generate_actions
(state)Determine all zero-cost action according to current state :param state: current State of the parser :return: generator of Action items to perform generate_log
(invalid, state)get_actions
(state, all_actions[, create])Determine all zero-cost action according to current state Asserts that the returned action is valid before returning :param state: current State of the parser :param all_actions: Actions object used to map actions to IDs :param create: whether to create new actions if they do not exist yet :return: dict of action ID to Action get_label
(state, node)need_label
(node)remove
(edge[, node])str
(sep)Methods Documentation
-
generate_actions
(state)[source]¶ Determine all zero-cost action according to current state :param state: current State of the parser :return: generator of Action items to perform
-
get_actions
(state, all_actions, create=True)[source]¶ Determine all zero-cost action according to current state Asserts that the returned action is valid before returning :param state: current State of the parser :param all_actions: Actions object used to map actions to IDs :param create: whether to create new actions if they do not exist yet :return: dict of action ID to Action
-