You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by Zoljargal Munkhjargal <zo...@gmail.com> on 2014/01/30 00:47:56 UTC

How to add POS tag feature in Namefinder

Dear members,

I am trying to setup the OpenNLP NameFinder in a project with
part-of-speech tag feature. I extended my feature class from
FeatureGeneratorAdapter<http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-tools/opennlp/tools/util/featuregen/FeatureGeneratorAdapter.html>
class,
and overrode following method. Unfortunately this method taking just raw
tokens in parameter. The problem is that how to pass POS tag information in
to this method?

public void createFeatures(List features, String[] tokens, int index,
String[] previousOutcomes)

-- 

_______________________________

With regards
Zoljargal Munkhjargal
Research Assistant and PhD Student
Information and Communication Technology (ICT)-Doctoral School
Department of Computer Science and Information Engineering.
University of Trento, Italy

RE: How to add POS tag feature in Namefinder

Posted by Ian Jackson <Ia...@trilliumsoftware.com>.
Token is a generic concept. The token could include "word", a separator, and the part of speech as long as the training and the processing are consistent. 
The "tokens" could be:
       Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .
Or
    Pierre_NNP Vinken_NNP ,_, 61_CD years_NNS old_JJ ,_, will_MD join_VB the_DT board_NN as_IN
    a_DT nonexecutive_JJ director_NN Nov._NNP 29_CD ._.
-----Original Message-----
From: Zoljargal Munkhjargal [mailto:zoljargal.m@gmail.com] 
Sent: Wednesday, January 29, 2014 6:48 PM
To: dev@opennlp.apache.org
Subject: How to add POS tag feature in Namefinder

Dear members,

I am trying to setup the OpenNLP NameFinder in a project with part-of-speech tag feature. I extended my feature class from FeatureGeneratorAdapter<http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-tools/opennlp/tools/util/featuregen/FeatureGeneratorAdapter.html>
class,
and overrode following method. Unfortunately this method taking just raw tokens in parameter. The problem is that how to pass POS tag information in to this method?

public void createFeatures(List features, String[] tokens, int index, String[] previousOutcomes)

-- 

_______________________________

With regards
Zoljargal Munkhjargal
Research Assistant and PhD Student
Information and Communication Technology (ICT)-Doctoral School Department of Computer Science and Information Engineering.
University of Trento, Italy

Re: How to add POS tag feature in Namefinder

Posted by Jörn Kottmann <ko...@gmail.com>.
This will probably not go along nicely with the our feature generators.

One option would be to have one at the top of the hierarchy which 
converts the input
token/tag pairs into tokens, and then passing them down the chain.

Jörn

On 01/30/2014 03:01 PM, Mark G wrote:
> Alternatively, could he pass in String[] tokens with each token having the
> pos appended to it? for instance String[]{"bob_nn","went_vv","home_nn"} .
> inside the createFeatures method he would then just take the contents of
> the array and populate the List...
>
>
>
> On Jan 30, 2014 8:16 AM, "Jörn Kottmann" <ko...@gmail.com> wrote:
>
>> Hello,
>>
>> the current interface does not support passing in pos tags.
>>
>> One option would be to just run the pos tagger inside the feature
>> generation
>> of the name finder.
>>
>> Would that help you?
>>
>> Jörn
>>
>> On 01/30/2014 12:47 AM, Zoljargal Munkhjargal wrote:
>>
>>> Dear members,
>>>
>>> I am trying to setup the OpenNLP NameFinder in a project with
>>> part-of-speech tag feature. I extended my feature class from
>>> FeatureGeneratorAdapter<http://opennlp.apache.org/documentation/1.5.2-
>>> incubating/apidocs/opennlp-tools/opennlp/tools/util/featuregen/
>>> FeatureGeneratorAdapter.html>
>>> class,
>>> and overrode following method. Unfortunately this method taking just raw
>>> tokens in parameter. The problem is that how to pass POS tag information
>>> in
>>> to this method?
>>>
>>> public void createFeatures(List features, String[] tokens, int index,
>>> String[] previousOutcomes)
>>>
>>>


Re: How to add POS tag feature in Namefinder

Posted by Mark G <gi...@gmail.com>.
Alternatively, could he pass in String[] tokens with each token having the
pos appended to it? for instance String[]{"bob_nn","went_vv","home_nn"} .
inside the createFeatures method he would then just take the contents of
the array and populate the List...



On Jan 30, 2014 8:16 AM, "Jörn Kottmann" <ko...@gmail.com> wrote:

> Hello,
>
> the current interface does not support passing in pos tags.
>
> One option would be to just run the pos tagger inside the feature
> generation
> of the name finder.
>
> Would that help you?
>
> Jörn
>
> On 01/30/2014 12:47 AM, Zoljargal Munkhjargal wrote:
>
>> Dear members,
>>
>> I am trying to setup the OpenNLP NameFinder in a project with
>> part-of-speech tag feature. I extended my feature class from
>> FeatureGeneratorAdapter<http://opennlp.apache.org/documentation/1.5.2-
>> incubating/apidocs/opennlp-tools/opennlp/tools/util/featuregen/
>> FeatureGeneratorAdapter.html>
>> class,
>> and overrode following method. Unfortunately this method taking just raw
>> tokens in parameter. The problem is that how to pass POS tag information
>> in
>> to this method?
>>
>> public void createFeatures(List features, String[] tokens, int index,
>> String[] previousOutcomes)
>>
>>
>

Re: How to add POS tag feature in Namefinder

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

the current interface does not support passing in pos tags.

One option would be to just run the pos tagger inside the feature generation
of the name finder.

Would that help you?

Jörn

On 01/30/2014 12:47 AM, Zoljargal Munkhjargal wrote:
> Dear members,
>
> I am trying to setup the OpenNLP NameFinder in a project with
> part-of-speech tag feature. I extended my feature class from
> FeatureGeneratorAdapter<http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-tools/opennlp/tools/util/featuregen/FeatureGeneratorAdapter.html>
> class,
> and overrode following method. Unfortunately this method taking just raw
> tokens in parameter. The problem is that how to pass POS tag information in
> to this method?
>
> public void createFeatures(List features, String[] tokens, int index,
> String[] previousOutcomes)
>