Conversation analysis (Tongyi-Xiaomi-Analysis)
Tongyi-Xiaomi-Analysis specializes in information extraction from dialogues, scenario classification, and satisfaction analysis. It excels at handling complex quality inspection rules, supports custom analysis standards, and provides powerful multi-turn dialogue understanding and semantic reasoning.
Core features
-
Information extraction: Automatically extracts key information from unstructured dialogues, such as time, location, product, issue description, and customer requests.
Typical applications: Automating work order population, updating CRM customer information, and classifying and archiving issues.
-
Scenario classification: Identifies the business scenario of a dialogue and supports custom scenario categories.
Typical applications: Automatically routing dialogues to specialized teams, tracking inquiry volume by scenario, and optimizing service processes for specific scenarios.
-
Satisfaction analysis: Determines customer satisfaction levels based on custom rules and supports multi-dimensional evaluation.
Typical applications: Evaluating agent performance, monitoring service quality, and improving customer experience.
-
Complex quality inspection: Supports complex quality inspection rules, including nested conditions and logical reasoning, to accurately enforce enterprise-specific standards.
Typical applications: Performing quality inspections in highly regulated industries like finance and healthcare, checking multi-step business processes, and verifying compliance with complex scripts.
-
Multi-turn dialogue understanding: Automatically connects context across turns to accurately resolve references and dependencies, grasping the user's true intent in a multi-turn exchange.
Typical applications: Analyzing dialogues in complex business processes, understanding intent in long conversations, and extracting context-dependent information.
-
Deep semantic understanding: Accurately identifies implied meanings, emotional tones, and subtext in a conversation.
Typical applications: Monitoring customer sentiment, detecting potential complaints, and identifying sales opportunities.
These features can be implemented by using custom prompts. For usage details, see Feature demos.
Scope
-
Supported regions: Only China (Beijing) is supported. You must use an API Key from this region.
-
Supported languages: The conversation analysis models only support Chinese dialogues.
-
Supported models:
- tongyi-xiaomi-analysis-flash: Designed for structured analysis tasks such as information extraction and scenario classification. Suitable for low-latency online analysis and cost-sensitive offline tasks.
- tongyi-xiaomi-analysis-pro: Designed for complex logical reasoning and deep semantic understanding. Suitable for scenarios such as quality inspection with multi-condition nested rules and multi-turn dialogue analysis with strong contextual dependencies. Compared to the Flash model, it offers stronger reasoning and understanding but at a higher cost and latency.
For more information, see Model selection.
-
The models support implicit cache. Cache-hit tokens are billed according to the implicit cache billing rules.
Model selection
Use case | Recommended model | Model advantages | Recommendations |
|---|---|---|---|
Fast information extraction and scenario classification | tongyi-xiaomi-analysis-flash | Low latency and cost. Suitable for high-frequency, real-time calls. | Use for standardized extraction and classification tasks that do not involve complex reasoning. |
Standard quality inspection | tongyi-xiaomi-analysis-flash | Accurately understands dialogue semantics and sentiment, supports custom evaluation rules, and meets most quality inspection needs. | Use for quality inspection scenarios with clear rules. For complex business logic, use the pro model. |
Complex logical quality inspection | tongyi-xiaomi-analysis-pro | Stronger reasoning capabilities, supporting complex business rules such as nested conditions and contextual dependencies. | Higher cost than the flash model. Use for scenarios that require extremely high accuracy, such as finance and healthcare. |
In-depth multi-turn dialogue analysis | tongyi-xiaomi-analysis-pro | Stronger dialogue understanding capabilities, accurately understanding references and implied intent. | Use for scenarios that require a global understanding, such as post-sales ticket analysis and complaint root-cause analysis. |
Quick start
Usage suggestions
-
Standardize dialogue content format: Organize dialogue content in the format of
[Turn] Role: Content. Using a standard format helps the model parse the dialogue structure and accurately identify speaker roles, turn order, and contextual references.Example:
[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?
[2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.
[3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?
-
Write clear rules: Clear analysis rules are key to the model's accuracy. Vague or contradictory rules can lead to unexpected analysis results.
Tips for writing rules:
- Be specific and actionable: Avoid vague descriptions. For example, instead of "good service attitude," use "responded promptly and used polite language."
- Define priorities: When there are multiple rules, define their priorities and execution order to resolve potential conflicts and ensure the model can make a clear judgment.
- Provide positive and negative examples: Include positive and negative examples in your rules to help the model accurately understand the evaluation criteria.
-
Use special markers for key terms: When a business term has a definition that differs from its common understanding, use a special marker (such as an abbreviation) to replace the term. This prevents the model from interpreting it based on general knowledge.
-
Set API parameters: Conversation analysis tasks typically require deterministic and accurate results. Use the following parameter settings:
temperature: Set to0.0so the model returns the same result for the same input every time, ensuring analysis consistency.top_k: Set to1so the model always selects the highest-probability token, avoiding randomness.
-
Control the output format: To ensure parsable and controllable analysis results, specify the output format in the
prompt. If necessary, provide an output example.
Code examples
Prerequisites: Obtain an API Key. If you use an SDK, install the latest version of the SDK.
OpenAI-compatible
from openai import OpenAI
import os
dialogue = """
[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?
[2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.
[3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?
[4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.
[5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?
[6] Customer: Sure, I'll record it and send it to you in a bit.
[7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.
[8] Customer: Okay, if it's confirmed to be a quality issue, can I get a direct replacement?
[9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.
[10] Customer: Okay, I'll wait for your feedback then. Thank you for your patient answers.
"""
analysis_prompt = f"""
## Rules for Agent Quality Inspection and Satisfaction Analysis
### I. Objective
Based on the dialogue between the agent and the customer, accurately analyze the customer's emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.
### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)
1. **No Customer Input**
- Condition: The entire dialogue contains no content from the customer.
- Result: Judge as **Neutral**.
2. **Complaint or Strong Dissatisfaction**
- Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.
- Examples:
- "I want to complain about your delivery driver."
- "Why hasn't this been handled yet? When will it be resolved?"
- Result: Judge as **Dissatisfied** and end the analysis immediately.
3. **Negative Emotion in the Last Sentence**
- Condition: The customer's last sentence contains negative emotion.
- Result: Judge as **Dissatisfied**.
4. **No Expression of Thanks**
- Condition: The customer does not express clear thanks, such as "thank you," throughout the entire dialogue.
- Result: Judge as **Neutral**.
5. **Customer Actively Expresses Satisfaction or Praise**
- Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.
- Result: Ignore Rule 4 and judge as **Satisfied**.
6. **Thanks After a Solution is Provided**
- Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.
- Notes:
- "Okay" or "Alright" do not count as thanks.
- No reply does not count as approval.
- Result: Judge as **Satisfied**.
7. **Other Situations**
- Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.
- Result: Judge as **Neutral**.
### III. Dialogue Content
```text
{dialogue}
```
### IV. Output Format
The judgment result must include two parts:
1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral
2. **Reason for Judgment**: A brief explanation based on the rules above.
Format:
```
Satisfaction Label#Reason for Judgment
```
Example:
```
Neutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.
Dissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.
```
"""
# Get an API Key: https://help.aliyun.com/en/model-studio/get-api-key
# If the environment variable is not set, replace the following line with your Model Studio API Key: api_key="sk-xxx"
client = OpenAI(
api_key=os.getenv("DASHSCOPE_API_KEY"),
# The URL for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID.
base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
model="tongyi-xiaomi-analysis-flash",
messages=[
{
'role': 'user',
'content': analysis_prompt
}
],
temperature=0,
extra_body={
"top_k": 1
}
)
print(completion.choices[0].message.content)
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.JsonValue;
import com.openai.models.chat.completions.ChatCompletion;
import com.openai.models.chat.completions.ChatCompletionCreateParams;
public class Main {
public static void main(String[] args) {
try {
OpenAIClient client = OpenAIOkHttpClient.builder()
// Get an API Key: https://help.aliyun.com/en/model-studio/get-api-key
// If the environment variable is not set, replace the following line with .apiKey("sk-xxx")
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
// The URL for the China (Beijing) region.
// Replace {WorkspaceId} with your workspace ID. The URL varies by region.
.baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
.build();
// Create ChatCompletion parameters
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
.model("tongyi-xiaomi-analysis-flash")
.addUserMessage(getUserMessage())
.temperature(0.0)
.putAdditionalBodyProperty("top_k", JsonValue.from(1))
.build();
// Send the request and get the response
ChatCompletion chatCompletion = client.chat().completions().create(params);
String content = chatCompletion.choices().get(0).message().content().orElse("No valid content returned");
System.out.println(content);
// To view the full response, uncomment the following line
// System.out.println(chatCompletion);
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
private static String getUserMessage() {
String dialogue = "[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?\n" +
" [2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.\n" +
" [3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?\n" +
" [4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.\n" +
" [5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?\n" +
" [6] Customer: Sure, I'll record it and send it to you in a bit.\n" +
" [7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.\n" +
" [8] Customer: Okay, if it's confirmed to be a quality issue, can I get a direct replacement?\n" +
" [9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.\n" +
" [10] Customer: Okay, I'll wait for your feedback then. Thank you for your patient answers.";
String analysisPrompt = "## Rules for Agent Quality Inspection and Satisfaction Analysis\n" +
"\n" +
"### I. Objective\n" +
"Based on the dialogue between the agent and the customer, accurately analyze the customer's emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.\n" +
"\n" +
"### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)\n" +
"\n" +
"1. **No Customer Input**\n" +
" - Condition: The entire dialogue contains no content from the customer.\n" +
" - Result: Judge as **Neutral**.\n" +
"\n" +
"2. **Complaint or Strong Dissatisfaction**\n" +
" - Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.\n" +
" - Examples:\n" +
" - \"I want to complain about your delivery driver.\"\n" +
" - \"Why hasn't this been handled yet? When will it be resolved?\"\n" +
" - Result: Judge as **Dissatisfied** and end the analysis immediately.\n" +
"\n" +
"3. **Negative Emotion in the Last Sentence**\n" +
" - Condition: The customer's last sentence contains negative emotion.\n" +
" - Result: Judge as **Dissatisfied**.\n" +
"\n" +
"4. **No Expression of Thanks**\n" +
" - Condition: The customer does not express clear thanks, such as \"thank you,\" throughout the entire dialogue.\n" +
" - Result: Judge as **Neutral**.\n" +
"\n" +
"5. **Customer Actively Expresses Satisfaction or Praise**\n" +
" - Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.\n" +
" - Result: Ignore Rule 4 and judge as **Satisfied**.\n" +
"\n" +
"6. **Thanks After a Solution is Provided**\n" +
" - Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.\n" +
" - Notes:\n" +
" - \"Okay\" or \"Alright\" do not count as thanks.\n" +
" - No reply does not count as approval.\n" +
" - Result: Judge as **Satisfied**.\n" +
"\n" +
"7. **Other Situations**\n" +
" - Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.\n" +
" - Result: Judge as **Neutral**.\n" +
"\n" +
"### III. Dialogue Content\n" +
"```text\n" +
dialogue + "\n" +
"```\n" +
"\n" +
"### IV. Output Format\n" +
"The judgment result must include two parts:\n" +
"1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral\n" +
"2. **Reason for Judgment**: A brief explanation based on the rules above.\n" +
"\n" +
"Format:\n" +
"```\n" +
"Satisfaction Label#Reason for Judgment\n" +
"```\n" +
"Example:\n" +
"```\n" +
"Neutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.\n" +
"Dissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.\n" +
"```";
return analysisPrompt;
}
}
// Requires Node.js v18+ and must be run in an ES Module environment.
import OpenAI from "openai";
const openai = new OpenAI(
{
// Get an API Key: https://help.aliyun.com/en/model-studio/get-api-key
// If the environment variable is not set, replace the following line with: apiKey: "sk-xxx",
apiKey: process.env.DASHSCOPE_API_KEY,
// The URL for the China (Beijing) region.
// Replace {WorkspaceId} with your workspace ID. The URL varies by region.
baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
}
);
const completion = await openai.chat.completions.create({
model: "tongyi-xiaomi-analysis-flash",
messages: [
{
role: "user",
content: `
## Rules for Agent Quality Inspection and Satisfaction Analysis
### I. Objective
Based on the dialogue between the agent and the customer, accurately analyze the customer's emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.
### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)
1. **No Customer Input**
- Condition: The entire dialogue contains no content from the customer.
- Result: Judge as **Neutral**.
2. **Complaint or Strong Dissatisfaction**
- Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.
- Examples:
- "I want to complain about your delivery driver."
- "Why hasn't this been handled yet? When will it be resolved?"
- Result: Judge as **Dissatisfied** and end the analysis immediately.
3. **Negative Emotion in the Last Sentence**
- Condition: The customer's last sentence contains negative emotion.
- Result: Judge as **Dissatisfied**.
4. **No Expression of Thanks**
- Condition: The customer does not express clear thanks, such as "thank you," throughout the entire dialogue.
- Result: Judge as **Neutral**.
5. **Customer Actively Expresses Satisfaction or Praise**
- Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.
- Result: Ignore Rule 4 and judge as **Satisfied**.
6. **Thanks After a Solution is Provided**
- Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.
- Notes:
- "Okay" or "Alright" do not count as thanks.
- No reply does not count as approval.
- Result: Judge as **Satisfied**.
7. **Other Situations**
- Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.
- Result: Judge as **Neutral**.
### III. Dialogue Content
\`\`\`text
[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?
[2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.
[3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?
[4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.
[5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?
[6] Customer: Sure, I'll record it and send it to you in a bit.
[7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.
[8] Customer: Okay, if it's confirmed to be a quality issue, can I get a direct replacement?
[9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.
[10] Customer: Okay, I'll wait for your feedback then. Thank you for your patient answers.
\`\`\`
### IV. Output Format
The judgment result must include two parts:
1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral
2. **Reason for Judgment**: A brief explanation based on the rules above.
Format:
\`\`\`
Satisfaction Label#Reason for Judgment
\`\`\`
Example:
\`\`\`
Neutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.
Dissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.
\`\`\`
`
}
],
temperature: 0,
top_k: 1
});
console.log(completion.choices[0].message.content);
// To view the full response, uncomment the following line
// console.log(JSON.stringify(completion, null, 4));
// OpenAI Go SDK version v2.4.0 or later is required.
package main
import (
"context"
// To view the full response, uncomment the line below and at the end of the code.
// "encoding/json"
"fmt"
"os"
"github.com/openai/openai-go/v2"
"github.com/openai/openai-go/v2/option"
)
func main() {
// Get an API Key: https://help.aliyun.com/en/model-studio/get-api-key
// If the environment variable is not set, replace the following line with: apiKey := "sk-xxx"
apiKey := os.Getenv("DASHSCOPE_API_KEY")
client := openai.NewClient(
option.WithAPIKey(apiKey),
// The URL for the China (Beijing) region.
// Replace {WorkspaceId} with your workspace ID. The URL varies by region.
option.WithBaseURL("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"),
)
chatCompletion, err := client.Chat.Completions.New(
context.TODO(), openai.ChatCompletionNewParams{
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage(`
## Rules for Agent Quality Inspection and Satisfaction Analysis
### I. Objective
Based on the dialogue between the agent and the customer, accurately analyze the customer's emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.
### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)
1. **No Customer Input**
- Condition: The entire dialogue contains no content from the customer.
- Result: Judge as **Neutral**.
2. **Complaint or Strong Dissatisfaction**
- Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.
- Examples:
- "I want to complain about your delivery driver."
- "Why hasn't this been handled yet? When will it be resolved?"
- Result: Judge as **Dissatisfied** and end the analysis immediately.
3. **Negative Emotion in the Last Sentence**
- Condition: The customer's last sentence contains negative emotion.
- Result: Judge as **Dissatisfied**.
4. **No Expression of Thanks**
- Condition: The customer does not express clear thanks, such as "thank you," throughout the entire dialogue.
- Result: Judge as **Neutral**.
5. **Customer Actively Expresses Satisfaction or Praise**
- Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.
- Result: Ignore Rule 4 and judge as **Satisfied**.
6. **Thanks After a Solution is Provided**
- Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.
- Notes:
- "Okay" or "Alright" do not count as thanks.
- No reply does not count as approval.
- Result: Judge as **Satisfied**.
7. **Other Situations**
- Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.
- Result: Judge as **Neutral**.
### III. Dialogue Content
` + "```" + `text
[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?
[2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.
[3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?
[4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.
[5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?
[6] Customer: Sure, I'll record it and send it to you in a bit.
[7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.
[8] Customer: Okay, if it's confirmed to be a quality issue, can I get a direct replacement?
[9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.
[10] Customer: Okay, I'll wait for your feedback then. Thank you for your patient answers.
` + "```" + `
### IV. Output Format
The judgment result must include two parts:
1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral
2. **Reason for Judgment**: A brief explanation based on the rules above.
Format:
` + "```" + `
Satisfaction Label#Reason for Judgment
` + "```" + `
Example:
` + "```" + `
Neutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.
Dissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.
` + "```" + `
`),
},
Model: "tongyi-xiaomi-analysis-flash",
Temperature: openai.Float(0.0),
},
option.WithJSONSet("top_k", 1),
)
if err != nil {
fmt.Fprintf(os.Stderr, "Request failed: %v\n", err)
os.Exit(1)
}
if len(chatCompletion.Choices) > 0 {
fmt.Println(chatCompletion.Choices[0].Message.Content)
}
// To view the full response, uncomment the following lines
// jsonData, _ := json.MarshalIndent(chatCompletion, "", " ")
// fmt.Println(string(jsonData))
}
# The URL for the China (Beijing) region.
# Replace {WorkspaceId} with your workspace ID. The URL varies by region.
curl --location "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tongyi-xiaomi-analysis-flash",
"messages": [
{
"role": "user",
"content": "\n## Rules for Agent Quality Inspection and Satisfaction Analysis\n\n### I. Objective\nBased on the dialogue between the agent and the customer, accurately analyze the customer''s emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.\n\n### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)\n\n1. **No Customer Input**\n - Condition: The entire dialogue contains no content from the customer.\n - Result: Judge as **Neutral**.\n\n2. **Complaint or Strong Dissatisfaction**\n - Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.\n - Examples:\n - \"I want to complain about your delivery driver.\"\n - \"Why hasn''t this been handled yet? When will it be resolved?\"\n - Result: Judge as **Dissatisfied** and end the analysis immediately.\n\n3. **Negative Emotion in the Last Sentence**\n - Condition: The customer''s last sentence contains negative emotion.\n - Result: Judge as **Dissatisfied**.\n\n4. **No Expression of Thanks**\n - Condition: The customer does not express clear thanks, such as \"thank you,\" throughout the entire dialogue.\n - Result: Judge as **Neutral**.\n\n5. **Customer Actively Expresses Satisfaction or Praise**\n - Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.\n - Result: Ignore Rule 4 and judge as **Satisfied**.\n\n6. **Thanks After a Solution is Provided**\n - Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.\n - Notes:\n - \"Okay\" or \"Alright\" do not count as thanks.\n - No reply does not count as approval.\n - Result: Judge as **Satisfied**.\n\n7. **Other Situations**\n - Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.\n - Result: Judge as **Neutral**.\n\n### III. Dialogue Content\n```text\n[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?\n[2] Customer: Hello, I bought a blender from your store last week, and it''s making a strange noise when it runs.\n[3] Agent: I''m sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?\n[4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.\n[5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?\n[6] Customer: Sure, I''ll record it and send it to you in a bit.\n[7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.\n[8] Customer: Okay, if it''s confirmed to be a quality issue, can I get a direct replacement?\n[9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.\n[10] Customer: Okay, I''ll wait for your feedback then. Thank you for your patient answers.\n```\n\n### IV. Output Format\nThe judgment result must include two parts:\n1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral\n2. **Reason for Judgment**: A brief explanation based on the rules above.\n\nFormat:\n```\nSatisfaction Label#Reason for Judgment\n```\nExample:\n```\nNeutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.\nDissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.\n```\n"
}
],
"temperature": 0.0,
"top_k": 1
}'
DashScope
from http import HTTPStatus
import dashscope
import os
# The URL for the China (Beijing) region.
# Replace {WorkspaceId} with your workspace ID. The URL varies by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
dialogue = """
[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?
[2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.
[3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?
[4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.
[5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?
[6] Customer: Sure, I'll record it and send it to you in a bit.
[7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.
[8] Customer: Okay, if it's confirmed to be a quality issue, can I get a direct replacement?
[9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.
[10] Customer: Okay, I'll wait for your feedback then. Thank you for your patient answers.
"""
analysis_prompt = f"""
## Rules for Agent Quality Inspection and Satisfaction Analysis
### I. Objective
Based on the dialogue between the agent and the customer, accurately analyze the customer's emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.
### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)
1. **No Customer Input**
- Condition: The entire dialogue contains no content from the customer.
- Result: Judge as **Neutral**.
2. **Complaint or Strong Dissatisfaction**
- Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.
- Examples:
- "I want to complain about your delivery driver."
- "Why hasn't this been handled yet? When will it be resolved?"
- Result: Judge as **Dissatisfied** and end the analysis immediately.
3. **Negative Emotion in the Last Sentence**
- Condition: The customer's last sentence contains negative emotion.
- Result: Judge as **Dissatisfied**.
4. **No Expression of Thanks**
- Condition: The customer does not express clear thanks, such as "thank you," throughout the entire dialogue.
- Result: Judge as **Neutral**.
5. **Customer Actively Expresses Satisfaction or Praise**
- Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.
- Result: Ignore Rule 4 and judge as **Satisfied**.
6. **Thanks After a Solution is Provided**
- Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.
- Notes:
- "Okay" or "Alright" do not count as thanks.
- No reply does not count as approval.
- Result: Judge as **Satisfied**.
7. **Other Situations**
- Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.
- Result: Judge as **Neutral**.
### III. Dialogue Content
```text
{dialogue}
```
### IV. Output Format
The judgment result must include two parts:
1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral
2. **Reason for Judgment**: A brief explanation based on the rules above.
Format:
```
Satisfaction Label#Reason for Judgment
```
Example:
```
Neutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.
Dissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.
```
"""
# Get an API Key: https://help.aliyun.com/en/model-studio/get-api-key
# If the environment variable is not set, replace the following line with: api_key="sk-xxx"
response = dashscope.Generation.call(
api_key=os.getenv('DASHSCOPE_API_KEY'),
model="tongyi-xiaomi-analysis-flash",
messages=[
{
'role': 'user',
'content': analysis_prompt
}
],
temperature=0.0,
top_k=1,
result_format="message"
)
if response.status_code == HTTPStatus.OK:
print(response.output.choices[0].message.content)
else:
print('Request id: %s, Status code: %s, error code: %s, error message: %s' % (
response.request_id, response.status_code,
response.code, response.message
))
import java.util.Arrays;
import java.lang.System;
import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.aigc.generation.GenerationParam;
import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.protocol.Protocol;
public class Main {
public static GenerationResult callWithMessage() throws ApiException, NoApiKeyException, InputRequiredException {
// The URL for the China (Beijing) region.
// Replace {WorkspaceId} with your workspace ID. The URL varies by region.
Generation gen = new Generation(Protocol.HTTP.getValue(), "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1");
Message userMsg = Message.builder()
.role(Role.USER.getValue())
.content(getContent())
.build();
GenerationParam param = GenerationParam.builder()
// Get an API Key: https://help.aliyun.com/en/model-studio/get-api-key
// If the environment variable is not set, replace the following line with: .apiKey("sk-xxx")
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.model("tongyi-xiaomi-analysis-flash")
.messages(Arrays.asList(userMsg))
.temperature(0.0f)
.topK(1)
.resultFormat(GenerationParam.ResultFormat.MESSAGE)
.build();
return gen.call(param);
}
public static void main(String[] args) {
try {
GenerationResult result = callWithMessage();
System.out.println(result.getOutput().getChoices().get(0).getMessage().getContent());
// To view the full response, uncomment the following line
// System.out.println(JsonUtils.toJson(result));
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.err.println("Error: "+e.getMessage());
}
}
private static String getContent() {
String dialogue = "[1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you?\n" +
" [2] Customer: Hello, I bought a blender from your store last week, and it's making a strange noise when it runs.\n" +
" [3] Agent: I'm sorry for the trouble. Does the noise start immediately after you turn it on, or after it has been running for a while?\n" +
" [4] Customer: It starts a few seconds after I turn it on, and the sound is very sharp.\n" +
" [5] Agent: Understood. Could you please take a video of it running and send it to our technical staff for confirmation?\n" +
" [6] Customer: Sure, I'll record it and send it to you in a bit.\n" +
" [7] Agent: Great. After we receive the video, we will provide you with a solution within two hours.\n" +
" [8] Customer: Okay, if it's confirmed to be a quality issue, can I get a direct replacement?\n" +
" [9] Agent: Yes, if it is identified as a quality issue, we will replace it with a new machine for free and cover the shipping costs.\n" +
" [10] Customer: Okay, I'll wait for your feedback then. Thank you for your patient answers.";
String analysisPrompt = "## Rules for Agent Quality Inspection and Satisfaction Analysis\n" +
"\n" +
"### I. Objective\n" +
"Based on the dialogue between the agent and the customer, accurately analyze the customer's emotions and feedback to determine their **satisfaction level** (Satisfied / Dissatisfied / Neutral) and provide the reason for the judgment. This is used for agent quality inspection and service improvement.\n" +
"\n" +
"### II. Decision Flow (Must be followed from top to bottom. Stop immediately when a matching rule is met.)\n" +
"\n" +
"1. **No Customer Input**\n" +
" - Condition: The entire dialogue contains no content from the customer.\n" +
" - Result: Judge as **Neutral**.\n" +
"\n" +
"2. **Complaint or Strong Dissatisfaction**\n" +
" - Condition: The customer directly or indirectly expresses a desire to complain (about a delivery driver, courier, merchant, agent, etc.), or shows clear negative emotions such as anxiety, questioning, or complaining when inquiring about progress.\n" +
" - Examples:\n" +
" - \"I want to complain about your delivery driver.\"\n" +
" - \"Why hasn't this been handled yet? When will it be resolved?\"\n" +
" - Result: Judge as **Dissatisfied** and end the analysis immediately.\n" +
"\n" +
"3. **Negative Emotion in the Last Sentence**\n" +
" - Condition: The customer's last sentence contains negative emotion.\n" +
" - Result: Judge as **Dissatisfied**.\n" +
"\n" +
"4. **No Expression of Thanks**\n" +
" - Condition: The customer does not express clear thanks, such as \"thank you,\" throughout the entire dialogue.\n" +
" - Result: Judge as **Neutral**.\n" +
"\n" +
"5. **Customer Actively Expresses Satisfaction or Praise**\n" +
" - Condition: The customer explicitly expresses satisfaction with the agent or gives praise during the dialogue.\n" +
" - Result: Ignore Rule 4 and judge as **Satisfied**.\n" +
"\n" +
"6. **Thanks After a Solution is Provided**\n" +
" - Condition: Before the service ends, after the agent provides a solution like compensation, order cancellation, or a refund, the customer clearly and positively expresses thanks.\n" +
" - Notes:\n" +
" - \"Okay\" or \"Alright\" do not count as thanks.\n" +
" - No reply does not count as approval.\n" +
" - Result: Judge as **Satisfied**.\n" +
"\n" +
"7. **Other Situations**\n" +
" - Condition: None of the above situations apply, and there are no complaints or obvious dissatisfaction.\n" +
" - Result: Judge as **Neutral**.\n" +
"\n" +
"### III. Dialogue Content\n" +
"```text\n" +
dialogue + "\n" +
"```\n" +
"\n" +
"### IV. Output Format\n" +
"The judgment result must include two parts:\n" +
"1. **Satisfaction Label**: Satisfied / Dissatisfied / Neutral\n" +
"2. **Reason for Judgment**: A brief explanation based on the rules above.\n" +
"\n" +
"Format:\n" +
"```\n" +
"Satisfaction Label#Reason for Judgment\n" +
"```\n" +
"Example:\n" +
"```\n" +
"Neutral#The customer did not express thanks, nor did they show any complaints or dissatisfaction during the dialogue, so the judgment is neutral.\n" +
"Dissatisfied#The customer showed clear dissatisfaction and questioning when asking about the progress, matching Rule 2, so the judgment is dissatisfied.\n" +
"```";
return analysisPrompt;
}
}
# The URL for the China (Beijing) region.
# Replace {WorkspaceId} with your workspace ID. The URL varies by region.
curl --location "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation" \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "tongyi-xiaomi-analysis-flash",
"input":{
"messages":[
{
"role": "user",
"content": "Please help me extract key information from the following dialogue: [1] Agent: Hello, thank you for calling the AB e-commerce platform. How can I help you? [2] Customer: Hello, I bought a blender from your store last week, and it''s making a strange noise when it runs."
}
],
"temperature": 0.0,
"top_k": 1
},
"parameters": {
"result_format": "message"
}
}'
Feature examples
Each feature example provides runnable content. To try out a feature, replace the content in the code sample.
Dialogue information extraction
Feature description: Automatically extracts key information from unstructured dialogues, such as time, location, product, problem description, and customer requests.
Use cases:
- Automatic ticket system population
- CRM customer information updates
- Problem classification and archiving
content example:
Extract key information from the following dialogue and output it in JSON format.
Dialogue content:
```
[1] Customer Service: Hello, this is Wang. How can I help you?
[2] Customer: Hello, I bought an iPhone 15 at your Nanjing Xinjiekou store last Wednesday. The order number is 123456789. The screen is now a bit yellow.
[3] Customer Service: Okay, let me check for you. Could you please provide your phone number?
[4] Customer: 138****5678
[5] Customer Service: Got it. I see your order. Regarding the yellow screen issue, under what circumstances did you notice it?
[6] Customer: I noticed it during normal use. It's especially obvious when looking at a white background.
```
Information to extract:
1. Purchase time
2. Purchase store
3. Product name
4. Order number
5. Customer contact information
6. Problem description
7. Scenario where the problem was found
Output format (JSON):
```json
{{
"Purchase time": "...",
"Purchase store": "...",
"Product name": "...",
"Order number": "...",
"Customer contact information": "...",
"Problem description": "...",
"Scenario where the problem was found": "..."
}}
```
Note: If a piece of information is not mentioned in the dialogue, fill in "Not mentioned".
Scenario classification
Feature description: Automatically identifies the business scenario of a dialogue and supports custom scenario categories.
Use cases:
- Automatic dialogue routing to specialized teams
- Statistics on inquiry volume for different scenarios
- Targeted optimization of service processes
content example:
Determine which business scenario the following dialogue belongs to.
Dialogue content:
```
[1] Customer Service: Hello, welcome to the customer service hotline. How can I help you?
[2] Customer: I'd like to ask about your membership promotions.
[3] Customer Service: Okay, we currently offer a 20% discount for the first month for new members, and existing members can earn reward points for referring friends.
[4] Customer: So how do I register for a membership?
[5] Customer Service: You can register through our app or mini program. Just fill in your basic information.
[6] Customer: Okay, thanks.
```
Optional scenario categories:
1. Pre-sales inquiry - The customer asks about product features, price, or purchase methods.
2. After-sales complaint - The customer reports product issues, service dissatisfaction, or requests returns or exchanges.
3. Logistics inquiry - The customer asks about order status, delivery progress, or logistics information.
4. Membership services - The customer inquires about member benefits, points, or promotions.
5. Technical support - The customer seeks help with product usage or troubleshooting.
6. Account issues - The customer reports problems with login, password, or account security.
Output format:
```
Scenario category: [Select one from the categories above]
Confidence: [High/Medium/Low]
Rationale: [Briefly explain the reason in 1-2 sentences]
```
Satisfaction analysis
Feature description: Determines customer satisfaction based on custom rules and supports multi-dimensional assessment.
Use cases:
- Customer service performance assessment
- Service quality monitoring
- Customer experience improvement
content example:
Determine the customer's satisfaction level based on the following dialogue.
Dialogue content:
```
[1] Customer Service: Hello, this is Agent Li. How can I help you?
[2] Customer: Why hasn't my order shipped yet? It's been three days!
[3] Customer Service: I'm very sorry for the inconvenience. I'll check for you right away. What is your order number?
[4] Customer: 1234567890
[5] Customer Service: Okay, I see your order. Shipping is slightly delayed due to a recent logistics peak. I will contact the warehouse immediately to expedite it. It will be shipped out today.
[6] Customer: Then when will it arrive?
[7] Customer Service: It is expected to arrive in 3-5 business days. As an apology, I have added a 20 yuan coupon to your account for your next purchase.
[8] Customer: Alright, just ship it quickly.
[9] Customer Service: Absolutely! I will keep an eye on your order and notify you as soon as it ships. Is there anything else I can help you with?
[10] Customer: No.
```
Satisfaction criteria:
1. **Dissatisfied**: The customer explicitly complains, expresses dissatisfaction, or requests compensation or a refund.
2. **Neutral**: The customer's problem is solved but they do not express thanks or approval, or they are reserved about the solution.
3. **Satisfied**: The customer explicitly expresses thanks, approves of the service, or indicates acceptance and satisfaction with the solution.
Assessment dimensions:
- Customer emotion (initial emotion vs. final emotion)
- Problem resolution (whether a solution was provided)
- Customer feedback (whether they expressed thanks, approval, or continued dissatisfaction)
- Compensation measures (whether there was extra compensation or a discount)
Output format:
```
Satisfaction level: [Satisfied/Neutral/Dissatisfied]
Initial emotion: [Describe the customer's initial emotional state]
Final emotion: [Describe the customer's emotional state at the end of the dialogue]
Problem resolved: [Yes/No/Partially resolved]
Rationale: [Explain the basis for the determination in detail, referencing the assessment dimensions]
```
Complex quality inspection
Feature description: Supports complex quality inspection rules such as nested conditions and logical reasoning to accurately enforce company-specific quality standards.
Use cases:
- Industries with high compliance requirements, such as finance and healthcare
- Quality inspection for multi-step business processes
- Compliance checks for complex scripts
content example:
Conduct a quality inspection on the dialogue based on the following rules for customer service in the financial industry.
Dialogue content:
```
[1] Customer Service: Hello, welcome to the XX Bank Credit Card Center. I am Agent 8888, Zhang. How can I help you?
[2] Customer: I'd like to request a credit limit increase for my credit card.
[3] Customer Service: Okay, what is your name and ID card number?
[4] Customer: My name is Zhang San, and my ID card number is 110101199001011234.
[5] Customer Service: Okay, Mr. Zhang. Let me check for you. Your current credit card limit is 20,000 yuan. Based on your card usage history and credit score, we can increase it to 50,000 yuan. Would you like to proceed?
[6] Customer: Yes, go ahead.
[7] Customer Service: Okay, please confirm: Your credit card limit will be increased from 20,000 yuan to 50,000 yuan, effective immediately. Do you confirm?
[8] Customer: Confirmed.
[9] Customer Service: Okay, your application has been submitted and is expected to be completed within 2 business days. Thank you for calling. Have a great day. Goodbye.
```
Quality inspection rules (must be strictly followed):
**1. Opening script rules (Mandatory)**
- Rule 1: Must include "Hello" or "Welcome".
- Rule 2: Must state agent ID.
- Rule 3: Must state the institution (e.g., "XX Bank Credit Card Center").
- **Result**: Pass only if all three items are met.
**2. Identity verification rules (Mandatory)**
- Rule 4: When performing account operations, must verify the customer's identity (Name + ID card number OR Name + Bank card number).
- **Result**: Failure to verify identity during an account operation is a serious violation.
**3. Important information disclosure rules (Mandatory)**
- Rule 5: When adjusting limits, changing rates, or modifying products, you must:
- Clearly state the specific details before and after the change.
- State the effective time.
- Obtain explicit confirmation from the customer (clear expressions such as "Yes", "Confirm", or "Agree").
- **Result**: Missing any of the above items is a serious violation.
**4. Closing script rules (Recommended)**
- Rule 6: Recommended to include a thank you.
- Rule 7: Recommended to include a closing pleasantry.
- **Result**: Failure does not affect the overall inspection result but will result in a point deduction.
**Output format**:
```
Inspection result: [Pass/Fail]
Number of violations: [Number]
Detailed check:
1. Opening script rules: [Pass/Fail] - [Explanation]
2. Identity verification rules: [Pass/Fail] - [Explanation]
3. Important information disclosure rules: [Pass/Fail] - [Explanation]
4. Closing script rules: [Pass/Fail (Recommended)] - [Explanation]
Overall evaluation: [Summary evaluation, 1-2 sentences]
```
Multi-turn dialogue understanding
Feature description: Automatically links previous and subsequent parts of a dialogue to accurately understand anaphora and contextual dependencies.
Use cases:
- Dialogue analysis for complex business processes
- Intent understanding in long dialogues
- Context-aware information extraction
content example:
Extract complete ticket information from the following dialogue. You need to integrate information scattered across multiple turns.
Dialogue content:
```
[1] Customer Service: Hello, how can I help you?
[2] Customer: The router I bought last week keeps disconnecting.
[3] Customer Service: Okay, which model did you purchase?
[4] Customer: The AX3000, the white one.
[5] Customer Service: Got it. How often does it disconnect?
[6] Customer: About once every 2-3 hours. It really affects my work.
[7] Customer Service: Understood. When did this start happening?
[8] Customer: Just in the last two days. It was working fine before.
[9] Customer Service: I see. Have you recently moved the router or changed any settings?
[10] Customer: No, it's always been in the living room, and I haven't touched the settings.
[11] Customer Service: Okay, this problem might be caused by an old firmware version. I suggest you try upgrading the firmware first.
[12] Customer: How do I upgrade it?
[13] Customer Service: Open our app on your phone, find this device, and tap "Firmware Upgrade".
[14] Customer: Okay, I'll try it now.
[15] Customer Service: Okay, the upgrade process takes about 5 minutes. The network will disconnect during this time. Do not turn off the router's power.
[16] Customer: Okay, will it reconnect automatically after the upgrade?
[17] Customer Service: Yes, it will restart automatically when finished. Then you can just reconnect to the Wi-Fi.
[18] Customer: I see. What if it still disconnects after the upgrade?
[19] Customer Service: If the problem persists after the upgrade, it might be a hardware failure. I will arrange a replacement or an on-site inspection for you.
[20] Customer: Okay, I'll try it first. Thanks.
```
Extract the following information (Note: This information is scattered across different turns of the dialogue and requires contextual understanding):
1. **Product information** (model, appearance, purchase time)
2. **Problem description** (specific issue, frequency)
3. **Problem timeline** (when it started, whether it was normal before)
4. **Customer actions** (any special operations or adjustments)
5. **Agent diagnosis** (preliminary suspected cause)
6. **Solution** (recommended steps)
7. **Contingency plan** (alternative plan if the solution is ineffective)
Output in a structured format and indicate which dialogue turns each piece of information comes from.
Deep semantic understanding
Feature description: Accurately identifies implicit semantics, emotional sentiment, and subtext in dialogues.
Use cases:
- Customer emotion monitoring
- Potential complaint alerts
- Sales opportunity identification
content example:
Perform a deep semantic analysis of the following dialogue.
Dialogue content:
```
[1] Customer Service: Hello, how can I help you?
[2] Customer: Why did my membership suddenly expire? I could still use it last month.
[3] Customer Service: Hello, let me check for you. What is your phone number?
[4] Customer: 138****5678
[5] Customer Service: Okay, I see that you have an annual membership that expired on October 15 of last year.
[6] Customer: Oh, I see. Can I still use the coupons I bought before?
[7] Customer Service: Member-exclusive coupons cannot be used after the membership expires. However, you can renew your membership to continue using the coupons.
[8] Customer: Alright, I get it.
[9] Customer Service: Is there anything else I can help you with?
[10] Customer: No, thanks.
```
Analysis dimensions:
1. **Customer emotion analysis**
- Turn 2: What is the emotion and implicit meaning of "Why did my membership suddenly expire? I could still use it last month."?
- Turn 6: What is the emotional shift in "Oh, I see."?
- Turn 8: What is the true emotion behind "Alright, I get it."?
2. **Potential issue identification**
- Is the customer dissatisfied?
- Is there a potential risk of a complaint?
- Is there a misunderstanding of the service or rules?
3. **Customer's true needs**
- What is the customer most concerned about?
- Was the customer's problem resolved satisfactorily?
- Does the customer have any unexpressed needs?
4. **Suggestions for improvement**
- Was the agent's response appropriate?
- How can the response be improved to increase customer satisfaction?
Output format: Clearly output the analysis results according to the four dimensions above.
API reference
For the input and output parameters of the model, see Text generation.