---
schema_version: "1"
id: 8c278b491161b09b354e4d7d1f90ee717e4568da3b9fe13895ee1559ed1d2200
title: Create a French Model
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/einstein-vision-language/einstein/guides/Multilanguage-Support/create-a-french-model.md
canonical_url: https://developer.salesforce.com/docs/analytics/einstein-vision-language/guide/create-a-french-model.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1bcd731065d82090aecd3da96d21e0882e56c4eb696bc09a486f779fba732e71
products:
  - Einstein Vision and Language
  - Einstein Vision and Language Repo
---

# Create a French Model

In this walkthrough, you use the Einstein Intent API to create a French model to route support cases. You can then use the model to analyze text and infer what the user wants to accomplish. You use the French case routing [sample .csv file](https://einstein.ai/text/case_routing_intent_fr.csv) that we make available to you.

## Step by Step: Create a French Model

### Step 1: Get a Token

A valid JWT token is required to make API calls.

1. Find your key file. If you already created an account, locate the einstein_platform.pem file that you downloaded as part of that process. This file contains your private key.

2. Install cURL. You use the cURL command-line tool throughout the following walkthrough. The tool is installed by default on Linux and OSX. If you don’t already have it installed, download it from [https://curl.haxx.se/download.html](https://curl.haxx.se/download.html). Alternatively, you can use Postman to make API calls.

3. Get a token. The Einstein Intent API uses the OAuth 2.0 JWT bearer token flow for authorization. Use the [token page](https://api.einstein.ai/token) to upload your key file and generate a JWT token.

### Step 2: Create a Dataset

1. Replace `<TOKEN>` with your JWT token, and run the following command from the command line. This command:

- Creates a dataset called Dataset de Routage de Cas from the specified .csv file by accessing the file via a URL. If you leave out the name parameter, the dataset name defaults to the name of the file: case_routing_intent_fr.
- Creates five labels as specified in the .csv file.
- Creates 150 examples.

```cURL
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "name=Dataset de Routage de Cas" -F "path=http://einstein.ai/text/case_routing_intent_fr.csv" -F "language=fr" -F "type=text-intent"  https://api.einstein.ai/v2/language/datasets/upload
```

This call is asynchronous, so the response looks like this JSON.

```json
{
  "id": 1020389,
  "name": "Dataset de Routage de Cas",
  "createdAt": "2020-03-16T17:54:51.000+0000",
  "updatedAt": "2020-03-16T17:54:51.000+0000",
  "labelSummary": {
    "labels": []
  },
  "totalExamples": 0,
  "available": false,
  "statusMsg": "UPLOADING",
  "type": "text-intent",
  "language": "fr",
  "numOfDuplicates": 0,
  "object": "dataset"
}
```

2. To verify that the data has been loaded, make a call to get the dataset. Replace `<TOKEN>` with your JWT token, and replace `<DATASET_ID>` with the ID of the dataset that you created.

```cURL
curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" https://api.einstein.ai/v2/language/datasets/<DATASET_ID>
```

The results look something like this JSON. You know the dataset is ready when `available` is `true` and `statusMsg` is `SUCCEEDED`. You can see that the response also returns the `language` field.

```json
{
  "id": 1020389,
  "name": "Dataset de Routage de Cas",
  "createdAt": "2020-03-16T17:54:51.000+0000",
  "updatedAt": "2020-03-16T17:54:51.000+0000",
  "labelSummary": {
    "labels": [
      {
        "id": 104866,
        "datasetId": 1020389,
        "name": "Informations d'Expédition",
        "numExamples": 30
      },
      {
        "id": 104867,
        "datasetId": 1020389,
        "name": "Facturation",
        "numExamples": 24
      },
      {
        "id": 104868,
        "datasetId": 1020389,
        "name": "Opportunité de Vente",
        "numExamples": 44
      },
      {
        "id": 104869,
        "datasetId": 1020389,
        "name": "Changement de Commande",
        "numExamples": 26
      },
      {
        "id": 104870,
        "datasetId": 1020389,
        "name": "Aide Mot de Passe",
        "numExamples": 25
      }
    ]
  },
  "totalExamples": 149,
  "totalLabels": 5,
  "available": true,
  "statusMsg": "SUCCEEDED",
  "type": "text-intent",
  "language": "fr",
  "numOfDuplicates": 1,
  "object": "dataset"
}
```

### Step 3: Train the Dataset to Create a Model

1. In the following command, replace `<TOKEN>` with your JWT token, and replace `<DATASET_ID>` with the ID of the dataset that you created, and run the command.

```cURL
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -F "name=Modèle de Routage de Cas" -F "algorithm=multilingual-intent" -F "datasetId=<DATASET_ID>" https://api.einstein.ai/v2/language/train
```

The response looks like this JSON.

```json
{
  "datasetId": 1020389,
  "datasetVersionId": 0,
  "name": "Modèle de Routage de Cas",
  "status": "QUEUED",
  "progress": 0,
  "createdAt": "2020-03-16T17:54:51.000+0000",
  "updatedAt": "2020-03-16T17:54:51.000+0000",
  "modelId": "EIN6TP2LJYUOAW44EH3VH2Z4DU",
  "learningRate": 0,
  "epochs": 0,
  "queuePosition": 1,
  "modelType": "text-intent",
  "algorithm": "multilingual-intent",
  "language": "fr",
  "object": "training",
  "trainParams": null,
  "trainStats": null
}
```

2.  Use the `modelId` to make this call and get the training status. Replace `<TOKEN>` with your JWT token, and replace `MODEL_ID` with the ID of the model that you created.

```cURL
curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" https://api.einstein.ai/v2/language/train/<MODEL_ID>
```

The training status response looks like this JSON. When `status` is `SUCCEEDED`, it means the training was successful, and the model is ready for predictions.

```json
{
  "datasetId": 1020389,
  "datasetVersionId": 15667,
  "name": "Modèle de Routage de Cas",
  "status": "SUCCEEDED",
  "progress": 1,
  "createdAt": "2020-03-16T17:54:51.000+0000",
  "updatedAt": "2020-03-16T17:54:51.000+0000",
  "modelId": "EIN6TP2LJYUOAW44EH3VH2Z4DU",
  "learningRate": 0,
  "epochs": 1000,
  "modelType": "text-intent",
  "algorithm": "multilingual-intent",
  "language": "fr",
  "object": "training",
  "trainParams": null,
  "trainStats": {
    "labels": 5,
    "examples": 149,
    "averageF1": 0.8880952380952379,
    "totalTime": "00:04:16:861",
    "transforms": null,
    "trainingTime": "00:04:16:280",
    "earlyStopping": true,
    "lastEpochDone": 64,
    "modelSaveTime": "00:00:00:262",
    "testSplitSize": 25,
    "trainSplitSize": 124,
    "datasetLoadTime": "00:00:00:581",
    "preProcessStats": null,
    "postProcessStats": null
  }
}
```

### Step 4: Send Text for Prediction

Now your model is ready to go. To test it, send some text in for prediction. This cURL call takes the `modelId` of the model from which you want to return a prediction and the text string to analyze. In this case, the string in English is, “I would like to buy a soccer jersey.”

1. Replace `<TOKEN>` with your JWT token, and replace `<MODEL_ID>` with the ID of your model. Then run the command.

```cURL
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "modelId=<MODEL_ID>" -F "document=Je voudrais acheter un maillot de foot"  https://api.einstein.ai/v2/language/intent
```

The response looks like this JSON. The model predicts that the text indicates that the user is interested in buying something, so the model returns Opportunité de Vente (Sales Opportunity) as the top probability.

Your app can then use this information to route the case to the correct department or sales person.

```json
{
  "probabilities": [
    {
      "probability": 0.95638543,
      "label": "Opportunité de Vente"
    },
    {
      "probability": 0.02187803,
      "label": "Changement de Commande"
    },
    {
      "probability": 0.01103622,
      "label": "Informations d'Expédition"
    },
    {
      "probability": 0.008903132,
      "label": "Facturation"
    },
    {
      "probability": 0.0017971398,
      "label": "Aide Mot de Passe"
    }
  ],
  "object": "predictresponse"
}
```
