- Documents d’API
- CLI
- Guides d'intégration
- Blog
- Comment les machines apprennent à comprendre les mots : guide d'intégration dans NLP
- Apprentissage basé sur des invites avec des Transformers
- Efficient Transformers II : Dilarisation des connaissances et affinement
- Transformateurs efficaces I : mécanismes d'attention
- Modélisation de l'intention hiérarchique profonde non supervisée : obtenir de la valeur sans données d'entraînement
- Correction du biais d'annotation avec Communications Mining
- Apprentissage actif : de meilleurs modèles d'ML en moins de temps
- Tout est dans les chiffres : évaluer les performances du modèle avec des métriques
- Pourquoi la validation du modèle est importante
- Comparaison de Communications Mining et de Google AutoML pour l'intelligence des données conversationnelles
Jeux de données
/api/v1/datasets
Autorisations requises : afficher les libellés
- Bash
curl -X GET 'https://<my_api_endpoint>/api/v1/datasets' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/datasets' \ -H "Authorization: Bearer $REINFER_TOKEN" - Nœud
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/datasets", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/datasets", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.get( "https://<my_api_endpoint>/api/v1/datasets", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.get( "https://<my_api_endpoint>/api/v1/datasets", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "datasets": [ { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "18ba5ce699f8da1f", "last_modified": "2018-10-15T15:48:49.603000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Example Dataset" } ], "status": "ok" }
{ "datasets": [ { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "18ba5ce699f8da1f", "last_modified": "2018-10-15T15:48:49.603000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Example Dataset" } ], "status": "ok" }
/api/v1/datasets/<project>
Autorisations requises : afficher les libellés
/api/v1/datasets/<project>/<dataset_name>
Autorisations requises : afficher les libellés
- Bash
curl -X GET 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" - Nœud
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.get( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.get( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "dataset": { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "18ba5ce699f8da1f", "last_modified": "2018-10-15T15:48:49.603000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Example Dataset" }, "status": "ok" }
{ "dataset": { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "18ba5ce699f8da1f", "last_modified": "2018-10-15T15:48:49.603000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Example Dataset" }, "status": "ok" }
/api/v1/datasets/<project>/<dataset>/model-tags
Autorisations requises : Administrateur de modèle
- Bash
curl -X GET 'https://<my_api_endpoint>/api/v1/datasets/<project>/model-tags' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/datasets/<project>/model-tags' \ -H "Authorization: Bearer $REINFER_TOKEN" - Nœud
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/model-tags", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/model-tags", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.get( "https://<my_api_endpoint>/api/v1/datasets/<project>/model-tags", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.get( "https://<my_api_endpoint>/api/v1/datasets/<project>/model-tags", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "model_tags": [ { "name": "prod", "updated_at": "2021-11-16T12:31:00.123Z", "version": 5 }, { "name": "staging", "updated_at": "2021-11-15T12:30:00.123Z", "version": 7 } ], "status": "ok" }
{ "model_tags": [ { "name": "prod", "updated_at": "2021-11-16T12:31:00.123Z", "version": 5 }, { "name": "staging", "updated_at": "2021-11-15T12:30:00.123Z", "version": 7 } ], "status": "ok" }
/api/v1/datasets/<project>/<dataset>
Autorisations requises : administrateurdes ensembles de données
- Bash
curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "dataset": { "description": "An optional long form description.", "model_family": "english", "source_ids": [ "18ba5ce699f8da1f" ], "title": "An Example Dataset" } }'
curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "dataset": { "description": "An optional long form description.", "model_family": "english", "source_ids": [ "18ba5ce699f8da1f" ], "title": "An Example Dataset" } }' - Nœud
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { dataset: { description: "An optional long form description.", model_family: "english", source_ids: ["18ba5ce699f8da1f"], title: "An Example Dataset", }, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { dataset: { description: "An optional long form description.", model_family: "english", source_ids: ["18ba5ce699f8da1f"], title: "An Example Dataset", }, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.put( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "dataset": { "title": "An Example Dataset", "description": "An optional long form description.", "source_ids": ["18ba5ce699f8da1f"], "model_family": "english", } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.put( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "dataset": { "title": "An Example Dataset", "description": "An optional long form description.", "source_ids": ["18ba5ce699f8da1f"], "model_family": "english", } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "dataset": { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "b9a1fd75f6133bce", "last_modified": "2018-10-15T15:48:49.603000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Example Dataset" }, "status": "ok" }
{ "dataset": { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "b9a1fd75f6133bce", "last_modified": "2018-10-15T15:48:49.603000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Example Dataset" }, "status": "ok" }
Nom | Saisie de texte | Requis | DESCRIPTION |
---|---|---|---|
title | string | non | Titre une ligne lisible par un humain pour l'ensemble de données. |
description | string | non | Une description plus longue de l'ensemble de données. |
source_ids | array<string> | non | Un tableau des ID de source à inclure dans cet ensemble de données. |
model_family | string | non | La famille de modèles de jeux de données peut être anglaise ou multilingue. La valeur par défaut est l' anglais. Voir ici les langues prises en charge par la famille de modèles multilingue. |
has_sentiment | boolean | non | Si les libellés de l'ensemble de données doivent être appliqués avec sentiment. La valeur par défaut est true. |
/api/v1/datasets/<project>/<dataset>
Autorisations requises : administrateurdes ensembles de données
- Bash
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "dataset": { "title": "An Alternative Title" } }'
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "dataset": { "title": "An Alternative Title" } }' - Nœud
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { dataset: { title: "An Alternative Title" } }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { dataset: { title: "An Alternative Title" } }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"dataset": {"title": "An Alternative Title"}}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"dataset": {"title": "An Alternative Title"}}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "dataset": { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "b9a1fd75f6133bce", "last_modified": "2018-10-15T15:53:08.479000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Alternative Title" }, "status": "ok" }
{ "dataset": { "created": "2018-10-15T15:48:49.603000Z", "description": "An optional long form description.", "has_sentiment": true, "id": "b9a1fd75f6133bce", "last_modified": "2018-10-15T15:53:08.479000Z", "model_family": "english", "name": "example", "owner": "<project>", "source_ids": ["18ba5ce699f8da1f"], "title": "An Alternative Title" }, "status": "ok" }
Nom | Saisie de texte | Requis | DESCRIPTION |
---|---|---|---|
title | string | non | Titre une ligne lisible par un humain pour l'ensemble de données. |
description | string | non | Une description plus longue de l'ensemble de données. |
source_ids | array<string> | non | Un tableau des ID de source à inclure dans cet ensemble de données. |
/api/v1/datasets/<project>/<dataset_name>
Autorisations requises : administrateurdes ensembles de données
- Bash
curl -X DELETE 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X DELETE 'https://<my_api_endpoint>/api/v1/datasets/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" - Nœud
const request = require("request"); request.delete( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.delete( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.delete( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.delete( "https://<my_api_endpoint>/api/v1/datasets/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "status": "ok" }
{ "status": "ok" }
/api/v1/datasets/<project>/<dataset_name>/export
Autorisations requises : Exporter des jeux de données
- Bash
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/<project>/example/export' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "limit": 1 }'
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/<project>/example/export' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "limit": 1 }' - Nœud
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example/export", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { limit: 1 }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/<project>/example/export", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { limit: 1 }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/datasets/<project>/example/export", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"limit": 1}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/datasets/<project>/example/export", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"limit": 1}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Réponse
{ "comments": [ { "annotations": { "labels": { "assigned": [ { "name": "Parent Label", "sentiment": "positive" }, { "name": "Parent Label > Child Label", "sentiment": "positive" } ] } }, "comment": { "context": "1596721237668", "created_at": "2020-08-06T13:20:28.531000Z", "has_annotations": true, "id": "0123456789abcdef", "last_modified": "2020-08-06T13:40:37.668000Z", "messages": [ { "body": { "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob" }, "from": "bob@organisation.org", "sent_at": "2011-12-11T11:05:10Z", "subject": { "text": "Today's figures" }, "to": ["alice@company.com"] } ], "source_id": "47194279497e141e", "text_format": "plain", "thread_id": "123456", "timestamp": "2011-12-11T11:05:10Z", "uid": "47194279497e141e.0123456789abcdef", "user_properties": { "string:Recipient Domain": "company.com", "string:Sender Domain": "organisation.org" } }, "predictions": { "labels": [ { "name": "Another Parent Label", "probability": 0.954979807138443, "sentiment": -0.4281917143125379 }, { "name": "Another Parent Label > Another Child Label", "probability": 0.7726812064647675, "sentiment": -0.6603664430231163 } ] } } ], "continuation": "2021-02-16T10:55:05Z.c060a787c0b2bbf95526ad5cf28bf582", "status": "ok" }
{ "comments": [ { "annotations": { "labels": { "assigned": [ { "name": "Parent Label", "sentiment": "positive" }, { "name": "Parent Label > Child Label", "sentiment": "positive" } ] } }, "comment": { "context": "1596721237668", "created_at": "2020-08-06T13:20:28.531000Z", "has_annotations": true, "id": "0123456789abcdef", "last_modified": "2020-08-06T13:40:37.668000Z", "messages": [ { "body": { "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob" }, "from": "bob@organisation.org", "sent_at": "2011-12-11T11:05:10Z", "subject": { "text": "Today's figures" }, "to": ["alice@company.com"] } ], "source_id": "47194279497e141e", "text_format": "plain", "thread_id": "123456", "timestamp": "2011-12-11T11:05:10Z", "uid": "47194279497e141e.0123456789abcdef", "user_properties": { "string:Recipient Domain": "company.com", "string:Sender Domain": "organisation.org" } }, "predictions": { "labels": [ { "name": "Another Parent Label", "probability": 0.954979807138443, "sentiment": -0.4281917143125379 }, { "name": "Another Parent Label > Another Child Label", "probability": 0.7726812064647675, "sentiment": -0.6603664430231163 } ] } } ], "continuation": "2021-02-16T10:55:05Z.c060a787c0b2bbf95526ad5cf28bf582", "status": "ok" }
Nom | Saisie de texte | Requis | DESCRIPTION |
---|---|---|---|
comment_uids | array<string> | non | Une liste d'un maximum de 256 UID de commentaires (au format source_id.comment_id). Si fourni, seuls ces commentaires seront inclus dans la réponse. Aucun autre filtre ne peut être transmis avec comment_uids .
|
source_ids | array<string> | non | Liste de 1 024 ID source maximum. Si fourni, seuls les commentaires de ces sources seront inclus dans la réponse. |
order_by | string | non | L'un des created_at ou timestamp . Si fourni, renvoie les commentaires triés soit par la date de création d'API des commentaires (created_at ), soit par l'horodatage de commentaire défini par l'utilisateur (timestamp ). La valeur par défaut est timestamp .
|
from | string | non | Un horodatage ISO-8601. Si fourni, renvoie les commentaires uniquement à partir de cet horodatage. Le champ order_by associé contrôle l'horodatage qui sera utilisé pour le filtrage.
|
to | string | non | Un horodatage ISO-8601. Si fourni, renvoie les commentaires uniquement jusqu'à cet horodatage (inclus). Le champ order_by associé contrôle l'horodatage qui sera utilisé pour le filtrage.
|
continuation | string | non | Jeton de pagination (fourni dans la réponse). Doit être utilisé pour récupérer le nombre limit suivant de commentaires.
|
limit | Numérique | non | Nombre de commentaires renvoyés par réponse, jusqu'à un maximum de 256. Par défaut : 64. |
Nom | Saisie de texte | DESCRIPTION |
---|---|---|
comments | array<Comment> | Une liste de commentaires avec leurs libellés attribués et prédits. |
continuation | string | Jeton de pagination pour récupérer le nombre limit suivant de commentaires. S'il n'y a pas d'autres commentaires, ce champ ne sera pas présent dans la réponse.
|
Comment
a le format suivant :
Nom | Saisie de texte | DESCRIPTION |
---|---|---|
comment | object | Objet de commentaire. Le format est décrit dans la Référence du commentaire. |
annotations | object | Un objet contenant un seul champ labels.assigned qui est une liste de libellés affectés à ce commentaire. Le format est décrit dans la référence libellés. Notez qu'il n'inclura pas de prédictions car ces libellés sont attribués, non prédits.
|
predictions | object | Un objet contenant un seul champ labels qui est une liste de libellés prédits pour ce commentaire. Le format est décrit dans la référence libellés.
|