1.1.7 • Published 7 years ago

en-parse v1.1.7

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

English Parse

English language syntactic dependency parser.

important This project is in a very early stage, it's rather an experiment than a real a project. Using it in production may hurt your feelings.

Installation and Usage

npm i --save en-parse
const parser = require("en-parse").default;
let parsed = parser(["PRP","VBP","TO","VBP"],["i","like","to","parse"]);

NOTE: tokens should be normalized (contractions, abbreviations and such all resolved to it's normal form).

The parsed variable is now an array like this one:

[
  {
    "label": "MWE",
    "type": "NP",
    "master": 1
  },
  {
    "label": "NSUBJ",
    "type": "NP",
    "master": 2
  },
  {
    "label": "ROOT",
    "type": "VP",
    "master": -1
  },
  {
    "label": "COMPMARK",
    "type": "PP",
    "master": 5
  },
  {
    "label": "NSUBJ",
    "type": "NP",
    "master": 5
  },
  {
    "label": "XCOMP",
    "type": "VP",
    "master": 2
  },
  {
    "label": "ADVMOD",
    "type": "ADV",
    "master": 8
  },
  {
    "label": "AUX",
    "type": "VBN",
    "master": 8
  },
  {
    "label": "ADVCL",
    "type": "VP",
    "master": 5
  },
  {
    "label": "PUNCT",
    "type": "PUNCT",
    "master": 2
  }
]

Annotation Specs:

Core Nominal Arguments

AnnotationNameExample
NSUBJNominal SubjectI like you
DOBJDirect ObjectI like you
IOBJIndirect Objectshe gave me a book
NSUBJPASSNominal Subject (passive)I have been given a chance
CCOMPClausal ComplementThe boss ordered to dig the hole
XCOMPOpen Clausal ComplementThe boss told us to dig
OBLOblique ObjectGive the toys to the children
EXPLExpletiveI have been there
ADVCLAdverb Clause ModifierWe were walking as the rain was falling
ADVMODAdverbial modifierI don't eat genetically modified food.
DISCOURSEDiscourseI like that :)
VPRTVerbal ParticleI switched the TV off
AUXAuxiliaryI am going to buy a new computer
AUXPASSAuxiliary (passive)I have been marked
COMPMARKComplement MarkerI will do it if I like it
ADVMARKAdverb MarkerI did it after I was convinced
NOMDNominal ModifierMSNBC news had little effect on the market
NUMMODNumeric ModifierI ate 2 eggs this morning
ACLClausal Modifier of a NounI saw the man you love
AMODAdjectival Modifieryou were good to him
DETDeterminerwhich book you prefer?
CASECase MarkingI went to Rachel
PUNCTPunctuationGuys, keep calm!
CCCoordinating ConjunctionMathew and Alex
INTERJInterjectionPass me the sugar, please
EXTExtensionMy name is Alex Corvi
DEPUnrecognized dependencyhow what

Why?

  • Current solutions uses statistical machine learning models which makes it 5 times slower (if not worse) than a rule based implementation like this one.
  • This is a javascript implementation, so it can be used for an in-browser natural language processing.
  • Also because it's written in javascript it might be preferred in smart bots to reduce the complexity of having your bot written in node.js and the natural language processor written in Python or C++.

Credits

The idea of this parser was originally featured as a small experiment in Xav Ulflander's Compendium.

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago