Skip to content

Commit

Permalink
Merge pull request #560 from 10up/feature/Update-references-from-Comp…
Browse files Browse the repository at this point in the history
…uter-Vision-to-Azure-AI-Vision

Update references from Computer Vision to Azure AI Vision
  • Loading branch information
dkotter authored Aug 14, 2023
2 parents d4858c0 + 85259da commit 158bfdf
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 40 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
* [Set Up OpenAI Embeddings Language Processing](#set-up-language-processing-via-openai-embeddings)
* [Set Up OpenAI Whisper Language Processing](#set-up-language-processing-via-openai-whisper)
* [Set Up Azure AI Language Processing](#set-up-language-processing-via-microsoft-azure)
* [Set Up Azure AI Computer Vision Image Processing](#set-up-image-processing-via-microsoft-azure)
* [Set Up Azure AI Vision Image Processing](#set-up-image-processing-via-microsoft-azure)
* [Set Up OpenAI DALL·E Image Processing](#set-up-image-processing-via-openai)
* [Set Up Azure Personalizer Recommended Content](#set-up-recommended-content-via-microsoft-azure-personalizer)
* [Set Up Azure AI Personalizer Recommended Content](#set-up-recommended-content-via-microsoft-azure-ai-personalizer)
* [WP CLI Commands](#wp-cli-commands)
* [FAQs](#frequently-asked-questions)
* [Support](#support-level)
Expand All @@ -41,16 +41,16 @@ Tap into leading cloud-based services like [OpenAI](https://openai.com/), [Micro
* Generate transcripts of audio files using [OpenAI's Whisper API](https://platform.openai.com/docs/guides/speech-to-text)
* Convert text content into audio and output a "read-to-me" feature on the front-end to play this audio using [Microsoft Azure's Text to Speech API](https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/text-to-speech)
* Classify post content using [IBM Watson's Natural Language Understanding API](https://www.ibm.com/watson/services/natural-language-understanding/) and [OpenAI's Embedding API](https://platform.openai.com/docs/guides/embeddings)
* BETA: Recommend content based on overall site traffic via [Microsoft Azure's Personalizer API](https://azure.microsoft.com/en-us/services/cognitive-services/personalizer/) _(note that we're gathering feedback on this feature and may significantly iterate depending on community input)_
* Generate image alt text, image tags, and smartly crop images using [Microsoft Azure's Computer Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* Scan images and PDF files for embedded text and save for use in post meta using [Microsoft Azure's Computer Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* BETA: Recommend content based on overall site traffic via [Microsoft Azure's AI Personalizer API](https://azure.microsoft.com/en-us/services/cognitive-services/personalizer/) _(note that we're gathering feedback on this feature and may significantly iterate depending on community input)_
* Generate image alt text, image tags, and smartly crop images using [Microsoft Azure's AI Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* Scan images and PDF files for embedded text and save for use in post meta using [Microsoft Azure's AI Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* Bulk classify content with [WP-CLI](https://wp-cli.org/)

### Language Processing

| Tagging | Recommended Content | Excerpt Generation |
| :-: | :-: | :-: |
| ![Screenshot of ClassifAI post tagging](assets/img/screenshot-1.png "Example of a Block Editor post with Watson Categories, Keywords, Concepts, and Entities.") | ![Screenshot of ClassifAI recommended content](assets/img/screenshot-2.png "Example of a Recommended Content Block with Azure Personalizer.") | ![Screenshot of ClassifAI excerpt generation](assets/img/screenshot-7.png "Example of automatic excerpt generation with OpenAI.") |
| ![Screenshot of ClassifAI post tagging](assets/img/screenshot-1.png "Example of a Block Editor post with Watson Categories, Keywords, Concepts, and Entities.") | ![Screenshot of ClassifAI recommended content](assets/img/screenshot-2.png "Example of a Recommended Content Block with Azure AI Personalizer.") | ![Screenshot of ClassifAI excerpt generation](assets/img/screenshot-7.png "Example of automatic excerpt generation with OpenAI.") |

| Audio Transcripts | Title Generation | Text to Speech |
| :-: | :-: | :-: |
Expand All @@ -68,7 +68,7 @@ Tap into leading cloud-based services like [OpenAI](https://openai.com/), [Micro
* [WordPress](http://wordpress.org) 5.7+
* To utilize the NLU Language Processing functionality, you will need an active [IBM Watson](https://cloud.ibm.com/registration) account.
* To utilize the ChatGPT, Embeddings, or Whisper Language Processing functionality or DALL·E Image Processing functionality, you will need an active [OpenAI](https://platform.openai.com/signup) account.
* To utilize the Computer Vision Image Processing functionality or Text to Speech Language Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.
* To utilize the Azure AI Vision Image Processing functionality or Text to Speech Language Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.

## Pricing

Expand All @@ -78,11 +78,11 @@ The service that powers ClassifAI's NLU Language Processing, IBM Watson's Natura

The service that powers ClassifAI's ChatGPT, Embeddings and Whisper Language Processing and DALL·E Image Processing, OpenAI, has a limited free trial and then requires a [pay per usage](https://openai.com/pricing) plan.

The service that powers ClassifAI's Computer Vision Image Processing, Microsoft Azure, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/computer-vision/) that offers 20 transactions per minute and 5,000 transactions per month.
The service that powers ClassifAI's Azure AI Vision Image Processing, Microsoft Azure, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/computer-vision/) that offers 20 transactions per minute and 5,000 transactions per month.

The service that powers ClassifAI's Text to Speech Language Processing, Microsoft Azure, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/speech-services/) that offers 0.5 million characters per month.

The service that powers ClassifAI's Recommended Content, Microsoft Azure's Personalizer, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/personalizer/) that offers 50,000 transactions per month.
The service that powers ClassifAI's Recommended Content, Microsoft Azure AI Personalizer, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/personalizer/) that offers 50,000 transactions per month.

## Installation

Expand Down Expand Up @@ -311,7 +311,7 @@ Note that [OpenAI](https://platform.openai.com/docs/guides/speech-to-text) can c

## Set Up Image Processing (via Microsoft Azure)

Note that [Computer Vision](https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/home#image-requirements) can analyze and crop images that meet the following requirements:
Note that [Azure AI Vision](https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/home#image-requirements) can analyze and crop images that meet the following requirements:
- The image must be presented in JPEG, PNG, GIF, or BMP format
- The file size of the image must be less than 4 megabytes (MB)
- The dimensions of the image must be greater than 50 x 50 pixels
Expand All @@ -320,7 +320,7 @@ Note that [Computer Vision](https://docs.microsoft.com/en-us/azure/cognitive-ser
### 1. Sign up for Azure services

- [Register for a Microsoft Azure account](https://azure.microsoft.com/en-us/free/) or sign into your existing one.
- Log into your account and create a new [*Computer Vision*](https://portal.azure.com/#blade/Microsoft_Azure_Marketplace/GalleryFeaturedMenuItemBlade/selectedMenuItemId/CognitiveServices_MP/dontDiscardJourney/true/launchingContext/%7B%22source%22%3A%22Resources%20Microsoft.CognitiveServices%2Faccounts%22%7D/resetMenuId/) Service if you do not already have one. It may take a minute for your account to fully populate with the default resource group to use.
- Log into your account and create a new [*Azure AI Vision*](https://portal.azure.com/#blade/Microsoft_Azure_Marketplace/GalleryFeaturedMenuItemBlade/selectedMenuItemId/CognitiveServices_MP/dontDiscardJourney/true/launchingContext/%7B%22source%22%3A%22Resources%20Microsoft.CognitiveServices%2Faccounts%22%7D/resetMenuId/) Service if you do not already have one. It may take a minute for your account to fully populate with the default resource group to use.
- Click `Keys and Endpoint` in the left hand Resource Management menu to view the `Endpoint` URL for this resource.
- Click the copy icon next to `KEY 1` to copy the API Key credential for this resource.

Expand Down Expand Up @@ -365,7 +365,7 @@ Note that [Computer Vision](https://docs.microsoft.com/en-us/azure/cognitive-ser
* Once images are generated, choose one or more images to import into your media library
* Choose one image to insert into the content

## Set Up Recommended Content (via Microsoft Azure Personalizer)
## Set Up Recommended Content (via Microsoft Azure AI Personalizer)

Note that [Personalizer](https://azure.microsoft.com/en-us/services/cognitive-services/personalizer/) requires sufficient data volume to enable Personalizer to learn. In general, we recommend a minimum of ~1,000 events per day to ensure Personalizer learns effectively. If Personalizer doesn't receive sufficient data, the service takes longer to determine the best actions.

Expand Down
4 changes: 2 additions & 2 deletions hookdocs/wp-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ The following WP-CLI commands are supported by ClassifAI:

* `wp classifai image <attachment_ids> [--limit=<int>] [--skip=<skip>] [--force]`

Directly add description "alt text" and tags to attachment(s) using Azure AI Computer Vision API.
Directly add description "alt text" and tags to attachment(s) using Azure AI Vision API.

* `<attachment_ids>`: Comma delimited list of Attachment IDs to classify.

Expand All @@ -256,7 +256,7 @@ The following WP-CLI commands are supported by ClassifAI:

* `wp classifai crop <attachment_ids> [--limit=<limit>] [--skip=<skip>]`

Batch crop image(s) using Azure AI Computer Vision API.
Batch crop image(s) using Azure AI Vision API.

* `<attachment_ids>`: Comma delimited list of Attachment IDs to crop.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"title": "Recommended Content",
"description": "Display content recommended by Azure Personalizer",
"description": "Display content recommended by Azure AI Personalizer",
"textdomain": "classifai",
"name": "classifai/recommended-content-block",
"category": "classifai-blocks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { ReactComponent as icon } from '../../../../assets/img/block-icon.svg';
registerBlockType( block.name, {
title: __( 'Recommended Content', 'classifai' ),
description: __(
'Display content recommended by Azure Personalizer',
'Display content recommended by Azure AI Personalizer',
'classifai'
),
edit,
Expand Down
6 changes: 3 additions & 3 deletions includes/Classifai/Providers/Azure/ComputerVision.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class ComputerVision extends Provider {
public function __construct( $service ) {
parent::__construct(
'Microsoft Azure',
'Computer Vision',
'AI Vision',
'computer_vision',
$service
);

// Set the onboarding options.
$this->onboarding_options = array(
'title' => __( 'Microsoft Azure Computer Vision', 'classifai' ),
'title' => __( 'Microsoft Azure AI Vision', 'classifai' ),
'fields' => array( 'url', 'api-key' ),
'features' => array(
'enable_image_captions' => __( 'Automatically add alt-text to images', 'classifai' ),
Expand Down Expand Up @@ -1053,7 +1053,7 @@ public function setup_fields_sections() {
'input_type' => 'checkbox',
'default_value' => $default_settings['enable_smart_cropping'],
'description' => __(
'ComputerVision detects and saves the most visually interesting part of your image (i.e., faces, animals, notable text).',
'AI Vision detects and saves the most visually interesting part of your image (i.e., faces, animals, notable text).',
'classifai'
),
]
Expand Down
14 changes: 7 additions & 7 deletions includes/Classifai/Providers/Azure/Personalizer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Azure Personalizer
* Azure AI Personalizer
*/

namespace Classifai\Providers\Azure;
Expand Down Expand Up @@ -35,14 +35,14 @@ class Personalizer extends Provider {
public function __construct( $service ) {
parent::__construct(
'Microsoft Azure',
'Personalizer',
'AI Personalizer',
'personalizer',
$service
);

// Set the onboarding options.
$this->onboarding_options = array(
'title' => __( 'Microsoft Azure Personalizer', 'classifai' ),
'title' => __( 'Microsoft Azure AI Personalizer', 'classifai' ),
'fields' => array( 'url', 'api-key' ),
'features' => array(
'authenticated' => __( 'Recommended content block', 'classifai' ),
Expand Down Expand Up @@ -97,7 +97,7 @@ public function setup_fields_sections() {
'description' => sprintf(
wp_kses(
// translators: 1 - link to create a Personalizer resource.
__( 'Azure Cognitive Service Personalizer Endpoint, <a href="%1$s" target="_blank">create a Personalizer resource</a> in the Azure portal to get your key and endpoint.', 'classifai' ),
__( 'Azure AI Personalizer Endpoint, <a href="%1$s" target="_blank">create a Personalizer resource</a> in the Azure portal to get your key and endpoint.', 'classifai' ),
array(
'a' => array(
'href' => array(),
Expand All @@ -119,7 +119,7 @@ public function setup_fields_sections() {
'label_for' => 'api_key',
'input_type' => 'password',
'default_value' => $default_settings['api_key'],
'description' => __( 'Azure Cognitive Service Personalizer Key.', 'classifai' ),
'description' => __( 'Azure AI Personalizer Key.', 'classifai' ),
]
);
}
Expand Down Expand Up @@ -310,7 +310,7 @@ function( $ele ) {

if ( is_wp_error( $response ) ) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
error_log( __( 'Failed to contact Azure Cognitive Service Personalizer: ', 'classifai' ) . $response->get_error_message() );
error_log( __( 'Failed to contact Azure AI Personalizer: ', 'classifai' ) . $response->get_error_message() );
return array(
'response' => (object) array(),
'actions' => $action_ids,
Expand Down Expand Up @@ -605,7 +605,7 @@ protected function get_string_words( $string ) {
}

/**
* Get Ranked action by sending request to Azure Personalizer.
* Get Ranked action by sending request to Azure AI Personalizer.
*
* @param array $rank_request Prepared Request data.
* @return object|string
Expand Down
2 changes: 1 addition & 1 deletion includes/Classifai/Providers/Azure/TextToSpeech.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function register() {
}

/**
* Resets settings for the Personalizer provider.
* Resets settings for the TextToSpeech provider.
*/
public function reset_settings() {
update_option( $this->get_option_name(), $this->get_default_settings() );
Expand Down
6 changes: 3 additions & 3 deletions includes/Classifai/Services/ImageProcessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function enqueue_media_scripts() {
true
);

$provider = find_provider_class( $this->provider_classes ?? [], 'Computer Vision' );
$provider = find_provider_class( $this->provider_classes ?? [], 'AI Vision' );
if ( ! is_wp_error( $provider ) ) {
wp_add_inline_script(
'classifai-media-script',
Expand Down Expand Up @@ -236,7 +236,7 @@ public function computer_vision_endpoint_callback( $request ) {
}

// Find the right provider class.
$provider = find_provider_class( $this->provider_classes ?? [], 'Computer Vision' );
$provider = find_provider_class( $this->provider_classes ?? [], 'AI Vision' );

// Ensure we have a provider class. Should never happen but :shrug:
if ( is_wp_error( $provider ) ) {
Expand Down Expand Up @@ -273,7 +273,7 @@ public function computer_vision_endpoint_permissions_check( WP_REST_Request $req
return false;
}

$settings = \Classifai\get_plugin_settings( 'image_processing', 'Computer Vision' );
$settings = \Classifai\get_plugin_settings( 'image_processing', 'AI Vision' );

// For the image-tags route, ensure the taxonomy is valid and the user has permission to assign terms.
if ( 'image-tags' === $route_to_call ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/Classifai/Services/Personalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function ajax_render_recommended_content() {
}
}

$provider = find_provider_class( $this->provider_classes ?? [], 'Personalizer' );
$provider = find_provider_class( $this->provider_classes ?? [], 'AI Personalizer' );

if ( ! is_wp_error( $provider ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand Down Expand Up @@ -146,7 +146,7 @@ public function reward_endpoint_callback( WP_REST_Request $request ) {
}

// Find the right provider class.
$provider = find_provider_class( $this->provider_classes ?? [], 'Personalizer' );
$provider = find_provider_class( $this->provider_classes ?? [], 'AI Personalizer' );

// Ensure we have a provider class. Should never happen but :shrug:
if ( is_wp_error( $provider ) ) {
Expand Down
8 changes: 4 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ Tap into leading cloud-based services like [OpenAI](https://openai.com/), [Micro
* Generate transcripts of audio files using [OpenAI's Whisper API](https://platform.openai.com/docs/guides/speech-to-text)
* Convert text content into audio and output a "read-to-me" feature on the front-end to play this audio using [Microsoft Azure's Text to Speech API](https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/text-to-speech)
* Classify post content using [IBM Watson's Natural Language Understanding API](https://www.ibm.com/watson/services/natural-language-understanding/) and [OpenAI's Embedding API](https://platform.openai.com/docs/guides/embeddings)
* BETA: Recommend content based on overall site traffic via [Microsoft Azure's Personalizer API](https://azure.microsoft.com/en-us/services/cognitive-services/personalizer/) _(note that we're gathering feedback on this feature and may significantly iterate depending on community input)_
* Generate image alt text, image tags, and smartly crop images using [Microsoft Azure's Computer Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* Scan images and PDF files for embedded text and save for use in post meta using [Microsoft Azure's Computer Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* BETA: Recommend content based on overall site traffic via [Microsoft Azure's AI Personalizer API](https://azure.microsoft.com/en-us/services/cognitive-services/personalizer/) _(note that we're gathering feedback on this feature and may significantly iterate depending on community input)_
* Generate image alt text, image tags, and smartly crop images using [Microsoft Azure's AI Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* Scan images and PDF files for embedded text and save for use in post meta using [Microsoft Azure's AI Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/)
* Bulk classify content with [WP-CLI](https://wp-cli.org/)

**Requirements**

* To utilize the NLU Language Processing functionality, you will need an active [IBM Watson](https://cloud.ibm.com/registration) account.
* To utilize the ChatGPT, Embeddings, or Whisper Language Processing functionality or DALL·E Image Processing functionality, you will need an active [OpenAI](https://platform.openai.com/signup) account.
* To utilize the Computer Vision Image Processing functionality or Text to Speech Language Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.
* To utilize the Azure AI Vision Image Processing functionality or Text to Speech Language Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.

== Upgrade Notice ==

Expand Down
Loading

0 comments on commit 158bfdf

Please sign in to comment.