Lamonpy, Latin POS Tagger & Lemmatizer for Python
Project description
Lamon (LAtin MOrphological tools, pronounced /leɪmən/) is a simple POS tagger & lemmatizer for Latin written in C++ and Lamonpy is a Python package of Lamon. You can easily obtain lemma and tag of each word in given text using Lamonpy.
Getting Started
You can install Lamonpy easily using pip. (https://pypi.org/project/lamonpy/)
$ pip install --upgrade pip $ pip install lamonpy
The supported OS and Python versions are:
Linux (x86-64) with Python >= 3.5
macOS >= 10.13 with Python >= 3.5
Windows 7 or later (x86, x86-64) with Python >= 3.5
Other OS with Python >= 3.5: Compilation from source code required (with c++11 compatible compiler)
Here is a simple example using Lamonpy to analyze Latin texts.
from lamonpy import Lamon lamon = Lamon() score, tagged = lamon.tag('In principio creavit Deus caelum et terram.')[0] print(tagged) # `tagged` is a list of tuples `(start_pos, end_pos, lemma, tag)` # [(0, 2, 'in', 'r--------'), # (3, 12, 'principium', 'n-s---nb-'), # (13, 20, 'creo', 'v3sria---'), # (21, 25, 'deus', 'n-s---mn-'), # (26, 32, 'caelus', 'n-s---ma-'), # (33, 35, 'et', 'c--------'), # (36, 42, 'terra', 'n-s---fa-'), # (42, 43, '.', '---------')]
Tagging Model and Its Accuracy
Lamon’s tagging model is based on BiLSTM network trained with Perseus Latin Dependency Treebanks (4,000 sentences) and self-trained with raw Latin corpora (440,000 sentences) collected by Latina Vivense.
Since there is no available standard for evaluating Latin taggers, we built own test set named vivens of 900 sentences. The result of evaluation is shown below:
vivens (900 sents) |
Perseus (4000 sents) |
|||||
---|---|---|---|---|---|---|
lemma |
tag |
both |
lemma |
tag |
both |
|
Lamon |
94.6 |
83.0 |
81.1 |
89.4 |
80.2 |
76.6 |
Lamon (large) |
94.2 |
83.3 |
81.3 |
89.7 |
81.9 |
78.3 |
Lamon (uv.) |
94.4 |
82.6 |
80.7 |
87.7 |
77.9 |
73.8 |
Backoff |
88.1 |
92.4 |
||||
123 POS |
58.1 |
54.8 |
83.8 |
79.6 |
||
CRF POS |
69.1 |
63.4 |
77.3 |
72.9 |
Lamon : base size (embedding_size:80, hidden_size:160)
Lamon (large) : large size (embedding_size:160, hidden_size:320)
Lamon (uv.) : large size without Perseus’ dataset
Backoff : cltk.lemmatize.latin.backoff.BackoffLatinLemmatizer
CRF POS : cltk.tag.pos.POSTag.tag_crf
For calculating both score of 123 POS and CRF POS, Backoff’s results are used.
Since Lamon and all cltk’s tagger are trained with Perseus’ dataset, the scores for Perseus are not significant for confirming the actual accuracy of each model. Rather, it shows that 123 POS and CRF POS are overfitting to Perseus’s dataset.
Because the size of the vivens dataset is small, the results of this evaluation can be inaccurate. We plan to acquire larger dataset for evaluation and publish the dataset to make more accurate evaluation.
Demo
License
Lamonpy is licensed under the terms of MIT License, meaning you can use it for any reasonable purpose and remain in complete ownership of all the documentation you produce.
History
- 0.1.0 (2020-09-26)
the first version of lamonpy
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.
Source Distribution
Built Distributions
Hashes for lamonpy-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e076014bb6b29984243686baf024aecab16a10301c853f51bc40a87c118b3e27 |
|
MD5 | cd871f6445e20e5c0bf912a52bcb643a |
|
BLAKE2b-256 | 798de0ae05a025275e1101131be72158e7cd406e17cf6b71bacc0d685bd8897b |
Hashes for lamonpy-0.1.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d83ebe4af1f1a928e411b56e7add424ea7004e643ba28461d99617936fc551b |
|
MD5 | ad494cf4b0bd90c094f4926ee3d1689f |
|
BLAKE2b-256 | d5699260d0f195dd9700b60fa9b20f58a565d30bf3bfc3ce04d982a34b1072a5 |
Hashes for lamonpy-0.1.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eea12fca981718eb43a13520e9b7dbbe87fcfbfe770eec0b49d0bfca21705931 |
|
MD5 | fb07b9f97a840b63d8f03651895a743c |
|
BLAKE2b-256 | 86c24fd7dd18c17215e1017a3dd09c0c298fe54332aad83369f4fa81260982c3 |
Hashes for lamonpy-0.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be44e5557b3396b0aaf0b4faa758a17a4c748968fe178522b05331449f6b8111 |
|
MD5 | 4f634787143c97d1680b1ce36c1b365e |
|
BLAKE2b-256 | 6b8727cbf303180fa0ae4c2a34474280460a55483658901581b4e8225c1de788 |
Hashes for lamonpy-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3d9b6807ffbffd94d29881092f2c0468b42cd7942faf04f3e8b039292f4fb72 |
|
MD5 | eb309a1957d4b2e739932409a9daf2c4 |
|
BLAKE2b-256 | f54b2603c5981e4cd3b182feab4348d0014eda6b8dfd7ba180e6a34beec4659d |
Hashes for lamonpy-0.1.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a48c10c8edefd848bb58994434628004f1bd120b2525825c44d8c9c1920a0020 |
|
MD5 | 0614f596e5116297c275ca76194a5066 |
|
BLAKE2b-256 | c002b1ef2ef100421bd43e57b06ad963fb0a7918acee8f99549268eb765b1936 |
Hashes for lamonpy-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374fbc6dd654770204ea4abe030642f96ebc7c862d7c16d4c7332e0358697c7c |
|
MD5 | 4dee14402cbd9d28979a1d3ff55727b9 |
|
BLAKE2b-256 | 098f8a1f2bc2f9e9537392608f1e71951afad5edcfeac1692761225d0c927474 |
Hashes for lamonpy-0.1.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 320d85ca96e9ac322045761a19277070f8a585ec003d10016cac6f0863590c4c |
|
MD5 | e01fb77a73d11c2d9df516b32ad1e265 |
|
BLAKE2b-256 | 39f31518c514e870e5b01781be71ea4a76226ba88ed6a6724d09a3d5fe7477a2 |
Hashes for lamonpy-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0de52e792f298eb01453b720c0689bc8e73ae0a79875e28654f2ac2f221f1317 |
|
MD5 | b0300347184e14aedafb7930e730aa16 |
|
BLAKE2b-256 | 4a520b10261cbe1aba826131d0b3ee800c02a189a3c12cd431b7ec0c40e3cf25 |
Hashes for lamonpy-0.1.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 326be93d0b2de055026ef8543c8838b05fd8d8b9f126e960fe949b37aa1277ba |
|
MD5 | 27a97d1f0c25f0aaa54bec8e3ad8eb8a |
|
BLAKE2b-256 | 1238d83f815e442ce21e2b76b31437ea64fc54c51782960fa538c1c75479d397 |
Hashes for lamonpy-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57a9d982b191ac3fa1f1cfab031833ec792027652d67095f2e3172d6efe0320a |
|
MD5 | 8dce6c5db6f12d8acb651324eef491d1 |
|
BLAKE2b-256 | bfdb9940ff89b137c581d28edd0d31109ebe20bd86c2e6f0395ee53c5385292b |
Hashes for lamonpy-0.1.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f6bac80038b3bcd379cc0287eff4433b3b0909158e782fe75ab532cb3b9ffec |
|
MD5 | 3c25efa50c938f1bb1fcb2f52ca1727c |
|
BLAKE2b-256 | 7e54b8236dc240832b62e9b2e4b91068ce2199347dac99f295b98e3467735dac |
Hashes for lamonpy-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc775dcc64369a5f1968e976bfd107a30b89d3759af359ddb67820d2082205ad |
|
MD5 | d2a4ba88c5b221703fadf02e5d37b80a |
|
BLAKE2b-256 | db253905e1acaaddbc82ec5b7a7fe0b2608849a7a12ee4a8a4b392166b8f4f00 |
Hashes for lamonpy-0.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9e83f97d6fd86ab6143635eb60d7191c339a93f5cc241ce0d7fd96eb7c3711f |
|
MD5 | 7c5f1cb9893b54218e138702a53e9378 |
|
BLAKE2b-256 | ae18cdd962a2c9591a6a4e60f28ef27733f963dbed612460ab282a85370473f4 |
Hashes for lamonpy-0.1.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9f97239940c42411a27da3a1d8fed420c32866ea520e6fd4ec1956e5e378e26 |
|
MD5 | fb7305d16024ed3d43b13338a5dda9ff |
|
BLAKE2b-256 | 29a40a97296c63fced362b04c223cb48c9a8103834bcd55ad382627b62a2134f |
Hashes for lamonpy-0.1.0-cp35-cp35m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac1e5ab4f36585f1e7cc5796454763b0f3f5e88273ab5c9e110f7f7529904b6 |
|
MD5 | 355141c41c6fdeb1c632e31c39389ecb |
|
BLAKE2b-256 | ea11a7af1ac4b61ab8808208208e925c279783a6401333a2dfa1ee5fea782f75 |