Python wrapper for VDU NLP online services
Project description
vdu-nlp-services
Function Reference
Reference
analyze_text
Perform morphological analysis
from vdu_nlp_services import analyze_text
res = analyze_text(u'Laba diena!', include_lemmas=True)
print (res)
([{u'lemma': u'laba diena', u'word': u'Laba diena', u'type': u'jst.'}, {u'sep': u'!'}, {u'p': None}], [{u'lemma': u'laba diena', 'span': (0, 4), u'word': u'Laba', u'type': u'jst.'}, {'other': u' ', 'span': (4, 5)}, {u'lemma': u'laba diena', 'span': (5, 10), u'word': u'diena', u'type': u'jst.'}, {'other': u'!', 'span': (10, 11)}])
stress_text
Accentuate text
from vdu_nlp_services import stress_text
res = stress_text(u'Laba diena!')
print (res)
'Laba` diena`!'
stress_word
Accentuate word
from vdu_nlp_services import stress_word
res = stress_word(u'Laba')
for stressed_word, tags in res:
print(stressed_word, list(tags))
Laba` ['dktv.', 'mot.gim.', 'vnsk.', 'Įn.']
La~ba ['dktv.', 'mot.gim.', 'vnsk.', 'Š.']
Laba` ['bdvr.', 'mot.gim.', 'vnsk.', 'V.', 'neįvardž.']
Laba` ['bdvr.', 'mot.gim.', 'vnsk.', 'Įn.', 'neįvardž.']
La~ba ['bdvr.', 'mot.gim.', 'vnsk.', 'Š.', 'neįvardž.']
La~ba ['bdvr.', 'bevrd.gim.', 'neįvardž.']
Install
PyPi
pip install vdu-nlp-services
Git
pip install git+https://github.com/aleksas/vdu-nlp-services.git
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.