User Tools

Site Tools


public:t-malv-15-3:8

Differences

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

Link to this comparison view

public:t-malv-15-3:8 [2015/10/08 07:54]
orvark [3. Interactive python script]
public:t-malv-15-3:8 [2015/10/08 08:53] (current)
orvark [3. Interactive python script]
Line 90: Line 90:
 </code> </code>
  
-**Note** that ''tree.label()['SEM']'' returns an object of type ''nltk.sem.logic.ApplicationExpression'' and not a string even if you can print it out. To use it in ''evaluate()'' it has to be turned into a string. The simplest way to do that is to use the expression ''"%s" % semantic_representation'' which returns a string.+**Note** that ''tree.label()['SEM']'' returns an object of type ''nltk.sem.logic.ApplicationExpression'' (as can be seen by checking its type with ''type()'') and not a string even though you can print it out. To use it in ''evaluate()'' it has to be turned into a string. The simplest way to do that is to use ''str(semantic_expression)'' or the format operator ''"%s" % semantic_representation'' which return a string.
/var/www/ailab/WWW/wiki/data/attic/public/t-malv-15-3/8.1444290852.txt.gz ยท Last modified: 2015/10/08 07:54 by orvark