Skip to content

GH-1469: Add command-line tools for the feedforward dependency parser - #1473

Open
krickert wants to merge 1 commit into
mainfrom
feat/GH-1469-feedforward-parser-cli
Open

krickert wants to merge 1 commit into
mainfrom
feat/GH-1469-feedforward-parser-cli

Conversation

@krickert

@krickert krickert commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The feedforward dependency parser from #1323 can now be trained, run, and evaluated from the command line, like the existing maxent DependencyParser tools.

Fixes #1469.

The new tools:

  • FeedforwardDependencyParserTrainer trains a model from the same sample formats as DependencyParserTrainerME. The -params file takes the FeedforwardDependencyTrainer keys, and keys not given take the trainer's defaults. -refineParams refines the trained model with beam search, and -baseModel refines an existing model instead of training a new one.
  • FeedforwardDependencyParser parses token_TAG lines from standard input and prints CoNLL-U.
  • FeedforwardDependencyParserEvaluator reports UAS and LAS in the same format as DependencyParserEvaluator.

The parser and the evaluator take an optional -beamSize. Without it, they use the beam size a refined model records, or parse greedily.

opennlp FeedforwardDependencyParserTrainer.conllu -lang eng -data train.conllu \
    -model en-depparse-ff.bin -params ff.params -refineParams refine.params
opennlp FeedforwardDependencyParserEvaluator.conllu -model en-depparse-ff.bin -data dev.conllu
opennlp FeedforwardDependencyParser -beamSize 4 en-depparse-ff.bin < tagged-sentences.txt

ModelLoader now reports a model of another component as "Model has invalid format" for all CLI loaders, instead of failing with an IllegalArgumentException. The maxent and feedforward tools share the CoNLL-U output, scoring, and parameter loading code, and the maxent tools behave as before. There is no cross-validation tool, since no feedforward cross validator exists.

Tests cover the output of each tool, refinement, the beam size rules, and the rejected arguments, including exit codes, messages, and that no model file is written on failure. The dependency parser chapter of the manual gets a command-line section.

@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from c1e5fa1 to f0d8072 Compare October 11, 2026 15:14
@krickert
krickert force-pushed the feat/GH-1469-feedforward-parser-cli branch from f21d77b to 2295a6b Compare October 11, 2026 15:14
@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from f0d8072 to ff09c3f Compare October 11, 2026 22:30
@krickert
krickert force-pushed the feat/GH-1469-feedforward-parser-cli branch from 2295a6b to d323630 Compare October 11, 2026 22:31
@krickert
krickert force-pushed the OPENNLP-1991-feedforward-dependency-parser branch from ff09c3f to 851484e Compare October 14, 2026 03:21
@krickert

Copy link
Copy Markdown
Contributor Author

Fixing this now

@krickert
krickert force-pushed the feat/GH-1469-feedforward-parser-cli branch from d323630 to da14618 Compare October 14, 2026 05:57
@mawiesne mawiesne changed the title GH-1469: Add command-line tools for the feedforward dependency parser OPENNLP-1991: Add command-line tools for the feedforward dependency parser Oct 15, 2026
Base automatically changed from OPENNLP-1991-feedforward-dependency-parser to main October 15, 2026 13:06
@krickert

Copy link
Copy Markdown
Contributor Author

rebasing

FeedforwardDependencyParserTrainer trains a FeedforwardDependencyModel from
the depparse sample formats. The -params file takes the trainer keys, and
without a file the trainer defaults apply. -refineParams refines the model
with beam search; with -baseModel the tool refines a saved model instead
of training one. FeedforwardDependencyParser parses tagged lines from
standard input and FeedforwardDependencyParserEvaluator logs UAS and LAS
in the format of the maxent tools. Both take -beamSize, defaulting to the
beam size a refined model records in the manifest, or 1. The manual's
dependency chapter documents the tools.

ModelLoader now reports a model of another component as "Model has
invalid format" for all loaders instead of a raw IllegalArgumentException.
The CoNLL-U output loop and the scoring step are shared with the maxent
tools, and the depparse CLI tests use one fixture class.

Signed-off-by: Kristian Rickert <kristian@apache.org>
Co-authored-by: Claude Code 2.1.296 (Opus 5.5) <noreply@anthropic.com>
@krickert
krickert force-pushed the feat/GH-1469-feedforward-parser-cli branch from da14618 to 3dbca22 Compare October 15, 2026 13:34
@krickert krickert changed the title OPENNLP-1991: Add command-line tools for the feedforward dependency parser GH-1469: Add command-line tools for the feedforward dependency parser Oct 15, 2026
@krickert
krickert marked this pull request as ready for review October 15, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add command-line tools for the feedforward dependency parser

1 participant