New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

en-pos

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

en-pos

A better English POS tagger written in JavaScript

  • 1.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
decreased by-14.75%
Maintainers
1
Weekly downloads
 
Created
Source

en-pos

A better English POS tagger written in JavaScript

Installation and usage

Install via NPM:

npm i --save en-pos

How to use

const Tag = require("en-pos").Tag;
var tags = new Tag(["this","is","my","sentence"])
.initial() // initial dictionary and pattern based tagging
.smooth() // further context based smoothing
.tags;
console.log(tags);
// ["DT","VBZ","PRP$","NN"]

Annotation Specification

AnnotationNameExample
NNNoundog man
NNSPlural noundogs men
NNPProper nounLondon Alex
NNPSPlural proper nounSmiths
VBBase form verbbe
VBPPresent form verbthrow
VBZPresent form (3rd person)throws
VBGGerund form verbthrowing
VBDPast tense verbthrew
VBNPast participle verbthrown
MDModal verbcan shall will may must ought
JJAdjectivebig fast
JJRComparative adjectivebigger
JJSSuperlative adjectivebiggest
RBAdverbnot quickly closely
RBRComparative adverbless-closely faster
RBSSuperlative adverbfastest
DTDeterminerthe a some both
PDTPredeterminerall quite
PRPPersonal PronounI you he she
PRP$Possessive PronounI you he she
POSPossessive ending's
INPrepositionof by in
PRParticleup off
TOtoto
WDTWh-determinerwhich that whatever whichever
WPWh-pronounwho whoever whom what
WP$Wh-possessivewhose
WRBWh-adverbhow where
EXExpletive therethere
CCCoordinating conjugation& and nor or
CDCardinal Numbers1 7 77 one
LSList item marker1 B C One
UHInterjectionah oh oops
FWForeign Wordsviva mon toujours
,Comma,
:Mid-sent punct: ; ...
.Sent-final punct.. ! ?
(Left parenthesis) } ]
)Right parenthesis( { [
#Pound sign#
$Currency symbols$ £ ¥
SYMOther symbols+ * / < >
EMEmojis & emoticons:)

Accuracy and performance

TL:DR;
  • When smoothing is enabled: 96.43% accuracy (processing 132K tokens in 38 seconds)
  • When smoothing is disabled: 94.4% accuracy (processing 132K tokens in 3 seconds)

As of 25 Jan 2017, this library scored 96.43% at the Penn Treebank test (0.3% away from being a state of the art tagger).

Being written in JavaScript, I think it's safe to say that this is the most accurate JavaScript POS tagger, since the only JS library I know of is pos-js which when I tested on the same treebank scored 87.8%, though it was faster than my implementation when smoothing is enabled.

However, if performance is what's you're after rather than accuracy, then you have the option to disable smoothing in this library and this will marginally increase performance making this library even faster than pos-js but with far better accuracy (94.4%).

Building from source and testing

  • Build: tsc (requires typescript)
  • Test: node test/test.ts

Credits

Keywords

FAQs

Package last updated on 09 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc