Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semgraph, semgrex, and ssurgeon improvements #1331

Merged
merged 28 commits into from
Jan 20, 2023
Merged

Semgraph, semgrex, and ssurgeon improvements #1331

merged 28 commits into from
Jan 20, 2023

Conversation

AngledLuffa
Copy link
Contributor

Various improvements to semgrex & friends. Includes a CLI for Ssurgeon which can be used from Python (or anything else communicating via protobuf)

  • valueOf upgrades for Semgraph
  • interface updates for Semgraph
  • tokens as part of the DependencyGraph protobuf
  • protobuf for Ssurgeon requests
  • backreferencing of relation
  • addition of named edges to semgrex
  • various tests & improvements to ssurgeon

…ly changes the meaning of existing expressions, since it was previously possible to assign multiple words to the same index, but that was a bad feature anyway
…when looking at the collection of roots

Also, add a test of if a node is a root or not
…rex. Implementations of the Spacy extensions of the same operations

Add a short test of adjacent left/right, left/right
- Pass around a map for matching edges
- Setting ~name on a relation in the SemgrexPattern keeps the matched edge in the map
- this only applies to relations which are immediate parent or child relations:
  > >-- >++ < <-- <++
  if set on any other relation, an exception is thrown (test included)
- includes a test of the edge naming and backreferences for the various relations
- document the feature in the SemgrexPattern javadoc
not clear how this ever worked in the first place
…rk multiple times over a single graph instead of returning all possible single modifications of the graph
… SsurgeonEdit evaluation. Add a bunch of notes to the operations, including some notes on whether or not they are used in RTE
…it no longer does anything new

Can now use valueOf() and assertEquals to make sure the graph is as expected in the unittest - much simpler than taking apart the graph

Leave a comment on something we need to figure out regarding the iteration
Include a test of the basic operation using a semgrex which searches for unattached nodes
Also check the operation of resetting the roots when a root is pruned
…(it was currently unused everyone, including RTE, so changing the interface should be no harm done)
…ng. This is the only bugfix needed to make killNonRooted work as expected
…bel of the edge to be deleted. Essentially, it deletes all the edges between the two nodes. Still need to test the gov / dep wildcard variants of those - they seem less useful when calling iterate(), though
…reNLP side of an Ssurgeon interface for Python. Included in this change is adding optional tokens to the DependencyGraph
… doesn't) change the graph

Adds a test of the multi-pattern iterate
@AngledLuffa AngledLuffa merged commit b8dfde8 into dev Jan 20, 2023
@AngledLuffa AngledLuffa deleted the semgrex branch January 20, 2023 06:27
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.

1 participant