Hi, Yngve,

It is a FAQ, so I added a code example to our Wiki:
https://cwiki.apache.org/confluence/display/OPENNLP/Creating+a+POSDictionary+using+the+API

Let me know if it helps and how I could improve the page.

Regards,
William


On Wed, May 16, 2012 at 8:19 AM, Yngve Ødegård <[email protected]>wrote:

> Thanks William!
>
> I have now installed Eclipse on my computer and I am trying to do the
> training using the API.
>
> I am still not entirely sure how to code it so I would really appreciate it
> if somebody has a code example of how they trained the tagger using a Tag
> Dictionary.
>
> Regards,
> Yngve.
>
> On Wed, May 16, 2012 at 12:00 AM, William Colen <[email protected]
> >wrote:
>
> > Hi, Yngve,
> >
> > The best way to create a POSDictionary is using the API. You should
> create
> > a subclass of POSDictionary and use the method addTags(String word,
> > String... tags) to populate it.
> > Your class should be in the package opennlp.tools.postag, because the
> > addTags method is package-private. Use the serialize method to save it
> to a
> > file.
> >
> > Java Doc:
> >
> >
> http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-tools/index.html?opennlp/tools/postag/POSDictionary.html
> > Source Code:
> >
> >
> http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSDictionary.java?view=co
> >
> > Regards,
> > William
> >
> >
> > On Tue, May 15, 2012 at 7:21 AM, Yngve Ødegård <[email protected]
> > >wrote:
> >
> > > I am going to create my own training data for the Part-of-speech tagger
> > and
> > > would like to use a Tag Dictionary file in the training. But I cannot
> > find
> > > any documentation on how the Tag Dictionary file format should be
> (except
> > > that it is XML).
> > >
> > > Does anybody have an example of how the Tag Dictionary should look
> like?
> > >
> > > Thanks,
> > > Yngve.
> > >
> >
>

Reply via email to