extract_event_mapper¶
Extracts events and relevant characters from the text.
This operator uses an API model to summarize the text into multiple events and extract the relevant characters for each event. The summary and character extraction follow a predefined format. The operator retries the API call up to a specified number of times if there is an error. The extracted events and characters are stored in the meta field of the samples. If no events are found, the original samples are returned. The operator can optionally drop the original text after processing.
从文本中提取事件和相关角色。
此算子使用 API 模型将文本总结为多个事件,并提取每个事件的相关角色。摘要和角色提取遵循预定义的格式。如果出现错误,该算子将重试 API 调用最多指定次数。提取的事件和角色存储在样本的 meta 字段中。如果没有找到事件,则返回原始样本。该算子可以选择在处理后删除原始文本。
Type 算子类型: mapper
Tags 标签: cpu, api, text
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
---|---|---|---|
|
<class ‘str’> |
|
API model name. |
|
<class ‘str’> |
|
The key name to store the event descriptions |
|
<class ‘str’> |
|
The field name to store the relevant |
|
typing.Optional[str] |
|
URL endpoint for the API. |
|
typing.Optional[str] |
|
Path to extract content from the API response. |
|
typing.Optional[str] |
|
System prompt for the task. |
|
typing.Optional[str] |
|
Template for building the model input. |
|
typing.Optional[str] |
|
Regular expression for parsing model output. |
|
typing.Annotated[int, Gt(gt=0)] |
|
The number of retry attempts when there is an API |
|
<class ‘bool’> |
|
If drop the text in the output. |
|
typing.Dict |
|
Parameters for initializing the API model. |
|
typing.Dict |
|
Extra parameters passed to the API call. |
|
|
Extra keyword arguments. |
📊 Effect demonstration 效果演示¶
not available 暂无