DEV Community

Multigrid
Multigrid

Posted on • Originally published at multigrid.ai

Extracting Motion Type and Filing Party From a Court Document

A document that argues at length about a motion for summary judgment is very often not a motion for summary judgment. It is an opposition to one, and the only place that is stated unambiguously is the line of capitals under the caption.

The title is the type

Every conventional filing carries a document title, centred and usually in capitals, immediately below the caption block and above the first line of text:

         DEFENDANT HARBORLINE SYSTEMS, INC.'S
     MOTION TO DISMISS THE FIRST AMENDED COMPLAINT
      PURSUANT TO FED. R. CIV. P. 12(b)(6)
Enter fullscreen mode Exit fullscreen mode

That is the authoritative statement of what the document is. It is also the string the clerk’s office uses when it enters the document on the docket, which is why docket text so often mirrors it almost word for word.

The practical consequence is that motion-type extraction should be scoped to a region, not to a document. Locate the caption block, take the text between the end of the caption and the first body paragraph, and extract from that span alone. Everything below it is argument, and argument is full of the names of other motions. If you are already clustering text by coordinates to read the caption — see extracting case numbers — the title block falls out of the same pass as the first full-width centred run after the two-column region ends.

Head noun, target and rule

Titles are compound, and the grammatical head is the type. Three documents can all contain the words “motion to dismiss” and be three different things:

  • Motion to Dismiss — the request itself.
  • Memorandum of Law in Support of Defendant’s Motion to Dismiss — a brief, a separate docket entry, and in many districts required to be filed separately from the motion.
  • Opposition to Defendant’s Motion to Dismiss — the other side’s response.

One field cannot hold that. Model it as at least three: a document type drawn from a controlled list (motion, memorandum, opposition, reply, declaration, notice, order, stipulation), a relief sought, and an optional target — the filing this one responds to. An opposition’s relief is “deny”, and its target is the motion named in the title. Collapsing target into type is what produces a dataset in which the same motion appears to have been filed four times by both parties.

Wherever a rule is cited in the title, extract it as a separate field and prefer it for classification. “Motion to Dismiss pursuant to Rule 12(b)(6)” and “Motion to Dismiss for Lack of Subject Matter Jurisdiction” describe different motions under different subsections; the citation says which, in four characters, with no natural-language variance. The Federal Rules of Civil Procedure are published in full by the Legal Information Institute at Cornell, and the subsection structure of Rule 12 in particular repays reading before designing the enumeration. State courts have their own numbering, so store the rule citation with the rule set it belongs to rather than as a bare string.

Why body text poisons the field

The body of a brief refers to motions constantly, and almost always to somebody else’s. An opposition’s first sentence is typically a full restatement of the motion it opposes. A reply names the opposition. An order recites the entire procedural history: “Before the Court are Defendant’s Motion to Dismiss (ECF No. 14), Plaintiff’s Motion for Leave to Amend (ECF No. 22), and Defendant’s Motion to Strike (ECF No. 31)”.

A whole-document extraction has no way to rank those against the document’s own title, and the frequency signal actively points the wrong way: the opposed motion is named more often than the document’s own type. Models are not immune to that; asked what kind of document this is, given twenty pages of text in which “motion for summary judgment” occurs thirty times and “opposition” twice, a plausible answer is the wrong one.

Two defences beyond region scoping. Require the extraction to quote the exact span it read the type from, and reject any answer whose span does not lie inside the title block — a mechanical check that costs nothing. And extract the referenced filings as their own array, with their docket numbers where the document gives them, so the model has a legitimate place to put “motion for summary judgment” instead of having to force it into the type field. Giving a model a correct home for the information it has found is generally more effective than instructing it not to mention it; the same idea, at more length, is in extraction prompts.

The filing party is in the signature block

The caption lists every party in the case, so it cannot tell you which of them filed this document. The title usually can — “Defendant Harborline Systems, Inc.’s Motion” — but titles are abbreviated freely, and in a case with four defendants “Defendants’ Motion” does not say which four.

The reliable statement is at the end, in the signature block:

Dated: March 12, 2025          Respectfully submitted,

                               /s/ Dana R. Whitfield
                               Dana R. Whitfield (Bar No. 000000)
                               WHITFIELD & ASSOCIATES LLP
                               100 Example Street, Suite 400
                               Attorneys for Defendant
                               Harborline Systems, Inc.
Enter fullscreen mode Exit fullscreen mode

The representation line — “Attorneys for Defendant…” or “Counsel for Plaintiff…” — names the filing party explicitly and by role, and it is required by local rules in most courts precisely so that the record shows who each filing came from. Extract it as the primary source for the filing party, and the party named in the title as corroboration.

Two details about that block. The /s/ conformed signature is the electronic filing convention and is machine text, not an image, on an electronically filed document; its absence on a document that also lacks a wet signature is a sign you are looking at an unsigned draft rather than a filed copy. And a pro se filing has no representation line at all — the signature is the party’s own, sometimes followed by “Plaintiff, pro se”. A pipeline that requires a representation line will fail on exactly the filings that are hardest to read anyway, so make it optional and fall back to the title.

Compound and cross-motions

Single-value fields also break on documents that genuinely are more than one thing. Combined filings are ordinary: “Defendant’s Opposition to Plaintiff’s Motion for Summary Judgment and Cross-Motion for Summary Judgment” is one document, one docket entry, two motions, and two different pieces of relief sought by two different parties within the same PDF. “Motion to Dismiss or, in the Alternative, for a More Definite Statement” pleads two forms of relief in a stated order of preference.

Represent the filing as a document with an array of requested relief, each carrying its own rule citation and its own movant — a multi-entity document schema rather than one row per file — plus a flag for alternative pleading where the title says “in the alternative”. Then the deadlines that follow — which are computed per motion, not per document, and are the subject of extracting hearing dates and deadlines — attach to the right thing. A cross-motion in particular starts its own briefing clock running in the opposite direction, and a pipeline that recorded one motion has lost half the schedule.

Related

Top comments (0)