views:

607

answers:

2

I'm trying this:

Sentence<TaggedWord> taggedString = MaxentTagger.tagStringTokenized("here is a string to tag");

which gives me:

Error: \u\nlp\data\pos-tagger\wsj3t0-18-left3words\left3words-wsj-0-18.tagger (The system cannot find the path specified)

I'm using Stanford's POS tagger.

What can I do to overcome this problem?

+1  A: 

It's saying that it can't find that path. So, does it exist on your machine?

Note that the slashes are backslashes - does your OS support backslash as a file separator?

Also note that it's an absolute path - is that intended?

If all else is OK, does the file exist?

Edit: if not, you should download it here (http://github.com/tiendung/ruby-nlp/blob/master/left3words-wsj-0-18.tagger), place it in the path that the system is specifying, and see what happens.

danben
it doesnt exist but i don't know where i'm supposed to get it from. i downloaded this:http://nlp.stanford.edu/software/tagger.shtml so i assumed all the files would be included :S
Lily
Added a URL to my response
danben
+1  A: 

It seems you first have to instantiate a tagger passing the included file:

new MaxentTagger("models/left3words-wsj-0-18.tagger");

Which is pretty nasty as the tagging method used later is static:

MaxentTagger.tagStringTokenized("here is a string to tag");

I also had to pass -Xmx256m to make it run with that setup.

Fabian Steeg