- Documentos de la API
- Introducción
- Uso de la API
- Tutorial de la API
- Resumen
- Fuentes
- Conjuntos de datos
- Comentarios
- Archivos adjuntos
- Predictions
- Crear una transmisión
- Actualizar una transmisión
- Obtener una transmisión por nombre
- Obtener todas las transmisiones
- Eliminar una transmisión
- Obtener resultados de la transmisión
- Obtener comentarios de una transmisión (heredado)
- Avanzar una transmisión
- Restablecer una transmisión
- Etiquetar una excepción
- Desetiquetar una excepción
- Eventos de auditoría
- Obtener todos los usuarios
- CLI
- Guías de integración
- Blog
- Cómo aprenden las máquinas a entender palabras: una guía para las incrustaciones en PNL
- Aprendizaje basado en solicitudes con Transformers
- Efficient Transformers II: destilación de conocimientos y ajuste
- Transformadores eficientes I: mecanismos de atención
- Modelado de intenciones jerárquico profundo no supervisado: obtener valor sin datos de entrenamiento
- Corrección del sesgo de anotación con Communications Mining
- Aprendizaje activo: mejores modelos ML en menos tiempo
- Todo está en los números: evaluar el rendimiento del modelo con métricas
- Por qué es importante la validación del modelo
- Comparación de Communications Mining y Google AutoML para la inteligencia de datos conversacional
Conjuntos de datos
/api/v1/datasets
Permisos necesarios: ver etiquetas
- 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" - Nodo
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)) - Respuesta
{ "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>
Permisos necesarios: ver etiquetas
/api/v1/datasets/<project>/<dataset_name>
Permisos necesarios: ver etiquetas
- 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" - Nodo
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)) - Respuesta
{ "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
Permisos necesarios: administrador del modelo
- 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" - Nodo
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)) - Respuesta
{ "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>
Permisos necesarios: administrador de conjuntos de datos
- 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" } }' - Nodo
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)) - Respuesta
{ "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" }
Nombre | Tipo | Obligatorio | Descripción |
---|---|---|---|
title | String | No | Título legible por humanos de una línea para el conjunto de datos. |
description | String | No | Una descripción más larga del conjunto de datos. |
source_ids | array<string> | No | Una matriz de ID de origen que se incluirán en este conjunto de datos. |
model_family | String | No | La familia de modelos del conjunto de datos puede ser inglesa o multilingüe. El valor predeterminado es inglés. Consulta aquí los idiomas compatibles con la familia de modelos multilingües. |
has_sentiment | Booleano | No | Si las etiquetas del conjunto de datos deben aplicarse con sentimiento. El valor predeterminado es verdadero. |
/api/v1/datasets/<project>/<dataset>
Permisos necesarios: administrador de conjuntos de datos
- 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" } }' - Nodo
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)) - Respuesta
{ "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" }
Nombre | Tipo | Obligatorio | Descripción |
---|---|---|---|
title | String | No | Título legible por humanos de una línea para el conjunto de datos. |
description | String | No | Una descripción más larga del conjunto de datos. |
source_ids | array<string> | No | Una matriz de ID de origen que se incluirán en este conjunto de datos. |
/api/v1/datasets/<project>/<dataset_name>
Permisos necesarios: administrador de conjuntos de datos
- 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" - Nodo
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)) - Respuesta
{ "status": "ok" }
{ "status": "ok" }
/api/v1/datasets/<project>/<dataset_name>/export
Permisos necesarios: exportar conjuntos de datos
- 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 }' - Nodo
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)) - Respuesta
{ "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" }
Nombre | Tipo | Obligatorio | Descripción |
---|---|---|---|
comment_uids | array<string> | No | Una lista de 256 UID de comentario como máximo (en el formato source_id.comment_id). Si se proporcionan, solo estos comentarios se incluirán en la respuesta. No se pueden pasar otros filtros con comment_uids .
|
source_ids | array<string> | No | Una lista de 1024 ID de origen como máximo. Si se proporcionan, solo se incluirán en la respuesta los comentarios de estas fuentes. |
order_by | String | No | Uno de created_at o timestamp . Si se proporciona, devuelve los comentarios ordenados por la fecha de creación de la API de los comentarios (created_at ) o la marca de tiempo del comentario definida por el usuario (timestamp ). El valor predeterminado es timestamp .
|
from | String | No | Una marca de tiempo ISO-8601. Si se proporciona, devuelve los comentarios solo a partir de esta marca de tiempo. El campo order_by relacionado controla qué marca de tiempo se utilizará para el filtrado.
|
to | String | No | Una marca de tiempo ISO-8601. Si se proporciona, devuelve comentarios solo hasta esta marca de tiempo (incluida). El campo order_by relacionado controla qué marca de tiempo se utilizará para el filtrado.
|
continuation | String | No | Token de paginación (proporcionado en la respuesta). Debe utilizarse para obtener el siguiente limit número de comentarios.
|
limit | Número | No | Número de comentarios devueltos por respuesta hasta un máximo de 256. Predeterminado: 64. |
Nombre | Tipo | Descripción |
---|---|---|
comments | array<Comment> | Una lista de comentarios con sus etiquetas asignadas y previstas. |
continuation | String | Token de paginación para obtener el siguiente limit número de comentarios. Si no hay más comentarios, este campo no estará presente en la respuesta.
|
Comment
tiene el siguiente formato:
Nombre | Tipo | Descripción |
---|---|---|
comment | object | Objeto de comentario. El formato se describe en la Referencia de comentarios. |
annotations | object | Un objeto que contiene un solo campo labels.assigned que es una lista de etiquetas asignadas a este comentario. El formato se describe en la Referencia de etiquetas. Ten en cuenta que no incluirá predicciones, ya que estas etiquetas se asignan, no se predicen.
|
predictions | object | Un objeto que contiene un solo campo labels que es una lista de etiquetas previstas para este comentario. El formato se describe en la Referencia de etiquetas.
|