> For the complete documentation index, see [llms.txt](https://docs.mindee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindee.com/v2/fr/modeles-classification/sdk-integration/classification-result.md).

# Résultat de classification

## Accéder à la Classification

A `Classifieur` décrit la classe détectée de l’ensemble du document.

### `Classifieur` Attributs

#### Type de document

La catégorie de document attribuée au sous-document. Elle est toujours renseignée.

Elle est renvoyée sous forme de chaîne et est identique à la valeur saisie sur la plateforme Mindee — casse, espaces et ponctuation compris.

#### Réponse d'extraction

Réponse d'extraction optionnelle associée au Split. Elle n'est renseignée que si l'enchaînement d'extraction est activé pour le modèle.

{% tabs %}
{% tab title="Python" %}

```python
from mindee import ClassificationResponse

def handle_response(response: ClassificationResponse) -> None:
    classification = response.inference.result.classification

    # Type de document identifié pour ce fichier
    document_type: str = classification.document_type
    print(f"Type détecté : {document_type}")

    # Réponse d'extraction optionnelle, présente si l'enchaînement d'extraction a été demandé
    extraction_response = classification.extraction_response

    if extraction_response is not None:
        # Accédez aux champs extraits à partir du résultat de l’inférence
        fields = extraction_response.inference.result.fields
        print(f"Champs d'extraction : {fields}")
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
function handleResponse(response) {
  const classification = response.getInference().getResult().getClassification();

  // Type de document identifié pour ce fichier
  const documentType = classification.getDocumentType();
  console.log(`Type détecté : ${documentType}`);

  // Réponse d'extraction optionnelle, présente si l'enchaînement d'extraction a été demandé
  const extractionResponse = classification.getExtractionResponse();

  if (extractionResponse != null) {
    // Accéder aux champs extraits depuis le résultat d'inférence du Split
    const fields = extractionResponse.getInference().getResult().getFields();
    console.log(`Extraction fields: ${fields.toString()}`);
  }
}
```

{% endtab %}

{% tab title="PHP" %}

```php
use Mindee\V2\Product\Classification\ClassificationResponse;

public function handleResponse(SplitResponse $response)
{
    $classification = $response->inference->result->classification;
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
def handle_response(response)
  classification = response.inference.result.classification

  # Type de document identifié pour ce fichier
  document_type = classification.document_type
  puts "Type détecté : #{document_type}"

  # Réponse d'extraction optionnelle, présente si l'enchaînement d'extraction a été demandé
  extraction_response = classification.extraction_response

  unless extraction_response.nil?
    # Accéder aux champs extraits depuis le résultat d'inférence du Split
    fields = extraction_response.inference.result.fields
    puts "Champs d'extraction : #{fields}"
  end
end
```

{% endtab %}

{% tab title="Java" %}

```java
import com.mindee.v2.product.classification.ClassificationResponse;

public void handleResponse(ClassificationResponse response) {
  var classification = response.getInference().getResult().getClassification();
  
  // Type de document identifié pour ce fichier
  String documentType = classification.getDocumentType();
  System.out.println("Type détecté : " + documentType);

  // Réponse d'extraction optionnelle, présente si l'enchaînement d'extraction a été demandé
  var extractionResponse = classification.getExtractionResponse();

  if (extractionResponse != null) {
    // Accéder aux champs extraits depuis le résultat d'inférence du Split
    var fields = extractionResponse.getInference().getResult().getFields();
    System.out.println("Champs d'extraction : " + fields.toString());
  }
}
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using Mindee.V2.Product.Classification;

public void HandleResponse(ClassificationResponse response)
{
    var classification = response.Inference.Result.Classification;

    // Type de document identifié pour ce fichier
    string documentType = classification.DocumentType;
    Console.WriteLine($"Type détecté : {documentType}");

    // Réponse d'extraction optionnelle, présente si l'enchaînement d'extraction a été demandé
    var extractionResponse = classification.ExtractionResponse;

    if (extractionResponse != null)
    {
        // Accédez aux champs extraits à partir du résultat de l’inférence de la Classification
        var fields = extractionResponse.Inference.Result.Fields;
        Console.WriteLine($"Champs d'extraction : {fields}");
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.mindee.com/v2/fr/modeles-classification/sdk-integration/classification-result.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.
