Visitar URL original
OPENNLP-1991: Add a feedforward neural dependency parser by krickert · Pull Request #1323 · apache/opennlp · GitHub
Skip to content

OPENNLP-1991: Add a feedforward neural dependency parser - #1323

Open
krickert wants to merge 1 commit into
mainfrom
OPENNLP-1991-feedforward-dependency-parser
Open

krickert wants to merge 1 commit into
mainfrom
OPENNLP-1991-feedforward-dependency-parser

Conversation

@krickert

@krickert krickert commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds FeedforwardDependencyParser, an arc-standard neural dependency parser after Chen and Manning (2014). It implements the same DependencyParser API as DependencyParserME and decodes greedily or with a beam.

FeedforwardDependencyTrainer trains the model from TrainingParameters and can refine it with beam search and early updates. FeedforwardDependencyModel extends BaseModel and stores the network as an artifact with its own serializer. The scoring cache is parser-owned, opt-in and bounded in bytes. StringUtil.toLowerCase now applies the Unicode final sigma rule, which the parser uses to key its word vocabulary.

The manual, the CoNLL-U usage test and UniversalDependencyParserEval cover the new parser. The evaluation has greedy and beam 4 cases for English EWT and Spanish AnCora; the pinned scores will be refreshed from an eval build on this branch before the PR leaves draft.

Remaining before 3.0.0: factory and CLI integration, which will be a follow-up PR.

@krickert
krickert changed the base branch from OPENNLP-547-dependency-parser to main September 29, 2026 05:18
@krickert krickert changed the title OPENNLP-1991: Add a feedforward neural dependency parser OPENNLP-1991 (part of OPENNLP-547): Add a feedforward neural dependency parser Oct 1, 2026
@krickert

krickert commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

After 547 merges, this is a small ticket that piggy backs on it. Just needs a rebase when it merges.

@rzo1 rzo1 added new feature New functionality (Jira: New Feature) component: parser Parser and dependency parser labels Oct 4, 2026
@mawiesne mawiesne changed the title OPENNLP-1991 (part of OPENNLP-547): Add a feedforward neural dependency parser OPENNLP-1991: Add a feedforward neural dependency parser Oct 8, 2026
@mawiesne mawiesne added this to the 3.1.0 milestone Oct 8, 2026
@mawiesne

mawiesne commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@krickert Please go for rebase and harmonization of this branch, pls. Just want to make sure, things are consistent for ppl to inspect the PR draft against main.

@krickert

krickert commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

On it

@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from 6e889ec to 1519c75 Compare October 8, 2026 21:13
@krickert

krickert commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@krickert
krickert marked this pull request as ready for review October 8, 2026 21:16

@rzo1 rzo1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @krickert - as usual here is the first round of an AI review with our usual review bar:

The findings are inline (5 blocking, 32 minor). Process points:

  • The PR is marked ready, but the remaining work listed in its description (model/factory/CLI integration, shared scoring, parser-owned caches, deterministic vocabulary, fresh evaluations) changes public API and the model format, both of which freeze at 3.0.0. Please move it back to draft until that has landed.
  • The pinned feedforward scores (UniversalDependencyParserEval.java:246/259) depend on the vocabulary order and cover greedy decoding only, while the manual uses beam 4. After the ordering fix we need an eval build to re-pin them, with a beam row added.
  • Squash message: please drop the "Rebased onto main after OPENNLP-547…" paragraph and the Co-authored-by/Reviewed-by trailers, replace the Assisted-by/Co-authored-by: Claude lines with at most one ASF-conformant Generated-by: trailer, and keep the body to 2-3 sentences.

Comment thread opennlp-docs/src/docbkx/dependency.xml
@mawiesne mawiesne modified the milestones: 3.1.0, 3.0.0 Oct 9, 2026
@krickert
krickert marked this pull request as draft October 11, 2026 08:14
@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from 1519c75 to c1e5fa1 Compare October 11, 2026 08:17
@krickert

Copy link
Copy Markdown
Contributor Author

@krickert

Copy link
Copy Markdown
Contributor Author

Eval failed - small patch to fix it. On it now

@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from c1e5fa1 to f0d8072 Compare October 11, 2026 15:14
@krickert

Copy link
Copy Markdown
Contributor Author

Patch applied, eval build 101 is running. Will flip to ready for review once that is done.

Adds FeedforwardDependencyParser, an arc-standard neural parser after Chen
and Manning (2014) that implements the same DependencyParser API as
DependencyParserME, with greedy and beam decoding. FeedforwardDependencyTrainer
trains the FeedforwardDependencyModel from TrainingParameters and refines it
with beam search and early updates; the model is a BaseModel with the network
as an artifact. StringUtil.toLowerCase applies the Unicode final sigma rule,
and the manual, the CoNLL-U usage test and the UD evaluation cover the new
parser.

Generated-by: Claude Code
Signed-off-by: Kristian Rickert <kristian@apache.org>
Co-authored-by: Claude Code 2.1.296 (Claude Opus 5.5)
@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from f0d8072 to ff09c3f Compare October 11, 2026 22:30
@krickert

krickert commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Edit: passes

https://ci-builds.apache.org/job/OpenNLP/job/eval-tests-configurable/102/

101 revealed a change that was needed. Re-ran locally and passed. (sidenote: thinik that I found a way to make eval run 2x faster)

@krickert

Copy link
Copy Markdown
Contributor Author

Thanks for the review. All five blockers and the minors are addressed in the current push:

  • FeedforwardDependencyModel extends BaseModel, with the network as an artifact with its own serializer.
  • Training takes TrainingParameters; Settings is package-private.
  • The scoring cache is owned by the parser, off by default and budgeted in bytes.
  • One forward and backward pass and one log-softmax, shared by parsing, training and refinement.
  • @throws is complete on train and refine, and ParamChecks.requirePositive replaces the local checks.

The minors (loader limits through ResourceLimits, a versioned magic, sorted vocabularies, shared fixtures, parameterized loader and validation tests) are in the same push. The feedforward scores in the eval come from a new eval run, with a beam 4 row next to the greedy one.

@krickert
krickert marked this pull request as ready for review October 12, 2026 12:22
@krickert

Copy link
Copy Markdown
Contributor Author

102 passed. All comments addressed and chages made and tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: parser Parser and dependency parser new feature New functionality (Jira: New Feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants