• Stars
    star
    11
  • Rank 1,640,332 (Top 34 %)
  • Language
    Julia
  • License
    MIT License
  • Created over 5 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dependency parsing in Julia

DependencyTrees.jl

Build Status CodeCov

DependencyTrees.jl is a Julia package for working with dependency structures in natural language sentences. It provides a representation of dependency parse trees (DependencyTree), a treebank reader, and transition-based parsing algorithms.

Read the docs!

Features

Trees and Treebanks

The DependencyTree type represents a dependency parse of a natural language sentence.

julia> using DependencyTrees

julia> treebank = Treebank("test/data/english.conllu")

julia> for tree in treebank
           # ...
       end

julia> tree = first(treebank)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ROOT
β”‚                 β”Œβ”€β–Ί Pierre
β”‚     β”Œβ”€β–Ίβ”Œβ”€β”€β”Œβ”€β”€β”Œβ”€β”€β””β”€β”€ Vinken
β”‚     β”‚  β”‚  β”‚  └────► ,
β”‚     β”‚  β”‚  β”‚     β”Œβ”€β–Ί 61
β”‚     β”‚  β”‚  β”‚  β”Œβ”€β–Ίβ””β”€β”€ years
β”‚     β”‚  β”‚  └─►└───── old
β”‚     β”‚  └──────────► ,
β””β”€β–Ίβ”Œβ”€β”€β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Œβ”€β”€ will
   β”‚  β”Œβ”€β”€β”€β”€β”€β”Œβ”€β”€β”Œβ”€β”€β””β”€β–Ί join
   β”‚  β”‚     β”‚  β”‚  β”Œβ”€β–Ί the
   β”‚  β”‚     β”‚  └─►└── board
   β”‚  β”‚  β”Œβ”€β”€β””β”€β”€β”€β”€β”€β”€β”€β–Ί as
   β”‚  β”‚  β”‚     β”Œβ”€β”€β”€β”€β–Ί a
   β”‚  β”‚  β”‚     β”‚  β”Œβ”€β–Ί nonexecutive
   β”‚  β”‚  └────►└──└── director
   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ”Œβ”€β”€ Nov.
   β”‚              └─► 29
   └────────────────► .

Transition-based parsing

A number of transition systems and oracles are implemented in the TransitionParsing submodule.

julia> using DependencyTrees
julia> using DependencyTrees.TransitionParsing
julia> treebank = Treebank("test/data/english.conll")
julia> oracle = Oracle(ArcHybrid(), dymanic_oracle)
julia> for tree in treebank, (config, gold ts) in oracle(tree)
           # ...
       end

Transition systems:

  • ArcStandard (static oracle)
  • ArcEager[1],[2] (static and dynamic oracles)
  • ArcHybrid[3],[4] (static and dynamic oracles)
  • ArcSwift[5] (static oracle)
  • ListBasedNonProjective[2] (static oracle)

See the documentation for details.

Installation

]add DependencyTrees

Contributing & Help

Open an issue! Bug reports, feature requests, etc. are all welcome.

References

[1]: Nivre 2003: An efficient algorithm for projective dependency parsing. http://stp.lingfil.uu.se/~nivre/docs/iwpt03.pdf

[2]: Nivre 2008: Algorithms for Deterministic Incremental Dependency Parsing. https://www.aclweb.org/anthology/J/J08/J08-4003.pdf

[3]: Kuhlmann et all 2011: Dynamic programming algorithms for transition-based dependency parsers. https://www.aclweb.org/anthology/P/P11/P11-1068.pdf

[4]: Goldberg & Nivre 2013: Training deterministic parsers with non-deterministic oracles. https://aclweb.org/anthology/Q/Q13/Q13-1033.pdf

[5]: Qi & Manning 2016: Arc-swift: a novel transition system for dependency parsing. https://nlp.stanford.edu/pubs/qi2017arcswift.pdf