diff --git a/examples/annotation_import/text.ipynb b/examples/annotation_import/text.ipynb index c4d08f679..1ffa020b5 100644 --- a/examples/annotation_import/text.ipynb +++ b/examples/annotation_import/text.ipynb @@ -86,33 +86,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "id": "4d63074b-2379-48af-b9d6-2a66190f03c4", "metadata": { - "id": "4d63074b-2379-48af-b9d6-2a66190f03c4", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "0b4547c9-e534-441d-9bf6-7588ee50c8a2" + "id": "4d63074b-2379-48af-b9d6-2a66190f03c4" }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[K |████████████████████████████████| 184 kB 5.2 MB/s \n", - "\u001b[K |████████████████████████████████| 7.8 MB 45.4 MB/s \n", - "\u001b[?25h Building wheel for pygeotile (setup.py) ... \u001b[?25l\u001b[?25hdone\n" - ] - } - ], + "outputs": [], "source": [ "!pip install -q 'labelbox[data]'" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "id": "01fca8c9-0680-4a9c-a11e-1b49f31e9121", "metadata": { "id": "01fca8c9-0680-4a9c-a11e-1b49f31e9121" @@ -144,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "id": "86003724-4807-4281-95c1-5284a6f9609f", "metadata": { "id": "86003724-4807-4281-95c1-5284a6f9609f" @@ -199,7 +185,7 @@ "id": "Z5ORHD1pZKt1" }, "id": "Z5ORHD1pZKt1", - "execution_count": null, + "execution_count": 39, "outputs": [] }, { @@ -226,26 +212,13 @@ "id": "mrPJ1Ko0ZMdl" }, "id": "mrPJ1Ko0ZMdl", - "execution_count": null, + "execution_count": 40, "outputs": [] }, { "cell_type": "code", "source": [ - "########## Classification - Radio (with subclassifcations) ##########\n", - "\n", - "# Python annotation\n", - "radio_annotation_nested = ClassificationAnnotation(\n", - " name=\"radio_question_sub\", \n", - " value=Radio(answer = ClassificationAnswer(name = \"first_radio_answer\")),\n", - " classifications=[\n", - " \tClassificationAnnotation(\n", - " \tname=\"sub_radio_question\",\n", - " \t\tvalue=Radio(answer=ClassificationAnswer(name=\"first_sub_radio_answer\"))\n", - " )\n", - " ]\n", - ")\n", - "\n", + "########## Classification - Radio (with subclassifcations) is only suppported with NDJSON tools ##########\n", "\n", "# NDJSON\n", "radio_annotation_ndjson_with_subclass = {\n", @@ -263,7 +236,7 @@ "id": "vt7QvfV7ZPAF" }, "id": "vt7QvfV7ZPAF", - "execution_count": null, + "execution_count": 41, "outputs": [] }, { @@ -296,12 +269,12 @@ "id": "45BDh768ZYsH" }, "id": "45BDh768ZYsH", - "execution_count": null, + "execution_count": 42, "outputs": [] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "id": "f9f9287c-aad7-4914-bc87-1453fb8bce81", "metadata": { "id": "f9f9287c-aad7-4914-bc87-1453fb8bce81" @@ -364,27 +337,27 @@ "base_uri": "https://localhost:8080/" }, "id": "Ak-jnABK3OPH", - "outputId": "ff481cce-af08-4748-e8ac-a959085e07de" + "outputId": "0f80ba52-adde-4d97-d04a-fcdbe4d1a414" }, "id": "Ak-jnABK3OPH", - "execution_count": null, + "execution_count": 44, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\n", - "clbzkhbxy18ws07ysdumbbgnq\n" + "cldj4gyf60fy207xh3z1y2g1h\n" ] } ] @@ -395,7 +368,7 @@ "### Step 2: Create/select an ontology\n", "Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool names and classification instructions should match the `name`/`instructions` fields in your annotations to ensure the correct feature schemas are matched.\n", "\n", - "For example, when we create the checklist annotation [above](https://colab.research.google.com/drive/1mXfgydXxVR2OMAjJo1nj2EU9QQyVhW90#scrollTo=45BDh768ZYsH&line=1&uniqifier=1), we provided the `name` as `checklist_question`. Now, when we setup our ontology, we must ensure that the name of my classification tool is also `checklist_question`. The same alignment must hold true for the other tools and classifications we create in our ontology.\n", + "For example, when we create the checklist annotation above, we provided the `name` as `checklist_question`. Now, when we setup our ontology, we must ensure that the name of my classification tool is also `checklist_question`. The same alignment must hold true for the other tools and classifications we create in our ontology.\n", "\n", "[Documentation for reference ](https://docs.labelbox.com/reference/import-text-annotations)" ], @@ -459,7 +432,7 @@ "id": "_wWxYFoDTsar" }, "id": "_wWxYFoDTsar", - "execution_count": null, + "execution_count": 45, "outputs": [] }, { @@ -475,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 46, "id": "044e9194-d21d-403e-b64c-047c1063b0fe", "metadata": { "id": "044e9194-d21d-403e-b64c-047c1063b0fe" @@ -537,10 +510,10 @@ "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "153857ae-455d-4c7c-fb36-40fc16dc0819" + "outputId": "6eb66aad-477d-490e-ea91-53de995f1f65" }, "id": "DbwheC8RzI-0", - "execution_count": null, + "execution_count": 47, "outputs": [ { "output_type": "stream", @@ -548,11 +521,11 @@ "text": [ "Batch: \n" ] } @@ -575,7 +548,7 @@ { "cell_type": "markdown", "source": [ - "#### Python Annotations" + "#### Python annotations" ], "metadata": { "id": "7IgSl5SxcO4R" @@ -584,7 +557,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 48, "id": "53aaf87b-114f-4b56-a417-8c7cddc1f532", "metadata": { "id": "53aaf87b-114f-4b56-a417-8c7cddc1f532" @@ -599,8 +572,7 @@ " named_entitity_annotation, \n", " radio_annotation, \n", " checklist_annotation, \n", - " text_annotation, \n", - " radio_annotation_nested \n", + " text_annotation\n", " ]\n", ")\n", "\n", @@ -628,7 +600,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 49, "id": "c66672c7-33e8-4d5d-b79d-2ac76d830341", "metadata": { "id": "c66672c7-33e8-4d5d-b79d-2ac76d830341" @@ -693,10 +665,10 @@ "base_uri": "https://localhost:8080/" }, "id": "izli4zhEfi75", - "outputId": "b1cdc2d0-9541-4df2-d922-be0a7ce80499" + "outputId": "4eb1b790-4e60-4cc6-9224-de6a9ed339bf" }, "id": "izli4zhEfi75", - "execution_count": null, + "execution_count": 50, "outputs": [ { "output_type": "stream", @@ -720,14 +692,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 51, "id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4", "metadata": { "id": "e8d4e99b-ad7e-48b9-8073-afb764d7c5b4", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "be9df775-f18c-44ed-e02e-82b3c2a3691f" + "outputId": "1e52b23b-cefc-439b-f374-2e8b886280f4" }, "outputs": [ { @@ -770,7 +742,7 @@ "id": "ubbraAmo2_fe" }, "id": "ubbraAmo2_fe", - "execution_count": null, + "execution_count": 52, "outputs": [] } ],