dialog_sentiment_intensity_mapper¶
Mapper to predict user’s sentiment intensity in a dialog, ranging from -5 to 5.
This operator analyzes the sentiment of user queries in a dialog and outputs a list of sentiment intensities and corresponding analyses. The sentiment intensity ranges from -5 (extremely negative) to 5 (extremely positive), with 0 indicating a neutral sentiment. The analysis is based on the provided history, query, and response keys. The default system prompt and templates guide the sentiment analysis process. The results are stored in the meta field under ‘dialog_sentiment_intensity’ for intensities and ‘dialog_sentiment_intensity_analysis’ for analyses. The operator uses an API model to generate the sentiment analysis, with configurable retry attempts and sampling parameters.
预测用户在对话中的情感强度,范围从-5到5。
该算子分析对话中用户查询的情感,并输出一个情感强度列表及其对应的分析。情感强度范围从-5(极其负面)到5(极其正面),0表示中性情感。分析基于提供的历史记录、查询和响应键。默认系统提示和模板指导情感分析过程。结果存储在元数据字段下的’dialog_sentiment_intensity’键(强度)和’dialog_sentiment_intensity_analysis’键(分析)。该算子使用API模型生成情感分析,可配置重试尝试和采样参数。
Type 算子类型: mapper
Tags 标签: cpu, api
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
---|---|---|---|
|
<class ‘str’> |
|
API model name. |
|
typing.Annotated[int, Ge(ge=0)] |
|
The max num of round in the dialog to build the |
|
<class ‘str’> |
|
The key name in the meta field to store |
|
<class ‘str’> |
|
The key name in the meta field to store the |
|
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 query part to build the input |
|
typing.Optional[str] |
|
Template for response part to build the |
|
typing.Optional[str] |
|
Template for analysis part to build the |
|
typing.Optional[str] |
|
Template for intensity part to build the |
|
typing.Optional[str] |
|
Pattern to parse the return sentiment |
|
typing.Optional[str] |
|
Pattern to parse the return sentiment |
|
typing.Annotated[int, Gt(gt=0)] |
|
The number of retry attempts when there is an API |
|
typing.Dict |
|
Parameters for initializing the API model. |
|
typing.Dict |
|
Extra parameters passed to the API call. |
|
|
Extra keyword arguments. |
📊 Effect demonstration 效果演示¶
not available 暂无