Skip to content

Instantly share code, notes, and snippets.

@myedibleenso
Created February 18, 2016 01:52
Show Gist options
  • Save myedibleenso/465192e9d229b9f25731 to your computer and use it in GitHub Desktop.
Save myedibleenso/465192e9d229b9f25731 to your computer and use it in GitHub Desktop.
example rules for semantic relations
taxonomy:
- Entity:
- Noun
- Adjective
- NounPhrase
- Patterns:
- KindOfPattern
- PartOfPattern
- Event:
- KindOf
- PartOf
rules:
- name: n
label: Noun
priority: 1
type: token
unit: tag
pattern: |
/^NN/+
- name: adj
label: Adjective
priority: 1
type: token
unit: tag
pattern: |
/^JJ/+
- name: nounphrase
label: NounPhrase
priority: 2
type: token
pattern: |
[tag=/^(PRP|DT)$/]? @Adjective? @Noun
- name: kindofpattern
label: KindOfPattern
priority: 1
type: token
pattern: |
[lemma=be] [lemma=a]? @mod:Adjective? [lemma=kind] [lemma=of]
- name: partofpattern
label: PartOfPattern
priority: 1
type: token
pattern: |
[lemma=be] [lemma=a]? @mod:Adjective? [lemma=part] [lemma=of]
- name: isa
label: KindOf
priority: 4
type: token
pattern: |
@hypernym:NounPhrase @KindOfPattern @hyponym:NounPhrase
- name: partof
label: PartOf
priority: 4
type: token
pattern: |
@holonym:NounPhrase @PartOfPattern @meronym:NounPhrase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment