From 52087fe0e78cbd8f014a53ab6f8125bd45366114 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Tue, 26 Nov 2024 13:00:50 -0700 Subject: [PATCH] Change our recommended threshold from 55 back to 70 --- includes/Classifai/Admin/Notifications.php | 14 +++++++------- .../Classifai/Providers/Azure/ComputerVision.php | 4 ++-- .../provider-settings/azure-ai-vision.js | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/Classifai/Admin/Notifications.php b/includes/Classifai/Admin/Notifications.php index 501b7afc7..51493f3d2 100644 --- a/includes/Classifai/Admin/Notifications.php +++ b/includes/Classifai/Admin/Notifications.php @@ -116,8 +116,8 @@ public function render_activation_notice() { /** * Display a dismissable admin notice when a threshold may need updating. * - * We used to recommend thresholds between 70-75% but in the latest - * version of the AI Vision API, seems 55% is a better threshold. + * We used to recommend thresholds between 50-55% but in the latest + * version of the AI Vision API, seems 70% is a better threshold. */ public function thresholds_update_notice() { $features = [ @@ -143,7 +143,7 @@ public function thresholds_update_notice() { switch ( $feature_instance::ID ) { case DescriptiveTextGenerator::ID: $key = 'descriptive_confidence_threshold'; - $message = __( 'The previous recommended threshold for descriptive text generation was 75% but we find better results now at around 55%.', 'classifai' ); + $message = __( 'The previous recommended threshold for descriptive text generation was 55% but we find better results now at around 70%.', 'classifai' ); break; } @@ -152,8 +152,8 @@ public function thresholds_update_notice() { continue; } - // Don't show the notice if the threshold is already at 55% or lower. - if ( $key && isset( $settings[ $key ] ) && $settings[ $key ] <= 55 ) { + // Don't show the notice if the threshold is already at 70% or higher. + if ( $key && isset( $settings[ $key ] ) && $settings[ $key ] >= 70 ) { continue; } ?> @@ -164,9 +164,9 @@ public function thresholds_update_notice() { echo wp_kses_post( sprintf( // translators: %1$s: Feature specific message; %2$s: URL to Feature settings. - __( 'ClassifAI has updated to the v3.2 of the Azure AI Vision API. %1$s Click here to adjust those settings.', 'classifai' ), + __( 'ClassifAI has updated to the v4.0 of the Azure AI Vision API. %1$s Click here to adjust those settings.', 'classifai' ), esc_html( $message ), - esc_url( admin_url( "tools.php?page=classifai&tab=image_processing&feature=$name" ) ) + esc_url( admin_url( "tools.php?page=classifai#/image_processing/$name" ) ) ) ); ?> diff --git a/includes/Classifai/Providers/Azure/ComputerVision.php b/includes/Classifai/Providers/Azure/ComputerVision.php index 1bad7fd99..96d6ce666 100644 --- a/includes/Classifai/Providers/Azure/ComputerVision.php +++ b/includes/Classifai/Providers/Azure/ComputerVision.php @@ -131,7 +131,7 @@ public function add_descriptive_text_generation_fields() { 'min' => 1, 'step' => 1, 'default_value' => $settings['descriptive_confidence_threshold'], - 'description' => esc_html__( 'Minimum confidence score for automatically added generated text, numeric value from 0-100. Recommended to be set to at least 55.', 'classifai' ), + 'description' => esc_html__( 'Minimum confidence score for automatically added generated text, numeric value from 0-100. Recommended to be set to at least 70.', 'classifai' ), 'class' => 'classifai-provider-field hidden provider-scope-' . static::ID, // Important to add this. ] ); @@ -180,7 +180,7 @@ public function get_default_provider_settings(): array { return array_merge( $common_settings, [ - 'descriptive_confidence_threshold' => 55, + 'descriptive_confidence_threshold' => 70, ] ); diff --git a/src/js/settings/components/provider-settings/azure-ai-vision.js b/src/js/settings/components/provider-settings/azure-ai-vision.js index f34a27e21..77957d154 100644 --- a/src/js/settings/components/provider-settings/azure-ai-vision.js +++ b/src/js/settings/components/provider-settings/azure-ai-vision.js @@ -78,7 +78,7 @@ export const AzureAIVisionSettings = ( { isConfigured = false } ) => { @@ -87,7 +87,7 @@ export const AzureAIVisionSettings = ( { isConfigured = false } ) => { type="number" value={ providerSettings.descriptive_confidence_threshold || - 55 + 70 } onChange={ ( value ) => onChange( {