[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
external:tectomt:tutorial [2009/01/22 13:14]
kravalova
external:tectomt:tutorial [2009/01/22 14:06]
kravalova
Line 160: Line 160:
   * Each bundle contains tree shaped sentence representations on various linguistic layers. In our example ''sample.tmt'' we have morphological tree (''SEnglishM'') in each bundle. Later on, also an analytical layer (''SEnglishA'') will appear in each bundle as we proceed with our analysis.    * Each bundle contains tree shaped sentence representations on various linguistic layers. In our example ''sample.tmt'' we have morphological tree (''SEnglishM'') in each bundle. Later on, also an analytical layer (''SEnglishA'') will appear in each bundle as we proceed with our analysis. 
   * Trees are formed by nodes and edges. Attributes can be attached only to nodes. Edge's attributes must be stored as the lower node's attributes. Tree's attributes must be stored as attributes of the root node.   * Trees are formed by nodes and edges. Attributes can be attached only to nodes. Edge's attributes must be stored as the lower node's attributes. Tree's attributes must be stored as attributes of the root node.
 +
  
  
Line 238: Line 239:
  
 <code bash> <code bash>
-SEnglishM_to_SEnglishA::McD_parser_local MT_PARAM_MCD_EN_MODEL=conll_mcd_order2_0.1.model \+SEnglishM_to_SEnglishA::McD_parser_local TMT_PARAM_MCD_EN_MODEL=conll_mcd_order2_0.1.model \
 </code> </code>
  
Line 321: Line 322:
   * ''$node<nowiki>-></nowiki>set_attr($attr_name, $attr_value)''   * ''$node<nowiki>-></nowiki>set_attr($attr_name, $attr_value)''
  
-Some interesting attributes on morphologic layer are ''form'', ''lemma'' and ''tag''. Some interesting attributes on analytical layer are ''afun'' (analytical function) and ''ord'' (surface word order). To reach ''form'', ''lemma'' or ''tag'' from analytical layer, that is, when calling this attribute on an ''a-node'', you use ''$a_node->get_attr('m/form')'' and the same way for ''lemma'' and ''tag''. The easiest way to see the node attributes is to click on the node in TrEd:+Some interesting attributes on morphologic layer are ''form'', ''lemma'' and ''tag''. Some interesting attributes on analytical layer are ''afun'' (analytical function) and ''ord'' (surface word order). To reach ''form'', ''lemma'' or ''tag'' from analytical layer, that is, when calling this attribute on an ''a-node'', you use ''$a_node<nowiki>-></nowiki>get_attr('m/form')'' and the same way for ''lemma'' and ''tag''. The easiest way to see the node attributes is to click on the node in TrEd:
  
 <code bash> <code bash>
Line 365: Line 366:
 ==== Task ==== ==== Task ====
 A block which, given an analytical tree (''SEnglishA''), fills each ''a-node'' with boolean attribute ''is_clause_head'' which is set to ''1'' if the ''a-node'' corresponds to a finite verb, and to ''0'' otherwise. A block which, given an analytical tree (''SEnglishA''), fills each ''a-node'' with boolean attribute ''is_clause_head'' which is set to ''1'' if the ''a-node'' corresponds to a finite verb, and to ''0'' otherwise.
 +
 +
  
  
Line 416: Line 419:
   * ''my @eff_children = $node<nowiki>-></nowiki>get_eff_children()''   * ''my @eff_children = $node<nowiki>-></nowiki>get_eff_children()''
  
-//Note//: ''get_children()'' returns topological node children in a tree, while ''get_eff_children()'' returns node children in a linguistic sense. Mostly, these do not differ. If interested, see Figure 1 in [[http://ufal.mff.cuni.cz/pdt2.0/doc/tools/tred/bn-tutorial.html|btred tutorial]].+//Note//: ''get_children()'' returns topological node children in a tree, while ''get_eff_children()'' returns node children in a linguistic sense. Mostly, these do not differ. If interested, see Figure 1 in [[http://ufal.mff.cuni.cz/pdt2.0/doc/tools/tred/bn-tutorial.html#i-effective|btred tutorial]].
  
 //Hint//: Finite clauses in English usually require grammatical subject to be present. //Hint//: Finite clauses in English usually require grammatical subject to be present.
Line 457: Line 460:
   * Once you have the node ''$object'' and the node ''$verb'', use the method ''$object<nowiki>-></nowiki>shift_before_node($verb)''. This method takes the whole subtree under the node ''$object'' and recalculates the attributes ''ord'' (surface word order) so that all the nodes in the subtree under ''$object'' have a smaller ''ord'' than ''$verb''. That is, the method rearranges the surface word order from VO to OV.   * Once you have the node ''$object'' and the node ''$verb'', use the method ''$object<nowiki>-></nowiki>shift_before_node($verb)''. This method takes the whole subtree under the node ''$object'' and recalculates the attributes ''ord'' (surface word order) so that all the nodes in the subtree under ''$object'' have a smaller ''ord'' than ''$verb''. That is, the method rearranges the surface word order from VO to OV.
  
-**Advanced version**: This solution shifts object (or more objects) of a verb just in front of that verb node. So f.e.: //Mr. Brown has urged MPs.// changes to: //Mr. Brown has MPs urged.// You can try to change this solution, so the final sentence would be: //Mr. Brown MPs has urged.// You may need a method ''$node->shift_after_subtree($root_of_that_subtree)''. Subjects should have attribute '''afun' eq 'Sb'''.+**Advanced version**: This solution shifts object (or more objects) of a verb just in front of that verb node. So f.e.: //Mr. Brown has urged MPs.// changes to: //Mr. Brown has MPs urged.// You can try to change this solution, so the final sentence would be: //Mr. Brown MPs has urged.// You may need a method ''$node<nowiki>-></nowiki>shift_after_subtree($root_of_that_subtree)''. Subjects should have attribute '''afun' eq 'Sb'''.
  
  

[ Back to the navigation ] [ Back to the content ]