문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top