4 ms·
Darn, now I'm tempted to write a pure javascript POS tagger just to show that you don't really need anything server-side (or maybe just little bits here and the
by sqrt17 16y ago
Darn, now I'm tempted to write a pure javascript POS tagger just to show that you don't really need anything server-side (or maybe just little bits here and there so the web page doesn't need to load a 20MB model right away - the computational effort, in any case, is not so bad that you couldn't do it in JS).
Hmm. Maybe sometime.
EDIT: The Stanford POS tagger is more complex and quite a bit slower than anything you'd do on your own. To quantify this, there's methods that are 10x as fast while sacrificing 0.05%-0.2% accuracy. (Or the easy ones that are 100x as fast, but are 1% less accurate - these would be fun to do in JS).
- jacquesm 16y agoBold statements like that need to be backed up with code!
- deleted 16y ago[deleted]
- deleted 16y ago[deleted]
- sqrt17 16y agoI don't have a JS version, but here's a functioning HMM tagger in under 300 lines of Python: http://gist.github.com/503784 http://gist.github.com/503784 (model loading doesn't work yet for some reason, but you see what it's doing in principle). This uses a smoothed trigram HMM, so it should, in principle, be a bit better than NLTK's HMM tagger but not as good as serious POS tagging packages (e.g. hunpos, or the Stanford POS tagger)
- arethuza 16y agoTo me this looks like a classic case of where it makes sense to keep this kind of processing on the server and make it available as a service - what functional advantages would having a POS tagger locally give you (apart from offline access)?
- sqrt17 16y agoOnce the model is loaded, you can get around the ~200ms roundtrip latency that it takes to connect the server. Obviously, there's lots of ways to hide these 200ms from the user.
- danieldk 16y agoSure, it is possible, but what does it add? It's not as if a Hidden Markov Model tagger takes that many server resources. Or if you are really worried, you could build a unweighted finite state transducer (Roche, Schabes, 1995) ;).