Skip to content

Commit

Permalink
docs(examples:skip) Use more consistent naming for tags (#3706)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored Jul 2, 2024
1 parent d87b737 commit 999ea83
Show file tree
Hide file tree
Showing 44 changed files with 52 additions and 52 deletions.
18 changes: 9 additions & 9 deletions dev/build-example-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ def _read_metadata(example):
raise ValueError("Title not found in metadata")
title = title_match.group(1).strip()

labels_match = re.search(r"^labels:\s*\[(.+?)\]$", metadata, re.MULTILINE)
if not labels_match:
raise ValueError("Labels not found in metadata")
labels = labels_match.group(1).strip()
tags_match = re.search(r"^tags:\s*\[(.+?)\]$", metadata, re.MULTILINE)
if not tags_match:
raise ValueError("Tags not found in metadata")
tags = tags_match.group(1).strip()

dataset_match = re.search(
r"^dataset:\s*\[(.*?)\]$", metadata, re.DOTALL | re.MULTILINE
Expand All @@ -111,17 +111,17 @@ def _read_metadata(example):

dataset = _convert_to_link(re.sub(r"\s+", " ", dataset).strip())
framework = _convert_to_link(re.sub(r"\s+", " ", framework).strip())
return title, labels, dataset, framework
return title, tags, dataset, framework


def _add_table_entry(example, label, table_var):
title, labels, dataset, framework = _read_metadata(example)
def _add_table_entry(example, tag, table_var):
title, tags, dataset, framework = _read_metadata(example)
example_name = Path(example).stem
table_entry = (
f" * - `{title} <{example_name}.html>`_ \n "
f"- {framework} \n - {dataset} \n - {labels}\n\n"
f"- {framework} \n - {dataset} \n - {tags}\n\n"
)
if label in labels:
if tag in tags:
categories[table_var]["table"] += table_entry
categories[table_var]["list"] += f" {example_name}\n"
return True
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced-pytorch/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Advanced Flower Example using PyTorch
labels: [advanced, vision, fds]
tags: [advanced, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced-tensorflow/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Advanced Flower Example using TensorFlow/Keras
labels: [advanced, vision, fds]
tags: [advanced, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/android-kotlin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Android Example using Kotlin and TF Lite
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [Android | https://www.android.com/, Kotlin | https://kotlinlang.org/,
TensorFlowLite | https://www.tensorflow.org/lite]
Expand Down
2 changes: 1 addition & 1 deletion examples/android/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Android Example using Java and TF Lite
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [Android | https://www.android.com/, Java | https://www.java.com/, TensorFlowLite
| https://www.tensorflow.org/lite]
Expand Down
2 changes: 1 addition & 1 deletion examples/app-pytorch/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Flower App using PyTorch
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/app-secure-aggregation/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Flower App with Secure Aggregation
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: []
framework: [numpy | https://numpy.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-metrics/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Flower App with Custom Metrics
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [tensorflow | https://www.tensorflow.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-mods/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Flower App with Custom Mods
labels: [mods, monitoring, app]
tags: [mods, monitoring, app]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [wandb | https://wandb.ai/home, tensorboard | https://www.tensorflow.org/tensorboard]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/embedded-devices/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Embedded Devices Example
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10, MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [torch | https://pytorch.org/, tensorflow | https://www.tensorflow.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/federated-kaplan-meier-fitter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example using KaplanMeierFitter
labels: [estimator, medical]
tags: [estimator, medical]
dataset: [Waltons |
https://lifelines.readthedocs.io/en/latest/lifelines.datasets.html#lifelines.datasets.load_waltons]
framework: [lifelines | https://lifelines.readthedocs.io/en/latest/index.html]
Expand Down
2 changes: 1 addition & 1 deletion examples/fl-dp-sa/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example of Flower App with DP and SA
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/fl-tabular/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example on Adult Census Income Tabular Dataset
labels: [basic, tabular, fds]
tags: [basic, tabular, fds]
dataset: [Adult Census Income | https://www.kaggle.com/datasets/uciml/adult-census-income/data]
framework: [scikit-learn | https://scikit-learn.org/, torch | https://pytorch.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/flower-authentication/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example with Authentication
labels: [advanced, vision, fds]
tags: [advanced, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/flower-in-30-minutes/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 30-minute tutorial running Flower simulation with PyTorch
labels: [colab, vision, simulation]
tags: [colab, vision, simulation]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/flower-simulation-step-by-step-pytorch/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Simulation Step-by-Step
labels: [basic, vision, simulation]
tags: [basic, vision, simulation]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [torch | https://pytorch.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/flower-via-docker-compose/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Leveraging Flower and Docker for Device Heterogeneity Management in FL
labels: [deployment, vision, tutorial]
tags: [deployment, vision, tutorial]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [Docker | https://www.docker.com/, tensorflow | https://www.tensorflow.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/ios/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example on iOS
labels: [mobile, vision, fds]
tags: [mobile, vision, fds]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [Swift | https://www.swift.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/llm-flowertune/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Federated LLM Fine-tuning with Flower
labels: [llm, nlp, LLama2]
tags: [llm, nlp, LLama2]
dataset: [Alpaca-GPT4 | https://huggingface.co/datasets/vicgalle/alpaca-gpt4]
framework: [PEFT | https://huggingface.co/docs/peft/index, torch | https://pytorch.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/opacus/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Sample-Level Differential Privacy using Opacus
labels: [dp, security, fds]
tags: [dp, security, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [opacus | https://opacus.ai/, torch | https://pytorch.org/]
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Federated Variational Autoencoder using Pytorch
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch-from-centralized-to-federated/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: PyTorch, From Centralized To Federated
labels: [basic, vision, fds]
tags: [basic, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-cpp/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using C++
labels: [quickstart, linear regression, tabular]
tags: [quickstart, linear regression, tabular]
dataset: [Synthetic]
framework: [C++ | https://isocpp.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-fastai/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using fastai
labels: [quickstart, vision]
tags: [quickstart, vision]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [fastai | https://fast.ai]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-huggingface/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Transformers Example using HuggingFace
labels: [quickstart, llm, nlp, sentiment]
tags: [quickstart, llm, nlp, sentiment]
dataset: [IMDB | https://huggingface.co/datasets/stanfordnlp/imdb]
framework: [transformers | https://huggingface.co/docs/transformers/index]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-jax/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using Jax
labels: [quickstart, linear regression]
tags: [quickstart, linear regression]
dataset: [Synthetic]
framework: [JAX | https://jax.readthedocs.io/en/latest/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-mlcube/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example using TensorFlow/Keras + MLCube
labels: [quickstart, vision, deployment]
tags: [quickstart, vision, deployment]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-mlx/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using MLX
labels: [quickstart, vision]
tags: [quickstart, vision]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [MLX | https://ml-explore.github.io/mlx/build/html/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-monai/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example using MONAI
labels: [quickstart, medical, vision]
tags: [quickstart, medical, vision]
dataset: [MedNIST | https://medmnist.com/]
framework: [MONAI | https://monai.io/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-pandas/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using Pandas
labels: [quickstart, tabular, federated analytics]
tags: [quickstart, tabular, federated analytics]
dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html]
framework: [pandas | https://pandas.pydata.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-pytorch-lightning/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using PyTorch-Lightning
labels: [quickstart, vision, fds]
tags: [quickstart, vision, fds]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [lightning | https://lightning.ai/docs/pytorch/stable/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-pytorch/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using PyTorch
labels: [quickstart, vision, fds]
tags: [quickstart, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-sklearn-tabular/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example using Scikit-Learn
labels: [quickstart, tabular, fds]
tags: [quickstart, tabular, fds]
dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html]
framework: [scikit-learn | https://scikit-learn.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-tabnet/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using Tabnet
labels: [quickstart, tabular]
tags: [quickstart, tabular]
dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html]
framework: [tabnet | https://github.com/titu1994/tf-TabNet]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-tensorflow/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Simple Flower Example using TensorFlow
labels: [quickstart, vision, fds]
tags: [quickstart, vision, fds]
dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10]
framework: [tensorflow | https://www.tensorflow.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/simulation-pytorch/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Simulation Example using PyTorch
labels: [basic, vision, fds, simulation]
tags: [basic, vision, fds, simulation]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/simulation-tensorflow/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Simulation Example using TensorFlow/Keras
labels: [basic, vision, fds, simulation]
tags: [basic, vision, fds, simulation]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/sklearn-logreg-mnist/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower LogReg Example using Scikit-Learn
labels: [basic, vision, logistic regression, fds]
tags: [basic, vision, logistic regression, fds]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [scikit-learn | https://scikit-learn.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/tensorflow-privacy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Sample-Level DP using TensorFlow-Privacy Engine
labels: [basic, vision, fds, privacy, dp]
tags: [basic, vision, fds, privacy, dp]
dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist]
framework: [tensorflow | https://www.tensorflow.org/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/vertical-fl/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Vertical FL Flower Example
labels: [vertical, tabular, advanced]
tags: [vertical, tabular, advanced]
dataset: [Titanic | https://www.kaggle.com/competitions/titanic]
framework: [torch | https://pytorch.org/, pandas | https://pandas.pydata.org/, scikit-learn
| https://scikit-learn.org/]
Expand Down
2 changes: 1 addition & 1 deletion examples/vit-finetune/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Federated finetuning of a ViT
labels: [finetuneing, vision, fds]
tags: [finetuneing, vision, fds]
dataset: [Oxford Flower-102 | https://www.robots.ox.ac.uk/~vgg/data/flowers/102/]
framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/whisper-federated-finetuning/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: On-device Federated Finetuning for Speech Classification
labels: [finetuning, speech, transformers]
tags: [finetuning, speech, transformers]
dataset: [SpeechCommands | https://huggingface.co/datasets/google/speech_commands]
framework: [transformers | https://huggingface.co/docs/transformers/index, whisper
| https://huggingface.co/openai/whisper-tiny]
Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost-comprehensive/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example using XGBoost
labels: [advanced, classification, tabular]
tags: [advanced, classification, tabular]
dataset: [HIGGS | https://archive.ics.uci.edu/dataset/280/higgs]
framework: [xgboost | https://xgboost.readthedocs.io/en/stable/]
---
Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost-quickstart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Flower Example using PyTorch
labels: [quickstart, classification, tabular]
tags: [quickstart, classification, tabular]
dataset: [HIGGS | https://archive.ics.uci.edu/dataset/280/higgs]
framework: [xgboost | https://xgboost.readthedocs.io/en/stable/]
---
Expand Down

0 comments on commit 999ea83

Please sign in to comment.