You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by Nicolas Hernandez <ni...@gmail.com> on 2012/06/20 15:02:18 UTC

Training the pos tagger on "multi whitespace-separated tokens" terms

Hi Everyone

I need to train the POS tagger on multi-word terms. In other words,
some of my lexical units are made several tokens separated by
whitespace characters (like "traffic light", "feu rouge", "in order
to", ...).

I thing the training API allows to handle that but the command line
tools cannot. The former takes the words of a sentence as an array of
string. The latter assumes that the whitespace character is the
lexical unit separator.
A convention like concatenating all the words which are part of a
multi word term is not a solution since in that case models built by
the command line and by the API will be different.

It would be great if we could set by parameter what is the lexical
unit separator as well pos tag separator.

What do you think ?

/Nicolas

[1] http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
Hello,

I created a jira for the tag separator suppport:
https://issues.apache.org/jira/browse/OPENNLP-514

Lets finish the discussion about the mulit-word-unit support
first before we create a jira for it.

Jörn

On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
> Hi Everyone
>
> I need to train the POS tagger on multi-word terms. In other words,
> some of my lexical units are made several tokens separated by
> whitespace characters (like "traffic light", "feu rouge", "in order
> to", ...).
>
> I thing the training API allows to handle that but the command line
> tools cannot. The former takes the words of a sentence as an array of
> string. The latter assumes that the whitespace character is the
> lexical unit separator.
> A convention like concatenating all the words which are part of a
> multi word term is not a solution since in that case models built by
> the command line and by the API will be different.
>
> It would be great if we could set by parameter what is the lexical
> unit separator as well pos tag separator.
>
> What do you think ?
>
> /Nicolas
>
> [1] http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)



Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
I will have look at this next week. It should be possible
to train the POS Tagger directly from the file.

Anyway, we still need to over some options for tag set
and multi word handling.
It should be easy for a user to provide a tag-set mapping in case
they want to change something during training.

Jörn

On 06/21/2012 05:31 PM, Nicolas Hernandez wrote:
> On Thu, Jun 21, 2012 at 10:00 AM, Jörn Kottmann<ko...@gmail.com>  wrote:
>> BTW, if you are training on the FrenchTreebank.
>> We have dedicated format support for it in the trunk, would be
>> easy to do the POS training with it.
> =)
> I didn't know. It is nice for opennlp. I am sorry I did not answered
> you about your invitation to integrate my own code. My approach was
> not dedicated to the parsing of the FrenchTreebank. So I could not
> integrate it easily.
>
> I ve tried the converter. I am not sure how to use it ?
> [2] gives a sentence per line with no pos tag associated with the tokens.
>
> Anyway, it is very tricky to choose  what considering as tokens either
> compound or only simple words, or what pos tag to give to the tokens.
> I am not sure to understand well the choices which have been made in [1].
> As soon as I manage to make the converter works, it will be more
> simple to see them.
>
> Best regards
>
> [1] http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java?view=markup
> [2] ./bin/opennlp ParserConverter frenchtreebank  -lang fr -data my/ftb/dir/
>
>>
>> Jörn
>>
>> On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
>>> Hi Everyone
>>>
>>> I need to train the POS tagger on multi-word terms. In other words,
>>> some of my lexical units are made several tokens separated by
>>> whitespace characters (like "traffic light", "feu rouge", "in order
>>> to", ...).
>>>
>>> I thing the training API allows to handle that but the command line
>>> tools cannot. The former takes the words of a sentence as an array of
>>> string. The latter assumes that the whitespace character is the
>>> lexical unit separator.
>>> A convention like concatenating all the words which are part of a
>>> multi word term is not a solution since in that case models built by
>>> the command line and by the API will be different.
>>>
>>> It would be great if we could set by parameter what is the lexical
>>> unit separator as well pos tag separator.
>>>
>>> What do you think ?
>>>
>>> /Nicolas
>>>
>>> [1]
>>> http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)
>>
>
>


Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
On Wed, Jun 27, 2012 at 3:50 PM, Jörn Kottmann <ko...@gmail.com> wrote:
> On 06/27/2012 03:34 PM, Nicolas Hernandez wrote:
>>
>> Since I like to use the maltparser [1], I need now to adapt the ftb to
>> a tag set called ftb+ as described by [2].
>> (only multi-word expressions which can be recognized by regular
>> expression are considered, some pos tags result in the concatenation
>> of the cat and subcat attributes...)
>>
>> I plan to do it by processing the MarkupAnnotations provided by the
>> Tika MarkupAnnotator [3].
>
>
> Do you plan to use the UIMA POS Tagger Trainer to produce a model for you?

Actually... I use the POS Tagger Trainer CLI because I use some tools
which detect and correct annotation errors but work on this format...

>
> We could add support for ftb+ tag sets to the code that produces training
> data
> out of the FTB.
>
> With the separator support in the training format that should work out fine
> in the end.
> The CLI tools also give you easy access to the build-in evaluation.
>
> Jörn



-- 
Dr. Nicolas Hernandez
Associate Professor (Maître de Conférences)
Université de Nantes - LINA CNRS UMR 6241
http://enicolashernandez.blogspot.com
http://www.univ-nantes.fr/hernandez-n
+33 (0)2 51 12 53 94
+33 (0)2 40 30 60 67

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
On 06/27/2012 03:34 PM, Nicolas Hernandez wrote:
> Since I like to use the maltparser [1], I need now to adapt the ftb to
> a tag set called ftb+ as described by [2].
> (only multi-word expressions which can be recognized by regular
> expression are considered, some pos tags result in the concatenation
> of the cat and subcat attributes...)
>
> I plan to do it by processing the MarkupAnnotations provided by the
> Tika MarkupAnnotator [3].

Do you plan to use the UIMA POS Tagger Trainer to produce a model for you?

We could add support for ftb+ tag sets to the code that produces 
training data
out of the FTB.

With the separator support in the training format that should work out 
fine in the end.
The CLI tools also give you easy access to the build-in evaluation.

Jörn

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
On Wed, Jun 27, 2012 at 10:40 AM, Jörn Kottmann <ko...@gmail.com> wrote:
> On 06/21/2012 05:31 PM, Nicolas Hernandez wrote:
>>
>> On Thu, Jun 21, 2012 at 10:00 AM, Jörn Kottmann <ko...@gmail.com>
>> wrote:
>>>
>>> BTW, if you are training on the FrenchTreebank.
>>> We have dedicated format support for it in the trunk, would be
>>> easy to do the POS training with it.
>>
>> =)
>> I didn't know. It is nice for opennlp. I am sorry I did not answered
>> you about your invitation to integrate my own code. My approach was
>> not dedicated to the parsing of the FrenchTreebank. So I could not
>> integrate it easily.
>>
>> I ve tried the converter. I am not sure how to use it ?
>> [2] gives a sentence per line with no pos tag associated with the tokens.
>>
>> Anyway, it is very tricky to choose  what considering as tokens either
>> compound or only simple words, or what pos tag to give to the tokens.
>> I am not sure to understand well the choices which have been made in [1].
>> As soon as I manage to make the converter works, it will be more
>> simple to see them.
>
>
> The current implementation uses the same tag for all multi-word-unit
> tokens.
> For example: in_order_to/IN will be in/IN oder/IN to/IN.
>
> Would you use the pos tags as they are in the data? Maybe it would be useful
> to add support for pos tag mappings. This would make it easy to experiment
> with
> different tag sets.

It is never easy to map tagsets since there is rarely a bijective
relation and in addition, both process should assume the same
tokenization.

I made several experiences.

Since I like to use the maltparser [1], I need now to adapt the ftb to
a tag set called ftb+ as described by [2].
(only multi-word expressions which can be recognized by regular
expression are considered, some pos tags result in the concatenation
of the cat and subcat attributes...)

I plan to do it by processing the MarkupAnnotations provided by the
Tika MarkupAnnotator [3].

[1] http://www.maltparser.org/mco/french_parser/fremalt.html
[2] P. Denis and B. Sagot. 2009. Coupling an annotated corpus and a
morphosyntactic lexicon for state-of-the-art POS tagging with less
human effort. In Proceedings of The Pacific Asia Conference on
Language, Information and Computation (PACLIC 23), Hong Kong, China.
[3] http://uima.apache.org/sandbox.html#tika.annotator


>
> Looks like we want to give the user some options on how these cases will be
> handled.
>
> We need to add direct support for training the POS Tagger on this data.
> Then you can do:
> bin/opennlp POSTaggerConverter frenchtreebank ...
>
> There is a problem with the Parse object and the way the command line tools
> are build. The cli tools assume that hey can serialize via toString a sample
> object
> into training data, but that does not work for the Parse object yet. To fix
> that we need
> to make a breaking API change and need to refactor some code in the coref
> component.
> Anyway it would be nice to get the parser trained on it as well.
>
> Jörn

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
On 06/21/2012 05:31 PM, Nicolas Hernandez wrote:
> On Thu, Jun 21, 2012 at 10:00 AM, Jörn Kottmann <ko...@gmail.com> wrote:
>> BTW, if you are training on the FrenchTreebank.
>> We have dedicated format support for it in the trunk, would be
>> easy to do the POS training with it.
> =)
> I didn't know. It is nice for opennlp. I am sorry I did not answered
> you about your invitation to integrate my own code. My approach was
> not dedicated to the parsing of the FrenchTreebank. So I could not
> integrate it easily.
>
> I ve tried the converter. I am not sure how to use it ?
> [2] gives a sentence per line with no pos tag associated with the tokens.
>
> Anyway, it is very tricky to choose  what considering as tokens either
> compound or only simple words, or what pos tag to give to the tokens.
> I am not sure to understand well the choices which have been made in [1].
> As soon as I manage to make the converter works, it will be more
> simple to see them.

The current implementation uses the same tag for all multi-word-unit
tokens.
For example: in_order_to/IN will be in/IN oder/IN to/IN.

Would you use the pos tags as they are in the data? Maybe it would be useful
to add support for pos tag mappings. This would make it easy to 
experiment with
different tag sets.

Looks like we want to give the user some options on how these cases will 
be handled.

We need to add direct support for training the POS Tagger on this data.
Then you can do:
bin/opennlp POSTaggerConverter frenchtreebank ...

There is a problem with the Parse object and the way the command line tools
are build. The cli tools assume that hey can serialize via toString a 
sample object
into training data, but that does not work for the Parse object yet. To 
fix that we need
to make a breaking API change and need to refactor some code in the 
coref component.
Anyway it would be nice to get the parser trained on it as well.

Jörn

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
On Thu, Jun 21, 2012 at 10:00 AM, Jörn Kottmann <ko...@gmail.com> wrote:
> BTW, if you are training on the FrenchTreebank.
> We have dedicated format support for it in the trunk, would be
> easy to do the POS training with it.

=)
I didn't know. It is nice for opennlp. I am sorry I did not answered
you about your invitation to integrate my own code. My approach was
not dedicated to the parsing of the FrenchTreebank. So I could not
integrate it easily.

I ve tried the converter. I am not sure how to use it ?
[2] gives a sentence per line with no pos tag associated with the tokens.

Anyway, it is very tricky to choose  what considering as tokens either
compound or only simple words, or what pos tag to give to the tokens.
I am not sure to understand well the choices which have been made in [1].
As soon as I manage to make the converter works, it will be more
simple to see them.

Best regards

[1] http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitDocumentHandler.java?view=markup
[2] ./bin/opennlp ParserConverter frenchtreebank  -lang fr -data my/ftb/dir/

>
>
> Jörn
>
> On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
>>
>> Hi Everyone
>>
>> I need to train the POS tagger on multi-word terms. In other words,
>> some of my lexical units are made several tokens separated by
>> whitespace characters (like "traffic light", "feu rouge", "in order
>> to", ...).
>>
>> I thing the training API allows to handle that but the command line
>> tools cannot. The former takes the words of a sentence as an array of
>> string. The latter assumes that the whitespace character is the
>> lexical unit separator.
>> A convention like concatenating all the words which are part of a
>> multi word term is not a solution since in that case models built by
>> the command line and by the API will be different.
>>
>> It would be great if we could set by parameter what is the lexical
>> unit separator as well pos tag separator.
>>
>> What do you think ?
>>
>> /Nicolas
>>
>> [1]
>> http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)
>
>



-- 
Dr. Nicolas Hernandez
Associate Professor (Maître de Conférences)
Université de Nantes - LINA CNRS UMR 6241
http://enicolashernandez.blogspot.com
http://www.univ-nantes.fr/hernandez-n
+33 (0)2 51 12 53 94
+33 (0)2 40 30 60 67

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
BTW, if you are training on the FrenchTreebank.
We have dedicated format support for it in the trunk, would be
easy to do the POS training with it.

Jörn

On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
> Hi Everyone
>
> I need to train the POS tagger on multi-word terms. In other words,
> some of my lexical units are made several tokens separated by
> whitespace characters (like "traffic light", "feu rouge", "in order
> to", ...).
>
> I thing the training API allows to handle that but the command line
> tools cannot. The former takes the words of a sentence as an array of
> string. The latter assumes that the whitespace character is the
> lexical unit separator.
> A convention like concatenating all the words which are part of a
> multi word term is not a solution since in that case models built by
> the command line and by the API will be different.
>
> It would be great if we could set by parameter what is the lexical
> unit separator as well pos tag separator.
>
> What do you think ?
>
> /Nicolas
>
> [1] http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)


Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by William Colen <wi...@gmail.com>.
Hello,

I have similar issues in the Portuguese corpus.

I tried two approaches:

1) I trained an OpenNLP Name Finder model with the MWE extracted from the
corpus;
2) I divided the MWE in separated tokens while training the POS Tagger, for
example "por_favor_intj" --> "por_B-intj favor_I-intj"

Both approaches are OK in my system, I evaluated both but I don't have it
right now. l can post the values here another day. I prefer the second
method because it is one module less, but on the other hand we increase the
number of outcomes.

William


On Fri, Jun 22, 2012 at 6:13 AM, Nicolas Hernandez <
nicolas.hernandez@gmail.com> wrote:

> On Thu, Jun 21, 2012 at 5:55 PM, Jörn Kottmann <ko...@gmail.com> wrote:
> > To make this reliable the tokenization on new unseen
> > text must be done correctly. For the spanish data we had
> > a special chunker to put the multi word units into one token.
> >
> > Do you use something like that?
>
> A kind of.
>
> A POS tagger should always be used with the tokenizer which was used
> for the POS tagger trainer.
> The more you manage to automatically recognize multi word units, the
> more you should consider them for your training. It makes easier the
> further syntax analysis.
> (interaction can exist between the two processes (i.e. recognizing
> multi words units can require a pos tagging of simple words) but I won
> t speak about that).
>
> In the FTB, the notion of multi-word expression (compound) is a bit
> fuzzy and it is not simple to automatically process the same
> tokenization which is assumed.
>
> >
> > What do you think about outputting a special pos tag to indicate
> > that it is a multi-word tag?
>
> I do not see the point at the pos analysis level. We must try to
> re-use what it exists to preserve the compatibility.
> Here I should mention that [Green:2011:MEI:2145432.2145516] (see
> below) introduced multi-word tags (one for each pos label mw noun, mw
> verb, mw preposition...) at the chunk and syntax levels. This is
> probably a nice idea.
>
>
> The cli should offer a way to specify what are multi-word expressions
> in the data.
> This can be done by using a parameter to set what is the token
> separator character.
>
> Models built from the cli or the API should be the same.
> One way to do that is to use a parameter to set what is the multi-word
> separator character and to turn this separator character into
> whitespace before training the model.
> For example with " " as the token separator character, "_" as the
> multi-word separator character and "/" as the pos tag separator, the
> following sentence
> Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
> sleep/VB longer/RB
> should be turn into
> String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
> "earlier", "in order to", "sleep", "longer"};
> (note "in order to")
> What do you think about ?
>
> Best
>
> /Nicolas
>
>
> @inproceedings{Green:2011:MEI:2145432.2145516,
>  author = {Green, Spence and de Marneffe, Marie-Catherine and Bauer,
> John and Manning, Christopher D.},
>  title = {Multiword expression identification with tree substitution
> grammars: a parsing tour de force with French},
>  booktitle = {Proceedings of the Conference on Empirical Methods in
> Natural Language Processing},
>  series = {EMNLP '11},
>  year = {2011},
>  isbn = {978-1-937284-11-4},
>  location = {Edinburgh, United Kingdom},
>  pages = {725--735},
>  numpages = {11},
>  url = {http://dl.acm.org/citation.cfm?id=2145432.2145516},
>  acmid = {2145516},
>  publisher = {Association for Computational Linguistics},
>  address = {Stroudsburg, PA, USA},
> }
>
>
> >
> > Jörn
> >
> >
> > On 06/21/2012 04:47 PM, Nicolas Hernandez wrote:
> >>
> >> Hi Jörn
> >>
> >> On Thu, Jun 21, 2012 at 9:50 AM, Jörn Kottmann<ko...@gmail.com>
>  wrote:
> >>>
> >>> Hello,
> >>>
> >>> the lexical unit in the POS Tagger is a token. For the
> >>> spanish POS models mutli-token chunks were converted
> >>> into one token separated by a "_".
> >>>
> >>> To what would you set the lexical unit separator in your case?
> >>
> >> I do the same, but ... I m a bit confused of doing that because
> >> 1. I do not like pre and post process my data (here to add/remove an
> >> underscore to the multi-words terms)
> >> 2. A model trained with the API, which allows you not to preprocess
> >> your data, will be different from the model trained with the cli on
> >> the same data
> >> 3. Finally when you get a model you do not know which segmentation it
> >> assumes and how the multi-words terms are represented
> >>
> >> Since it is often convenient to use the cli it would be nice to set
> >> the token separator at least to be able to build the same models than
> >> with the API.
> >>
> >>> The pos tag separator can already be configured in the class
> >>> which reads the input, but this parameter is not be set by the cli
> >>> tool.
> >>>
> >>> +1 to make both configurable from the command line.
> >>
> >> Nice.
> >>
> >> At least the idea has been proposed. If I have time...
> >>
> >>> Jörn
> >>>
> >>>
> >>> On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
> >>>>
> >>>> Hi Everyone
> >>>>
> >>>> I need to train the POS tagger on multi-word terms. In other words,
> >>>> some of my lexical units are made several tokens separated by
> >>>> whitespace characters (like "traffic light", "feu rouge", "in order
> >>>> to", ...).
> >>>>
> >>>> I thing the training API allows to handle that but the command line
> >>>> tools cannot. The former takes the words of a sentence as an array of
> >>>> string. The latter assumes that the whitespace character is the
> >>>> lexical unit separator.
> >>>> A convention like concatenating all the words which are part of a
> >>>> multi word term is not a solution since in that case models built by
> >>>> the command line and by the API will be different.
> >>>>
> >>>> It would be great if we could set by parameter what is the lexical
> >>>> unit separator as well pos tag separator.
> >>>>
> >>>> What do you think ?
> >>>>
> >>>> /Nicolas
> >>>>
> >>>> [1]
> >>>>
> >>>>
> http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api
> )
> >>>
> >>>
> >>
> >>
> >
>
>
>
> --
> Dr. Nicolas Hernandez
> Associate Professor (Maître de Conférences)
> Université de Nantes - LINA CNRS UMR 6241
> http://enicolashernandez.blogspot.com
> http://www.univ-nantes.fr/hernandez-n
> +33 (0)2 51 12 53 94
> +33 (0)2 40 30 60 67
>

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Lance Norskog <go...@gmail.com>.
The average Chinese word has 1.5 ideograms. The multi-character words
do not have a simple dictionary, but "clump" in context-sensitive
ways. The "Smart Chinese" package in Lucene uses hidden markov models
to decide where to break word groups. Is this the kind of multi-word
finder you had in mind?

On Wed, Jun 27, 2012 at 1:03 AM, Jörn Kottmann <ko...@gmail.com> wrote:
> On 06/22/2012 11:13 AM, Nicolas Hernandez wrote:
>>
>> On Thu, Jun 21, 2012 at 5:55 PM, Jörn Kottmann <ko...@gmail.com> wrote:
>>>
>>> To make this reliable the tokenization on new unseen
>>> text must be done correctly. For the spanish data we had
>>> a special chunker to put the multi word units into one token.
>>>
>>> Do you use something like that?
>>
>> A kind of.
>>
>> A POS tagger should always be used with the tokenizer which was used
>> for the POS tagger trainer.
>> The more you manage to automatically recognize multi word units, the
>> more you should consider them for your training. It makes easier the
>> further syntax analysis.
>> (interaction can exist between the two processes (i.e. recognizing
>> multi words units can require a pos tagging of simple words) but I won
>> t speak about that).
>
>
> At some place we need multi-word-unit detection. If you do that
> in our tokenizer than it will affect all components which rely on the
> tokenization e.g. also NER.
>
>
>
>>> What do you think about outputting a special pos tag to indicate
>>> that it is a multi-word tag?
>>
>> I do not see the point at the pos analysis level. We must try to
>> re-use what it exists to preserve the compatibility.
>> Here I should mention that [Green:2011:MEI:2145432.2145516] (see
>> below) introduced multi-word tags (one for each pos label mw noun, mw
>> verb, mw preposition...) at the chunk and syntax levels. This is
>> probably a nice idea.
>
>
> That would move the responsibility to detect multi-word-units
> to the POS Tagger.
>
> A simple transformation step could convert the output to the
> non-multi-word-tags format.
>
> This has the advantage that a user can detect a multi-word unit.
>
>
>>
>> The cli should offer a way to specify what are multi-word expressions
>> in the data.
>> This can be done by using a parameter to set what is the token
>> separator character.
>>
>> Models built from the cli or the API should be the same.
>> One way to do that is to use a parameter to set what is the multi-word
>> separator character and to turn this separator character into
>> whitespace before training the model.
>> For example with " " as the token separator character, "_" as the
>> multi-word separator character and "/" as the pos tag separator, the
>> following sentence
>> Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
>> sleep/VB longer/RB
>> should be turn into
>> String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
>> "earlier", "in order to", "sleep", "longer"};
>> (note "in order to")
>> What do you think about ?
>>
>>
>
> I think that could be problematic if your training or test data contains
> the multi-word-separator character. In this case you might consider
> something
> as a multi-word-unit which should not be one.
> What do you think about using SGML style tags as we do in the NER training
> format?
> For example: <MW>in order to</MW>/IN.
>
> Would you prefer, dealing with multi-word-units at the tokenizer level
> or at the POS Tagger level?
> Or do we need support for both?
>
> Jörn
>



-- 
Lance Norskog
goksron@gmail.com

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
On Wed, Jun 27, 2012 at 3:40 PM, Jörn Kottmann <ko...@gmail.com> wrote:
> On 06/27/2012 03:07 PM, Nicolas Hernandez wrote:
>>
>> On Wed, Jun 27, 2012 at 10:03 AM, Jörn Kottmann <ko...@gmail.com>
>> wrote:
>>
>>>
>>> That would move the responsibility to detect multi-word-units
>>> to the POS Tagger.
>>>
>>> A simple transformation step could convert the output to the
>>> non-multi-word-tags format.
>>>
>>> This has the advantage that a user can detect a multi-word unit.
>>
>> The "special pos tags" would be for the whole multi-word expressions
>> (MWE) or for each word of the MWE ?
>>
>> Anyway, according to me, the pos tagger trainer should not be aware of
>> that and we must not force the users to change their tagset to use the
>> opennlp tools.
>> If the data is annotated with pos tags which inform about MWE then
>> they will be handled like any tags over simple words.
>
>
> Yes that should just work with our current way of handling the data.
> A user even has the option with the current implementation to customize
> the POS Tagger to handle it differently, even including a custom
> MWE detector model in the pos model package would be possible.
>
> That should be fine as it is.
>
>>>> The cli should offer a way to specify what are multi-word expressions
>>>> in the data.
>>>> This can be done by using a parameter to set what is the token
>>>> separator character.
>>>>
>>>> Models built from the cli or the API should be the same.
>>>> One way to do that is to use a parameter to set what is the multi-word
>>>> separator character and to turn this separator character into
>>>> whitespace before training the model.
>>>> For example with " " as the token separator character, "_" as the
>>>> multi-word separator character and "/" as the pos tag separator, the
>>>> following sentence
>>>> Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
>>>> sleep/VB longer/RB
>>>> should be turn into
>>>> String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
>>>> "earlier", "in order to", "sleep", "longer"};
>>>> (note "in order to")
>>>> What do you think about ?
>>>>
>>>>
>>> I think that could be problematic if your training or test data contains
>>> the multi-word-separator character. In this case you might consider
>>> something
>>> as a multi-word-unit which should not be one.
>>> What do you think about using SGML style tags as we do in the NER
>>> training
>>> format?
>>> For example: <MW>in order to</MW>/IN.
>>
>> I do not like to mix the annotation systems: either everything in XML
>> (<MW pos="IN">in order to</MW>) or not.
>> The multi-word separator can be a string not a character (e.g."_##_"
>> which is quite rare). The point is that the user should be informed
>> about the problem you mention and since it is up to him to set the
>> string by parameter, he will do an aware and wise choice.
>> If you mix both annotations systems, then the ambiguity problem
>> remains also for the start tag and end tag you use.
>>
>>> Would you prefer, dealing with multi-word-units at the tokenizer level
>>> or at the POS Tagger level?
>>> Or do we need support for both?
>>
>>
>> I think we agree that whatever the analyzers we use (POS, Chunk,
>> Parser, NER...), all should have been built on data word-tokenized in
>> the same way.
>
>
> If  a token can be a MWE then we need to fix all our formats to
> support the MWE separator char sequence. Currently we use the whitespace
> tokenizer in most of the places to process our training data.
> That we should change and use one which is sensitive to MWEs separated by
> a char sequence.
>
> We should specify a default MWE separator which is used when serializing
> data with MWEs
> and offer an option to specify it.
>
>
>> Personally I do not use the OpenNLP word tokenizer. Actually I used it
>> but I also use dictionaries and regex expressions which lead me to a
>> richer concept of "word" (what it is called "lexical unit"). I take
>> them as input of my processing chain.
>>
>> And since I used also UIMA and since UIMA process annotations. If the
>> annotation stands for "lexical unit", some can be MWE or simple word,
>> it is transparent for the user.
>>
>> So I would have like that the OpenNLP pos tagger/trainer cli offer me
>> a way to build models I can use with UIMA without pre/post processing.
>>
>> In my opinion, an OpenNLP labeller/trainer should offer the
>> possibility to the users of adapting its input/output to the users'
>> data and not the opposite.
>
>
> Yes, I see this in the same way.
>
> Would you mind to open a jira issue to request MWE support in our
> training formats?
>
> Jörn
>

done

https://issues.apache.org/jira/browse/OPENNLP-515

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
On 06/27/2012 03:07 PM, Nicolas Hernandez wrote:
> On Wed, Jun 27, 2012 at 10:03 AM, Jörn Kottmann <ko...@gmail.com> wrote:
>
>>
>> That would move the responsibility to detect multi-word-units
>> to the POS Tagger.
>>
>> A simple transformation step could convert the output to the
>> non-multi-word-tags format.
>>
>> This has the advantage that a user can detect a multi-word unit.
> The "special pos tags" would be for the whole multi-word expressions
> (MWE) or for each word of the MWE ?
>
> Anyway, according to me, the pos tagger trainer should not be aware of
> that and we must not force the users to change their tagset to use the
> opennlp tools.
> If the data is annotated with pos tags which inform about MWE then
> they will be handled like any tags over simple words.

Yes that should just work with our current way of handling the data.
A user even has the option with the current implementation to customize
the POS Tagger to handle it differently, even including a custom
MWE detector model in the pos model package would be possible.

That should be fine as it is.

>>> The cli should offer a way to specify what are multi-word expressions
>>> in the data.
>>> This can be done by using a parameter to set what is the token
>>> separator character.
>>>
>>> Models built from the cli or the API should be the same.
>>> One way to do that is to use a parameter to set what is the multi-word
>>> separator character and to turn this separator character into
>>> whitespace before training the model.
>>> For example with " " as the token separator character, "_" as the
>>> multi-word separator character and "/" as the pos tag separator, the
>>> following sentence
>>> Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
>>> sleep/VB longer/RB
>>> should be turn into
>>> String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
>>> "earlier", "in order to", "sleep", "longer"};
>>> (note "in order to")
>>> What do you think about ?
>>>
>>>
>> I think that could be problematic if your training or test data contains
>> the multi-word-separator character. In this case you might consider
>> something
>> as a multi-word-unit which should not be one.
>> What do you think about using SGML style tags as we do in the NER training
>> format?
>> For example: <MW>in order to</MW>/IN.
> I do not like to mix the annotation systems: either everything in XML
> (<MW pos="IN">in order to</MW>) or not.
> The multi-word separator can be a string not a character (e.g."_##_"
> which is quite rare). The point is that the user should be informed
> about the problem you mention and since it is up to him to set the
> string by parameter, he will do an aware and wise choice.
> If you mix both annotations systems, then the ambiguity problem
> remains also for the start tag and end tag you use.
>
>> Would you prefer, dealing with multi-word-units at the tokenizer level
>> or at the POS Tagger level?
>> Or do we need support for both?
>
> I think we agree that whatever the analyzers we use (POS, Chunk,
> Parser, NER...), all should have been built on data word-tokenized in
> the same way.

If  a token can be a MWE then we need to fix all our formats to
support the MWE separator char sequence. Currently we use the whitespace
tokenizer in most of the places to process our training data.
That we should change and use one which is sensitive to MWEs separated by
a char sequence.

We should specify a default MWE separator which is used when serializing 
data with MWEs
and offer an option to specify it.

> Personally I do not use the OpenNLP word tokenizer. Actually I used it
> but I also use dictionaries and regex expressions which lead me to a
> richer concept of "word" (what it is called "lexical unit"). I take
> them as input of my processing chain.
>
> And since I used also UIMA and since UIMA process annotations. If the
> annotation stands for "lexical unit", some can be MWE or simple word,
> it is transparent for the user.
>
> So I would have like that the OpenNLP pos tagger/trainer cli offer me
> a way to build models I can use with UIMA without pre/post processing.
>
> In my opinion, an OpenNLP labeller/trainer should offer the
> possibility to the users of adapting its input/output to the users'
> data and not the opposite.

Yes, I see this in the same way.

Would you mind to open a jira issue to request MWE support in our
training formats?

Jörn


Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
On Wed, Jun 27, 2012 at 10:03 AM, Jörn Kottmann <ko...@gmail.com> wrote:
> On 06/22/2012 11:13 AM, Nicolas Hernandez wrote:
>>
>> On Thu, Jun 21, 2012 at 5:55 PM, Jörn Kottmann <ko...@gmail.com> wrote:
>>>
>>> To make this reliable the tokenization on new unseen
>>> text must be done correctly. For the spanish data we had
>>> a special chunker to put the multi word units into one token.
>>>
>>> Do you use something like that?
>>
>> A kind of.
>>
>> A POS tagger should always be used with the tokenizer which was used
>> for the POS tagger trainer.
>> The more you manage to automatically recognize multi word units, the
>> more you should consider them for your training. It makes easier the
>> further syntax analysis.
>> (interaction can exist between the two processes (i.e. recognizing
>> multi words units can require a pos tagging of simple words) but I won
>> t speak about that).
>
>
> At some place we need multi-word-unit detection. If you do that
> in our tokenizer than it will affect all components which rely on the
> tokenization e.g. also NER.
>
>
>
>>> What do you think about outputting a special pos tag to indicate
>>> that it is a multi-word tag?
>>
>> I do not see the point at the pos analysis level. We must try to
>> re-use what it exists to preserve the compatibility.
>> Here I should mention that [Green:2011:MEI:2145432.2145516] (see
>> below) introduced multi-word tags (one for each pos label mw noun, mw
>> verb, mw preposition...) at the chunk and syntax levels. This is
>> probably a nice idea.
>
>
> That would move the responsibility to detect multi-word-units
> to the POS Tagger.
>
> A simple transformation step could convert the output to the
> non-multi-word-tags format.
>
> This has the advantage that a user can detect a multi-word unit.

The "special pos tags" would be for the whole multi-word expressions
(MWE) or for each word of the MWE ?

Anyway, according to me, the pos tagger trainer should not be aware of
that and we must not force the users to change their tagset to use the
opennlp tools.
If the data is annotated with pos tags which inform about MWE then
they will be handled like any tags over simple words.


>
>>
>> The cli should offer a way to specify what are multi-word expressions
>> in the data.
>> This can be done by using a parameter to set what is the token
>> separator character.
>>
>> Models built from the cli or the API should be the same.
>> One way to do that is to use a parameter to set what is the multi-word
>> separator character and to turn this separator character into
>> whitespace before training the model.
>> For example with " " as the token separator character, "_" as the
>> multi-word separator character and "/" as the pos tag separator, the
>> following sentence
>> Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
>> sleep/VB longer/RB
>> should be turn into
>> String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
>> "earlier", "in order to", "sleep", "longer"};
>> (note "in order to")
>> What do you think about ?
>>
>>
>
> I think that could be problematic if your training or test data contains
> the multi-word-separator character. In this case you might consider
> something
> as a multi-word-unit which should not be one.
> What do you think about using SGML style tags as we do in the NER training
> format?
> For example: <MW>in order to</MW>/IN.

I do not like to mix the annotation systems: either everything in XML
(<MW pos="IN">in order to</MW>) or not.
The multi-word separator can be a string not a character (e.g."_##_"
which is quite rare). The point is that the user should be informed
about the problem you mention and since it is up to him to set the
string by parameter, he will do an aware and wise choice.
If you mix both annotations systems, then the ambiguity problem
remains also for the start tag and end tag you use.

> Would you prefer, dealing with multi-word-units at the tokenizer level
> or at the POS Tagger level?
> Or do we need support for both?

I don t know think that currently (considering the state-of-art in
"(simple/multi)word" tokenization) there is an unique answer to the
question at which level(s) the MWE detection should occur. I see it
can be dealt at several levels.

MWEs are hard to define. They can be defined by regular forms, syntax
composition, semantic composition or none of these criteria.
Consequently many approaches are possible to recognize them: by
dictionary (like DBPedia), by regex (e.g. numbers, emails), by pos
pattern (Adj Noun, Noun Prep Noun), by (B-I-O) chunking...
So some of these approaches can be used at the word tokenization
stage, some other after a first pos tagging stage.

I think we agree that whatever the analyzers we use (POS, Chunk,
Parser, NER...), all should have been built on data word-tokenized in
the same way.

Personally I do not use the OpenNLP word tokenizer. Actually I used it
but I also use dictionaries and regex expressions which lead me to a
richer concept of "word" (what it is called "lexical unit"). I take
them as input of my processing chain.

And since I used also UIMA and since UIMA process annotations. If the
annotation stands for "lexical unit", some can be MWE or simple word,
it is transparent for the user.

So I would have like that the OpenNLP pos tagger/trainer cli offer me
a way to build models I can use with UIMA without pre/post processing.

In my opinion, an OpenNLP labeller/trainer should offer the
possibility to the users of adapting its input/output to the users'
data and not the opposite.

/Nicolas

>
> Jörn
>

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
On 06/22/2012 11:13 AM, Nicolas Hernandez wrote:
> On Thu, Jun 21, 2012 at 5:55 PM, Jörn Kottmann <ko...@gmail.com> wrote:
>> To make this reliable the tokenization on new unseen
>> text must be done correctly. For the spanish data we had
>> a special chunker to put the multi word units into one token.
>>
>> Do you use something like that?
> A kind of.
>
> A POS tagger should always be used with the tokenizer which was used
> for the POS tagger trainer.
> The more you manage to automatically recognize multi word units, the
> more you should consider them for your training. It makes easier the
> further syntax analysis.
> (interaction can exist between the two processes (i.e. recognizing
> multi words units can require a pos tagging of simple words) but I won
> t speak about that).

At some place we need multi-word-unit detection. If you do that
in our tokenizer than it will affect all components which rely on the
tokenization e.g. also NER.


>> What do you think about outputting a special pos tag to indicate
>> that it is a multi-word tag?
> I do not see the point at the pos analysis level. We must try to
> re-use what it exists to preserve the compatibility.
> Here I should mention that [Green:2011:MEI:2145432.2145516] (see
> below) introduced multi-word tags (one for each pos label mw noun, mw
> verb, mw preposition...) at the chunk and syntax levels. This is
> probably a nice idea.

That would move the responsibility to detect multi-word-units
to the POS Tagger.

A simple transformation step could convert the output to the
non-multi-word-tags format.

This has the advantage that a user can detect a multi-word unit.

>
> The cli should offer a way to specify what are multi-word expressions
> in the data.
> This can be done by using a parameter to set what is the token
> separator character.
>
> Models built from the cli or the API should be the same.
> One way to do that is to use a parameter to set what is the multi-word
> separator character and to turn this separator character into
> whitespace before training the model.
> For example with " " as the token separator character, "_" as the
> multi-word separator character and "/" as the pos tag separator, the
> following sentence
> Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
> sleep/VB longer/RB
> should be turn into
> String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
> "earlier", "in order to", "sleep", "longer"};
> (note "in order to")
> What do you think about ?
>
>

I think that could be problematic if your training or test data contains
the multi-word-separator character. In this case you might consider 
something
as a multi-word-unit which should not be one.
What do you think about using SGML style tags as we do in the NER 
training format?
For example: <MW>in order to</MW>/IN.

Would you prefer, dealing with multi-word-units at the tokenizer level
or at the POS Tagger level?
Or do we need support for both?

Jörn


Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
On Thu, Jun 21, 2012 at 5:55 PM, Jörn Kottmann <ko...@gmail.com> wrote:
> To make this reliable the tokenization on new unseen
> text must be done correctly. For the spanish data we had
> a special chunker to put the multi word units into one token.
>
> Do you use something like that?

A kind of.

A POS tagger should always be used with the tokenizer which was used
for the POS tagger trainer.
The more you manage to automatically recognize multi word units, the
more you should consider them for your training. It makes easier the
further syntax analysis.
(interaction can exist between the two processes (i.e. recognizing
multi words units can require a pos tagging of simple words) but I won
t speak about that).

In the FTB, the notion of multi-word expression (compound) is a bit
fuzzy and it is not simple to automatically process the same
tokenization which is assumed.

>
> What do you think about outputting a special pos tag to indicate
> that it is a multi-word tag?

I do not see the point at the pos analysis level. We must try to
re-use what it exists to preserve the compatibility.
Here I should mention that [Green:2011:MEI:2145432.2145516] (see
below) introduced multi-word tags (one for each pos label mw noun, mw
verb, mw preposition...) at the chunk and syntax levels. This is
probably a nice idea.


The cli should offer a way to specify what are multi-word expressions
in the data.
This can be done by using a parameter to set what is the token
separator character.

Models built from the cli or the API should be the same.
One way to do that is to use a parameter to set what is the multi-word
separator character and to turn this separator character into
whitespace before training the model.
For example with " " as the token separator character, "_" as the
multi-word separator character and "/" as the pos tag separator, the
following sentence
Nico/NNP wants/VBP to/TO get/VB to/TO bed/NN earlier/RB in_order_to/IN
sleep/VB longer/RB
should be turn into
String[] sentence = {"Nico", "wants", "to", "get", "to", "bed",
"earlier", "in order to", "sleep", "longer"};
(note "in order to")
What do you think about ?

Best

/Nicolas


@inproceedings{Green:2011:MEI:2145432.2145516,
 author = {Green, Spence and de Marneffe, Marie-Catherine and Bauer,
John and Manning, Christopher D.},
 title = {Multiword expression identification with tree substitution
grammars: a parsing tour de force with French},
 booktitle = {Proceedings of the Conference on Empirical Methods in
Natural Language Processing},
 series = {EMNLP '11},
 year = {2011},
 isbn = {978-1-937284-11-4},
 location = {Edinburgh, United Kingdom},
 pages = {725--735},
 numpages = {11},
 url = {http://dl.acm.org/citation.cfm?id=2145432.2145516},
 acmid = {2145516},
 publisher = {Association for Computational Linguistics},
 address = {Stroudsburg, PA, USA},
}


>
> Jörn
>
>
> On 06/21/2012 04:47 PM, Nicolas Hernandez wrote:
>>
>> Hi Jörn
>>
>> On Thu, Jun 21, 2012 at 9:50 AM, Jörn Kottmann<ko...@gmail.com>  wrote:
>>>
>>> Hello,
>>>
>>> the lexical unit in the POS Tagger is a token. For the
>>> spanish POS models mutli-token chunks were converted
>>> into one token separated by a "_".
>>>
>>> To what would you set the lexical unit separator in your case?
>>
>> I do the same, but ... I m a bit confused of doing that because
>> 1. I do not like pre and post process my data (here to add/remove an
>> underscore to the multi-words terms)
>> 2. A model trained with the API, which allows you not to preprocess
>> your data, will be different from the model trained with the cli on
>> the same data
>> 3. Finally when you get a model you do not know which segmentation it
>> assumes and how the multi-words terms are represented
>>
>> Since it is often convenient to use the cli it would be nice to set
>> the token separator at least to be able to build the same models than
>> with the API.
>>
>>> The pos tag separator can already be configured in the class
>>> which reads the input, but this parameter is not be set by the cli
>>> tool.
>>>
>>> +1 to make both configurable from the command line.
>>
>> Nice.
>>
>> At least the idea has been proposed. If I have time...
>>
>>> Jörn
>>>
>>>
>>> On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
>>>>
>>>> Hi Everyone
>>>>
>>>> I need to train the POS tagger on multi-word terms. In other words,
>>>> some of my lexical units are made several tokens separated by
>>>> whitespace characters (like "traffic light", "feu rouge", "in order
>>>> to", ...).
>>>>
>>>> I thing the training API allows to handle that but the command line
>>>> tools cannot. The former takes the words of a sentence as an array of
>>>> string. The latter assumes that the whitespace character is the
>>>> lexical unit separator.
>>>> A convention like concatenating all the words which are part of a
>>>> multi word term is not a solution since in that case models built by
>>>> the command line and by the API will be different.
>>>>
>>>> It would be great if we could set by parameter what is the lexical
>>>> unit separator as well pos tag separator.
>>>>
>>>> What do you think ?
>>>>
>>>> /Nicolas
>>>>
>>>> [1]
>>>>
>>>> http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)
>>>
>>>
>>
>>
>



-- 
Dr. Nicolas Hernandez
Associate Professor (Maître de Conférences)
Université de Nantes - LINA CNRS UMR 6241
http://enicolashernandez.blogspot.com
http://www.univ-nantes.fr/hernandez-n
+33 (0)2 51 12 53 94
+33 (0)2 40 30 60 67

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
To make this reliable the tokenization on new unseen
text must be done correctly. For the spanish data we had
a special chunker to put the multi word units into one token.

Do you use something like that?

What do you think about outputting a special pos tag to indicate
that it is a multi-word tag?

Jörn

On 06/21/2012 04:47 PM, Nicolas Hernandez wrote:
> Hi Jörn
>
> On Thu, Jun 21, 2012 at 9:50 AM, Jörn Kottmann<ko...@gmail.com>  wrote:
>> Hello,
>>
>> the lexical unit in the POS Tagger is a token. For the
>> spanish POS models mutli-token chunks were converted
>> into one token separated by a "_".
>>
>> To what would you set the lexical unit separator in your case?
> I do the same, but ... I m a bit confused of doing that because
> 1. I do not like pre and post process my data (here to add/remove an
> underscore to the multi-words terms)
> 2. A model trained with the API, which allows you not to preprocess
> your data, will be different from the model trained with the cli on
> the same data
> 3. Finally when you get a model you do not know which segmentation it
> assumes and how the multi-words terms are represented
>
> Since it is often convenient to use the cli it would be nice to set
> the token separator at least to be able to build the same models than
> with the API.
>
>> The pos tag separator can already be configured in the class
>> which reads the input, but this parameter is not be set by the cli
>> tool.
>>
>> +1 to make both configurable from the command line.
> Nice.
>
> At least the idea has been proposed. If I have time...
>
>> Jörn
>>
>>
>> On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
>>> Hi Everyone
>>>
>>> I need to train the POS tagger on multi-word terms. In other words,
>>> some of my lexical units are made several tokens separated by
>>> whitespace characters (like "traffic light", "feu rouge", "in order
>>> to", ...).
>>>
>>> I thing the training API allows to handle that but the command line
>>> tools cannot. The former takes the words of a sentence as an array of
>>> string. The latter assumes that the whitespace character is the
>>> lexical unit separator.
>>> A convention like concatenating all the words which are part of a
>>> multi word term is not a solution since in that case models built by
>>> the command line and by the API will be different.
>>>
>>> It would be great if we could set by parameter what is the lexical
>>> unit separator as well pos tag separator.
>>>
>>> What do you think ?
>>>
>>> /Nicolas
>>>
>>> [1]
>>> http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)
>>
>
>


Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Nicolas Hernandez <ni...@gmail.com>.
Hi Jörn

On Thu, Jun 21, 2012 at 9:50 AM, Jörn Kottmann <ko...@gmail.com> wrote:
> Hello,
>
> the lexical unit in the POS Tagger is a token. For the
> spanish POS models mutli-token chunks were converted
> into one token separated by a "_".
>
> To what would you set the lexical unit separator in your case?

I do the same, but ... I m a bit confused of doing that because
1. I do not like pre and post process my data (here to add/remove an
underscore to the multi-words terms)
2. A model trained with the API, which allows you not to preprocess
your data, will be different from the model trained with the cli on
the same data
3. Finally when you get a model you do not know which segmentation it
assumes and how the multi-words terms are represented

Since it is often convenient to use the cli it would be nice to set
the token separator at least to be able to build the same models than
with the API.

>
> The pos tag separator can already be configured in the class
> which reads the input, but this parameter is not be set by the cli
> tool.
>
> +1 to make both configurable from the command line.

Nice.

At least the idea has been proposed. If I have time...

>
> Jörn
>
>
> On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
>>
>> Hi Everyone
>>
>> I need to train the POS tagger on multi-word terms. In other words,
>> some of my lexical units are made several tokens separated by
>> whitespace characters (like "traffic light", "feu rouge", "in order
>> to", ...).
>>
>> I thing the training API allows to handle that but the command line
>> tools cannot. The former takes the words of a sentence as an array of
>> string. The latter assumes that the whitespace character is the
>> lexical unit separator.
>> A convention like concatenating all the words which are part of a
>> multi word term is not a solution since in that case models built by
>> the command line and by the API will be different.
>>
>> It would be great if we could set by parameter what is the lexical
>> unit separator as well pos tag separator.
>>
>> What do you think ?
>>
>> /Nicolas
>>
>> [1]
>> http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)
>
>



-- 
Dr. Nicolas Hernandez
Associate Professor (Maître de Conférences)
Université de Nantes - LINA CNRS UMR 6241
http://enicolashernandez.blogspot.com
http://www.univ-nantes.fr/hernandez-n
+33 (0)2 51 12 53 94
+33 (0)2 40 30 60 67

Re: Training the pos tagger on "multi whitespace-separated tokens" terms

Posted by Jörn Kottmann <ko...@gmail.com>.
Hello,

the lexical unit in the POS Tagger is a token. For the
spanish POS models mutli-token chunks were converted
into one token separated by a "_".

To what would you set the lexical unit separator in your case?

The pos tag separator can already be configured in the class
which reads the input, but this parameter is not be set by the cli
tool.

+1 to make both configurable from the command line.

Jörn

On 06/20/2012 03:02 PM, Nicolas Hernandez wrote:
> Hi Everyone
>
> I need to train the POS tagger on multi-word terms. In other words,
> some of my lexical units are made several tokens separated by
> whitespace characters (like "traffic light", "feu rouge", "in order
> to", ...).
>
> I thing the training API allows to handle that but the command line
> tools cannot. The former takes the words of a sentence as an array of
> string. The latter assumes that the whitespace character is the
> lexical unit separator.
> A convention like concatenating all the words which are part of a
> multi word term is not a solution since in that case models built by
> the command line and by the API will be different.
>
> It would be great if we could set by parameter what is the lexical
> unit separator as well pos tag separator.
>
> What do you think ?
>
> /Nicolas
>
> [1] http://incubator.apache.org/opennlp/documentation/manual/opennlp.html#tools.postagger.tagging.api)