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

Automatically infer syntactic match refinements #10

Open
sam-writer opened this issue Feb 27, 2020 · 2 comments
Open

Automatically infer syntactic match refinements #10

sam-writer opened this issue Feb 27, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@sam-writer
Copy link
Contributor

When positive/negative matches are included, we should be able to infer POS information for the spaCy match.

This is cool by itself, but there is at least one other thing we can do: if the match is a verb, if we notice that in the positive match, the verb is transitive (resp. intransitive) and the negative match is intransitive (resp. transitive), we could automatically only match when the verb is used transitively (resp. intransitively)

@sam-writer
Copy link
Contributor Author

sam-writer commented May 1, 2020

Hmm... I kind of like having the test matches be true, e.g. test.positive sentences are sentences which CURRENTLY are matched against, and test.negative sentences are ones that don't trigger a match.

Maybe this would look like a separate file, replacy_from_examples.json, which would look like:

{
  "require": {
    "positive": [
      ["I require more food", "I need more food"],
      ["Proof of ID will be required.", "Proof of ID will be needed."]
    ],
    "negative": [
      "But I satisfy all the requirements in the job posting!"
    ],
    "features": ["pos_", "tag_", "dep_"],
    "allowed_hooks": ["hook names", "this might be crazy though, for v1 we probably can't support hooks, possibly ever"]
  }
}

Then we would run python -m replacy.builder replacy_from_examples.json and it would auto-generate a match_dict.json?

@sam-writer
Copy link
Contributor Author

Could use https://github.com/cyclecycle/spacy-pattern-builder for some of this

@sam-writer sam-writer added the enhancement New feature or request label Jun 10, 2020
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

No branches or pull requests

1 participant