Skip to content

Feature/langpro parse results#78

Merged
XanderVertegaal merged 11 commits into
developfrom
feature/langpro-parse-results
Mar 19, 2026
Merged

Feature/langpro parse results#78
XanderVertegaal merged 11 commits into
developfrom
feature/langpro-parse-results

Conversation

@XanderVertegaal
Copy link
Copy Markdown
Contributor

@XanderVertegaal XanderVertegaal commented Mar 16, 2026

This PR displays syntactic parse results in the "CCG/LLF" tab of the Annotator interface.

The backend server now sends serialized results for all four parse trees to the frontend, but only the CCG Tree is currently visualised. The other three (CCG Term, Corrected CCG Term and LLF) are transformed into an NLTK in a different way (using parse_term instead of parse_ccg_tree, as indicated by @kovvalsky). This yields malformed visualisations in the frontend, which relies on the CCG Tree format.

We can of course handle these two types of trees differently in the frontend, but in my opinion it makes more sense to try to arrive at a common tree output format for both CCG Tree and the other three. This is something to discuss during our next meeting.

As a bonus, this PR enables scrolling in the ParseTreeTable, so complicated sentence parses (such as SICK 1) can be shown in full without overflowing the page.

@XanderVertegaal XanderVertegaal added the enhancement New feature or request label Mar 16, 2026
ccgTrees: TreeWithType[];
}

function flattenResult(parse: CCGParse): FlattenedParseResult {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"flattening" is probably not the most appropriate term here. Suggestions are welcome!

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.

Lift? Collapse? Unfold?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfold it is!

@XanderVertegaal XanderVertegaal marked this pull request as ready for review March 16, 2026 11:13
@kovvalsky
Copy link
Copy Markdown
Collaborator

I agree with having a common tree output format for both CCG Tree and the other three terms.
The only difference between trees and terms is that trees require rule names as decorations of the horizontal lines because trees use several rules. Terms don't require the rule names to be displayed. So as long as the rule name element takes no space when its value is empty, the tree format can be used for terms, too.

Copy link
Copy Markdown
Contributor

@jgonggrijp jgonggrijp left a comment

Choose a reason for hiding this comment

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

This looks good to me. The only thing I'd ask you to change, is to move the types from the parse results component folder to a central place, possibly just @/types.

</div>
} @empty {
<div class="mt-3">
<i class="text-muted" i18n>No parse results to display yet.</i>
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.

As a help to the user, perhaps write something like "press the parse and prove button to see the parse results".

}

function buildBinaryNode(node: BinaryNode): TreeNodeDisplay {
const left = buildDisplayTree(node.children[0]);
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.

For very large parses, recursion could lead to a stack overflow. Not something to worry about right now, but useful to know.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't worry about it. Kubernetes will solve all of our problems.

(Just kidding; good point! Let's hope we never have to worry about it.)

ccgTrees: TreeWithType[];
}

function flattenResult(parse: CCGParse): FlattenedParseResult {
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.

Lift? Collapse? Unfold?

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.

The types in this module belong in a central place, because the ParseService and also the TableauSVG component will have to refer to at least some of these types.

@XanderVertegaal XanderVertegaal merged commit 04fc5db into develop Mar 19, 2026
1 check passed
@XanderVertegaal XanderVertegaal deleted the feature/langpro-parse-results branch March 19, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants