Semantic predicates are atomic symbols representing semantic
entities or constructions. For example, in the English Resource
_mouse_n_1 is the
predicate for the word mouse, but it is underspecified for
lexical semantics—it could be an animal, a computer’s pointing
device, or something else. Another example from the ERG is
compound, which is used to link two compounded nouns, such as for
There are two main categories of predicates: abstract and
surface. In form, abstract predicates do not begin with an
underscore and in usage they often correspond to semantic
constructions that are not represented by a token in the input,
such as the
compound example above. Surface predicates, in
contrast, are the semantic representation of surface (i.e.,
lexical) tokens, such as the
_mouse_n_1 example above. In form,
they must always begin with a single underscore, and have two or
three components: lemma, part-of-speech, and (optionally) sense.
The DELPH-IN wiki about predicates: https://github.com/delph-in/docs/wiki/PredicateRfc
In DELPH-IN there is the concept of “real predicates” which are
surface predicates decomposed into their lemma, part-of-speech, and
sense, but in PyDelphin (as of v1.0.0) predicates are always
simple strings. However, this module has functions for composing
and decomposing predicates from/to their components (the
split() functions, respectively). In
addition, there are functions to normalize (
is_abstract()) predicate symbols.
Split predicate string s and return the lemma, pos, and sense.
This function uses more robust pattern matching than used by the validation functions
is_abstract(). This robustness is to accommodate inputs that are not entirely well-formed, such as surface predicates with underscores in the lemma or a missing part-of-speech. Additionally it can be used, with some discretion, to inspect abstract predicates, which technically do not have individual components but in practice follow the same convention as surface predicates.
>>> split('_dog_n_1_rel') ('dog', 'n', '1') >>> split('udef_q') ('udef', 'q', None)
create(lemma, pos, sense=None)¶
Create a surface predicate string from its lemma, pos, and sense.
The components are validated in order to guarantee that the resulting predicate symbol is well-formed.
This function cannot be used to create abstract predicate symbols.
>>> create('dog', 'n', '1') '_dog_n_1' >>> create('some', 'q') '_some_q'
Normalize the predicate string s to a conventional form.
This makes predicate strings more consistent by removing quotes and the
_relsuffix, and by lowercasing them.
>>> normalize('"_DOG_n_1_rel"') '_dog_n_1' >>> normalize('_dog_n_1') '_dog_n_1'
Trueif s is a valid predicate string.
>>> is_valid('"_dog_n_1_rel"') True >>> is_valid('_dog_n_1') True >>> is_valid('_dog_noun_1') False >>> is_valid('dog_noun_1') True
Trueif s is a valid surface predicate string.
>>> is_surface('"_dog_n_1_rel"') True >>> is_surface('_dog_n_1') True >>> is_surface('_dog_noun_1') False >>> is_surface('dog_noun_1') False
Trueif s is a valid abstract predicate string.
>>> is_abstract('udef_q_rel') True >>> is_abstract('"coord"') True >>> is_abstract('"_dog_n_1_rel"') False >>> is_abstract('_dog_n_1') False