2 releases

0.1.1 May 6, 2021
0.1.0 May 5, 2021

#548 in WebAssembly

47 downloads per month
Used in 3 crates


3.5K SLoC

Layered NLP

Incrementally build up recognizers over an abstract token that combine to create multiple possible interpretations.

Key features:

  • Abstract over token type to support "rich" tokens like we have at Storyscript.
  • May generate multiple interpretations of the same token span.
  • Produces a set of ranges over the input token list with different attributes, for example:


The key idea here is to enable starting from a bunch of vague tags and slowly building meaning up through incrementally adding information that builds on itself.

Simplification: Money = '$' + Number

    $   123   .     00
    ╰Money($/£, Num)─╯


  • Location(NYC) = 'New' + 'York' + 'City'
  • Location(AMS) = 'Amsterdam'
  • Address(Person, Location) = Person + Verb('live') + Predicate('in') + Location
    I     live      in      New York City
    ╰────Address(Person, Location)─────╯

MIT licensed APACHE licensed


~47K SLoC