Skip to content

Commit

Permalink
Change our recommended threshold from 55 back to 70
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Nov 26, 2024
1 parent 5d87ad6 commit 52087fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions includes/Classifai/Admin/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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;
}

Expand All @@ -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;
}
?>
Expand All @@ -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 <a href="%2$s">Click here to adjust those settings</a>.', 'classifai' ),
__( 'ClassifAI has updated to the v4.0 of the Azure AI Vision API. %1$s <a href="%2$s">Click here to adjust those settings</a>.', '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" ) )
)
);
?>
Expand Down
4 changes: 2 additions & 2 deletions includes/Classifai/Providers/Azure/ComputerVision.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
]
);
Expand Down Expand Up @@ -180,7 +180,7 @@ public function get_default_provider_settings(): array {
return array_merge(
$common_settings,
[
'descriptive_confidence_threshold' => 55,
'descriptive_confidence_threshold' => 70,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const AzureAIVisionSettings = ( { isConfigured = false } ) => {
<SettingsRow
label={ __( 'Confidence threshold', 'classifai' ) }
description={ __(
'Minimum confidence score for automatically added generated text, numeric value from 0-100. Recommended to be set to at least 55.',
'Minimum confidence score for automatically added generated text, numeric value from 0-100. Recommended to be set to at least 70.',
'classifai'
) }
>
Expand All @@ -87,7 +87,7 @@ export const AzureAIVisionSettings = ( { isConfigured = false } ) => {
type="number"
value={
providerSettings.descriptive_confidence_threshold ||
55
70
}
onChange={ ( value ) =>
onChange( {
Expand Down

0 comments on commit 52087fe

Please sign in to comment.