AnandInguva commented on code in PR #23035:
URL: https://github.com/apache/beam/pull/23035#discussion_r963812120
##########
examples/notebooks/beam-ml/run_custom_inference.ipynb:
##########
@@ -0,0 +1,575 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "C1rAsD2L-hSO",
+ "metadata": {
+ "cellView": "form",
+ "id": "C1rAsD2L-hSO"
+ },
+ "outputs": [],
+ "source": [
+ "# @title ###### Licensed to the Apache Software Foundation (ASF),
Version 2.0 (the \"License\")\n",
+ "\n",
+ "# Licensed to the Apache Software Foundation (ASF) under one\n",
+ "# or more contributor license agreements. See the NOTICE file\n",
+ "# distributed with this work for additional information\n",
+ "# regarding copyright ownership. The ASF licenses this file\n",
+ "# to you under the Apache License, Version 2.0 (the\n",
+ "# \"License\"); you may not use this file except in compliance\n",
+ "# with the License. You may obtain a copy of the License at\n",
+ "#\n",
+ "# http://www.apache.org/licenses/LICENSE-2.0\n",
+ "#\n",
+ "# Unless required by applicable law or agreed to in writing,\n",
+ "# software distributed under the License is distributed on an\n",
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
+ "# KIND, either express or implied. See the License for the\n",
+ "# specific language governing permissions and limitations\n",
+ "# under the License.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b6f8f3af-744e-4eaa-8a30-6d03e8e4d21e",
+ "metadata": {
+ "id": "b6f8f3af-744e-4eaa-8a30-6d03e8e4d21e"
+ },
+ "source": [
+ "# Bring your own Machine Leanring (ML) model to Beam RunInference\n",
+ "\n",
+ "<button>\n",
+ " <a
href=\"https://beam.apache.org/documentation/sdks/python-machine-learning/\">\n",
+ " <img src=\"https://beam.apache.org/images/favicon.ico\"
alt=\"Open the docs\" height=\"16\"/>\n",
+ " Beam RunInference\n",
+ " </a>\n",
+ "</button>\n",
+ "\n",
+ "In this notebook, we walk through a simple example to show how to
customize your own ML model handler using\n",
+
"[ModelHandler](https://beam.apache.org/releases/pydoc/current/apache_beam.ml.inference.base.html#apache_beam.ml.inference.base.ModelHandler).\n",
+ "\n",
+ "Named-Entity Recognition (NER) is one of the most common tasks for
Natural Language Processing (NLP), \n",
+ "which locates and classifies named entities in unstructured text into
pre-defined labels such as person name, organization, date, etc. \n",
+ "In this example, we illustrate how to use the popular spaCy package
to load a ML model and apply it inside a Beam pipeline.\n"
Review Comment:
```suggestion
"In this example, we illustrate how to use the popular spaCy package
to load a ML model and perform inference in a Beam pipeline using RunInference
PTransform.\n"
```
##########
examples/notebooks/beam-ml/run_custom_inference.ipynb:
##########
@@ -0,0 +1,575 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "C1rAsD2L-hSO",
+ "metadata": {
+ "cellView": "form",
+ "id": "C1rAsD2L-hSO"
+ },
+ "outputs": [],
+ "source": [
+ "# @title ###### Licensed to the Apache Software Foundation (ASF),
Version 2.0 (the \"License\")\n",
+ "\n",
+ "# Licensed to the Apache Software Foundation (ASF) under one\n",
+ "# or more contributor license agreements. See the NOTICE file\n",
+ "# distributed with this work for additional information\n",
+ "# regarding copyright ownership. The ASF licenses this file\n",
+ "# to you under the Apache License, Version 2.0 (the\n",
+ "# \"License\"); you may not use this file except in compliance\n",
+ "# with the License. You may obtain a copy of the License at\n",
+ "#\n",
+ "# http://www.apache.org/licenses/LICENSE-2.0\n",
+ "#\n",
+ "# Unless required by applicable law or agreed to in writing,\n",
+ "# software distributed under the License is distributed on an\n",
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
+ "# KIND, either express or implied. See the License for the\n",
+ "# specific language governing permissions and limitations\n",
+ "# under the License.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b6f8f3af-744e-4eaa-8a30-6d03e8e4d21e",
+ "metadata": {
+ "id": "b6f8f3af-744e-4eaa-8a30-6d03e8e4d21e"
+ },
+ "source": [
+ "# Bring your own Machine Leanring (ML) model to Beam RunInference\n",
+ "\n",
+ "<button>\n",
+ " <a
href=\"https://beam.apache.org/documentation/sdks/python-machine-learning/\">\n",
+ " <img src=\"https://beam.apache.org/images/favicon.ico\"
alt=\"Open the docs\" height=\"16\"/>\n",
+ " Beam RunInference\n",
+ " </a>\n",
+ "</button>\n",
+ "\n",
+ "In this notebook, we walk through a simple example to show how to
customize your own ML model handler using\n",
Review Comment:
```suggestion
"In this notebook, we walk through a simple example to show how to
build your own ML model handler using\n",
```
--
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]