> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/emotion-taxonomy.md). Agents can also search and read this documentation through its [MCP server](https://docs.convai.com/api-docs/~gitbook/mcp).

# Emotion 分类体系

说明内置情绪集合、服务器标签如何映射到它，以及如何为角色编写自定义情绪分类体系。

该分类体系会将 Convai 的原始情绪字符串转换为 Emotion 模块其他部分使用的规范标签。当 Convai 发送 `"happy"`时，分类体系会将该别名解析为 `"joy"` ，这样以规范标签为键的累加器和表情处理流水线就能准确知道要更新哪个分数。SDK 内置了一个受普鲁奇克理论启发、包含九种情绪的默认分类；如果需要使用不同的词汇或添加服务器别名，可以创建自定义 `EmotionTaxonomyAsset` 。

### 内置分类体系

当 `taxonomy` 字段在 `ConvaiEmotionProfile` 中留空时，系统会在运行时生成以下集合。此默认集合涵盖 Convai 目前生成的所有情绪，无需创建资源。

| 规范标签           | 服务器别名                                                                          | 默认嘴部影响程度 |
| -------------- | ------------------------------------------------------------------------------ | -------- |
| `neutral`      | `calm`, `idle`                                                                 | 0.0      |
| `joy`          | `happy`, `happiness`, `ecstasy`, `serenity`, `excited`, `enthusiastic`         | 0.6      |
| `trust`        | `acceptance`, `admiration`, `confident`, `reassured`                           | 0.3      |
| `fear`         | `afraid`, `apprehension`, `terror`, `fearful`, `worried`, `anxious`, `nervous` | 0.4      |
| `surprise`     | `amazement`, `distraction`, `surprised`                                        | 0.5      |
| `sadness`      | `sad`, `pensiveness`, `grief`                                                  | 0.3      |
| `disgust`      | `disgusted`, `loathing`, `boredom`, `bored`                                    | 0.4      |
| `anger`        | `angry`, `annoyance`, `rage`                                                   | 0.55     |
| `anticipation` | `interest`, `vigilance`, `curious`, `curiosity`, `eager`, `hopeful`            | 0.45     |

**默认嘴部影响** 是一个针对每种情绪的提示值（0–1），用于告知面部合成器：角色不说话时，由情绪驱动的嘴型应占多大比重。说话期间，LipSync 会控制嘴部混合形状；停止说话后，此值将控制情绪姿势对嘴部区域的影响程度。

内置集合中的每个非中性条目还包含一个 **互补情绪** ——一种相关情绪；启用 [情绪混合](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/emotion-profile.md#emotion-blending) 时，它会以较低强度伴随出现。 `joy` 和 `trust` 互为互补情绪； `fear` 和 `surprise` 互为互补情绪； `sadness` 与 `disgust`; `disgust` 与 `anger`; `anger` 与 `disgust`; `anticipation` 与 `joy`.

### 别名解析的工作原理

每当 Convai 发送一种情绪时，控制器都会调用 `IEmotionTaxonomy.TryResolve(serverLabel, out EmotionDescriptor descriptor)`。解析器会先检查规范标签，然后检查所有条目中的完整别名列表。

* 如果成功解析该标签，整个处理流程都会使用相应的规范标签和描述符。
* 如果该标签 **无法** 解析，控制器就会回退到中性描述符。 **不会生成控制台警告。** 处理流程会继续正常运行，并在每一帧写入中性分数。

**例如：** Convai 发送 `"happy"` → `TryResolve` 会在 `"happy"` 的别名列表中找到它， `joy` entry → 累积器为 `"joy"`.

{% hint style="warning" %}
当 Convai 发送的标签不在分类体系中时，系统会静默失败——不会显示控制台警告，也不会记录错误。角色会恢复为中性状态，就像没有收到情绪信号一样。如果某种特定情绪始终没有在角色身上出现，服务器标签很可能未包含在当前启用的分类体系中。有关如何检测并修复此问题，请参阅 [排查情绪问题](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/troubleshooting-and-diagnostics.md#unknown-server-labels-silent-neutral-fallback) 。
{% endhint %}

### 创建自定义分类体系资源

在 Project 窗口中，右键点击 `Assets/` 文件夹内，然后选择：

**Create → Convai → Embodiment → Emotion Taxonomy**

系统会创建一个名为 `EmotionTaxonomy` 的新资源。选中该资源，即可在 Inspector 中编辑条目列表。

#### EmotionTaxonomyEntry 字段

| 字段                                         | 类型               | 说明                                                                                                                                                                                                                               |
| ------------------------------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `label`                                    | `string`         | 在整个处理流程中使用的规范小写标签（例如 `"joy"`）。在分类体系中必须唯一。                                                                                                                                                                                        |
| `aliases`                                  | `List<string>`   | 所有应映射到此条目的服务器端字符串（例如 `"happy"`, `"happiness"`).                                                                                                                                                                                  |
| `complements`                              | `List<string>`   | 与该情绪搭配起来听起来自然、且在强度降低时会一同出现的情绪规范标签；当 [情绪混合](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/emotion-profile.md#emotion-blending) 启用时，例如 `joy` 中略带一丝 `trust`。只有角色配置文件启用了混合功能时才会使用此字段。 |
| `defaultMouthInfluence`                    | `float` (0–1)    | 供 LipSync 混合使用的嘴部影响提示值。参考值请参阅上方内置表格。                                                                                                                                                                                             |
| `isNeutral`                                | `bool`           | 将此条目标记为分类体系的中性基线——即不同情绪之间面部放松回归的状态，也是累积器的衰减锚点。                                                                                                                                                                                   |
| `useCustomDimensions`                      | `bool`           | 启用后，此条目的 `valence`/`arousal`/`agency`/`approach` 字段将覆盖该标签的内置维度默认值。禁用时，已知标签的值将从 `EmotionDimensionDefaults` 中解析。                                                                                                                   |
| `valence`, `arousal`, `agency`, `approach` | `float` (-1 – 1) | 该 `EmotionDimensions` 表示这种情绪的特征：愉悦程度、激动程度、掌控感，以及它会让角色靠近还是远离引发这种情绪的事物。Gaze、Body Language 和 locomotion 会将其与类别标签一同作为共享调制信号使用。仅在 `useCustomDimensions` 为 `true`.                                                                     |

{% hint style="warning" %}
**必须恰好有一个条目的 `isNeutral = true`.** 累加器会将中性条目用作衰减锚点。如果没有条目标记为中性，或有多个条目标记为中性，系统会记录警告并生成备用项，但运行时表情将无法正确回归。控制台警告消息如下：

* `[EmotionTaxonomyAsset] This emotion vocabulary marks no emotion as the neutral one, so a stand-in is being used. Tick 'Is Neutral' on exactly one emotion — it is what the face relaxes to between feelings.` — 未找到中性条目
* `[EmotionTaxonomyAsset] N emotions in this vocabulary are ticked 'Is Neutral' and only the first is used. Untick the others, so it is clear which one the face relaxes to.` — 找到多个中性条目
  {% endhint %}

#### 为配置文件指定自定义分类体系

{% stepper %}
{% step %}

#### 打开配置文件资源

打开你的 `ConvaiEmotionProfile` 资源。
{% endstep %}

{% step %}

#### 指定分类体系

将自定义的 `EmotionTaxonomyAsset` 拖到 **分类体系** 字段中。
{% endstep %}

{% step %}

#### 确认控制器已加载该分类体系

下次应用配置文件时，控制器会加载新的分类体系——在 Play Mode 中会立即加载；在 Edit Mode 中也会立即加载，因为 `ConvaiEmotionController` 继承自基类的 `[ExecuteAlways]` 特性。
{% endstep %}
{% endstepper %}

### 何时创建自定义分类体系

内置的 Plutchik 分类涵盖了 Convai 目前发送的所有情绪。遇到以下情况时，创建自定义分类体系会很有用：

* 你的 Convai 配置使用了与内置别名不同的自定义情绪标签。
* 你想采用不同的概念模型（例如 Ekman 的六种基本情绪），并将多个服务器别名映射到较少的规范类别。
* 你想调整 `defaultMouthInfluence` 值，让特定情绪更适合角色的绑定。
* 你需要定义 `complements` 关系以实现情绪混合，或为 `valence`/`arousal`/`agency`/`approach` 维度设置与内置默认值不同。

### 后续步骤

{% content-ref url="/pages/39d161d99d04e6ca98725c740d134ccb5eac9e73" %}
[Emotion 脚本 API](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/scripting-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/65ec9decd2473b72bc06bf3c946f3008c8528dda" %}
[排查情绪问题](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/troubleshooting-and-diagnostics.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/emotion-taxonomy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
