Repository navigation
Release 4.2.0 - #93
Merged
Merged
Conversation
Update the CLAUDE.md backlog: the heading, the share of news sentences that do not parse with 4.2.0 (346 of 5,000, against 404 with 4.1.0), and the parse speed against 4.1.0 (about 7% slower on a warm pass over 1,000 news sentences). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version bump to 4.2.0, with a CLAUDE.md backlog update. The work itself is already on master: #87 (no PyPy wheels for x86_64 macOS), #88 (filelock 4.2.1,
glockremoved), #89 (documentation build), #90 (question clauses, prepositional phrases, subjects of subordinate clauses, "á"), #91 (names) and #92 (the head noun of a noun phrase). This PR only prepares the release.4.1.0 against this branch
4.1.0 was measured from a worktree of the tag with its own environment. The speed figures are from
benchmarks/bench_parse.py, run twice for each version with the same result; 14 more of the 1,000 sentences parse with 4.2.0. The core takes 0.65 s of the warm pass, against 0.63 s, so most of the difference is outside it. It has not been profiled; this is in the backlog.Checks
ruff check,mypyanduv lock --checkare clean. The suite passes on CPython 3.14 (173 passed, 1 skipped), also withGREYNIR_MATCHING_PARITY=1 GREYNIR_REDUCER_PARITY=1; on free-threaded 3.14t (174 passed), also with--parallel-threads=8; on CPython 3.10 and on PyPy 3.11.NounPredicates.conf, the newNounPrepositions.confand both C++ files, and has noglock.py. Installed from source into a clean free-threaded 3.14t environment, it compiles, generates the grammar and parses with the GIL off.uv.lockare the current releases.Packages that use this one
Both were run against a wheel of this branch, and against 4.1.0 as a baseline. Neither breaks, but each has one or two expectations that depend on a tree that has changed.
reynir>=3.7.0with no upper bound, so its users get these changes with a fresh install:P_DIR_LOC. The pattern looks for the phrase inside the object,VP > { VP > { %verb } NP > { PP > ... } }, where 4.1.0 hung it on "þetta". It now hangs on the verb, which is right, so the pattern needs a variant with thePPdirectly in theVP.P_Néinstead ofP_NT_Né, at the same token and with the same text. The two question clauses are now joined; 4.1.0 had no sensible tree for the sentence.test_entitiesexpects the definition ("Fosshótel", "var", "rekin með tapi") from "Fosshótel, stór hótelkeðja, var rekin með tapi í fyrra". "með tapi" was inside theNP-PRDand now hangs on the verb phrase, as it already did in simple sentences ("Hún er stolt af honum"), so the definition lacks "með tapi".Against the gold standard, the phrases after an adjective that changed place are about even: 10 moved away from where the gold standard has them ("sýknaðir af kröfu", "líklegri til að ...") and 8 moved to it ("áfrýjað til Hæstaréttar", "aðskilin frá foreldrum sínum").
After the merge
Tagging
4.2.0on master starts the wheel workflow, which publishes to PyPI. The release notes below are for the GitHub release of that tag.Draft release notes for the 4.2.0 GitHub release
Highlights
More sentences parse, and more of them parse right. This release is about the quality of the trees. Two measurements, each made with 4.1.0 and with 4.2.0:
The gold standard is the hand-corrected part of GreynirCorpus. The changes were tuned on its development set (4,239 sentences) and the test set (455 sentences) was held out, so the test figures are the ones to go by. The figures are a baseline to follow over time, not an error rate: part of the difference from the gold standard is convention.
The public API is unchanged. The trees are not: about one news sentence in four gets a different tree (see Upgrading).
Changes
Prepositional phrases
The largest single kind of difference from the gold standard was a prepositional phrase attached in the wrong place.
NounPredicates.conf, which was not read before, and in a new generated table,NounPrepositions.conf(about 6,600 entries, from a million parsed news sentences and the development set). A strong entry outweighs a verb that lists the same preposition ("hafa áhrif á"); an entry marked$weakdoes not ("Hún setti bókina í hillu" keeps its phrase on the verb).Clauses
Question clauses can be joined, with each other and with a noun phrase:
Before, such sentences failed to parse or were read some other way, often as two main clauses.
The subject of a subordinate clause. "Ég held að fjölskyldan sé að brenna inni" and "að málið sé í skoðun" had no subject: the noun phrase was read as a predicate or an object standing in front of the verb. Those readings remain in relative clauses ("konurnar sem leikarar voru").
Names
Names were behind more parse failures in the news sample than any other single cause.
[static_phrases]inPhrases.conf) are names in all cases and at the start of a sentence, whatever BÍN has for the word form: "Adams", "von der Leyen", "Rolling Stones" and others are added.Packaging
filelock>=3.9.0, as no fixed version supports it.reynir.glockis removed. It was not used within the package, exported or documented.doc/conf.pyreads the version frompyproject.toml).Upgrading
NP-PRDis "rekin", not "rekin með tapi"), as it already did in simple ones ("Hún er stolt af honum").P_DIR_LOClooks for it, so that error is not reported; and "né" between joined question clauses is reported asP_Né, notP_NT_Né.ReducerorParseForestReducerthat overrides the scoring of prepositions falls back on the Python reducer, as before;noun_prep_bonus()is a new method that can be overridden in the same way.🤖 Generated with Claude Code