communications-mining
latest
false
Wichtig :
Dieser Inhalt wurde maschinell übersetzt.
Communications Mining-Entwicklerhandbuch
Last updated 27. Sep. 2024

Erstellen Sie einen Stream

Erstellen Sie einen Stream

docs image
/api/v1/datasets/<project>/<dataset_name>/streams
/api/v1/datasets/<project>/<dataset_name>/streams

Erforderliche Berechtigungen: Streams-Administrator, Bezeichnungen anzeigen

  • Bash
    curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "stream": {
        "comment_filter": {
          "user_properties": {
            "number:Spend": {
              "maximum": 100000,
              "minimum": 100
            },
            "number:Transactions": {
              "one_of": [
                1
              ]
            },
            "string:Country": {
              "one_of": [
                "uk",
                "de"
              ]
            }
          }
        },
        "description": "Used by ACME RPA to create tickets for disputes.",
        "model": {
          "label_thresholds": [
            {
              "name": [
                "Some Label"
              ],
              "threshold": 0.37
            },
            {
              "name": [
                "Another Label"
              ],
              "threshold": 0.46
            },
            {
              "name": [
                "Parent Label",
                "Child Label"
              ],
              "threshold": 0.41
            }
          ],
          "version": 8
        },
        "name": "dispute",
        "title": "Collateral Disputes"
      }
    }'curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "stream": {
        "comment_filter": {
          "user_properties": {
            "number:Spend": {
              "maximum": 100000,
              "minimum": 100
            },
            "number:Transactions": {
              "one_of": [
                1
              ]
            },
            "string:Country": {
              "one_of": [
                "uk",
                "de"
              ]
            }
          }
        },
        "description": "Used by ACME RPA to create tickets for disputes.",
        "model": {
          "label_thresholds": [
            {
              "name": [
                "Some Label"
              ],
              "threshold": 0.37
            },
            {
              "name": [
                "Another Label"
              ],
              "threshold": 0.46
            },
            {
              "name": [
                "Parent Label",
                "Child Label"
              ],
              "threshold": 0.41
            }
          ],
          "version": 8
        },
        "name": "dispute",
        "title": "Collateral Disputes"
      }
    }'
    
  • Knoten
    const request = require("request");
    
    request.put(
      {
        url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: {
          stream: {
            comment_filter: {
              user_properties: {
                "number:Spend": { maximum: 100000, minimum: 100 },
                "number:Transactions": { one_of: [1] },
                "string:Country": { one_of: ["uk", "de"] },
              },
            },
            description: "Used by ACME RPA to create tickets for disputes.",
            model: {
              label_thresholds: [
                { name: ["Some Label"], threshold: 0.37 },
                { name: ["Another Label"], threshold: 0.46 },
                { name: ["Parent Label", "Child Label"], threshold: 0.41 },
              ],
              version: 8,
            },
            name: "dispute",
            title: "Collateral Disputes",
          },
        },
      },
      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/project1/collateral/streams",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: {
          stream: {
            comment_filter: {
              user_properties: {
                "number:Spend": { maximum: 100000, minimum: 100 },
                "number:Transactions": { one_of: [1] },
                "string:Country": { one_of: ["uk", "de"] },
              },
            },
            description: "Used by ACME RPA to create tickets for disputes.",
            model: {
              label_thresholds: [
                { name: ["Some Label"], threshold: 0.37 },
                { name: ["Another Label"], threshold: 0.46 },
                { name: ["Parent Label", "Child Label"], threshold: 0.41 },
              ],
              version: 8,
            },
            name: "dispute",
            title: "Collateral Disputes",
          },
        },
      },
      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/project1/collateral/streams",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={
            "stream": {
                "name": "dispute",
                "title": "Collateral Disputes",
                "description": "Used by ACME RPA to create tickets for disputes.",
                "model": {
                    "version": 8,
                    "label_thresholds": [
                        {"name": ["Some Label"], "threshold": 0.37},
                        {"name": ["Another Label"], "threshold": 0.46},
                        {
                            "name": ["Parent Label", "Child Label"],
                            "threshold": 0.41,
                        },
                    ],
                },
                "comment_filter": {
                    "user_properties": {
                        "string:Country": {"one_of": ["uk", "de"]},
                        "number:Spend": {"minimum": 100, "maximum": 100000},
                        "number:Transactions": {"one_of": [1]},
                    }
                },
            }
        },
    )
    
    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/project1/collateral/streams",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={
            "stream": {
                "name": "dispute",
                "title": "Collateral Disputes",
                "description": "Used by ACME RPA to create tickets for disputes.",
                "model": {
                    "version": 8,
                    "label_thresholds": [
                        {"name": ["Some Label"], "threshold": 0.37},
                        {"name": ["Another Label"], "threshold": 0.46},
                        {
                            "name": ["Parent Label", "Child Label"],
                            "threshold": 0.41,
                        },
                    ],
                },
                "comment_filter": {
                    "user_properties": {
                        "string:Country": {"one_of": ["uk", "de"]},
                        "number:Spend": {"minimum": 100, "maximum": 100000},
                        "number:Transactions": {"one_of": [1]},
                    }
                },
            }
        },
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Antwort
    {
      "status": "ok",
      "stream": {
        "context": "0",
        "created_at": "2019-08-03T12:30:00.123456Z",
        "dataset_id": "abcdef0123456789",
        "description": "Used by ACME RPA to create tickets for disputes.",
        "id": "0123456789abcdef",
        "model": {
          "version": 8
        },
        "name": "dispute",
        "title": "Collateral Disputes",
        "updated_at": "2019-08-03T12:30:00.123456Z"
      }
    }{
      "status": "ok",
      "stream": {
        "context": "0",
        "created_at": "2019-08-03T12:30:00.123456Z",
        "dataset_id": "abcdef0123456789",
        "description": "Used by ACME RPA to create tickets for disputes.",
        "id": "0123456789abcdef",
        "model": {
          "version": 8
        },
        "name": "dispute",
        "title": "Collateral Disputes",
        "updated_at": "2019-08-03T12:30:00.123456Z"
      }
    }

Streams ermöglichen eine persistente, zustandsbehaftete Iteration durch Kommentare in einem Dataset, mit vorhergesagten Beschriftungen und allgemeinen Feldern, die mit einem fixierten Modell berechnet werden.

Once a stream is created, the and methods can be used to iterate through comments.

NameTypErforderlichBESCHREIBUNG
namestringjaAPI-Name für den Stream, der in URLs verwendet wird. Muss innerhalb eines Datasets eindeutig sein und mit [A-Za-z0-9-_]{1,256} übereinstimmen.
titlestringneinEinzeiliger, visuell lesbarer Titel für den Stream.
descriptionstringneinEine längere Beschreibung des Streams.
modelModellneinWenn angegeben, enthalten aus diesem Stream abgerufene Kommentare Vorhersagen aus einem angehefteten Modell.
comment_filterCommentFilterneinIf specified, comments not matching the filter will not be returned. See for details on how the comment filter will affect the results returned by the stream.

Dabei hat Model das folgende Format:

NameTypErforderlichBESCHREIBUNG
versionIntegerjaEine Modellversion, die über die Seite Modelle angeheftet wurde.
label_thresholdsarray<LabelThreshold>neinWenn diese Option festgelegt ist, werden nur Werte zurückgegeben, die den angegebenen label_thresholds entsprechen. Wenn diese Option nicht festgelegt ist, werden alle Beschriftungen und alle Vorhersagewerte zurückgegeben.
Dabei hat LabelThreshold das folgende Format:
NameTypErforderlichBESCHREIBUNG
namearray<string>jaDer Name der zurückzugebenden Bezeichnung, formatiert als Liste hierarchischer Bezeichnungen. Beispielsweise hat die Beschriftung "Some Label" das Format ["Some Label"] und die Beschriftung "Parent Label > Child Label" das Format ["Parent Label", "Child Label"].
thresholdNummerjaDer Konfidenz-Schwellenwert, der für die Bezeichnung verwendet werden soll (eine Zahl zwischen 0,0 und 1,0). Die Bezeichnung wird für einen Kommentar nur zurückgegeben, wenn die Vorhersage über diesem Schwellenwert liegt.
Dabei hat CommentFilter das folgende Format:
NameTypErforderlichBESCHREIBUNG
user_propertiesUserPropertyFilterneinEin Filter, der auf die Benutzereigenschaften eines Kommentars angewendet wird. Weitere Informationen zu Benutzereigenschaften finden Sie in der Kommentarreferenz.
UserPropertyFilter ist eine Zuordnung von Benutzereigenschaftsnamen, die gefiltert werden sollen. String-Eigenschaften können nach Werten in einem Satz gefiltert werden ({"one_of": ["val_1", "val_2"]}). Zahleneigenschaften können entweder nach Werten in einem Satz ({"one_of": [123, 456]}) oder nach einem Bereich ({"minimum": 123, "maximum": 456}) gefiltert werden.
  • Erstellen Sie einen Stream

War diese Seite hilfreich?

Hilfe erhalten
RPA lernen – Automatisierungskurse
UiPath Community-Forum
Uipath Logo White
Vertrauen und Sicherheit
© 2005–2024 UiPath. Alle Rechte vorbehalten