Files
2026-07-13 12:37:18 +08:00

918 B

jupytext, kernelspec
jupytext kernelspec
formats text_representation
ipynb,md:myst
extension format_name format_version jupytext_version
.md myst 0.8 1.4.2
display_name language name
Python 3 python python3

srl

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:

```{hint}
Feed in multiple sentences at once for faster speed! 
```
:tags: [output_scroll]
import hanlp

srl = hanlp.load(hanlp.pretrained.srl.CPB3_SRL_ELECTRA_SMALL)
srl(['男孩', '希望', '女孩', '相信', '他', '。'])

All the pre-trained labelers and their details are listed below.


.. automodule:: hanlp.pretrained.srl
    :members: