# Question Classifier

## Definition <a href="#id-1.-definition" id="id-1.-definition"></a>

By defining classification descriptions, the issue classifier can infer and match user inputs to the corresponding categories and output the classification results.

<figure><img src="https://vord.gitbook.io/~gitbook/image?url=https%3A%2F%2F4193241758-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FhxUatbw8WqecKw95HtRo%252Fuploads%252FSZIY3oEw82aXTHStMMxw%252FScreenshot%25202024-11-01%2520at%252015.51.09.png%3Falt%3Dmedia%26token%3D27eb1fcd-7023-464d-a3d6-4e8688277f15&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=f0aaa9d6&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## Scenarios <a href="#id-2.-scenarios" id="id-2.-scenarios"></a>

Common use cases include **customer service conversation intent classification, product review classification, and bulk email classification**.

In a typical product customer service Q\&A scenario, the issue classifier can serve as a preliminary step before knowledge base retrieval. It classifies the user's input question, directing it to different downstream knowledge base queries to accurately respond to the user's question.

The following diagram is an example workflow template for a product customer service scenario:

In this scenario, we set up three classification labels/descriptions:

* Category 1: **Questions related to after-sales service**
* Category 2: **Questions related to product usage**
* Category 3: **Other questions**

When users input different questions, the issue classifier will automatically classify them based on the set classification labels/descriptions:

* "**How to set up contacts on iPhone 14?**" —> "**Questions related to product usage**"
* "**What is the warranty period?**" —> "**Questions related to after-sales service**"
* "**How's the weather today?**" —> "**Other questions**"

## How to Configure <a href="#id-3.-how-to-configure" id="id-3.-how-to-configure"></a>

1. **Select Input Variable**: This refers to the content to be classified, usually the user's question in a customer service Q\&A scenario, e.g., `sys.query`.
2. **Choose Inference Model**: The issue classifier leverages the natural language classification and inference capabilities of large language models. Selecting an appropriate model can enhance classification effectiveness.
3. **Write Classification Labels/Descriptions**: You can manually add multiple classifications by writing keywords or descriptive statements for each category, helping the large language model better understand the classification criteria.
4. **Choose Corresponding Downstream Nodes**: After classification, the issue classification node can direct the flow to different paths based on the relationship between the classification and downstream nodes.

## **Advanced Settings**

**Instructions**: In **Advanced Settings - Instructions**, you can add supplementary instructions, such as more detailed classification criteria, to enhance the classifier's capabilities.

**Memory**: When enabled, each input to the issue classifier will include chat history from the conversation to help the LLM understand the context and improve question comprehension in interactive dialogues.

**Memory Window**: When the memory window is closed, the system dynamically filters the amount of chat history passed based on the model's context window; when open, users can precisely control the amount of chat history passed (in terms of numbers).

**Output Variable**:

`class_name`

This is the classification name output after classification. You can use the classification result variable in downstream nodes as needed.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.glik.ai/deprecation/orchestration-interface/node-orchestration/node/question-classifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
