diff --git a/docs/source/guide/ml_tutorials.html b/docs/source/guide/ml_tutorials.html index 52fe5e419fde..de73ef9d6c49 100644 --- a/docs/source/guide/ml_tutorials.html +++ b/docs/source/guide/ml_tutorials.html @@ -5,14 +5,14 @@ - Segmentation hide_frontmatter_title: true hide_menu: true - image: /tutorials/timeseries.png + image: /guide/ml_tutorials/timeseries.png meta_description: Tutorial demonstrating a minimal ML backend that performs time series segmentation in Label Studio. meta_title: Time Series Segmenter for Label Studio order: 35 tier: all title: Time Series Segmenter for Label Studio type: guide - url: /tutorials/timeseries_segmenter.html + url: /guide/ml_tutorials/timeseries_segmenter.html - categories: - Natural Language Processing - Text Classification @@ -20,7 +20,7 @@ - Hugging Face hide_frontmatter_title: true hide_menu: true - image: /tutorials/bert.png + image: /guide/ml_tutorials/bert.png meta_description: Tutorial on how to use BERT-based text classification with your Label Studio project meta_title: BERT-based text classification @@ -28,14 +28,14 @@ tier: all title: Classify text with a BERT model type: guide - url: /tutorials/bert_classifier.html + url: /guide/ml_tutorials/bert_classifier.html - categories: - Computer Vision - Optical Character Recognition - EasyOCR hide_frontmatter_title: true hide_menu: true - image: /tutorials/easyocr.png + image: /guide/ml_tutorials/easyocr.png meta_description: The EasyOCR model connection integrates the capabilities of EasyOCR with Label Studio to assist in machine learning labeling tasks involving Optical Character Recognition (OCR). @@ -44,21 +44,21 @@ tier: all title: Transcribe text from images with EasyOCR type: guide - url: /tutorials/easyocr.html + url: /guide/ml_tutorials/easyocr.html - categories: - Natural Language Processing - Named Entity Recognition - Flair hide_frontmatter_title: true hide_menu: true - image: /tutorials/flair.png + image: /guide/ml_tutorials/flair.png meta_description: Tutorial on how to use Label Studio and Flair for faster NER labeling meta_title: Use Flair with Label Studio order: 75 tier: all title: NER labeling with Flair type: guide - url: /tutorials/flair.html + url: /guide/ml_tutorials/flair.html - categories: - Natural Language Processing - Named Entity Recognition @@ -67,7 +67,7 @@ - Hugging Face hide_frontmatter_title: true hide_menu: true - image: /tutorials/gliner.png + image: /guide/ml_tutorials/gliner.png meta_description: Tutorial on how to use GLiNER with your Label Studio project to complete NER tasks meta_title: Use GLiNER for NER annotation @@ -75,7 +75,7 @@ tier: all title: Use GLiNER for NER annotation type: guide - url: /tutorials/gliner.html + url: /guide/ml_tutorials/gliner.html - categories: - Computer Vision - Image Annotation @@ -83,7 +83,7 @@ - Grounding DINO hide_frontmatter_title: true hide_menu: true - image: /tutorials/grounding-dino.png + image: /guide/ml_tutorials/grounding-dino.png meta_description: Label Studio tutorial for using Grounding DINO for zero-shot object detection in images meta_title: Image segmentation in Label Studio using a Grounding DINO backend @@ -91,7 +91,7 @@ tier: all title: Zero-shot object detection and image segmentation with Grounding DINO type: guide - url: /tutorials/grounding_dino.html + url: /guide/ml_tutorials/grounding_dino.html - categories: - Computer Vision - Image Annotation @@ -101,7 +101,7 @@ - Segment Anything Model hide_frontmatter_title: true hide_menu: true - image: /tutorials/grounding-sam.png + image: /guide/ml_tutorials/grounding-sam.png meta_description: Label Studio tutorial for using Grounding DINO and SAM for zero-shot object detection in images meta_title: Image segmentation in Label Studio using a Grounding DINO backend and @@ -111,7 +111,7 @@ title: Zero-shot object detection and image segmentation with Grounding DINO and SAM type: guide - url: /tutorials/grounding_sam.html + url: /guide/ml_tutorials/grounding_sam.html - categories: - Generative AI - Large Language Model @@ -119,7 +119,7 @@ - Hugging Face hide_frontmatter_title: true hide_menu: true - image: /tutorials/hf-llm.png + image: /guide/ml_tutorials/hf-llm.png meta_description: This tutorial explains how to run Hugging Face Large Language model backend in Label Studio. Hugging Face Large Language Model Backend is a machine learning backend designed to work with Label Studio, providing a custom @@ -129,14 +129,14 @@ tier: all title: Hugging Face Large Language Model (LLM) type: guide - url: /tutorials/huggingface_llm.html + url: /guide/ml_tutorials/huggingface_llm.html - categories: - Natural Language Processing - Named Entity Recognition - Hugging Face hide_frontmatter_title: true hide_menu: true - image: /tutorials/hf-ner.png + image: /guide/ml_tutorials/hf-ner.png meta_description: This tutorial explains how to run a Hugging Face NER backend in Label Studio. meta_title: Label Studio tutorial to run Hugging Face NER backend @@ -144,14 +144,14 @@ tier: all title: Hugging Face NER type: guide - url: /tutorials/huggingface_ner.html + url: /guide/ml_tutorials/huggingface_ner.html - categories: - Natural Language Processing - Named Entity Recognition - Interactive matching hide_frontmatter_title: true hide_menu: true - image: /tutorials/interactive-substring-matching.png + image: /guide/ml_tutorials/interactive-substring-matching.png meta_description: Use the interactive substring matching model for labeling NER tasks in Label Studio meta_title: Interactive substring matching for NER tasks @@ -159,7 +159,7 @@ tier: all title: Interactive substring matching for NER tasks type: guide - url: /tutorials/interactive_substring_matching.html + url: /guide/ml_tutorials/interactive_substring_matching.html - categories: - Generative AI - Retrieval Augmented Generation @@ -168,7 +168,7 @@ - Langchain hide_frontmatter_title: true hide_menu: true - image: /tutorials/langchain.png + image: /guide/ml_tutorials/langchain.png meta_description: Use Langchain, OpenAI, and Google to generate responses based on Google search results. meta_title: RAG with a Langchain search agent @@ -176,7 +176,7 @@ tier: all title: RAG with a Langchain search agent type: guide - url: /tutorials/langchain_search_agent.html + url: /guide/ml_tutorials/langchain_search_agent.html - categories: - Generative AI - Large Language Model @@ -186,7 +186,7 @@ - ChatGPT hide_frontmatter_title: true hide_menu: true - image: /tutorials/llm-interactive.png + image: /guide/ml_tutorials/llm-interactive.png meta_description: Label Studio tutorial for interactive LLM labeling with OpenAI, Azure, or Ollama meta_title: Interactive LLM labeling with OpenAI, Azure, or Ollama @@ -194,7 +194,7 @@ tier: all title: Interactive LLM labeling with GPT type: guide - url: /tutorials/llm_interactive.html + url: /guide/ml_tutorials/llm_interactive.html - categories: - Computer Vision - Object Detection @@ -203,7 +203,7 @@ - MMDetection hide_frontmatter_title: true hide_menu: true - image: /tutorials/openmmlab.png + image: /guide/ml_tutorials/openmmlab.png meta_description: This is a tutorial on how to use the example MMDetection model backend with Label Studio for image segmentation tasks. meta_title: Object detection in images with Label Studio and MMDetection @@ -211,7 +211,7 @@ tier: all title: Object detection with bounding boxes using MMDetection type: guide - url: /tutorials/mmdetection-3.html + url: /guide/ml_tutorials/mmdetection-3.html - categories: - Audio/Speech Processing - Automatic Speech Recognition @@ -219,7 +219,7 @@ - NVidia hide_frontmatter_title: true hide_menu: true - image: /tutorials/nvidia.png + image: /guide/ml_tutorials/nvidia.png meta_description: Tutorial on how to use set up Nvidia NeMo to use for ASR tasks in Label Studio meta_title: Automatic Speech Recognition with NeMo @@ -227,7 +227,7 @@ tier: all title: Automatic Speech Recognition with NVidia NeMo type: guide - url: /tutorials/nemo_asr.html + url: /guide/ml_tutorials/nemo_asr.html - categories: - Computer Vision - Image Annotation @@ -235,13 +235,13 @@ - Segment Anything Model hide_frontmatter_title: true hide_menu: true - image: /tutorials/sam2-images.png + image: /guide/ml_tutorials/sam2-images.png meta_title: Using SAM2 with Label Studio for Image Annotation order: 15 tier: all title: SAM2 with Images type: guide - url: /tutorials/segment_anything_2_image.html + url: /guide/ml_tutorials/segment_anything_2_image.html - categories: - Computer Vision - Video Annotation @@ -249,13 +249,13 @@ - Segment Anything Model hide_frontmatter_title: true hide_menu: true - image: /tutorials/sam2-video.png + image: /guide/ml_tutorials/sam2-video.png meta_title: Using SAM2 with Label Studio for Video Annotation order: 15 tier: all title: SAM2 with Videos type: guide - url: /tutorials/segment_anything_2_video.html + url: /guide/ml_tutorials/segment_anything_2_video.html - categories: - Computer Vision - Object Detection @@ -265,7 +265,7 @@ - ONNX hide_frontmatter_title: true hide_menu: true - image: /tutorials/segment-anything.png + image: /guide/ml_tutorials/segment-anything.png meta_description: Label Studio tutorial for labeling images with MobileSAM or ONNX SAM. meta_title: Interactive annotation in Label Studio with Segment Anything Model (SAM) @@ -273,14 +273,14 @@ tier: all title: Interactive annotation with Segment Anything Model type: guide - url: /tutorials/segment_anything_model.html + url: /guide/ml_tutorials/segment_anything_model.html - categories: - Natural Language Processing - Text Classification - Scikit-learn hide_frontmatter_title: true hide_menu: true - image: /tutorials/scikit-learn.png + image: /guide/ml_tutorials/scikit-learn.png meta_description: Tutorial on how to use an example ML backend for Label Studio with Scikit-learn logistic regression meta_title: Sklearn Text Classifier model for Label Studio @@ -288,14 +288,14 @@ tier: all title: Sklearn Text Classifier model type: guide - url: /tutorials/sklearn_text_classifier.html + url: /guide/ml_tutorials/sklearn_text_classifier.html - categories: - Natural Language Processing - Named Entity Recognition - SpaCy hide_frontmatter_title: true hide_menu: true - image: /tutorials/spacy.png + image: /guide/ml_tutorials/spacy.png meta_description: Tutorial on how to use Label Studio and spaCy for faster NER and POS labeling meta_title: Use spaCy models with Label Studio @@ -303,14 +303,14 @@ tier: all title: spaCy models for NER type: guide - url: /tutorials/spacy.html + url: /guide/ml_tutorials/spacy.html - categories: - Computer Vision - Optical Character Recognition - Tesseract hide_frontmatter_title: true hide_menu: true - image: /tutorials/tesseract.png + image: /guide/ml_tutorials/tesseract.png meta_description: Tutorial for how to use Label Studio and Tesseract to assist with your OCR projects meta_title: Interactive bounding boxes OCR in Label Studio with a Tesseract backend @@ -318,20 +318,20 @@ tier: all title: Interactive bounding boxes OCR with Tesseract type: guide - url: /tutorials/tesseract.html + url: /guide/ml_tutorials/tesseract.html - categories: - Generative AI - Large Language Model - WatsonX hide_frontmatter_title: true hide_menu: true - image: /tutorials/watsonx.png + image: /guide/ml_tutorials/watsonx.png meta_title: Integrate WatsonX with Label Studio order: 15 tier: all title: Integrate WatsonX with Label Studio type: guide - url: /tutorials/watsonx_llm.html + url: /guide/ml_tutorials/watsonx_llm.html - categories: - Computer Vision - Object Detection @@ -339,7 +339,7 @@ - YOLO hide_frontmatter_title: true hide_menu: true - image: /tutorials/yolo.png + image: /guide/ml_tutorials/yolo.png meta_description: Tutorial on how to use an example ML backend for Label Studio with YOLO meta_title: YOLO ML Backend for Label Studio @@ -347,7 +347,7 @@ tier: all title: YOLO ML Backend for Label Studio type: guide - url: /tutorials/yolo.html + url: /guide/ml_tutorials/yolo.html - categories: - Computer Vision - Video Classification @@ -355,7 +355,7 @@ - LSTM hide_frontmatter_title: true hide_menu: true - image: /tutorials/yolo-video-classification.png + image: /guide/ml_tutorials/yolo-video-classification.png meta_description: Tutorial on how to use an example ML backend for Label Studio with TimelineLabels meta_title: TimelineLabels ML Backend for Label Studio @@ -363,7 +363,7 @@ tier: all title: TimelineLabels ML Backend for Label Studio type: guide - url: /tutorials/yolo_timeline_labels.html + url: /guide/ml_tutorials/yolo_timeline_labels.html layout: templates meta_description: Tutorial documentation for setting up a machine learning model with predictions using PyTorch, GPT2, Sci-kit learn, and other popular frameworks. diff --git a/docs/source/tutorials/Sam2Video.gif b/docs/source/guide/ml_tutorials/Sam2Video.gif similarity index 100% rename from docs/source/tutorials/Sam2Video.gif rename to docs/source/guide/ml_tutorials/Sam2Video.gif diff --git a/docs/source/tutorials/bert.png b/docs/source/guide/ml_tutorials/bert.png similarity index 100% rename from docs/source/tutorials/bert.png rename to docs/source/guide/ml_tutorials/bert.png diff --git a/docs/source/tutorials/bert_classifier.md b/docs/source/guide/ml_tutorials/bert_classifier.md similarity index 98% rename from docs/source/tutorials/bert_classifier.md rename to docs/source/guide/ml_tutorials/bert_classifier.md index 02ff81dcf0d1..cecb3c108edd 100644 --- a/docs/source/tutorials/bert_classifier.md +++ b/docs/source/guide/ml_tutorials/bert_classifier.md @@ -12,7 +12,7 @@ categories: - Text Classification - BERT - Hugging Face -image: "/tutorials/bert.png" +image: "/guide/ml_tutorials/bert.png" --- # BERT-based text classification @@ -123,4 +123,4 @@ The following parameters are available for training: # Customization -The ML backend can be customized by adding your own models and logic inside the `./bert_classifier` directory. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside the `./bert_classifier` directory. diff --git a/docs/source/tutorials/create-simple-ml-backend.png b/docs/source/guide/ml_tutorials/create-simple-ml-backend.png similarity index 100% rename from docs/source/tutorials/create-simple-ml-backend.png rename to docs/source/guide/ml_tutorials/create-simple-ml-backend.png diff --git a/docs/source/tutorials/dummy_model.md b/docs/source/guide/ml_tutorials/dummy_model.md similarity index 100% rename from docs/source/tutorials/dummy_model.md rename to docs/source/guide/ml_tutorials/dummy_model.md diff --git a/docs/source/tutorials/easyocr.md b/docs/source/guide/ml_tutorials/easyocr.md similarity index 98% rename from docs/source/tutorials/easyocr.md rename to docs/source/guide/ml_tutorials/easyocr.md index f61825764cb2..daa0d2ae2045 100644 --- a/docs/source/tutorials/easyocr.md +++ b/docs/source/guide/ml_tutorials/easyocr.md @@ -11,7 +11,7 @@ categories: - Computer Vision - Optical Character Recognition - EasyOCR -image: "/tutorials/easyocr.png" +image: "/guide/ml_tutorials/easyocr.png" --- # EasyOCR model connection @@ -124,4 +124,4 @@ These options allow you to customize the behavior of the EasyOCR model connectio # Customization -The ML backend can be customized by adding your own models and logic inside the `./easyocr` directory. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside the `./easyocr` directory. diff --git a/docs/source/tutorials/easyocr.png b/docs/source/guide/ml_tutorials/easyocr.png similarity index 100% rename from docs/source/tutorials/easyocr.png rename to docs/source/guide/ml_tutorials/easyocr.png diff --git a/docs/source/tutorials/flair.md b/docs/source/guide/ml_tutorials/flair.md similarity index 94% rename from docs/source/tutorials/flair.md rename to docs/source/guide/ml_tutorials/flair.md index 03498f56a175..cd089b771eee 100644 --- a/docs/source/tutorials/flair.md +++ b/docs/source/guide/ml_tutorials/flair.md @@ -11,7 +11,7 @@ categories: - Natural Language Processing - Named Entity Recognition - Flair -image: "/tutorials/flair.png" +image: "/guide/ml_tutorials/flair.png" --- # Flair NER example @@ -59,4 +59,4 @@ $ curl http://localhost:9090/health ## Parameters -- `FLAIR_MODEL_NAME`: The name of the Flair model to use. Default is `ner`. See all options [here](https://flairnlp.github.io/docs/tutorial-basics/tagging-entities#list-of-ner-models) \ No newline at end of file +- `FLAIR_MODEL_NAME`: The name of the Flair model to use. Default is `ner`. See all options [here](https://flairnlp.github.io/docs/tutorial-basics/tagging-entities#list-of-ner-models) diff --git a/docs/source/tutorials/flair.png b/docs/source/guide/ml_tutorials/flair.png similarity index 100% rename from docs/source/tutorials/flair.png rename to docs/source/guide/ml_tutorials/flair.png diff --git a/docs/source/tutorials/gliner.md b/docs/source/guide/ml_tutorials/gliner.md similarity index 96% rename from docs/source/tutorials/gliner.md rename to docs/source/guide/ml_tutorials/gliner.md index 9564dac76853..c63d7864b3ac 100644 --- a/docs/source/tutorials/gliner.md +++ b/docs/source/guide/ml_tutorials/gliner.md @@ -13,7 +13,7 @@ categories: - GLiNER - BERT - Hugging Face -image: "/tutorials/gliner.png" +image: "/guide/ml_tutorials/gliner.png" --- # Use GLiNER for NER annotation @@ -82,4 +82,4 @@ The following common parameters are available: - `WORKERS` - Specify the number of workers for the model server. - `THREADS` - Specify the number of threads for the model server. - `LABEL_STUDIO_URL` - Specify the URL of your Label Studio instance. Note that this might need to be `http://host.docker.internal:8080` if you are running Label Studio on another Docker container. -- `LABEL_STUDIO_API_KEY`- Specify the API key for authenticating your Label Studio instance. You can find this by logging into Label Studio and and [going to the **Account & Settings** page](https://labelstud.io/guide/user_account#Access-token). \ No newline at end of file +- `LABEL_STUDIO_API_KEY`- Specify the API key for authenticating your Label Studio instance. You can find this by logging into Label Studio and and [going to the **Account & Settings** page](https://labelstud.io/guide/user_account#Access-token). diff --git a/docs/source/tutorials/gliner.png b/docs/source/guide/ml_tutorials/gliner.png similarity index 100% rename from docs/source/tutorials/gliner.png rename to docs/source/guide/ml_tutorials/gliner.png diff --git a/docs/source/tutorials/gpt.md b/docs/source/guide/ml_tutorials/gpt.md similarity index 100% rename from docs/source/tutorials/gpt.md rename to docs/source/guide/ml_tutorials/gpt.md diff --git a/docs/source/tutorials/gpt2.png b/docs/source/guide/ml_tutorials/gpt2.png similarity index 100% rename from docs/source/tutorials/gpt2.png rename to docs/source/guide/ml_tutorials/gpt2.png diff --git a/docs/source/tutorials/grounding-dino.png b/docs/source/guide/ml_tutorials/grounding-dino.png similarity index 100% rename from docs/source/tutorials/grounding-dino.png rename to docs/source/guide/ml_tutorials/grounding-dino.png diff --git a/docs/source/tutorials/grounding-sam.png b/docs/source/guide/ml_tutorials/grounding-sam.png similarity index 100% rename from docs/source/tutorials/grounding-sam.png rename to docs/source/guide/ml_tutorials/grounding-sam.png diff --git a/docs/source/tutorials/grounding_dino.md b/docs/source/guide/ml_tutorials/grounding_dino.md similarity index 97% rename from docs/source/tutorials/grounding_dino.md rename to docs/source/guide/ml_tutorials/grounding_dino.md index cc894906c3df..b47f72017984 100644 --- a/docs/source/tutorials/grounding_dino.md +++ b/docs/source/guide/ml_tutorials/grounding_dino.md @@ -12,7 +12,7 @@ categories: - Image Annotation - Object Detection - Grounding DINO -image: "/tutorials/grounding-dino.png" +image: "/guide/ml_tutorials/grounding-dino.png" --- https://github.com/HumanSignal/label-studio-ml-backend/assets/106922533/d1d2f233-d7c0-40ac-ba6f-368c3c01fd36 @@ -91,4 +91,4 @@ deploy: ## Using GroundingSAM -If you are looking for GroundingDINO integration with SAM, [check this example](https://github.com/HumanSignal/label-studio-ml-backend/tree/master/label_studio_ml/examples/grounding_sam). \ No newline at end of file +If you are looking for GroundingDINO integration with SAM, [check this example](https://github.com/HumanSignal/label-studio-ml-backend/tree/master/label_studio_ml/examples/grounding_sam). diff --git a/docs/source/tutorials/grounding_sam.md b/docs/source/guide/ml_tutorials/grounding_sam.md similarity index 98% rename from docs/source/tutorials/grounding_sam.md rename to docs/source/guide/ml_tutorials/grounding_sam.md index 49b994d30f7e..4f68a50b85ba 100644 --- a/docs/source/tutorials/grounding_sam.md +++ b/docs/source/guide/ml_tutorials/grounding_sam.md @@ -14,7 +14,7 @@ categories: - Zero-shot Image Segmentation - Grounding DINO - Segment Anything Model -image: "/tutorials/grounding-sam.png" +image: "/guide/ml_tutorials/grounding-sam.png" --- https://github.com/HumanSignal/label-studio-ml-backend/assets/106922533/d1d2f233-d7c0-40ac-ba6f-368c3c01fd36 @@ -131,4 +131,4 @@ https://github.com/HumanSignal/label-studio-ml-backend/assets/106922533/79b788e3 Adjust `BOX_THRESHOLD` and `TEXT_THRESHOLD` values in the Dockerfile to a number between 0 to 1 if experimenting. Defaults are set in `dino.py`. For more information about these values, [click here](https://github.com/IDEA-Research/GroundingDINO#star-explanationstips-for-grounding-dino-inputs-and-outputs). -If you want to use SAM models saved from either directories, you can use the `MOBILESAM_CHECKPOINT` and `SAM_CHECKPOINT` as shown in the Dockerfile. \ No newline at end of file +If you want to use SAM models saved from either directories, you can use the `MOBILESAM_CHECKPOINT` and `SAM_CHECKPOINT` as shown in the Dockerfile. diff --git a/docs/source/tutorials/hf-llm.png b/docs/source/guide/ml_tutorials/hf-llm.png similarity index 100% rename from docs/source/tutorials/hf-llm.png rename to docs/source/guide/ml_tutorials/hf-llm.png diff --git a/docs/source/tutorials/hf-ner.png b/docs/source/guide/ml_tutorials/hf-ner.png similarity index 100% rename from docs/source/tutorials/hf-ner.png rename to docs/source/guide/ml_tutorials/hf-ner.png diff --git a/docs/source/tutorials/huggingface.png b/docs/source/guide/ml_tutorials/huggingface.png similarity index 100% rename from docs/source/tutorials/huggingface.png rename to docs/source/guide/ml_tutorials/huggingface.png diff --git a/docs/source/tutorials/huggingface_llm.md b/docs/source/guide/ml_tutorials/huggingface_llm.md similarity index 97% rename from docs/source/tutorials/huggingface_llm.md rename to docs/source/guide/ml_tutorials/huggingface_llm.md index 6b518b79cf88..f15182b846a3 100644 --- a/docs/source/tutorials/huggingface_llm.md +++ b/docs/source/guide/ml_tutorials/huggingface_llm.md @@ -12,7 +12,7 @@ categories: - Large Language Model - Text Generation - Hugging Face -image: "/tutorials/hf-llm.png" +image: "/guide/ml_tutorials/hf-llm.png" --- # Hugging Face Large Language Model backend @@ -97,4 +97,4 @@ The following common parameters are available: # Customization -The ML backend can be customized by adding your own models and logic inside the `./huggingface_llm` directory. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside the `./huggingface_llm` directory. diff --git a/docs/source/tutorials/huggingface_ner.md b/docs/source/guide/ml_tutorials/huggingface_ner.md similarity index 99% rename from docs/source/tutorials/huggingface_ner.md rename to docs/source/guide/ml_tutorials/huggingface_ner.md index 78a34166a71b..3a3c4fb00957 100644 --- a/docs/source/tutorials/huggingface_ner.md +++ b/docs/source/guide/ml_tutorials/huggingface_ner.md @@ -11,7 +11,7 @@ categories: - Natural Language Processing - Named Entity Recognition - Hugging Face -image: "/tutorials/hf-ner.png" +image: "/guide/ml_tutorials/hf-ner.png" --- # Hugging Face NER model with Label Studio @@ -123,4 +123,4 @@ The following common parameters are available: The ML backend can be customized by adding your own models and logic inside `./huggingface_ner/model.py`. -Modify the `predict()` and `fit()` methods to implement your own logic. \ No newline at end of file +Modify the `predict()` and `fit()` methods to implement your own logic. diff --git a/docs/source/tutorials/image-classification-pytorch.png b/docs/source/guide/ml_tutorials/image-classification-pytorch.png similarity index 100% rename from docs/source/tutorials/image-classification-pytorch.png rename to docs/source/guide/ml_tutorials/image-classification-pytorch.png diff --git a/docs/source/tutorials/interactive-substring-matching.png b/docs/source/guide/ml_tutorials/interactive-substring-matching.png similarity index 100% rename from docs/source/tutorials/interactive-substring-matching.png rename to docs/source/guide/ml_tutorials/interactive-substring-matching.png diff --git a/docs/source/tutorials/interactive_substring_matching.md b/docs/source/guide/ml_tutorials/interactive_substring_matching.md similarity index 96% rename from docs/source/tutorials/interactive_substring_matching.md rename to docs/source/guide/ml_tutorials/interactive_substring_matching.md index 11ede5085620..504fd81ec0d3 100644 --- a/docs/source/tutorials/interactive_substring_matching.md +++ b/docs/source/guide/ml_tutorials/interactive_substring_matching.md @@ -11,7 +11,7 @@ categories: - Natural Language Processing - Named Entity Recognition - Interactive matching -image: "/tutorials/interactive-substring-matching.png" +image: "/guide/ml_tutorials/interactive-substring-matching.png" --- # Interactive substring matching @@ -97,4 +97,4 @@ The following common parameters are available: ## Customization -The ML backend can be customized by adding your own models and logic inside the `./interactive_substring_matching` directory. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside the `./interactive_substring_matching` directory. diff --git a/docs/source/tutorials/langchain.png b/docs/source/guide/ml_tutorials/langchain.png similarity index 100% rename from docs/source/tutorials/langchain.png rename to docs/source/guide/ml_tutorials/langchain.png diff --git a/docs/source/tutorials/langchain_search_agent.md b/docs/source/guide/ml_tutorials/langchain_search_agent.md similarity index 97% rename from docs/source/tutorials/langchain_search_agent.md rename to docs/source/guide/ml_tutorials/langchain_search_agent.md index 00720d271a68..76d285209689 100644 --- a/docs/source/tutorials/langchain_search_agent.md +++ b/docs/source/guide/ml_tutorials/langchain_search_agent.md @@ -13,7 +13,7 @@ categories: - Google - OpenAI - Langchain -image: "/tutorials/langchain.png" +image: "/guide/ml_tutorials/langchain.png" --- # Langchain search agent @@ -97,4 +97,4 @@ $ curl http://localhost:9090/health {"status":"UP"} ``` -3. Create a project in Label Studio. Then from the **Model** page in the project settings, [connect the model](https://labelstud.io/guide/ml#Connect-the-model-to-Label-Studio). The default URL is `http://localhost:9090`. \ No newline at end of file +3. Create a project in Label Studio. Then from the **Model** page in the project settings, [connect the model](https://labelstud.io/guide/ml#Connect-the-model-to-Label-Studio). The default URL is `http://localhost:9090`. diff --git a/docs/source/tutorials/llm-interactive.png b/docs/source/guide/ml_tutorials/llm-interactive.png similarity index 100% rename from docs/source/tutorials/llm-interactive.png rename to docs/source/guide/ml_tutorials/llm-interactive.png diff --git a/docs/source/tutorials/llm_interactive.md b/docs/source/guide/ml_tutorials/llm_interactive.md similarity index 99% rename from docs/source/tutorials/llm_interactive.md rename to docs/source/guide/ml_tutorials/llm_interactive.md index 10b4d8adf688..c5ae56866658 100644 --- a/docs/source/tutorials/llm_interactive.md +++ b/docs/source/guide/ml_tutorials/llm_interactive.md @@ -14,7 +14,7 @@ categories: - Azure - Ollama - ChatGPT -image: "/tutorials/llm-interactive.png" +image: "/guide/ml_tutorials/llm-interactive.png" --- # Interactive LLM labeling @@ -389,4 +389,4 @@ If you are using Ollama as your LLM provider (`OPENAI_PROVIDER=ollama`), you nee - `OPENAI_MODEL` : The Ollama model to use, for example `llama3`. -- `OLLAMA_ENDPOINT`: This is the endpoint for your Ollama endpoint. It should be set to the appropriate value based on your setup. If you are running it locally, then it can typically be reached on `http://host.docker.internal:11434/v1/` \ No newline at end of file +- `OLLAMA_ENDPOINT`: This is the endpoint for your Ollama endpoint. It should be set to the appropriate value based on your setup. If you are running it locally, then it can typically be reached on `http://host.docker.internal:11434/v1/` diff --git a/docs/source/tutorials/mmdetection-3.md b/docs/source/guide/ml_tutorials/mmdetection-3.md similarity index 99% rename from docs/source/tutorials/mmdetection-3.md rename to docs/source/guide/ml_tutorials/mmdetection-3.md index eb2e12c58f51..dc78d5ea69c5 100644 --- a/docs/source/tutorials/mmdetection-3.md +++ b/docs/source/guide/ml_tutorials/mmdetection-3.md @@ -13,7 +13,7 @@ categories: - Image Annotation - OpenMMLab - MMDetection -image: "/tutorials/openmmlab.png" +image: "/guide/ml_tutorials/openmmlab.png" --- # Object detection with bounding boxes using MMDetection diff --git a/docs/source/tutorials/models.md b/docs/source/guide/ml_tutorials/models.md similarity index 100% rename from docs/source/tutorials/models.md rename to docs/source/guide/ml_tutorials/models.md diff --git a/docs/source/tutorials/nemo.png b/docs/source/guide/ml_tutorials/nemo.png similarity index 100% rename from docs/source/tutorials/nemo.png rename to docs/source/guide/ml_tutorials/nemo.png diff --git a/docs/source/tutorials/nemo_asr.md b/docs/source/guide/ml_tutorials/nemo_asr.md similarity index 98% rename from docs/source/tutorials/nemo_asr.md rename to docs/source/guide/ml_tutorials/nemo_asr.md index 92bc84b1f527..bf262f5eac3e 100644 --- a/docs/source/tutorials/nemo_asr.md +++ b/docs/source/guide/ml_tutorials/nemo_asr.md @@ -12,7 +12,7 @@ categories: - Automatic Speech Recognition - NeMo - NVidia -image: "/tutorials/nvidia.png" +image: "/guide/ml_tutorials/nvidia.png" --- # ASR with NeMo @@ -103,4 +103,4 @@ The following common parameters are available: ## Customization -The ML backend can be customized by adding your own models and logic inside `./nemo_asr/model.py`. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside `./nemo_asr/model.py`. diff --git a/docs/source/tutorials/nvidia.png b/docs/source/guide/ml_tutorials/nvidia.png similarity index 100% rename from docs/source/tutorials/nvidia.png rename to docs/source/guide/ml_tutorials/nvidia.png diff --git a/docs/source/tutorials/object-detection-with-bounding-boxes.png b/docs/source/guide/ml_tutorials/object-detection-with-bounding-boxes.png similarity index 100% rename from docs/source/tutorials/object-detection-with-bounding-boxes.png rename to docs/source/guide/ml_tutorials/object-detection-with-bounding-boxes.png diff --git a/docs/source/tutorials/object-detector.md b/docs/source/guide/ml_tutorials/object-detector.md similarity index 100% rename from docs/source/tutorials/object-detector.md rename to docs/source/guide/ml_tutorials/object-detector.md diff --git a/docs/source/tutorials/openai.png b/docs/source/guide/ml_tutorials/openai.png similarity index 100% rename from docs/source/tutorials/openai.png rename to docs/source/guide/ml_tutorials/openai.png diff --git a/docs/source/tutorials/openmmlab.png b/docs/source/guide/ml_tutorials/openmmlab.png similarity index 100% rename from docs/source/tutorials/openmmlab.png rename to docs/source/guide/ml_tutorials/openmmlab.png diff --git a/docs/source/tutorials/pytorch-image-transfer-learning.md b/docs/source/guide/ml_tutorials/pytorch-image-transfer-learning.md similarity index 100% rename from docs/source/tutorials/pytorch-image-transfer-learning.md rename to docs/source/guide/ml_tutorials/pytorch-image-transfer-learning.md diff --git a/docs/source/tutorials/pytorch.png b/docs/source/guide/ml_tutorials/pytorch.png similarity index 100% rename from docs/source/tutorials/pytorch.png rename to docs/source/guide/ml_tutorials/pytorch.png diff --git a/docs/source/tutorials/ragas.png b/docs/source/guide/ml_tutorials/ragas.png similarity index 100% rename from docs/source/tutorials/ragas.png rename to docs/source/guide/ml_tutorials/ragas.png diff --git a/docs/source/tutorials/sam2-images.png b/docs/source/guide/ml_tutorials/sam2-images.png similarity index 100% rename from docs/source/tutorials/sam2-images.png rename to docs/source/guide/ml_tutorials/sam2-images.png diff --git a/docs/source/tutorials/sam2-video.png b/docs/source/guide/ml_tutorials/sam2-video.png similarity index 100% rename from docs/source/tutorials/sam2-video.png rename to docs/source/guide/ml_tutorials/sam2-video.png diff --git a/docs/source/tutorials/scikit-learn.png b/docs/source/guide/ml_tutorials/scikit-learn.png similarity index 100% rename from docs/source/tutorials/scikit-learn.png rename to docs/source/guide/ml_tutorials/scikit-learn.png diff --git a/docs/source/tutorials/screenshot.png b/docs/source/guide/ml_tutorials/screenshot.png similarity index 100% rename from docs/source/tutorials/screenshot.png rename to docs/source/guide/ml_tutorials/screenshot.png diff --git a/docs/source/tutorials/segment-anything.png b/docs/source/guide/ml_tutorials/segment-anything.png similarity index 100% rename from docs/source/tutorials/segment-anything.png rename to docs/source/guide/ml_tutorials/segment-anything.png diff --git a/docs/source/tutorials/segment_anything_2_image.md b/docs/source/guide/ml_tutorials/segment_anything_2_image.md similarity index 98% rename from docs/source/tutorials/segment_anything_2_image.md rename to docs/source/guide/ml_tutorials/segment_anything_2_image.md index 65da24227bf2..1425e5a75b8b 100644 --- a/docs/source/tutorials/segment_anything_2_image.md +++ b/docs/source/guide/ml_tutorials/segment_anything_2_image.md @@ -11,7 +11,7 @@ categories: - Image Annotation - Object Detection - Segment Anything Model -image: "/tutorials/sam2-images.png" +image: "/guide/ml_tutorials/sam2-images.png" --- # Using SAM2 with Label Studio for Image Annotation @@ -177,4 +177,4 @@ The following common parameters are available: ## Customization -The ML backend can be customized by adding your own models and logic inside the `./segment_anything_2` directory. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside the `./segment_anything_2` directory. diff --git a/docs/source/tutorials/segment_anything_2_video.md b/docs/source/guide/ml_tutorials/segment_anything_2_video.md similarity index 98% rename from docs/source/tutorials/segment_anything_2_video.md rename to docs/source/guide/ml_tutorials/segment_anything_2_video.md index 392db9aa8db9..deb214c784da 100644 --- a/docs/source/tutorials/segment_anything_2_video.md +++ b/docs/source/guide/ml_tutorials/segment_anything_2_video.md @@ -11,7 +11,7 @@ categories: - Video Annotation - Object Detection - Segment Anything Model -image: "/tutorials/sam2-video.png" +image: "/guide/ml_tutorials/sam2-video.png" --- # Using SAM2 with Label Studio for Video Annotation diff --git a/docs/source/tutorials/segment_anything_model.md b/docs/source/guide/ml_tutorials/segment_anything_model.md similarity index 99% rename from docs/source/tutorials/segment_anything_model.md rename to docs/source/guide/ml_tutorials/segment_anything_model.md index 530ad3ce98b4..22e23d7b351d 100644 --- a/docs/source/tutorials/segment_anything_model.md +++ b/docs/source/guide/ml_tutorials/segment_anything_model.md @@ -14,7 +14,7 @@ categories: - Segment Anything Model - Facebook - ONNX -image: "/tutorials/segment-anything.png" +image: "/guide/ml_tutorials/segment-anything.png" --- # Interactive annotation in Label Studio with Segment Anything Model @@ -487,4 +487,4 @@ MobileSAM paper- journal={arXiv preprint arXiv:2306.14289}, year={2023} } -``` \ No newline at end of file +``` diff --git a/docs/source/tutorials/simple-image-classification.png b/docs/source/guide/ml_tutorials/simple-image-classification.png similarity index 100% rename from docs/source/tutorials/simple-image-classification.png rename to docs/source/guide/ml_tutorials/simple-image-classification.png diff --git a/docs/source/tutorials/sklearn-text-classifier.md b/docs/source/guide/ml_tutorials/sklearn-text-classifier.md similarity index 100% rename from docs/source/tutorials/sklearn-text-classifier.md rename to docs/source/guide/ml_tutorials/sklearn-text-classifier.md diff --git a/docs/source/tutorials/sklearn_text_classifier.md b/docs/source/guide/ml_tutorials/sklearn_text_classifier.md similarity index 98% rename from docs/source/tutorials/sklearn_text_classifier.md rename to docs/source/guide/ml_tutorials/sklearn_text_classifier.md index f24906fb4019..eeb67f0a55be 100644 --- a/docs/source/tutorials/sklearn_text_classifier.md +++ b/docs/source/guide/ml_tutorials/sklearn_text_classifier.md @@ -11,7 +11,7 @@ categories: - Natural Language Processing - Text Classification - Scikit-learn -image: "/tutorials/scikit-learn.png" +image: "/guide/ml_tutorials/scikit-learn.png" --- # Sklearn Text Classifier model for Label Studio @@ -104,4 +104,4 @@ The following common parameters are available: # Customization -The ML backend can be customized by adding your own models and logic inside the `./dir_with_your_model` directory. \ No newline at end of file +The ML backend can be customized by adding your own models and logic inside the `./dir_with_your_model` directory. diff --git a/docs/source/tutorials/spacy.md b/docs/source/guide/ml_tutorials/spacy.md similarity index 98% rename from docs/source/tutorials/spacy.md rename to docs/source/guide/ml_tutorials/spacy.md index 0d7503fed83c..3595839d54a9 100644 --- a/docs/source/tutorials/spacy.md +++ b/docs/source/guide/ml_tutorials/spacy.md @@ -11,7 +11,7 @@ categories: - Natural Language Processing - Named Entity Recognition - SpaCy -image: "/tutorials/spacy.png" +image: "/guide/ml_tutorials/spacy.png" --- This ML backend provides a simple way to use [spaCy](https://spacy.io/) models for Named Entity Recognition (NER) and Part-of-Speech (POS) tagging. @@ -76,4 +76,4 @@ To change default parameters, specify the following environment variables: - `PORT` - port to run the server on, default is `9090` - `WORKERS` - number of workers to run the server with, default is `2` -- `SPACY_MODEL` - spaCy model to use, default is `en_core_web_sm` \ No newline at end of file +- `SPACY_MODEL` - spaCy model to use, default is `en_core_web_sm` diff --git a/docs/source/tutorials/spacy.png b/docs/source/guide/ml_tutorials/spacy.png similarity index 100% rename from docs/source/tutorials/spacy.png rename to docs/source/guide/ml_tutorials/spacy.png diff --git a/docs/source/tutorials/styles.css b/docs/source/guide/ml_tutorials/styles.css similarity index 100% rename from docs/source/tutorials/styles.css rename to docs/source/guide/ml_tutorials/styles.css diff --git a/docs/source/tutorials/tesseract.md b/docs/source/guide/ml_tutorials/tesseract.md similarity index 98% rename from docs/source/tutorials/tesseract.md rename to docs/source/guide/ml_tutorials/tesseract.md index 235bd90e953b..3be41e0aa805 100644 --- a/docs/source/tutorials/tesseract.md +++ b/docs/source/guide/ml_tutorials/tesseract.md @@ -11,7 +11,7 @@ categories: - Computer Vision - Optical Character Recognition - Tesseract -image: "/tutorials/tesseract.png" +image: "/guide/ml_tutorials/tesseract.png" --- # Interactive bounding boxes OCR using Tesseract @@ -174,4 +174,4 @@ Example below: Reference links: - https://labelstud.io/blog/improve-ocr-quality-for-receipt-processing-with-tesseract-and-label-studio -- https://labelstud.io/blog/release-130.html \ No newline at end of file +- https://labelstud.io/blog/release-130.html diff --git a/docs/source/tutorials/tesseract.png b/docs/source/guide/ml_tutorials/tesseract.png similarity index 100% rename from docs/source/tutorials/tesseract.png rename to docs/source/guide/ml_tutorials/tesseract.png diff --git a/docs/source/tutorials/text-classification.png b/docs/source/guide/ml_tutorials/text-classification.png similarity index 100% rename from docs/source/tutorials/text-classification.png rename to docs/source/guide/ml_tutorials/text-classification.png diff --git a/docs/source/tutorials/timeseries.png b/docs/source/guide/ml_tutorials/timeseries.png similarity index 100% rename from docs/source/tutorials/timeseries.png rename to docs/source/guide/ml_tutorials/timeseries.png diff --git a/docs/source/tutorials/timeseries_segmenter.md b/docs/source/guide/ml_tutorials/timeseries_segmenter.md similarity index 99% rename from docs/source/tutorials/timeseries_segmenter.md rename to docs/source/guide/ml_tutorials/timeseries_segmenter.md index 1c51f597de58..03cbcc4cb330 100644 --- a/docs/source/tutorials/timeseries_segmenter.md +++ b/docs/source/guide/ml_tutorials/timeseries_segmenter.md @@ -10,7 +10,7 @@ meta_description: Tutorial demonstrating a minimal ML backend that performs time categories: - Time Series - Segmentation -image: "/tutorials/timeseries.png" +image: "/guide/ml_tutorials/timeseries.png" --- # Time Series Segmenter for Label Studio @@ -320,4 +320,4 @@ environment: **For short time series:** - Reduce sequence size (`SEQUENCE_SIZE=20`) for sequences shorter than 50 timesteps -- Reduce hidden size (`HIDDEN_SIZE=32`) to prevent overfitting \ No newline at end of file +- Reduce hidden size (`HIDDEN_SIZE=32`) to prevent overfitting diff --git a/docs/source/tutorials/watsonx.png b/docs/source/guide/ml_tutorials/watsonx.png similarity index 100% rename from docs/source/tutorials/watsonx.png rename to docs/source/guide/ml_tutorials/watsonx.png diff --git a/docs/source/tutorials/watsonx_llm.md b/docs/source/guide/ml_tutorials/watsonx_llm.md similarity index 98% rename from docs/source/tutorials/watsonx_llm.md rename to docs/source/guide/ml_tutorials/watsonx_llm.md index 0373a878340f..358588bc2ec2 100644 --- a/docs/source/tutorials/watsonx_llm.md +++ b/docs/source/guide/ml_tutorials/watsonx_llm.md @@ -10,7 +10,7 @@ categories: - Generative AI - Large Language Model - WatsonX -image: "/tutorials/watsonx.png" +image: "/guide/ml_tutorials/watsonx.png" --- # Integrate WatsonX to Label Studio @@ -169,4 +169,4 @@ To get the host and port information below, you can follow the steps under [Pre- - `WATSONX_ENG_PORT` - the port information for your WatsonX.data Engine - `WATSONX_CATALOG` - the name of the catalog for the table you'll insert your data into. Must be created in the WatsonX.data platform. - `WATSONX_SCHEMA` - the name of the schema for the table you'll insert your data into. Must be created in the WatsonX.data platform. -- `WATSONX_TABLE` - the name of the table you'll insert your data into. Does not need to be already created. \ No newline at end of file +- `WATSONX_TABLE` - the name of the table you'll insert your data into. Does not need to be already created. diff --git a/docs/source/tutorials/yolo-video-classification.png b/docs/source/guide/ml_tutorials/yolo-video-classification.png similarity index 100% rename from docs/source/tutorials/yolo-video-classification.png rename to docs/source/guide/ml_tutorials/yolo-video-classification.png diff --git a/docs/source/tutorials/yolo.md b/docs/source/guide/ml_tutorials/yolo.md similarity index 99% rename from docs/source/tutorials/yolo.md rename to docs/source/guide/ml_tutorials/yolo.md index 7bcab226901d..a9e99ca73a72 100644 --- a/docs/source/tutorials/yolo.md +++ b/docs/source/guide/ml_tutorials/yolo.md @@ -12,7 +12,7 @@ categories: - Object Detection - Image Segmentation - YOLO -image: "/tutorials/yolo.png" +image: "/guide/ml_tutorials/yolo.png" --- # YOLO ML backend for Label Studio diff --git a/docs/source/tutorials/yolo.png b/docs/source/guide/ml_tutorials/yolo.png similarity index 100% rename from docs/source/tutorials/yolo.png rename to docs/source/guide/ml_tutorials/yolo.png diff --git a/docs/source/tutorials/yolo_timeline_labels.md b/docs/source/guide/ml_tutorials/yolo_timeline_labels.md similarity index 99% rename from docs/source/tutorials/yolo_timeline_labels.md rename to docs/source/guide/ml_tutorials/yolo_timeline_labels.md index cb53effd2505..be6844a4dff4 100644 --- a/docs/source/tutorials/yolo_timeline_labels.md +++ b/docs/source/guide/ml_tutorials/yolo_timeline_labels.md @@ -12,7 +12,7 @@ categories: - Video Classification - Temporal Labeling - LSTM -image: "/tutorials/yolo-video-classification.png" +image: "/guide/ml_tutorials/yolo-video-classification.png" --- # TimelineLabels Model for Temporal Video Multi-Label Classification in Label Studio @@ -520,4 +520,4 @@ The TimelineLabels ML backend integrates seamlessly with Label Studio to provide Understanding the class hierarchies and method flows is crucial for developers looking to extend or modify the backend. By following the starting points and execution flows outlined in this guide, developers can navigate the codebase more effectively and implement custom features or optimizations. -**Note**: For further development or contributions, please refer to the [`README_DEVELOP.md`](https://github.com/HumanSignal/label-studio-ml-backend/blob/master/label_studio_ml/examples/yolo/README_DEVELOP.md) file, which provides additional guidelines and architectural details. \ No newline at end of file +**Note**: For further development or contributions, please refer to the [`README_DEVELOP.md`](https://github.com/HumanSignal/label-studio-ml-backend/blob/master/label_studio_ml/examples/yolo/README_DEVELOP.md) file, which provides additional guidelines and architectural details. diff --git a/docs/source/tutorials/adding_new_labels_to_projects.md b/docs/source/tutorials/adding_new_labels_to_projects.md new file mode 100644 index 000000000000..69b0a34846c7 --- /dev/null +++ b/docs/source/tutorials/adding_new_labels_to_projects.md @@ -0,0 +1,109 @@ +--- +title: Adding new labels to the projects +hide_sidebar: true +--- + +This tutorial demonstrates how to add new labels to an ongoing project in real-time. The included example showcases the use of the `` tag, which can be applied to the entire document. However, this same principle can also be used for other cases, such as + +- modifying labels for computer vision applications (bounding boxes, polygons, etc.), or segments in text and audio using nested `` tags. +- modify other tags that contain lists of labels, such as `` and ``. + +**Note:** This code utilizes functions from an older version of the Label Studio SDK (v0.0.34). +The newer versions v1.0 and above still support the functionalities of the old version, but you will need to specify +[`label_studio_sdk._legacy`](../README.md) in your script. + +Here is a list of the necessary items: + +```python +import os +# Label Studio instance - replace if using self-hosted app +LABEL_STUDIO_URL = os.getenv("LABEL_STUDIO_URL", "http://localhost:8080") +LABEL_STUDIO_API_KEY = os.getenv("LABEL_STUDIO_API_KEY") + +# The project ID where you want to add new labels +project_id = int(os.getenv("LABEL_STUDIO_PROJECT_ID", "1")) + +# Taxonomy tag name where labels should be added in each project +tag_name = 'taxonomy' + +# JSON payload representing the taxonomy tree to be added +update_taxonomy = { + 'New Top Level class': 1, + 'Eukarya': { + 'Cat': 1 + }, + 'New Class': { + 'Object': 1, + 'Nested classes': { + 'And deeper hierarchy': { + 'Object': 1 + }, + 'Another Object': 1 + } + } +} +``` + +Here is a function `add_taxonomy_nodes` that supports Label Studio XML tree structure and update the nodes given `update_taxonomy` payload. Note that it adds new non-leaf nodes if they are missing: + +```python +import xml.etree.ElementTree as ET + + +def add_nodes_recursive(parent, payload, tag_type='Choice'): + """Helper function to walk recursively over taxonomy tree given current 'parent' node""" + for key, value in payload.items(): + if isinstance(value, dict): + nested_parent = parent.find(f".//{tag_type}[@value='{key}']") + if nested_parent is None: + nested_parent = ET.SubElement(parent, tag_type, {'value': key}) + add_nodes_recursive(nested_parent, value, tag_type) + else: + ET.SubElement(parent, tag_type, {'value': key}) + +def add_new_labels(project_id, tag_name, payload, tag_type='Taxonomy'): + project = ls.projects.get(id=project_id) + print(f'Updating project "{project.title}" (ID={project.id})') + label_config = project.label_config + root = ET.fromstring(label_config) + tag_to_update = root.find(f'.//{tag_type}[@name="{tag_name}"]') + if not len(tag_to_update): + print(f'No <{tag_type} name="{tag_name}".../> tag found.') + return + child_tag_type = 'Choice' if tag_type in ('Taxonomy', 'Choices') else 'Label' + add_nodes_recursive(tag_to_update, payload, child_tag_type) + new_label_config = ET.tostring(root, encoding='unicode') + ls.projects.update(id=project.id, label_config=new_label_config) +``` + +Now let's try it in action. Here is the current project configuration - it's taken from the default Templates under [Natural Language Processing > Taxonomy](https://labelstud.io/templates/taxonomy.html) + +```python +from label_studio_sdk.client import LabelStudio +ls = LabelStudio(base_url=LABEL_STUDIO_URL, api_key=LABEL_STUDIO_API_KEY) + +print(ls.projects.get(id=project_id).label_config) +``` + +Now let's add new labels from the specified `update_taxonomy` payload: + +```python +add_new_labels(project_id, tag_name, update_taxonomy, tag_type='Taxonomy') +``` + +```python +print(ls.projects.get(id=project_id).label_config) +``` + +The existing taxonomy tree has been updated with new labels, including nested hierarchical items. Since only new labels were added, this can be done without interrupting ongoing projects. + +
+WARNING It's important to be cautious when adding new labels during the annotation process, as it could potentially invalidate previously created data and require you to restart the process. Only proceed with adding new labels if you are certain it won't cause any issues. +
+ +Now you can get all project IDs where you need to add new labels: + +```python +for project in ls.projects.list(): + add_new_labels(project.id, tag_name, update_taxonomy) +``` diff --git a/docs/source/tutorials/index.md b/docs/source/tutorials/index.md new file mode 100644 index 000000000000..9c2a21e2cbe4 --- /dev/null +++ b/docs/source/tutorials/index.md @@ -0,0 +1,5 @@ +--- +title: Tutorials +layout: tutorials +hide_sidebar: true +--- diff --git a/docs/themes/v2/layout/templates.ejs b/docs/themes/v2/layout/templates.ejs index ceb0c5f1293f..2e2d3e469621 100644 --- a/docs/themes/v2/layout/templates.ejs +++ b/docs/themes/v2/layout/templates.ejs @@ -6,7 +6,7 @@ <% page.cards.forEach(function(card) { %> <% const tags = typeof card.categories === "object" ? card.categories.join(", ") : card.categories %>
- + <% if (card.image) { %><% } %> <%- partial("component/heading", {text: card.title, size: "XXSmall", tag: "span" }) %> <%- partial("component/text", {text: tags, tag: "p", size: "Small"}) %>
@@ -24,4 +24,4 @@ -<% } %> \ No newline at end of file +<% } %> diff --git a/docs/themes/v2/layout/tutorials.ejs b/docs/themes/v2/layout/tutorials.ejs new file mode 100644 index 000000000000..1b931652f0e3 --- /dev/null +++ b/docs/themes/v2/layout/tutorials.ejs @@ -0,0 +1,12 @@ +<%- partial("component/heading", {text: "Tutorials", size: "XLarge", tag: "h1", customClass: "home-page-title"}) %> + +
+ <% site.pages + .filter(p => p.source.startsWith('tutorials/') && p.source !== 'tutorials/index.md') + .sort((a,b) => a.source.localeCompare(b.source)) + .forEach(function(p){ %> + + <% }); %> +
diff --git a/scripts/update_ml_tutorials.py b/scripts/update_ml_tutorials.py index a230ee4f9809..7fc0d5e4dcff 100644 --- a/scripts/update_ml_tutorials.py +++ b/scripts/update_ml_tutorials.py @@ -57,7 +57,9 @@ def create_tutorial_files(): files_and_headers = [] for file in readme_files: model_name = file.parts[-2] - tutorial_path = Path(__file__).resolve().parent.parent / 'docs' / 'source' / 'tutorials' / f'{model_name}.md' + tutorial_path = ( + Path(__file__).resolve().parent.parent / 'docs' / 'source' / 'guide' / 'ml_tutorials' / f'{model_name}.md' + ) tutorial_dir = os.path.dirname(tutorial_path) os.makedirs(tutorial_dir, exist_ok=True) @@ -93,7 +95,7 @@ def update_ml_tutorials_index(files_and_headers: List): logging.error(f'No dict header found in {f} file. Skipping ...') continue print('Processing', f['model_name']) - card = {'title': h.get('title') or f['model_name'], 'url': f'/tutorials/{f["model_name"]}.html'} + card = {'title': h.get('title') or f['model_name'], 'url': f'/guide/ml_tutorials/{f["model_name"]}.html'} card.update(h) data['cards'].append(card)