udapi.block.zellig_harris package

Submodules

udapi.block.zellig_harris.baseline module

class udapi.block.zellig_harris.baseline.Baseline(args=None)[source]

Bases: udapi.core.block.Block

A block for extraction context configurations for training verb representations using word2vecf.

get_word(node)[source]

Format the correct string representation of the given node according to the block settings.

Parameters:node – A input node.
Returns:A node’s string representation.
print_triple(target_node, context_node, relation_name)[source]

Print to the standard output the context triple according to the block settings.

Parameters:
  • target_node – A target word.
  • context_node – A context word.
  • relation_name – A relation name.
process_node(node)[source]

Extract context configuration for verbs according to (Vulic et al., 2016).

Parameters:node – A node to be process.

udapi.block.zellig_harris.common module

udapi.block.zellig_harris.common.get_node_representation(node, print_lemma=False)[source]

Transform the node into the proper textual representation, as will appear in the extracted contexts.

Parameters:
  • node – An input Node.
  • print_lemma – If true, the node lemma is used, otherwise the node form.
Returns:

A proper node textual representation for the contexts data.

udapi.block.zellig_harris.common.print_triple(node_a, relation_name, node_b, print_lemma=False)[source]

Print to the standard output the context.

udapi.block.zellig_harris.configurations module

class udapi.block.zellig_harris.configurations.Configurations(args=None)[source]

Bases: udapi.core.block.Block

An abstract class for four extracting scenarios.

apply_query(query_id, node)[source]

A generic method for applying a specified query on a specified node.

Parameters:
  • query_id – A name of the query method to be called.
  • node – An input node.
process_node(node)[source]

Extract context configuration for verbs according to (Vulic et al., 2016).

Parameters:node – A node to be process.
process_tree(tree)[source]

If required, print detailed info about the processed sentence.

Parameters:tree – A sentence to be processed.

udapi.block.zellig_harris.csnouns module

class udapi.block.zellig_harris.csnouns.CsNouns(args=None)[source]

Bases: udapi.block.zellig_harris.configurations.Configurations

A block for extraction context configurations for Czech nouns. The configurations will be used as the train data for obtaining the word representations using word2vecf.

process_node(node)[source]

Extract context configurations for Czech nouns.

Parameters:node – A node to be process.

udapi.block.zellig_harris.csverbs module

class udapi.block.zellig_harris.csverbs.CsVerbs(args=None)[source]

Bases: udapi.block.zellig_harris.configurations.Configurations

A block for extraction context configurations for Czech verbs. The configurations will be used as the train data for obtaining the word representations using word2vecf.

process_node(node)[source]

Extract context configurations for Czech verbs.

Parameters:node – A node to be process.

udapi.block.zellig_harris.enhancedeps module

class udapi.block.zellig_harris.enhancedeps.EnhanceDeps(zones='all')[source]

Bases: udapi.core.block.Block

Identify new relations between nodes in the dependency tree (an analogy of effective parents/children from PML). Add these new relations into secondary dependencies slot.

process_node(node)[source]

Enhance secondary dependencies by application of the following rules: 1. when the current node A has a deprel ‘conj’ to its parent B,

create a new secondary dependence (B.parent, B.deprel) to A
  1. when the current node A has a deprel ‘conj’ to its parent B, look at B.children C when C.deprel is in {subj, subjpass, iobj, dobj, compl} and there is no A.children D such that C.deprel == D.deprel, add a new secondary dependence (A, C.deprel) to C
Parameters:node – A node to be process.
udapi.block.zellig_harris.enhancedeps.echildren(node)[source]

Return a list with node’s effective children.

Parameters:node – An input node.
Returns:A list with node’s effective children.
Return type:list
udapi.block.zellig_harris.enhancedeps.enhance_deps(node, new_dependence)[source]

Add a new dependence to the node.deps, but firstly check if there is no such dependence already.

Parameters:
  • node – A node to be enhanced.
  • new_dependence – A new dependence to be add into node.deps.
udapi.block.zellig_harris.enhancedeps.eparent(node)[source]

Return an effective parent for the given node.

The rule for the effective parent - when the current node A has a deprel ‘conj’ to its parent B, return B.parent, otherwise return A.parent.

Parameters:node – An input node.
Returns:An effective parent.
Return type:udapi.core.node.Node

udapi.block.zellig_harris.ennouns module

class udapi.block.zellig_harris.ennouns.EnNouns(args=None)[source]

Bases: udapi.block.zellig_harris.configurations.Configurations

A block for extraction context configurations for English nouns.

The configurations will be used as the train data for obtaining the word representations using word2vecf.

process_node(node)[source]

Extract context configurations for English nouns.

Parameters:node – A node to be process.

udapi.block.zellig_harris.enverbs module

class udapi.block.zellig_harris.enverbs.EnVerbs(args=None)[source]

Bases: udapi.block.zellig_harris.configurations.Configurations

A block for extraction context configurations for English verbs.

The configurations will be used as the train data for obtaining the word representations using word2vecf.

process_node(node)[source]

Extract context configurations for English verbs.

Parameters:node – A node to be process.

udapi.block.zellig_harris.queries module

udapi.block.zellig_harris.queries.en_verb_mydobj(node)[source]

Extract the ‘myobj’ relation.

Module contents