diff --git a/explore-analyze/machine-learning/anomaly-detection/anomaly-detection-scale.md b/explore-analyze/machine-learning/anomaly-detection/anomaly-detection-scale.md index df26ce7101..4512dcce54 100644 --- a/explore-analyze/machine-learning/anomaly-detection/anomaly-detection-scale.md +++ b/explore-analyze/machine-learning/anomaly-detection/anomaly-detection-scale.md @@ -9,7 +9,7 @@ There are many advanced configuration options for {{anomaly-jobs}}, some of them In this guide, you’ll learn how to: -* Understand the impact of configuration options on the performance of {anomaly-jobs} +* Understand the impact of configuration options on the performance of {{anomaly-jobs}} Prerequisites: diff --git a/explore-analyze/machine-learning/nlp.md b/explore-analyze/machine-learning/nlp.md index b14799a427..44f6f13255 100644 --- a/explore-analyze/machine-learning/nlp.md +++ b/explore-analyze/machine-learning/nlp.md @@ -7,12 +7,13 @@ mapped_pages: You can use {{stack-ml-features}} to analyze natural language data and make predictions. -* [*Overview*](nlp/ml-nlp-overview.md) -* [*Deploy trained models*](nlp/ml-nlp-deploy-models.md) -* [*Trained model autoscaling*](nlp/ml-nlp-auto-scale.md) -* [*Add NLP {{infer}} to ingest pipelines*](nlp/ml-nlp-inference.md) -* [*API quick reference*](nlp/ml-nlp-apis.md) +* [Overview](nlp/ml-nlp-overview.md) +* [Deploy trained models](nlp/ml-nlp-deploy-models.md) +* [Trained model autoscaling](nlp/ml-nlp-auto-scale.md) +* [Add NLP {{infer}} to ingest pipelines](nlp/ml-nlp-inference.md) +* [API quick reference](nlp/ml-nlp-apis.md) * [ELSER](nlp/ml-nlp-elser.md) -* [*Examples*](nlp/ml-nlp-examples.md) -* [*Limitations*](nlp/ml-nlp-limitations.md) - +* [E5](nlp/ml-nlp-e5.md) +* [Language identification](nlp/ml-nlp-lang-ident.md) +* [Examples](nlp/ml-nlp-examples.md) +* [Limitations](nlp/ml-nlp-limitations.md) diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-apis.md b/explore-analyze/machine-learning/nlp/ml-nlp-apis.md index 71370e704c..78e8b550ed 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-apis.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-apis.md @@ -34,4 +34,3 @@ The {{infer}} APIs have the following base: * [Delete inference endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference-api.html) * [Get inference endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-api.html) * [Perform inference](https://www.elastic.co/guide/en/elasticsearch/reference/current/post-inference-api.html) - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-auto-scale.md b/explore-analyze/machine-learning/nlp/ml-nlp-auto-scale.md index 5323de43a1..8856795521 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-auto-scale.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-auto-scale.md @@ -16,8 +16,6 @@ There are two ways to enable autoscaling: To fully leverage model autoscaling, it is highly recommended to enable [{{es}} deployment autoscaling](../../../deploy-manage/autoscaling.md). :::: - - ## Enabling autoscaling through APIs - adaptive allocations [nlp-model-adaptive-allocations] Model allocations are independent units of work for NLP tasks. If you set the numbers of threads and allocations for a model manually, they remain constant even when not all the available resources are fully used or when the load on the model requires more resources. Instead of setting the number of allocations manually, you can enable adaptive allocations to set the number of allocations based on the load on the process. This can help you to manage performance and cost more easily. (Refer to the [pricing calculator](https://cloud.elastic.co/pricing) to learn more about the possible costs.) @@ -31,7 +29,6 @@ You can enable adaptive allocations by using: If the new allocations fit on the current {{ml}} nodes, they are immediately started. If more resource capacity is needed for creating new model allocations, then your {{ml}} node will be scaled up if {{ml}} autoscaling is enabled to provide enough resources for the new allocation. The number of model allocations can be scaled down to 0. They cannot be scaled up to more than 32 allocations, unless you explicitly set the maximum number of allocations to more. Adaptive allocations must be set up independently for each deployment and [{{infer}} endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html). - ### Optimizing for typical use cases [optimize-use-case] You can optimize your model deployment for typical use cases, such as search and ingest. When you optimize for ingest, the throughput will be higher, which increases the number of {{infer}} requests that can be performed in parallel. When you optimize for search, the latency will be lower during search processes. @@ -39,7 +36,6 @@ You can optimize your model deployment for typical use cases, such as search and * If you want to optimize for ingest, set the number of threads to `1` (`"threads_per_allocation": 1`). * If you want to optimize for search, set the number of threads to greater than `1`. Increasing the number of threads will make the search processes more performant. - ## Enabling autoscaling in {{kib}} - adaptive resources [nlp-model-adaptive-resources] You can enable adaptive resources for your models when starting or updating the model deployment. Adaptive resources make it possible for {{es}} to scale up or down the available resources based on the load on the process. This can help you to manage performance and cost more easily. When adaptive resources are enabled, the number of vCPUs that the model deployment uses is set automatically based on the current load. When the load is high, the number of vCPUs that the process can use is automatically increased. When the load is low, the number of vCPUs that the process can use is automatically decreased. @@ -53,7 +49,6 @@ Refer to the tables in the [Model deployment resource matrix](#auto-scaling-matr :class: screenshot ::: - ## Model deployment resource matrix [auto-scaling-matrix] The used resources for trained model deployments depend on three factors: @@ -68,13 +63,10 @@ If you use {{es}} on-premises, vCPUs level ranges are derived from the `total_ml On Serverless, adaptive allocations are automatically enabled for all project types. However, the "Adaptive resources" control is not displayed in {{kib}} for Observability and Security projects. :::: - - ### Deployments in Cloud optimized for ingest [_deployments_in_cloud_optimized_for_ingest] In case of ingest-optimized deployments, we maximize the number of model allocations. - #### Adaptive resources enabled [_adaptive_resources_enabled] | Level | Allocations | Threads | vCPUs | @@ -85,7 +77,6 @@ In case of ingest-optimized deployments, we maximize the number of model allocat * The Cloud console doesn’t directly set an allocations limit; it only sets a vCPU limit. This vCPU limit indirectly determines the number of allocations, calculated as the vCPU limit divided by the number of threads. - #### Adaptive resources disabled [_adaptive_resources_disabled] | Level | Allocations | Threads | vCPUs | @@ -96,12 +87,10 @@ In case of ingest-optimized deployments, we maximize the number of model allocat * The Cloud console doesn’t directly set an allocations limit; it only sets a vCPU limit. This vCPU limit indirectly determines the number of allocations, calculated as the vCPU limit divided by the number of threads. - ### Deployments in Cloud optimized for search [_deployments_in_cloud_optimized_for_search] In case of search-optimized deployments, we maximize the number of threads. The maximum number of threads that can be claimed depends on the hardware your architecture has. - #### Adaptive resources enabled [_adaptive_resources_enabled_2] | Level | Allocations | Threads | vCPUs | @@ -112,7 +101,6 @@ In case of search-optimized deployments, we maximize the number of threads. The * The Cloud console doesn’t directly set an allocations limit; it only sets a vCPU limit. This vCPU limit indirectly determines the number of allocations, calculated as the vCPU limit divided by the number of threads. - #### Adaptive resources disabled [_adaptive_resources_disabled_2] | Level | Allocations | Threads | vCPUs | @@ -121,5 +109,4 @@ In case of search-optimized deployments, we maximize the number of threads. The | Medium | 2 (if threads=16) statically | maximum that the hardware allows (for example, 16) | 32 if available | | High | Maximum available set in the Cloud console *, statically | maximum that the hardware allows (for example, 16) | Maximum available set in the Cloud console, statically | -* The Cloud console doesn’t directly set an allocations limit; it only sets a vCPU limit. This vCPU limit indirectly determines the number of allocations, calculated as the vCPU limit divided by the number of threads. - +\* The Cloud console doesn’t directly set an allocations limit; it only sets a vCPU limit. This vCPU limit indirectly determines the number of allocations, calculated as the vCPU limit divided by the number of threads. diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-classify-text.md b/explore-analyze/machine-learning/nlp/ml-nlp-classify-text.md index a037c428f7..750a0c5c10 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-classify-text.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-classify-text.md @@ -11,13 +11,11 @@ These NLP tasks enable you to identify the language of text and classify or labe * [Text classification](#ml-nlp-text-classification) * [Zero-shot text classification](#ml-nlp-zero-shot) - -## {{lang-ident-cap}} [_lang_ident_cap] +## {{lang-ident-cap}} [_lang_ident_cap] The {{lang-ident}} model is provided out-of-the box in your {{es}} cluster. You can find the documentation of the model on the [{{lang-ident-cap}}](ml-nlp-lang-ident.md) page under the Built-in models section. - -## Text classification [ml-nlp-text-classification] +## Text classification [ml-nlp-text-classification] Text classification assigns the input text to one of multiple classes that best describe the text. The classes used depend on the model and the data set that was used to train it. Based on the number of classes, two main types of classification exist: binary classification, where the number of classes is exactly two, and multi-class classification, where the number of classes is more than two. @@ -39,8 +37,7 @@ Likewise, you might use a trained model to perform multi-class classification an ... ``` - -## Zero-shot text classification [ml-nlp-zero-shot] +## Zero-shot text classification [ml-nlp-zero-shot] The zero-shot classification task offers the ability to classify text without training a model on a specific set of classes. Instead, you provide the classes when you deploy the model or at {{infer}} time. It uses a model trained on a large data set that has gained a general language understanding and asks the model how well the labels you provided fit with your text. @@ -95,4 +92,3 @@ The task returns the following result: ``` Since you can adjust the labels while you perform {{infer}}, this type of task is exceptionally flexible. If you are consistently using the same labels, however, it might be better to use a fine-tuned text classification model. - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-deploy-model.md b/explore-analyze/machine-learning/nlp/ml-nlp-deploy-model.md index 8d6dbde7d2..b24ee042d4 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-deploy-model.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-deploy-model.md @@ -22,7 +22,6 @@ Each deployment will be fine-tuned automatically based on its specific purpose y Since eland uses APIs to deploy the models, you cannot see the models in {{kib}} until the saved objects are synchronized. You can follow the prompts in {{kib}}, wait for automatic synchronization, or use the [sync {{ml}} saved objects API](https://www.elastic.co/guide/en/kibana/current/machine-learning-api-sync.html). :::: - You can define the resource usage level of the NLP model during model deployment. The resource usage levels behave differently depending on [adaptive resources](ml-nlp-auto-scale.md#nlp-model-adaptive-resources) being enabled or disabled. When adaptive resources are disabled but {{ml}} autoscaling is enabled, vCPU usage of Cloud deployments derived from the Cloud console and functions as follows: * Low: This level limits resources to two vCPUs, which may be suitable for development, testing, and demos depending on your parameters. It is not recommended for production use @@ -31,7 +30,6 @@ You can define the resource usage level of the NLP model during model deployment For the resource levels when adaptive resources are enabled, refer to <[*Trained model autoscaling*](ml-nlp-auto-scale.md). - ## Request queues and search priority [infer-request-queues] Each allocation of a model deployment has a dedicated queue to buffer {{infer}} requests. The size of this queue is determined by the `queue_capacity` parameter in the [start trained model deployment API](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html). When the queue reaches its maximum capacity, new requests are declined until some of the queued requests are processed, creating available capacity once again. When multiple ingest pipelines reference the same deployment, the queue can fill up, resulting in rejected requests. Consider using dedicated deployments to prevent this situation. diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-deploy-models.md b/explore-analyze/machine-learning/nlp/ml-nlp-deploy-models.md index 0cecc80ab7..ebe39c2b6b 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-deploy-models.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-deploy-models.md @@ -11,8 +11,3 @@ If you want to perform {{nlp}} tasks in your cluster, you must deploy an appropr 2. [Import the trained model and vocabulary](ml-nlp-import-model.md). 3. [Deploy the model in your cluster](ml-nlp-deploy-model.md). 4. [Try it out](ml-nlp-test-inference.md). - - - - - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-extract-info.md b/explore-analyze/machine-learning/nlp/ml-nlp-extract-info.md index 4c538757c7..b66356afd1 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-extract-info.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-extract-info.md @@ -11,7 +11,6 @@ These NLP tasks enable you to extract information from your unstructured text: * [Fill-mask](#ml-nlp-mask) * [Question answering](#ml-nlp-question-answering) - ## Named entity recognition [ml-nlp-ner] The named entity recognition (NER) task can identify and categorize certain entities - typically proper nouns - in your unstructured text. Named entities usually refer to objects in the real world such as persons, locations, organizations, and other miscellaneous entities that are consistently referenced by a proper name. @@ -53,7 +52,6 @@ The task returns the following result: ... ``` - ## Fill-mask [ml-nlp-mask] The objective of the fill-mask task is to predict a missing word from a text sequence. The model uses the context of the masked word to predict the most likely word to complete the text. @@ -80,7 +78,6 @@ The task returns the following result: ... ``` - ## Question answering [ml-nlp-question-answering] The question answering (or extractive question answering) task makes it possible to get answers to certain questions by extracting information from the provided text. @@ -105,4 +102,3 @@ The answer is shown by the object below: } ... ``` - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-import-model.md b/explore-analyze/machine-learning/nlp/ml-nlp-import-model.md index 9f5b02171b..b61d790699 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-import-model.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-import-model.md @@ -9,17 +9,14 @@ mapped_pages: If you want to install a trained model in a restricted or closed network, refer to [these instructions](https://www.elastic.co/guide/en/elasticsearch/client/eland/current/machine-learning.html#ml-nlp-pytorch-air-gapped). :::: - After you choose a model, you must import it and its tokenizer vocabulary to your cluster. When you import the model, it must be chunked and imported one chunk at a time for storage in parts due to its size. ::::{note} Trained models must be in a TorchScript representation for use with {{stack-ml-features}}. :::: - [Eland](https://github.com/elastic/eland) is an {{es}} Python client that provides a simple script to perform the conversion of Hugging Face transformer models to their TorchScript representations, the chunking process, and upload to {{es}}; it is therefore the recommended import method. You can either install the Python Eland client on your machine or use a Docker image to build Eland and run the model import script. - ## Import with the Eland client installed [ml-nlp-import-script] 1. Install the [Eland Python client](https://www.elastic.co/guide/en/elasticsearch/client/eland/current/installation.html) with PyTorch extra dependencies. @@ -30,7 +27,7 @@ Trained models must be in a TorchScript representation for use with {{stack-ml-f 2. Run the `eland_import_hub_model` script to download the model from Hugging Face, convert it to TorchScript format, and upload to the {{es}} cluster. For example: - ```shell + ``` eland_import_hub_model \ --cloud-id \ <1> -u -p \ <2> @@ -43,10 +40,8 @@ Trained models must be in a TorchScript representation for use with {{stack-ml-f 3. Specify the identifier for the model in the Hugging Face model hub. 4. Specify the type of NLP task. Supported values are `fill_mask`, `ner`, `question_answering`, `text_classification`, `text_embedding`, `text_expansion`, `text_similarity`, and `zero_shot_classification`. - For more details, refer to [https://www.elastic.co/guide/en/elasticsearch/client/eland/current/machine-learning.html#ml-nlp-pytorch](https://www.elastic.co/guide/en/elasticsearch/client/eland/current/machine-learning.html#ml-nlp-pytorch). - ## Import with Docker [ml-nlp-import-docker] If you want to use Eland without installing it, run the following command: @@ -65,9 +60,26 @@ docker run -it --rm docker.elastic.co/eland/eland \ --start ``` -Replace the `$ELASTICSEARCH_URL` with the URL for your {{es}} cluster. Refer to [Authentication methods](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-authentication.html) to learn more. +Replace the `$ELASTICSEARCH_URL` with the URL for your {{es}} cluster. Refer to [Authentication methods](#ml-nlp-authentication) to learn more. + +## Authentication methods [ml-nlp-authentication] +The following authentication options are available when using the import script: +* username/password authentication (specified with the `-u` and `-p` options): + +```bash +eland_import_hub_model --url https://: -u -p ... +``` + +* username/password authentication (embedded in the URL): + +```bash +eland_import_hub_model --url https://:@: ... +``` +* API key authentication: -$$$ml-nlp-authentication$$$ \ No newline at end of file +```bash +eland_import_hub_model --url https://: --es-api-key ... +``` diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-inference.md b/explore-analyze/machine-learning/nlp/ml-nlp-inference.md index b66dbf4b43..b407bcac65 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-inference.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-inference.md @@ -12,7 +12,6 @@ After you [deploy a trained model in your cluster](ml-nlp-deploy-models.md), you 3. [Ingest documents](#ml-nlp-inference-ingest-docs). 4. [View the results](#ml-nlp-inference-discover). - ## Add an {{infer}} processor to an ingest pipeline [ml-nlp-inference-processor] In {{kib}}, you can create and edit pipelines in **{{stack-manage-app}}** > **Ingest Pipelines**. To open **Ingest Pipelines**, find **{{stack-manage-app}}** in the main menu, or use the [global search field](../../overview/kibana-quickstart.md#_finding_your_apps_and_objects). @@ -94,8 +93,6 @@ In {{kib}}, you can create and edit pipelines in **{{stack-manage-app}}** > **In 3. If everything looks correct, close the panel, and click **Create pipeline**. The pipeline is now ready for use. - - ## Ingest documents [ml-nlp-inference-ingest-docs] You can now use your ingest pipeline to perform NLP tasks on your data. @@ -120,7 +117,6 @@ PUT ner-test To use the `annotated_text` data type in this example, you must install the [mapper annotated text plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-annotated-text.html). For more installation details, refer to [Add plugins provided with {{ess}}](https://www.elastic.co/guide/en/cloud/current/ec-adding-elastic-plugins.html). :::: - You can then use the new pipeline to index some documents. For example, use a bulk indexing request with the `pipeline` query parameter for your NER pipeline: ```console @@ -168,8 +164,6 @@ However, those web log messages are unlikely to contain enough words for the mod Set the reindex `size` option to a value smaller than the `queue_capacity` for the trained model deployment. Otherwise, requests might be rejected with a "too many requests" 429 error code. :::: - - ## View the results [ml-nlp-inference-discover] Before you can verify the results of the pipelines, you must [create {{data-sources}}](../../find-and-organize/data-views.md). Then you can explore your data in **Discover**: @@ -190,7 +184,6 @@ In this {{lang-ident}} example, the `ml.inference.predicted_value` contains the To learn more about ingest pipelines and all of the other processors that you can add, refer to [Ingest pipelines](../../../manage-data/ingest/transform-enrich/ingest-pipelines.md). - ## Common problems [ml-nlp-inference-common-problems] If you encounter problems while using your trained model in an ingest pipeline, check the following possible causes: @@ -201,7 +194,6 @@ If you encounter problems while using your trained model in an ingest pipeline, These common failure scenarios and others can be captured by adding failure processors to your pipeline. For more examples, refer to [Handling pipeline failures](../../../manage-data/ingest/transform-enrich/ingest-pipelines.md#handling-pipeline-failures). - ## Further reading [nlp-example-reading] * [How to deploy NLP: Text Embeddings and Vector Search](https://www.elastic.co/blog/how-to-deploy-nlp-text-embeddings-and-vector-search) diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-lang-ident.md b/explore-analyze/machine-learning/nlp/ml-nlp-lang-ident.md index 1b49ec9185..d2699017cc 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-lang-ident.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-lang-ident.md @@ -13,7 +13,6 @@ The longer the text passed into the {{lang-ident}} model, the more accurately th {{lang-ident-cap}} takes into account Unicode boundaries when the feature set is built. If the text has diacritical marks, then the model uses that information for identifying the language of the text. In certain cases, the model can detect the source language even if it is not written in the script that the language traditionally uses. These languages are marked in the supported languages table (see below) with the `Latn` subtag. {{lang-ident-cap}} supports Unicode input. - ## Supported languages [ml-lang-ident-supported-languages] The table below contains the ISO codes and the English names of the languages that {{lang-ident}} supports. If a language has a 2-letter `ISO 639-1` code, the table contains that identifier. Otherwise, the 3-letter `ISO 639-2` code is used. The `Latn` subtag indicates that the language is transliterated into Latin script. @@ -59,8 +58,7 @@ The table below contains the ISO codes and the English names of the languages th | hi-Latn | Hindi | no | Norwegian | | | | hmn | Hmong | ny | Chichewa | | | - -## Example of {{lang-ident}} [ml-lang-ident-example] +## Example of {{lang-ident}} [ml-lang-ident-example] In the following example, we feed the {{lang-ident}} trained model a short Hungarian text that contains diacritics and a couple of English words. The model identifies the text correctly as Hungarian with high probability. @@ -97,7 +95,6 @@ POST _ingest/pipeline/_simulate 2. Specifies the number of languages to report by descending order of probability. 3. The source object that contains the text to identify. - In the example above, the `num_top_classes` value indicates that only the top five languages (that is to say, the ones with the highest probability) are reported. The request returns the following response: @@ -158,9 +155,6 @@ The request returns the following response: 1. Contains scores for the most probable languages. 2. The ISO identifier of the language with the highest probability. - - ## Further reading [ml-lang-ident-readings] * [Multilingual search using {{lang-ident}} in {{es}}](https://www.elastic.co/blog/multilingual-search-using-language-identification-in-elasticsearch) - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-overview.md b/explore-analyze/machine-learning/nlp/ml-nlp-overview.md index dc7459e92d..ba8dc6a995 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-overview.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-overview.md @@ -7,7 +7,6 @@ mapped_pages: {{nlp-cap}} (NLP) refers to the way in which we can use software to understand natural language in spoken word or written text. - ## NLP in the {{stack}} [nlp-elastic-stack] Elastic offers a wide range of possibilities to leverage natural language processing. @@ -20,7 +19,6 @@ You can **upload and manage NLP models** using the Eland client and the [{{stack You can **store embeddings in your {{es}} vector database** if you generate [dense vector](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html) or [sparse vector](https://www.elastic.co/guide/en/elasticsearch/reference/current/sparse-vector.html) model embeddings outside of {{es}}. - ## What is NLP? [what-is-nlp] Classically, NLP was performed using linguistic rules, dictionaries, regular expressions, and {{ml}} for specific tasks such as automatic categorization or summarization of text. In recent years, however, deep learning techniques have taken over much of the NLP landscape. Deep learning capitalizes on the availability of large scale data sets, cheap computation, and techniques for learning at scale with less human involvement. Pre-trained language models that use a transformer architecture have been particularly successful. For example, BERT is a pre-trained language model that was released by Google in 2018. Since that time, it has become the inspiration for most of today’s modern NLP techniques. The {{stack}} {ml} features are structured around BERT and transformer models. These features support BERT’s tokenization scheme (called WordPiece) and transformer models that conform to the standard BERT model interface. For the current list of supported architectures, refer to [Compatible third party models](ml-nlp-model-ref.md). diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-search-compare.md b/explore-analyze/machine-learning/nlp/ml-nlp-search-compare.md index dd3b90e783..b0e181e10c 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-search-compare.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-search-compare.md @@ -10,7 +10,6 @@ The {{stack-ml-features}} can generate embeddings, which you can use to search i * [Text embedding](#ml-nlp-text-embedding) * [Text similarity](#ml-nlp-text-similarity) - ## Text embedding [ml-nlp-text-embedding] Text embedding is a task which produces a mathematical representation of text called an embedding. The {{ml}} model turns the text into an array of numerical values (also known as a *vector*). Pieces of content with similar meaning have similar representations. This means it is possible to determine whether different pieces of text are either semantically similar, different, or even opposite by using a mathematical similarity function. @@ -37,7 +36,6 @@ The task returns the following result: ... ``` - ## Text similarity [ml-nlp-text-similarity] The text similarity task estimates how similar two pieces of text are to each other and expresses the similarity in a numeric value. This is commonly referred to as cross-encoding. This task is useful for ranking document text when comparing it to another provided text input. @@ -67,4 +65,3 @@ In the example above, every string in the `docs` array is compared individually } ... ``` - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-select-model.md b/explore-analyze/machine-learning/nlp/ml-nlp-select-model.md index 3e307f3eac..9b45527bae 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-select-model.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-select-model.md @@ -5,9 +5,8 @@ mapped_pages: # Select a trained model [ml-nlp-select-model] -Per the [*Overview*](ml-nlp-overview.md), there are multiple ways that you can use NLP features within the {{stack}}. After you determine which type of NLP task you want to perform, you must choose an appropriate trained model. +Per the [Overview](ml-nlp-overview.md), there are multiple ways that you can use NLP features within the {{stack}}. After you determine which type of NLP task you want to perform, you must choose an appropriate trained model. The simplest method is to use a model that has already been fine-tuned for the type of analysis that you want to perform. For example, there are models and data sets available for specific NLP tasks on [Hugging Face](https://huggingface.co/models). These instructions assume you’re using one of those models and do not describe how to create new models. For the current list of supported model architectures, refer to [Compatible third party models](ml-nlp-model-ref.md). If you choose to perform {{lang-ident}} by using the `lang_ident_model_1` that is provided in the cluster, no further steps are required to import or deploy the model. You can skip to using the model in [ingestion pipelines](ml-nlp-inference.md). - diff --git a/explore-analyze/machine-learning/nlp/ml-nlp-test-inference.md b/explore-analyze/machine-learning/nlp/ml-nlp-test-inference.md index efeb45add2..bd0185f0ab 100644 --- a/explore-analyze/machine-learning/nlp/ml-nlp-test-inference.md +++ b/explore-analyze/machine-learning/nlp/ml-nlp-test-inference.md @@ -52,4 +52,3 @@ In this example, the response contains the annotated text output and the recogni ``` If you are satisfied with the results, you can add these NLP tasks in your [ingestion pipelines](ml-nlp-inference.md). -