public:t-malv-15-3:8
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
public:t-malv-15-3:8 [2015/10/06 13:00] – orvark | public:t-malv-15-3:8 [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 10: | Line 10: | ||
The exercise can be divided into two distinct parts: | The exercise can be divided into two distinct parts: | ||
- | - 1. Semantic analysis of the natural language input using a parser and a grammar with semantic attachments, | + | - Semantic analysis of the natural language input using a parser and a grammar with semantic attachments, |
- | - 2. EvaluatingtheFOLrepresentationoftheinputagainstamodelcreated | + | - Evaluating the FOL representation of the input against a model created |
===== 1. Parsing using " | ===== 1. Parsing using " | ||
- | **Semantic analysis of the natural language input using a parser and a grammar with semantic attachments, | + | **Semantic analysis of the natural language input using a parser and a grammar with semantic attachments, |
You can perform syntax-driven semantic analysis of the natural language input sentence (as seen in chapters 18.1 and 18.2 in the text book) by building a NLTK parser from a " | You can perform syntax-driven semantic analysis of the natural language input sentence (as seen in chapters 18.1 and 18.2 in the text book) by building a NLTK parser from a " | ||
Line 27: | Line 27: | ||
>>> | >>> | ||
>>> | >>> | ||
- | ... | + | ... |
all z2.(dog(z2) -> exists z1.(bone(z1) & give(angus, | all z2.(dog(z2) -> exists z1.(bone(z1) & give(angus, | ||
</ | </ | ||
Line 71: | Line 71: | ||
m = nltk.Model(val.domain, | m = nltk.Model(val.domain, | ||
- | m.evaluate(" | + | m.evaluate(" |
</ | </ | ||
Line 78: | Line 78: | ||
===== 3. Interactive python script ===== | ===== 3. Interactive python script ===== | ||
- | Once you have the two parts working you glue them together in a python script. You should allow users to type in sentences and see their truth value printed until they finally type " | + | Once you have the two parts working you glue them together in a python script. You should allow users to type in sentences and see their truth value printed until they finally type " |
< | < | ||
Line 90: | Line 90: | ||
</ | </ | ||
+ | **Note** that '' |
/var/www/cadia.ru.is/wiki/data/attic/public/t-malv-15-3/8.1444136449.txt.gz · Last modified: 2024/04/29 13:32 (external edit)