Semantic Role Labeling (SRL) is one shallow semantic parsing that produces predicate-argument structures which are semantic roles (or participants) such as agent, patient, and theme associated with verbs.
Inputs to SRL are tokenized sentences:
import hanlp srl = hanlp.load(hanlp.pretrained.srl.CPB3_SRL_ELECTRA_SMALL) srl(['男孩', '希望', '女孩', '相信', '他', '。'])
[[('男孩', 'ARG0', 0, 1), ('希望', 'PRED', 1, 2), ('女孩相信他', 'ARG1', 2, 5)], [('女孩', 'ARG0', 2, 3), ('相信', 'PRED', 3, 4), ('他', 'ARG1', 4, 5)]]
All the pre-trained labelers and their details are listed below.