Examples of Hungarian Sentence Analysis with NLTK ~> 3.2.1
Gerő Dávid Péter (2014) Egyszerű magyar mondatok kezelése NLTK környezetben. Hungarian sentence analysis in NLTK, BA/BSc, Szegedi Tudományegyetem. [http://diploma.bibl.u-szeged.hu/51272/]
- I recommend to use Anaconda
- Python
~> 3.5(It includes in Anaconda 3)
conda build .easy_install install nltk| Word | Stem |
|---|---|
| Péter | Péter |
| szereti | szeret |
| Enikőt | Enikő |
| és | és |
| Marit | Mari |
| Word | Stem |
|---|---|
| Péter | péter |
| szereti | szeret |
| Enikőt | enikő |
| és | és |
| Marit | mar |
$ python examples/unigramm_tagger.py
[('Péter', 'N'), ('Enikő', 'N'), ('szeret', 'V'), ('Marit', 'Nacc')]$ python examples/word_tokenizer.py
Szeretnék
kérni
tőled
egy
óriási
szívességet
.A True sentence: Egy asztal poros ~> a table is dusty
The sentence: 'egy asztal poros'
The parsed tree: '(S[SEM=<exists x.(-alive(x) & -agent(x))>]
(NP[SEM=<\P.exists x.(-alive(x) & P(x))>]
(Det[SEM=<\Q P.exists x.(Q(x) & P(x))>] egy)
(N[SEM=<\x.-alive(x)>] asztal))
(VP[SEM=<\x.-agent(x)>] (V[SEM=<\x.-agent(x)>] poros)))'
The semantic formula: 'exists x.(-alive(x) & -agent(x))'
The semantic value: 'True'A False sentence: egy asztal fut ~> a table runs
The sentence: 'egy asztal fut'
The parsed tree: '(S[SEM=<exists x.(-alive(x) & agent(x))>]
(NP[SEM=<\P.exists x.(-alive(x) & P(x))>]
(Det[SEM=<\Q P.exists x.(Q(x) & P(x))>] egy)
(N[SEM=<\x.-alive(x)>] asztal))
(VP[SEM=<\x.agent(x)>] (V[SEM=<\x.agent(x)>] fut)))'
The semantic formula: 'exists x.(-alive(x) & agent(x))'
The semantic value: 'False'

