diff --git a/README b/README index eea3104e5191fee9e28b9991e805304aa8e44284..491db2a1c098e8cc9e951448182f267d642464f8 100644 --- a/README +++ b/README @@ -4,15 +4,19 @@ Istitute of Informatics, Wrocław University of Technology http://nlp.pwr.wroc.pl/redmine/projects/wcrft/wiki - Dependencies: -* Python 2.6 with headers -* SWIG -* CRF++ with Python support (install CRF++ itself first, then enter the `python' subdir and install Python wrappers); http://crfpp.googlecode.com/svn/trunk/doc/index.html -* corpus2 library (http://nlp.pwr.wroc.pl/redmine/projects/libpltagger/wiki) installed with Python support -* MACA library (http://nlp.pwr.wroc.pl/redmine/projects/libpltagger/wiki) installed with Python support +* g++ 4.6.3 +* CRF++ - http://crfpp.googlecode.com/svn/trunk/doc/index.html +* Corpus2 library (http://nlp.pwr.wroc.pl/redmine/projects/libpltagger/wiki) +* MACA library (http://nlp.pwr.wroc.pl/redmine/projects/libpltagger/wiki) * Morfeusz SGJP (http://sgjp.pl/morfeusz/index.html), please install it before installing MACA so that it also builds Morfeusz plugin -* wccl library (http://nlp.pwr.wroc.pl/redmine/projects/joskipi/wiki) installed with Python support +* WCCL library (http://nlp.pwr.wroc.pl/redmine/projects/joskipi/wiki) + +WCRFT (Wrocław CRF Tagger) is a simple morpho-syntactic tagger for Polish. + +The tagger combines tiered tagging, conditional random fields (CRF) and features tailored for inflective languages written in WCCL. The algorithm and code are inspired by Wrocław Memory-Based Tagger. WCRFT uses CRF++ API as the underlying CRF implementation. + +Tiered tagging is assumed. Grammatical class is disambiguated first, then subsequent attributes (as defined in a config file) are taken care of. Each attribute is treated with a separate CRF and may be supplied a different set of feature templates. The tagger is able to tag morphologically analysed input (sentences divided into tokens, tokens assigned lists of candidate interpretations). If you need to tag plain text, it is recommended to use MACA for the analysis (http://nlp.pwr.wroc.pl/redmine/projects/libpltagger/wiki). @@ -32,13 +36,12 @@ There are two possibilities with respect to placement of the model: Basic usage: The package comes with ready-made configuration for tagging (NCP, nkjp.pl) tagset. The configuration is config/nkjp.ini. A configuration specifies parameter values and points to a file with features used for different layers. To get a working tagger, a TRAINED MODEL is also needed. You can obtain one by training the tagger with a reference corpus and storing the model to a given directory, for instance: -wcrft/wcrft.py -d path/to/nkjp_model config/nkjp_s2.ini --train path/to/training-corpus.xml -i xces +wcrft-app -d path/to/nkjp_model config/nkjp_s2.ini --train path/to/training-corpus.xml -i xces Note: for best results it is highly recommended to re-analyse the training data using the same version of morphological analyser (e.g. the same MACA config) as will be using during tagger usage. The model available for download at the WCRFT wiki page already includes this. To use the trained model to tag a single file: -wcrft/wcrft.py -d path/to/nkjp_model config/nkjp_s2.ini input.xml -O tagged.xml - -For more details, see wcrft.py -h and the project wiki. +wcrft-app -d path/to/nkjp_model config/nkjp_s2.ini input.xml -O tagged.xml +For more details, see wcrft-app -h and the project wiki. diff --git a/libwcrft/CMakeLists.txt b/libwcrft/CMakeLists.txt index a48b2855a4c28e194835522fc38b67f34264c1b0..5c5c0b6a17a6a3add669e909375ac2caa9d4a949 100644 --- a/libwcrft/CMakeLists.txt +++ b/libwcrft/CMakeLists.txt @@ -88,4 +88,5 @@ message(STATUS "Model directory is in ${libwcrft_SRC_MODEL_DIR}") install(DIRECTORY ${libwcrft_SRC_MODEL_DIR}/ DESTINATION ${libwcrft_INSTALL_DATA_DIR} FILES_MATCHING PATTERN model - PATTERN model/*) + PATTERN model/* + PATTERN model/*/*) diff --git a/libwcrft/config/nkjp.ini b/libwcrft/config/nkjp.ini index b3df296cbdab5224c0504b4ccacaea11f2a7eb9b..f37478de0dc2ffbd987ef7f15ff926a353541932 100644 --- a/libwcrft/config/nkjp.ini +++ b/libwcrft/config/nkjp.ini @@ -1,10 +1,13 @@ -; NKJP tagset with unknown word treatment. This is the recommended config for NKJP. -; +; NKJP tagset with unknown word treatment. +; This is an OUTDATED config for NKJP. +; Use nkjp_s2 (slightly better) +; or nkjp_e2 (much smaller and somewhat faster, works just slightly +; worse than nkjp_s2). [general] tagset = nkjp ; all the attrs -attrs = nmb,cas,gnd,per,deg,asp,ngt,acm,acn,ppr,agg,vcl,dot +attrs = CLASS,nmb,cas,gnd,per,deg,asp,ngt,acm,acn,ppr,agg,vcl,dot macacfg = morfeusz-nkjp-official [lexicon] diff --git a/libwcrft/config/nkjp_e2-CLASS.txt b/libwcrft/config/nkjp_e2-CLASS.txt new file mode 100644 index 0000000000000000000000000000000000000000..e6a7173829db3d8916546b2bf06b2ada5b844a91 --- /dev/null +++ b/libwcrft/config/nkjp_e2-CLASS.txt @@ -0,0 +1,45 @@ +# Unigram +# orth +U00:%x[-2,1] +U01:%x[-1,1] +U02:%x[0,1] +U03:%x[1,1] +U04:%x[2,1] + +U05:%x[-1,0] +U06:%x[0,0] +U07:%x[1,0] + +# class +U10:%x[-2,2] +U11:%x[-1,2] +U12:%x[0,2] +U13:%x[1,2] +U14:%x[2,2] + +# cas +U20:%x[-2,3] +U21:%x[-1,3] +U22:%x[0,3] +U23:%x[1,3] +U24:%x[2,3] + +# gnd +U30:%x[-2,4] +U31:%x[-1,4] +U32:%x[0,4] +U33:%x[1,4] +U34:%x[2,4] + +# nmb +U40:%x[-2,5] +U41:%x[-1,5] +U42:%x[0,5] +U43:%x[1,5] +U44:%x[2,5] + +# regex feats +U61:%x[0,8]/%x[0,9] + +# Bigram +B diff --git a/libwcrft/config/nkjp_e2-asp.txt b/libwcrft/config/nkjp_e2-asp.txt new file mode 100644 index 0000000000000000000000000000000000000000..a729ae217c72235ff5033388331948c605103444 --- /dev/null +++ b/libwcrft/config/nkjp_e2-asp.txt @@ -0,0 +1,37 @@ +# Unigram +# orth +U00:%x[-2,1] +U01:%x[-1,1] +U02:%x[0,1] +U03:%x[1,1] +U04:%x[2,1] + +U05:%x[-1,0] +U06:%x[0,0] +U07:%x[1,0] + +# class +U10:%x[-2,2] +U11:%x[-1,2] +U12:%x[0,2] +U13:%x[1,2] +U14:%x[2,2] + +# cas +U21:%x[-1,3] +U22:%x[0,3] +U23:%x[1,3] + +# gnd +U32:%x[0,4] + +# nmb +U41:%x[-1,5] +U42:%x[0,5] +U43:%x[1,5] + +# regex feats +U61:%x[0,8]/%x[0,9] + +# Bigram +B diff --git a/libwcrft/config/nkjp_e2-cas.txt b/libwcrft/config/nkjp_e2-cas.txt new file mode 100644 index 0000000000000000000000000000000000000000..2e3e5c947db954791c9ff99c55cf492b47db7b08 --- /dev/null +++ b/libwcrft/config/nkjp_e2-cas.txt @@ -0,0 +1,59 @@ +# Unigram +# orth +U00:%x[-2,1] +U01:%x[-1,1] +U02:%x[0,1] +U03:%x[1,1] +U04:%x[2,1] + +U05:%x[-1,0] +U06:%x[0,0] +U07:%x[1,0] + +U08:%x[-1,1]/%x[0,1] +U09:%x[0,1]/%x[1,1] + +# class +U10:%x[-2,2] +U11:%x[-1,2] +U12:%x[0,2] +U13:%x[1,2] +U14:%x[2,2] +U15:%x[-2,2]/%x[-1,2] +U16:%x[-1,2]/%x[0,2] +U17:%x[0,2]/%x[1,2] +U18:%x[1,2]/%x[2,2] + +# cas +U20:%x[-2,3] +U21:%x[-1,3] +U22:%x[0,3] +U23:%x[1,3] +U24:%x[2,3] + +# gnd +U30:%x[-2,4] +U31:%x[-1,4] +U32:%x[0,4] +U33:%x[1,4] +U34:%x[2,4] + +# nmb +U40:%x[-2,5] +U41:%x[-1,5] +U42:%x[0,5] +U43:%x[1,5] +U44:%x[2,5] + +# agr +U50:%x[-1,6] # agr(0,2) -> agr(-1,0) +U51:%x[0,6] # agr(0,2) +U52:%x[-1,7] # agr..(-1,2) -> agr(-2,0) +U53:%x[0,7] # (-1,2) +U54:%x[1,7] # ... -> (0,3) + +# regex feats +U61:%x[0,8]/%x[0,9] + +# Bigram +B diff --git a/libwcrft/config/nkjp_e2-gnd.txt b/libwcrft/config/nkjp_e2-gnd.txt new file mode 100644 index 0000000000000000000000000000000000000000..2e3e5c947db954791c9ff99c55cf492b47db7b08 --- /dev/null +++ b/libwcrft/config/nkjp_e2-gnd.txt @@ -0,0 +1,59 @@ +# Unigram +# orth +U00:%x[-2,1] +U01:%x[-1,1] +U02:%x[0,1] +U03:%x[1,1] +U04:%x[2,1] + +U05:%x[-1,0] +U06:%x[0,0] +U07:%x[1,0] + +U08:%x[-1,1]/%x[0,1] +U09:%x[0,1]/%x[1,1] + +# class +U10:%x[-2,2] +U11:%x[-1,2] +U12:%x[0,2] +U13:%x[1,2] +U14:%x[2,2] +U15:%x[-2,2]/%x[-1,2] +U16:%x[-1,2]/%x[0,2] +U17:%x[0,2]/%x[1,2] +U18:%x[1,2]/%x[2,2] + +# cas +U20:%x[-2,3] +U21:%x[-1,3] +U22:%x[0,3] +U23:%x[1,3] +U24:%x[2,3] + +# gnd +U30:%x[-2,4] +U31:%x[-1,4] +U32:%x[0,4] +U33:%x[1,4] +U34:%x[2,4] + +# nmb +U40:%x[-2,5] +U41:%x[-1,5] +U42:%x[0,5] +U43:%x[1,5] +U44:%x[2,5] + +# agr +U50:%x[-1,6] # agr(0,2) -> agr(-1,0) +U51:%x[0,6] # agr(0,2) +U52:%x[-1,7] # agr..(-1,2) -> agr(-2,0) +U53:%x[0,7] # (-1,2) +U54:%x[1,7] # ... -> (0,3) + +# regex feats +U61:%x[0,8]/%x[0,9] + +# Bigram +B diff --git a/libwcrft/config/nkjp_e2-nmb.txt b/libwcrft/config/nkjp_e2-nmb.txt new file mode 100644 index 0000000000000000000000000000000000000000..2e3e5c947db954791c9ff99c55cf492b47db7b08 --- /dev/null +++ b/libwcrft/config/nkjp_e2-nmb.txt @@ -0,0 +1,59 @@ +# Unigram +# orth +U00:%x[-2,1] +U01:%x[-1,1] +U02:%x[0,1] +U03:%x[1,1] +U04:%x[2,1] + +U05:%x[-1,0] +U06:%x[0,0] +U07:%x[1,0] + +U08:%x[-1,1]/%x[0,1] +U09:%x[0,1]/%x[1,1] + +# class +U10:%x[-2,2] +U11:%x[-1,2] +U12:%x[0,2] +U13:%x[1,2] +U14:%x[2,2] +U15:%x[-2,2]/%x[-1,2] +U16:%x[-1,2]/%x[0,2] +U17:%x[0,2]/%x[1,2] +U18:%x[1,2]/%x[2,2] + +# cas +U20:%x[-2,3] +U21:%x[-1,3] +U22:%x[0,3] +U23:%x[1,3] +U24:%x[2,3] + +# gnd +U30:%x[-2,4] +U31:%x[-1,4] +U32:%x[0,4] +U33:%x[1,4] +U34:%x[2,4] + +# nmb +U40:%x[-2,5] +U41:%x[-1,5] +U42:%x[0,5] +U43:%x[1,5] +U44:%x[2,5] + +# agr +U50:%x[-1,6] # agr(0,2) -> agr(-1,0) +U51:%x[0,6] # agr(0,2) +U52:%x[-1,7] # agr..(-1,2) -> agr(-2,0) +U53:%x[0,7] # (-1,2) +U54:%x[1,7] # ... -> (0,3) + +# regex feats +U61:%x[0,8]/%x[0,9] + +# Bigram +B diff --git a/libwcrft/config/nkjp_e2.ccl b/libwcrft/config/nkjp_e2.ccl new file mode 100644 index 0000000000000000000000000000000000000000..c4abefb23697db2e5e5b8382f3ab62e6e368650e --- /dev/null +++ b/libwcrft/config/nkjp_e2.ccl @@ -0,0 +1,12 @@ +@ "default" ( + affix(lower(orth[0]), 3); // 0 + affix(lower(orth[0]), -3); // 1 + class[0]; // 2 + cas[0]; // 3 + gnd[0]; // 4 + nmb[0]; // 5 + agrpp(0,1,{nmb,gnd,cas}); // 6 + and(inside(-1), inside(1), wagr(-1,1,{nmb,gnd,cas})); // 7 + regex(orth[0], "\\P{Ll}.*"); regex(orth[0], "\\P{Lu}.*") // 8, 9 +) + diff --git a/libwcrft/config/nkjp_e2.ini b/libwcrft/config/nkjp_e2.ini new file mode 100644 index 0000000000000000000000000000000000000000..67875c8ff5623ebc1f14feee72e72d92ed337892 --- /dev/null +++ b/libwcrft/config/nkjp_e2.ini @@ -0,0 +1,31 @@ +; NKJP tagset with unknown word treatment, reduced feature set. +; Got rid of agreement features. +; For layers other than CLASS,nmb,gnd,cas reduced context to 3 +; + +[general] +tagset = nkjp +; all the attrs +attrs = CLASS,nmb,cas,gnd,asp +; acm,dot could be useful for uknown +macacfg = morfeusz-nkjp-official +defaultmodel = model_nkjp10_wcrft_e2 + +[lexicon] +; currently lexicon itself is not used, but unk tag list is +casesens = no +minfreq = 10 +maxentries = 500 + +[lemmatiser] +; if lemmatiser outputs a lemma not present in morpho analysis +; --- should the lemma be ignored (forcelemma = no) +; or used to overwrite lemmas of each possible interpretation (yes) +forcelemma = yes + +[crf] +params = -a CRF-L2 -f5 + +[unknown] +guess = yes +unktagfreq = 1 diff --git a/libwcrft/config/nkjp_s2.ini b/libwcrft/config/nkjp_s2.ini index eebc8806c332e946ef7d996b40c665f3add4ce0d..9e3d8b6d2edf11cc2dc17eed40f9863253be6c62 100644 --- a/libwcrft/config/nkjp_s2.ini +++ b/libwcrft/config/nkjp_s2.ini @@ -6,8 +6,9 @@ [general] tagset = nkjp ; all the attrs -attrs = nmb,cas,gnd,per,deg,asp,ngt,acm,acn,ppr,agg,vcl,dot +attrs = CLASS,nmb,cas,gnd,per,deg,asp,ngt,acm,acn,ppr,agg,vcl,dot macacfg = morfeusz-nkjp-official +defaultmodel = model_nkjp10_wcrft_s2 [lexicon] ; currently lexicon itself is not used, but unk tag list is diff --git a/libwcrft/config/nkjp_s2_class.ini b/libwcrft/config/nkjp_s2_class.ini index 518723042548a850c62cb399adcc225725c33a31..c84f1485b75da332db9d41c2e1e9e9e141eb15f2 100644 --- a/libwcrft/config/nkjp_s2_class.ini +++ b/libwcrft/config/nkjp_s2_class.ini @@ -6,7 +6,7 @@ [general] tagset = nkjp ; all the attrs -attrs = +attrs = CLASS macacfg = morfeusz-nkjp-official [lexicon] diff --git a/libwcrft/config/nkjp_s6-CLASS.txt b/libwcrft/config/nkjp_s6-CLASS.txt new file mode 100644 index 0000000000000000000000000000000000000000..56cf4ea2f546c2d7bafcc6500471d980d4e38fef --- /dev/null +++ b/libwcrft/config/nkjp_s6-CLASS.txt @@ -0,0 +1,43 @@ +# Unigram +# orth +U00:%x[-2,0] +U01:%x[-1,0] +U02:%x[0,0] +U03:%x[1,0] +U04:%x[2,0] + +# class +U10:%x[-2,1] +U11:%x[-1,1] +U12:%x[0,1] +U13:%x[1,1] +U14:%x[2,1] + +# cas +U20:%x[-2,2] +U21:%x[-1,2] +U22:%x[0,2] +U23:%x[1,2] +U24:%x[2,2] + +# gnd +U30:%x[-2,3] +U31:%x[-1,3] +U32:%x[0,3] +U33:%x[1,3] +U34:%x[2,3] + +# nmb +U40:%x[-2,4] +U41:%x[-1,4] +U42:%x[0,4] +U43:%x[1,4] +U44:%x[2,4] + +# regex feats +#U60:%x[-1,7]/%x[-1,8] +U61:%x[0,7]/%x[0,8] +#U62:%x[1,7]/%x[1,8] + +# Bigram +B diff --git a/libwcrft/config/nkjp_s6-asp.txt b/libwcrft/config/nkjp_s6-asp.txt new file mode 100644 index 0000000000000000000000000000000000000000..090f3c1f5c4352304ec40e1fb99080850e221073 --- /dev/null +++ b/libwcrft/config/nkjp_s6-asp.txt @@ -0,0 +1,33 @@ +# Unigram +# orth +U00:%x[-2,0] +U01:%x[-1,0] +U02:%x[0,0] +U03:%x[1,0] +U04:%x[2,0] + +# class +U10:%x[-2,1] +U11:%x[-1,1] +U12:%x[0,1] +U13:%x[1,1] +U14:%x[2,1] + +# cas +U21:%x[-1,2] +U22:%x[0,2] +U23:%x[1,2] + +# gnd +U32:%x[0,3] + +# nmb +U41:%x[-1,4] +U42:%x[0,4] +U43:%x[1,4] + +# regex feats +U61:%x[0,7]/%x[0,8] + +# Bigram +B diff --git a/libwcrft/config/nkjp_s6-cas.txt b/libwcrft/config/nkjp_s6-cas.txt new file mode 100644 index 0000000000000000000000000000000000000000..127e3356eb95dd87296f409d055f24bae52bda72 --- /dev/null +++ b/libwcrft/config/nkjp_s6-cas.txt @@ -0,0 +1,61 @@ +# Unigram +# orth +U00:%x[-2,0] +U01:%x[-1,0] +U02:%x[0,0] +U03:%x[1,0] +U04:%x[2,0] +U05:%x[-1,0]/%x[0,0] +U06:%x[0,0]/%x[1,0] + +# class +U10:%x[-2,1] +U11:%x[-1,1] +U12:%x[0,1] +U13:%x[1,1] +U14:%x[2,1] +U15:%x[-2,1]/%x[-1,1] +U16:%x[-1,1]/%x[0,1] +U17:%x[0,1]/%x[1,1] +U18:%x[1,1]/%x[2,1] + +# cas +U20:%x[-2,2] +U21:%x[-1,2] +U22:%x[0,2] +U23:%x[1,2] +U24:%x[2,2] + +# gnd +U30:%x[-2,3] +U31:%x[-1,3] +U32:%x[0,3] +U33:%x[1,3] +U34:%x[2,3] + +# nmb +U40:%x[-2,4] +U41:%x[-1,4] +U42:%x[0,4] +U43:%x[1,4] +U44:%x[2,4] + +# agr +U50:%x[-1,5] # agr(0,1) -> agr(-1,0) +U51:%x[0,5] # agr(0,1) +U52:%x[-1,6] # agr..(-1,1) -> agr(-2,0) +U53:%x[0,6] # (-1,1) +U54:%x[1,6] # ... -> (0,2) + +# regex feats +#U60:%x[-1,7]/%x[-1,8] +U61:%x[0,7]/%x[0,8] +#U62:%x[1,7]/%x[1,8] + +# wordclass trigrams +#U80:%x[-2,1]/%x[-1,1]/%x[0,1] +#U81:%x[-1,1]/%x[0,1]/%x[1,1] +#U82:%x[0,1]/%x[1,1]/%x[2,1] + +# Bigram +B diff --git a/libwcrft/config/nkjp_s6-gnd.txt b/libwcrft/config/nkjp_s6-gnd.txt new file mode 100644 index 0000000000000000000000000000000000000000..127e3356eb95dd87296f409d055f24bae52bda72 --- /dev/null +++ b/libwcrft/config/nkjp_s6-gnd.txt @@ -0,0 +1,61 @@ +# Unigram +# orth +U00:%x[-2,0] +U01:%x[-1,0] +U02:%x[0,0] +U03:%x[1,0] +U04:%x[2,0] +U05:%x[-1,0]/%x[0,0] +U06:%x[0,0]/%x[1,0] + +# class +U10:%x[-2,1] +U11:%x[-1,1] +U12:%x[0,1] +U13:%x[1,1] +U14:%x[2,1] +U15:%x[-2,1]/%x[-1,1] +U16:%x[-1,1]/%x[0,1] +U17:%x[0,1]/%x[1,1] +U18:%x[1,1]/%x[2,1] + +# cas +U20:%x[-2,2] +U21:%x[-1,2] +U22:%x[0,2] +U23:%x[1,2] +U24:%x[2,2] + +# gnd +U30:%x[-2,3] +U31:%x[-1,3] +U32:%x[0,3] +U33:%x[1,3] +U34:%x[2,3] + +# nmb +U40:%x[-2,4] +U41:%x[-1,4] +U42:%x[0,4] +U43:%x[1,4] +U44:%x[2,4] + +# agr +U50:%x[-1,5] # agr(0,1) -> agr(-1,0) +U51:%x[0,5] # agr(0,1) +U52:%x[-1,6] # agr..(-1,1) -> agr(-2,0) +U53:%x[0,6] # (-1,1) +U54:%x[1,6] # ... -> (0,2) + +# regex feats +#U60:%x[-1,7]/%x[-1,8] +U61:%x[0,7]/%x[0,8] +#U62:%x[1,7]/%x[1,8] + +# wordclass trigrams +#U80:%x[-2,1]/%x[-1,1]/%x[0,1] +#U81:%x[-1,1]/%x[0,1]/%x[1,1] +#U82:%x[0,1]/%x[1,1]/%x[2,1] + +# Bigram +B diff --git a/libwcrft/config/nkjp_s6-nmb.txt b/libwcrft/config/nkjp_s6-nmb.txt new file mode 100644 index 0000000000000000000000000000000000000000..127e3356eb95dd87296f409d055f24bae52bda72 --- /dev/null +++ b/libwcrft/config/nkjp_s6-nmb.txt @@ -0,0 +1,61 @@ +# Unigram +# orth +U00:%x[-2,0] +U01:%x[-1,0] +U02:%x[0,0] +U03:%x[1,0] +U04:%x[2,0] +U05:%x[-1,0]/%x[0,0] +U06:%x[0,0]/%x[1,0] + +# class +U10:%x[-2,1] +U11:%x[-1,1] +U12:%x[0,1] +U13:%x[1,1] +U14:%x[2,1] +U15:%x[-2,1]/%x[-1,1] +U16:%x[-1,1]/%x[0,1] +U17:%x[0,1]/%x[1,1] +U18:%x[1,1]/%x[2,1] + +# cas +U20:%x[-2,2] +U21:%x[-1,2] +U22:%x[0,2] +U23:%x[1,2] +U24:%x[2,2] + +# gnd +U30:%x[-2,3] +U31:%x[-1,3] +U32:%x[0,3] +U33:%x[1,3] +U34:%x[2,3] + +# nmb +U40:%x[-2,4] +U41:%x[-1,4] +U42:%x[0,4] +U43:%x[1,4] +U44:%x[2,4] + +# agr +U50:%x[-1,5] # agr(0,1) -> agr(-1,0) +U51:%x[0,5] # agr(0,1) +U52:%x[-1,6] # agr..(-1,1) -> agr(-2,0) +U53:%x[0,6] # (-1,1) +U54:%x[1,6] # ... -> (0,2) + +# regex feats +#U60:%x[-1,7]/%x[-1,8] +U61:%x[0,7]/%x[0,8] +#U62:%x[1,7]/%x[1,8] + +# wordclass trigrams +#U80:%x[-2,1]/%x[-1,1]/%x[0,1] +#U81:%x[-1,1]/%x[0,1]/%x[1,1] +#U82:%x[0,1]/%x[1,1]/%x[2,1] + +# Bigram +B diff --git a/libwcrft/config/nkjp_s6.ccl b/libwcrft/config/nkjp_s6.ccl new file mode 100644 index 0000000000000000000000000000000000000000..3956d281c89664ce15d5ad627626956908b4ee0a --- /dev/null +++ b/libwcrft/config/nkjp_s6.ccl @@ -0,0 +1,10 @@ +@ "default" ( + orth[0]; // 0 + class[0]; // 1 + cas[0]; // 2 + gnd[0]; // 3 + nmb[0]; // 4 + agrpp(0,1,{nmb,gnd,cas}); // 5 + and(inside(-1), inside(1), wagr(-1,1,{nmb,gnd,cas})); // 6 + regex(orth[0], "\\P{Ll}.*"); regex(orth[0], "\\P{Lu}.*") // 7, 8 +) diff --git a/libwcrft/config/nkjp_s6.ini b/libwcrft/config/nkjp_s6.ini new file mode 100644 index 0000000000000000000000000000000000000000..13e5fc1c7f9b6f6d2e63a9c3f6967a00e3eb6173 --- /dev/null +++ b/libwcrft/config/nkjp_s6.ini @@ -0,0 +1,32 @@ +; NKJP tagset with unknown word treatment, reduced feature set. +; Generates quite small models and works almost as accurately +; as nkjp_s2. + + + +[general] +tagset = nkjp +; all the attrs +attrs = CLASS,nmb,cas,gnd,asp +; acm,dot could be useful for uknown +macacfg = morfeusz-nkjp-official +defaultmodel = model_nkjp10_wcrft_s6 + +[lexicon] +; currently lexicon itself is not used, but unk tag list is +casesens = no +minfreq = 10 +maxentries = 500 + +[lemmatiser] +; if lemmatiser outputs a lemma not present in morpho analysis +; --- should the lemma be ignored (forcelemma = no) +; or used to overwrite lemmas of each possible interpretation (yes) +forcelemma = yes + +[crf] +params = -a CRF-L2 -f5 + +[unknown] +guess = yes +unktagfreq = 1 diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/info.txt b/libwcrft/model/model_nkjp10_wcrft_e2/info.txt new file mode 100644 index 0000000000000000000000000000000000000000..67b848b137cf0a028bd10150735d0c89b8477ac1 --- /dev/null +++ b/libwcrft/model/model_nkjp10_wcrft_e2/info.txt @@ -0,0 +1,11 @@ +Model trained on full NKJP 1.0. +To be used with nkjp_e2.ini config. + +Trained with WCRFT 0.9.5, 1 April 2014. + +time wcrft --train nkjp_e2.ini -d model_nkjp10_wcrft_e2/ nkjp10-merged-ng-rea.xml -v + +real 262m53.201s +user 2475m4.391s +sys 0m45.750s + diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-CLASS.cr b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-CLASS.cr new file mode 100644 index 0000000000000000000000000000000000000000..5ba1df2dd4ef18f9b514aec53b74eb2675fb29a3 Binary files /dev/null and b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-CLASS.cr differ diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-asp.cr b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-asp.cr new file mode 100644 index 0000000000000000000000000000000000000000..c1d43f00d7cf34e0e6611e9d87034a603c064985 Binary files /dev/null and b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-asp.cr differ diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-cas.cr b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-cas.cr new file mode 100644 index 0000000000000000000000000000000000000000..c8cd462c7f6af9ba57ed1dd56410a43e0b14dfbf Binary files /dev/null and b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-cas.cr differ diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-gnd.cr b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-gnd.cr new file mode 100644 index 0000000000000000000000000000000000000000..5f5e1a32b749d6e483f16fd048dd0946fa29c72a Binary files /dev/null and b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-gnd.cr differ diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-nmb.cr b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-nmb.cr new file mode 100644 index 0000000000000000000000000000000000000000..d575faa71d5d4000cab67e08e1758b445e4b96d9 Binary files /dev/null and b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2-nmb.cr differ diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2.lex b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2.lex new file mode 100644 index 0000000000000000000000000000000000000000..d55797dc1847d2ed39f91a911550a1168ccc8d98 --- /dev/null +++ b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2.lex @@ -0,0 +1,500 @@ +. . +, , +w w +i i +się się +na na +nie nie +z z +- - +do do +to to +– – +" " +że że +jest jest +? ? +o o +a a +jak jak +: : +po po +ale ale +) ) +( ( +tak tak +za za +co co +od od +by by +przez przez +em em +tym tym +czy czy +już już +! ! +no no +m m +dla dla +ma ma +tylko tylko +może może +są są +tego tego +bo bo +było było +jego jego +był był +ja ja +też też +ze ze +jeszcze jeszcze +będzie będzie +ich ich +śmy śmy +oraz oraz +być być +bardzo bardzo +jej jej +roku roku +ten ten +mnie mnie +jednak jednak +tam tam +przy przy +tej tej +sobie sobie +pan pan +go go +które które +który który +lub lub +mi mi +pod pod +przed przed +była była +nawet nawet +lat lat +można można +teraz teraz +więc więc +jako jako +także także +mu mu +1 1 +gdy gdy +żeby żeby +te te +bez bez +tu tu +kiedy kiedy +2 2 +; ; +nad nad +tych tych +coś coś +pracy pracy +on on +miał miał +r r +nas nas +która która +jeśli jeśli +wszystko wszystko +mam mam +mówi mówi +gdzie gdzie +właśnie właśnie +takie takie +u u +niż niż +również również +pani pani +były były +aby aby +kto kto +których których +nic nic +nich nich +3 3 +ci ci +którzy którzy +trzeba trzeba +ta ta +ją ją +chyba chyba +albo albo +potem potem +we we +którym którym +wiem wiem +mają mają +dwa dwa +będą będą +wtedy wtedy +zł zł +powiedział powiedział +dobrze dobrze +nim nim +osób osób +raz raz +je je +jeżeli jeżeli +więcej więcej +ludzi ludzi +zawsze zawsze +kilka kilka +siebie siebie +wiesz wiesz +jestem jestem +” ” +przecież przecież +ona ona +„ „ +domu domu +taki taki +jeden jeden +czyli czyli +polsce polsce +dzieci dzieci +ani ani +miała miała +bardziej bardziej +sposób sposób +ty ty +im im +proszę proszę +życia życia +polski polski +ś ś +dziś dziś +nam nam +której której +dlatego dlatego +sam sam +chciał chciał +wczoraj wczoraj +został został +wszystkich wszystkich +czas czas +5 5 +innych innych +4 4 +między między +wiele wiele +pana pana +wszystkie wszystkie +mogą mogą +temu temu +dlaczego dlaczego +panie panie +niego niego +eś eś +czasu czasu +życie życie +gdyby gdyby +podczas podczas +ktoś ktoś +dwóch dwóch +swoje swoje +ponad ponad +państwa państwa +wielu wielu +ust ust +tys tys +ludzie ludzie +trochę trochę +wszystkim wszystkim +sprawie sprawie +choć choć +oczywiście oczywiście +którego którego +dopiero dopiero +miasta miasta +ustawy ustawy +dni dni +nigdy nigdy +tutaj tutaj +trzy trzy +niej niej +musi musi +aż aż +pierwszy pierwszy +proc proc +mógł mógł +czym czym +dnia dnia +jakby jakby +tyle tyle +jakie jakie +czasie czasie +razem razem +chodzi chodzi +art art +lecz lecz +później później +prostu prostu +należy należy +mamy mamy +nikt nikt +wszyscy wszyscy +miejsce miejsce +według według +chce chce +oni oni +10 10 +jednym jednym +znaczy znaczy +tę tę +inne inne +każdy każdy +poza poza +wcześniej wcześniej +byli byli +razie razie +kraju kraju +taka taka +6 6 +mieć mieć +np np +temat temat +natomiast natomiast +my my +coraz coraz +strony strony +30 30 +rady rady +najbardziej najbardziej +około około +takich takich +masz masz +naprawdę naprawdę +związku związku +dzień dzień +jakiś jakiś +kilku kilku +świata świata +wśród wśród +dziękuję dziękuję +dużo dużo +często często +dalej dalej +jakieś jakieś +ile ile +chwili chwili +stanie stanie +mimo mimo +rzeczy rzeczy +dzięki dzięki +spraw spraw +mowa mowa +ul ul +powiedzieć powiedzieć +cały cały +lata lata +m.in m.in +takiego takiego +swoich swoich +prawo prawo +iż iż +dzisiaj dzisiaj +pytanie pytanie +osoby osoby +dwie dwie +komisji komisji +prawie prawie +została została +przykład przykład +mieli mieli +ogóle ogóle +ok ok +prawa prawa +20 20 +minister minister +latach latach +one one +nr nr +część część +człowiek człowiek +polska polska +części części +cię cię +miejscu miejscu +wiadomo wiadomo +przede przede +15 15 +bowiem bowiem +rok rok +człowieka człowieka +pewno pewno +wie wie +wobec wobec +polskiej polskiej +mówił mówił +którą którą +kiedyś kiedyś +jedynie jedynie +7 7 +niech niech +nią nią +niestety niestety +poseł poseł +mln mln +czego czego +swoją swoją +koniec koniec +sytuacji sytuacji +mniej mniej +oczy oczy +słowa słowa +jaki jaki +przypadku przypadku +trzech trzech +polskich polskich +mogę mogę +raczej raczej +ziemi ziemi +— — +8 8 +złotych złotych +lepiej lepiej +ponieważ ponieważ +udział udział +zrobić zrobić +pierwsze pierwsze +powinien powinien +obok obok +rzecz rzecz +prawda prawda +swoim swoim +mój mój +tysięcy tysięcy +polskiego polskiego +takim takim +12 12 +nowe nowe +firmy firmy +mało mało +trudno trudno +pieniądze pieniądze +l l +yyy yyy +zdaniem zdaniem +samo samo +swój swój +policji policji +jednej jednej +szkoły szkoły +wieku wieku +końcu końcu +zupełnie zupełnie +centrum centrum +długo długo +śmierci śmierci +większość większość +prezydenta prezydenta +obecnie obecnie +sprawy sprawy +jesteś jesteś +ii ii +wreszcie wreszcie +końca końca +pieniędzy pieniędzy +pomocy pomocy +warszawie warszawie +zostanie zostanie +rząd rząd +czasem czasem +miejsca miejsca +sobą sobą +udało udało +taką taką +ciągu ciągu +zgodnie zgodnie +będę będę +mogli mogli +informacji informacji +nadal nadal +szybko szybko +zbyt zbyt +jednego jednego +s s +wraz wraz +prezydent prezydent +zaś zaś +wydaje wydaje +tą tą +drodze drodze +nowego nowego +dziecko dziecko +chwilę chwilę +różnych różnych +/ / +naszych naszych +uwagę uwagę +partii partii +cztery cztery +chciała chciała +zresztą zresztą +drzwi drzwi +sld sld +myśli myśli +świecie świecie +dość dość +akcji akcji +jedno jedno +sprawa sprawa +jedna jedna +świat świat +naszej naszej +samym samym +sąd sąd +swojej swojej +km km +chociaż chociaż +celu celu +początku początku +pewnie pewnie +inaczej inaczej +przeciw przeciw +gminy gminy +brak brak +moje moje +ciebie ciebie +drugi drugi +tzw tzw +razy razy +wówczas wówczas +myślę myślę +zaraz zaraz +gdzieś gdzieś +widać widać +% % +nasze nasze +zdrowia zdrowia +nagle nagle +kultury kultury +życiu życiu +program program +możemy możemy +kobiety kobiety +mogła mogła +drugiej drugiej +będziemy będziemy +pierwszym pierwszym +andrzej andrzej +godz godz +powiedziała powiedziała +głos głos +nowy nowy +zwłaszcza zwłaszcza +mówię mówię +nocy nocy +ojciec ojciec +wniosek wniosek +powodu powodu +przeciwko przeciwko +jesteśmy jesteśmy +zostały zostały +ręce ręce +sama sama diff --git a/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2.unk b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2.unk new file mode 100644 index 0000000000000000000000000000000000000000..d9df0ed5edf5c32f991d2a0df4bd085bb9973954 --- /dev/null +++ b/libwcrft/model/model_nkjp10_wcrft_e2/nkjp_e2.unk @@ -0,0 +1,402 @@ +adj:pl:inst:n:pos +adjp +num:pl:dat:m3:congr +praet:pl:f:imperf +adj:sg:gen:f:pos +adja +ger:pl:inst:n:imperf:aff +adjc +ppas:sg:acc:m2:perf:aff +adj:sg:acc:m2:pos +adj:sg:nom:m1:com +ppas:sg:nom:f:perf:aff +ppas:sg:acc:n:perf:aff +num:pl:acc:m2:rec +pact:pl:gen:m3:imperf:aff +num:pl:acc:f:congr +num:pl:nom:n:rec +adj:pl:gen:m1:pos +adj:pl:loc:n:pos +subst:pl:acc:m1 +subst:pl:acc:m2 +subst:pl:acc:m3 +adj:pl:loc:f:pos +adj:sg:nom:m2:pos +fin:sg:ter:perf +pact:sg:gen:m3:imperf:aff +siebie:inst +ger:sg:nom:n:perf:aff +ppas:sg:inst:f:perf:aff +adj:sg:dat:m1:pos +ppas:pl:acc:f:imperf:aff +subst:pl:nom:m2 +praet:pl:f:perf +adj:sg:inst:m2:pos +adj:pl:nom:m2:pos +num:pl:acc:m2:congr +ger:pl:inst:n:perf:aff +adj:pl:dat:n:pos +ppron12:sg:inst:m1:pri:nakc +adj:sg:dat:m3:pos +subst:pl:acc:f +num:pl:loc:m2:rec +num:pl:gen:m1:rec +subst:pl:acc:n +ppas:pl:nom:m1:perf:aff +ppas:sg:gen:m3:imperf:aff +adj:pl:voc:f:pos +adj:pl:acc:m3:pos +ppas:sg:nom:m1:perf:aff +brev:npun +pact:pl:gen:m1:imperf:aff +ger:pl:nom:n:imperf:aff +num:pl:inst:m1:congr +adj:sg:acc:m3:pos +num:sg:nom:m3:congr +ger:pl:nom:n:perf:aff +num:pl:acc:m1:congr +praet:pl:m1:perf:nagl +ppas:pl:nom:m3:perf:aff +ppron12:sg:acc:m1:sec:akc +pred +subst:sg:nom:m1 +subst:sg:nom:m3 +subst:sg:nom:m2 +numcol:pl:nom:m1:rec +adj:sg:inst:n:pos +adj:sg:nom:f:pos +fin:pl:ter:imperf +adj:pl:dat:m1:pos +pact:pl:acc:n:imperf:aff +ger:sg:loc:n:imperf:aff +pact:sg:nom:m3:imperf:aff +num:pl:loc:m1:congr +num:pl:inst:n:congr +num:pl:acc:n:congr +subst:sg:acc:f +ppron3:sg:gen:f:ter:akc:npraep +subst:sg:acc:n +numcol:pl:inst:m1:rec +ger:sg:gen:n:imperf:aff +ppron12:pl:nom:m1:sec +subst:sg:gen:m1 +pcon:imperf +subst:sg:gen:m2 +num:pl:loc:m3:rec +adj:sg:loc:n:sup +inf:perf +num:pl:loc:m3:congr +adj:sg:nom:m3:pos +pact:sg:nom:m1:imperf:aff +subst:sg:gen:m3 +ppron3:sg:loc:m1:ter:akc:praep +praet:sg:m3:perf +numcol:pl:dat:m1:congr +numcol:pl:gen:n:congr +adj:sg:acc:f:com +adj:sg:nom:m1:pos +ppron3:sg:gen:m1:ter:akc:npraep +adj:sg:inst:f:sup +adj:sg:nom:n:sup +adj:sg:inst:f:pos +adj:sg:nom:n:pos +adj:sg:inst:m1:pos +ppron12:sg:voc:n:sec +pact:sg:acc:m3:imperf:aff +ppron3:sg:dat:f:ter:akc:npraep +num:pl:gen:f:congr +adj:pl:nom:m1:pos +num:sg:nom:n:rec +adj:pl:inst:m3:pos +subst:pl:dat:n +ppas:sg:nom:n:perf:aff +adj:pl:gen:f:pos +ppron12:sg:nom:f:pri +subst:pl:dat:f +ppas:pl:nom:n:imperf:aff +adj:pl:acc:m1:pos +pact:pl:acc:m3:imperf:aff +num:pl:nom:m2:rec +prep:nom +prep:gen:nwok +num:pl:gen:n:rec +adj:pl:nom:m3:pos +fin:pl:sec:imperf +adj:sg:acc:f:pos +winien:sg:m1:imperf +prep:loc +num:pl:loc:n:congr +ppron12:pl:dat:f:pri +ppas:pl:nom:n:perf:aff +ppron3:sg:gen:m1:ter:nakc:npraep +fin:pl:ter:perf +pact:pl:acc:m1:imperf:aff +siebie:dat +impt:pl:pri:perf +adj:sg:loc:m2:pos +subst:sg:gen:f +adj:pl:nom:m1:sup +subst:sg:gen:n +num:sg:gen:m1:congr +adj:pl:inst:m1:pos +impt:sg:sec:perf +pact:sg:nom:n:imperf:aff +qub +adj:sg:dat:f:pos +adj:sg:nom:n:com +ppas:sg:voc:m2:imperf:aff +winien:sg:m3:imperf +ppas:pl:inst:f:perf:aff +subst:sg:loc:m1 +subst:sg:loc:m3 +subst:sg:loc:m2 +ppron3:sg:gen:m1:ter:akc:praep +adj:sg:acc:n:pos +ppas:sg:nom:m3:imperf:aff +ppron3:sg:loc:m3:ter:akc:praep +fin:sg:pri:imperf +subst:pl:gen:n +subst:pl:gen:f +adj:pl:acc:f:sup +ppron12:sg:gen:m1:pri:akc +adj:sg:nom:m3:com +ppas:pl:acc:m3:perf:aff +ppas:pl:nom:f:perf:aff +ppron12:sg:acc:m1:sec:nakc +adj:sg:gen:m3:sup +pact:sg:gen:f:imperf:aff +ger:pl:gen:n:perf:aff +bedzie:sg:ter:imperf +adj:sg:gen:m1:pos +adv:pos +num:pl:acc:m3:rec +numcol:pl:gen:m1:congr +subst:sg:acc:m2 +subst:sg:acc:m3 +subst:sg:acc:m1 +adj:sg:inst:m3:pos +adj:sg:loc:f:pos +bedzie:pl:ter:imperf +pact:sg:acc:f:imperf:aff +ger:sg:gen:n:perf:aff +num:pl:gen:m3:rec +inf:imperf +adj:pl:nom:m2:sup +num:pl:inst:m2:congr +num:sg:gen:m3:congr +prep:acc:wok +num:pl:nom:m1:congr +subst:pl:loc:m2 +ppas:pl:nom:m3:imperf:aff +ppas:pl:voc:f:imperf:aff +num:pl:gen:m3:congr +adv:com +ppron12:sg:nom:m1:pri:nakc +prep:inst:wok +ppas:pl:nom:f:imperf:aff +praet:sg:m1:imperf +adj:pl:nom:n:pos +adj:sg:gen:n:pos +subst:pl:inst:m1 +subst:pl:inst:m2 +subst:pl:inst:m3 +subst:sg:voc:m1 +ppron12:sg:nom:f:pri:nakc +num:pl:acc:m3:congr +praet:sg:m2:perf +num:pl:acc:m1:rec +adj:sg:loc:m1:pos +prep:dat +ppron3:pl:dat:m2:ter:akc:npraep +ppron12:sg:acc:f:sec:nakc +bedzie:sg:sec:imperf +ppas:pl:dat:f:perf:aff +ppas:sg:nom:m3:perf:aff +adj:sg:gen:m1:com +adj:pl:gen:m3:sup +adj:sg:voc:m1:pos +ger:sg:inst:n:imperf:aff +ger:pl:gen:n:imperf:aff +pact:sg:gen:m1:imperf:aff +ppas:sg:nom:f:imperf:aff +num:pl:inst:f:congr +ppron12:sg:gen:m1:pri +numcol:pl:gen:m1:rec +num:pl:acc:f:rec +adj:pl:loc:f:com +adj:sg:gen:m2:pos +adj:sg:loc:m3:pos +ppas:sg:gen:m3:perf:aff +numcol:pl:gen:n:rec +ger:pl:dat:n:perf:aff +adj:pl:acc:n:pos +ppas:sg:nom:m2:perf:aff +ger:sg:inst:n:perf:aff +num:pl:gen:m1:congr +aglt:sg:sec:imperf:nwok +praet:sg:m2:imperf +adj:sg:gen:n:com +pact:sg:gen:m2:imperf:aff +subst:pl:gen:m3 +subst:pl:gen:m2 +subst:pl:gen:m1 +praet:sg:m1:perf +pact:pl:voc:f:imperf:aff +ger:sg:nom:n:imperf:aff +comp +adj:pl:acc:f:pos +num:pl:nom:f:congr +num:pl:dat:m2:congr +praet:pl:m2:perf +praet:sg:f:imperf:nagl +praet:sg:f:imperf +subst:pl:nom:m3 +praet:pl:m1:imperf +subst:pl:nom:m1 +adj:pl:dat:m3:pos +numcol:pl:acc:m1:rec +subst:sg:loc:n +num:pl:inst:m3:rec +brev:pun +num:pl:dat:m3:rec +subst:sg:loc:f +prep:loc:nwok +subst:sg:dat:f +ppron3:sg:nom:m1:ter:akc:npraep +subst:sg:dat:n +xxx +bedzie:sg:pri:imperf +num:pl:dat:f:congr +ppas:pl:acc:m2:perf:aff +num:pl:loc:f:congr +ppas:sg:nom:m1:imperf:neg +subst:pl:loc:n +subst:pl:loc:f +num:sg:acc:m3:rec +pact:sg:loc:m3:imperf:aff +ppas:sg:inst:m3:perf:aff +adj:pl:dat:f:pos +imps:perf +impt:sg:sec:imperf +adj:sg:loc:n:pos +conj +adj:sg:nom:m3:sup +adj:pl:gen:n:pos +qub:nwok +pact:sg:gen:n:imperf:aff +num:pl:dat:m1:congr +num:sg:nom:m3:rec +ger:sg:acc:n:perf:aff +num:pl:inst:m3:congr +praet:sg:m1:perf:nagl +prep:inst:nwok +fin:sg:sec:imperf +adj:pl:inst:f:pos +adj:sg:inst:m1:sup +adj:sg:voc:m3:pos +ppron3:pl:acc:m2:ter:akc:npraep +ppron12:pl:gen:m1:sec:akc +num:pl:nom:m3:rec +subst:sg:inst:m2 +subst:sg:inst:m3 +subst:sg:inst:m1 +subst:sg:voc:m3 +subst:sg:voc:m2 +num:pl:loc:f:rec +subst:pl:nom:n +prep:gen:wok +subst:pl:nom:f +qub:wok +subst:sg:inst:n +subst:sg:inst:f +ppas:sg:dat:m3:perf:aff +ppron3:pl:gen:n:ter:akc:praep +adv +fin:sg:ter:imperf +praet:pl:m1:perf +num:pl:gen:n:congr +ppron12:sg:nom:m1:pri +pact:pl:acc:f:imperf:aff +adj:sg:gen:m3:com +ppron3:pl:dat:m1:ter:akc:npraep +adj:sg:voc:f:pos +praet:pl:m3:imperf +num:pl:nom:m3:congr +subst:sg:nom:f +praet:sg:m3:imperf +praet:sg:f:imperf:agl +subst:sg:nom:n +interp +pact:sg:voc:m1:imperf:aff +interj +numcol:pl:nom:n:rec +numcol:pl:acc:n:rec +ppas:sg:nom:n:imperf:aff +bedzie:pl:pri:imperf +ger:pl:loc:n:imperf:aff +adj:sg:acc:m1:pos +num:pl:nom:m2:congr +prep:inst +burk +ppas:sg:acc:f:perf:aff +adj:pl:gen:m2:pos +ger:sg:loc:n:perf:aff +adj:pl:gen:f:sup +numcol:pl:inst:n:rec +ppron3:sg:acc:f:ter:akc:npraep +prep:gen +ppron3:pl:nom:f:ter:akc:npraep +adj:sg:gen:m3:pos +adj:sg:acc:n:sup +adj:pl:acc:m2:pos +praet:pl:m3:perf +ppron12:sg:acc:f:sec:akc +num:pl:nom:m1:rec +impt:pl:sec:imperf +pact:pl:nom:m1:imperf:aff +num:pl:gen:f:rec +adj:sg:nom:f:sup +impt:pl:pri:imperf +pact:pl:gen:f:imperf:aff +praet:pl:n:perf +subst:sg:voc:f +subst:pl:loc:m3 +num:pl:gen:m2:rec +subst:pl:loc:m1 +adj:pl:loc:m3:pos +num:pl:nom:f:rec +praet:sg:n:perf +fin:sg:sec:perf +adj:sg:acc:f:sup +praet:sg:f:perf +ppas:sg:gen:n:perf:aff +imps:imperf +fin:pl:pri:imperf +praet:sg:n:imperf +adv:sup +num:pl:gen:m2:congr +fin:sg:pri:perf +prep:acc +prep:acc:nwok +adj:pl:gen:m3:pos +subst:sg:dat:m2 +subst:sg:dat:m3 +subst:sg:dat:m1 +ppron3:pl:inst:m1:ter:akc:praep +ger:sg:acc:n:imperf:aff +adj:pl:nom:f:pos +depr:pl:nom:m2 +ppron3:sg:nom:n:ter:akc:npraep +num:sg:gen:m3:rec +subst:pl:dat:m1 +subst:pl:dat:m2 +subst:pl:dat:m3 +depr:pl:acc:m2 +pact:sg:nom:f:imperf:aff +fin:pl:pri:perf +num:pl:nom:n:congr +adj:sg:nom:f:com +num:pl:acc:n:rec +subst:pl:inst:f +num:sg:nom:f:rec +subst:pl:inst:n diff --git a/wcrft-app/main.cpp b/wcrft-app/main.cpp index 0b0f50be1c6873a1fbe7b37bc239bcce3ec5f853..9e2b96a5fe4b3cc044950f5a60c0f3b82f06e81f 100644 --- a/wcrft-app/main.cpp +++ b/wcrft-app/main.cpp @@ -18,6 +18,7 @@ #include <utility> #include <vector> +#include <boost/algorithm/string/replace.hpp> #include <boost/foreach.hpp> #include <boost/program_options.hpp> @@ -27,15 +28,23 @@ #include "program_options.h" -const std::string ADDITIONAL_FORMAT_INFO = "INFO: formats: txt premorph; require installed Maca and Morfeusz\n" + Wcrft::FORMAT_HELP; +const std::string ADDITIONAL_FORMAT_INFO = +"Supported I/O formats: txt premorph; require installed Maca and Morfeusz\n" + +boost::algorithm::replace_all_copy(Wcrft::FORMAT_HELP, "input formats: ccl", + "input formats: txt premorph ccl"); const std::string DESCRIPTION = "wcrft [options] CONFIGFILE [INPUT...]\n\ \n\ WCRFT, Wroclaw CRF Tagger\n\ (C) 2012, Wroclaw University of Technology\n\ \n\ -Tags input file(s) using the selected configuration. Use -d to specify where to\n\ -look for a trained tagger model (or where to store a model when training).\n\ +Tags input file(s) using the selected configuration (e.g. nkjk_e2.ini).\ +Configurations may provide default name of a trained tagger model\ +(the standard configurations do) so if both the tagger and the model\ +is installed properly, you don't have to worry about traned tagger model.\ +Otherwise, you can use -d to specify where to look for a trained tagger model.\ +This may also be used to override default model dir. When training,\ +use -d to specify a directory where trained model should be saved.\n\ \n\ Use -O to specify output path (by default will write to stdout).\n\ Use - to tag stdin to stdout.\n\ diff --git a/wcrft-app/program_options.cpp b/wcrft-app/program_options.cpp index f8b196d64c81ce00a1fb9ec8a19684db7840bc34..defe981a6da2a76c3b4c75074b7aa85f02f40427 100644 --- a/wcrft-app/program_options.cpp +++ b/wcrft-app/program_options.cpp @@ -32,10 +32,10 @@ prog_opts::options_description create_options_description(const std::string& des ("input-format,i", prog_opts::value<std::string>()->default_value("xces"), "set the input format") ("output-format,o", prog_opts::value<std::string>()->default_value("xces"), "set the output format") ("output-file,O", prog_opts::value<std::string>()->default_value(""), "set output filename (do not write to stdout)") - ("data-dir,d", prog_opts::value<std::string>(), "assume WCCL and trained model to sit in the given dir") + ("data-dir,d", prog_opts::value<std::string>(), "search for trainedmodel in the given dir") ("maca-config,mc", prog_opts::value<std::string>()->default_value("morfeusz_nkjp"), "overrides maca config file") ("ambiguity,A", prog_opts::value<bool>()->default_value(false), "preserve non-disamb interpretations after tagging") - ("chunks,C", prog_opts::value<bool>()->default_value(true), "preserve input paragraph chunks") + ("chunks,C", prog_opts::value<bool>()->default_value(false), "preserve input paragraph chunks (the default is to read sentences only)") ("verbose,v", prog_opts::value<bool>()->default_value(false), "verbose mode") ("train", prog_opts::value<bool>()->default_value(false), "train the tagger") ("batch", prog_opts::value<bool>()->default_value(false), "treat arguments as lists of paths to files")