damccorm commented on code in PR #23497:
URL: https://github.com/apache/beam/pull/23497#discussion_r995860082


##########
website/www/site/content/en/documentation/ml/overview.md:
##########
@@ -59,3 +59,4 @@ In order to automate and track the AI/ML workflows throughout 
your project, you
 
 You can find examples of end-to-end AI/ML pipelines for several use cases:

Review Comment:
   I agree it would be good to add a little bit of detail on these, we can also 
probably defer that to a future PR though where we clean up that page more 
generally. @shub-kris @Juta thoughts?



##########
sdks/python/apache_beam/examples/inference/anomaly_detection/write_data_to_pubsub_pipeline/main.py:
##########
@@ -0,0 +1,89 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""This file contains the pipeline for writing twitter messages to PubSub."""
+import argparse
+import sys
+
+import apache_beam as beam
+import config as cfg
+from apache_beam.io.gcp.pubsub import WriteToPubSub
+from pipeline.options import get_pipeline_options
+from pipeline.utils import AssignUniqueID
+from pipeline.utils import ConvertToPubSubMessage
+from pipeline.utils import get_dataset
+
+
+def parse_arguments(argv):
+  """
+    Parses the arguments passed to the command line and returns them as an 
object
+
+    Args:
+      argv: The arguments passed to the command line.
+
+    Returns:
+      The arguments that are being passed in.
+    """
+  parser = argparse.ArgumentParser(description="write-to-pubsub")
+
+  parser.add_argument(
+      "-m",
+      "--mode",
+      help="Mode to run pipeline in.",
+      choices=["local", "cloud"],
+      default="local",
+  )
+  parser.add_argument(
+      "-p",
+      "--project",
+      help="GCP project to run pipeline on.",
+      default=cfg.PROJECT_ID,
+  )
+
+  args, _ = parser.parse_known_args(args=argv)
+  return args
+
+
+def run():
+  """
+    Runs the interjector pipeline which loads the training data,
+    assigns an unique ID to each document, converts it to a PubSub message, and

Review Comment:
   ```suggestion
       assigns a unique ID to each document, converts it to a PubSub message, 
and
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to