-
Notifications
You must be signed in to change notification settings - Fork 0
/
emmorphrest.py
21 lines (17 loc) · 1021 Bytes
/
emmorphrest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python3
# -*- coding: utf-8, vim: expandtab:ts=4 -*-
from xtsv import pipeline_rest_api, singleton_store_factory
em_morph_stem = ('emmorphpy.emmorphpy', 'EmMorphPy', 'stem', (),
{'task': 'stem', 'source_fields': {'form'}, 'target_fields': ['anas']})
em_morph_analyze = ('emmorphpy.emmorphpy', 'EmMorphPy', 'analyze', (),
{'task': 'analyze', 'source_fields': {'form'}, 'target_fields': ['anas']})
em_morph_dstem = ('emmorphpy.emmorphpy', 'EmMorphPy', 'dstem', (),
{'task': 'dstem', 'source_fields': {'form'}, 'target_fields': ['anas']})
tools = [(em_morph_stem, ('stem',)),
(em_morph_analyze, ('analyze',)),
(em_morph_dstem, ('dstem',)),
]
app = pipeline_rest_api('emMorph', tools, {}, conll_comments=False, singleton_store=singleton_store_factory(),
form_title='emMorph demo', form_type='radio', doc_link='https://github.com/ppke-nlpg/emmorphpy')
if __name__ == '__main__':
app.run(debug=False)