Skip to content

Commit

Permalink
Merge pull request #402 from 10up/fix/preview-features
Browse files Browse the repository at this point in the history
Remove some code in the preview section that isn't needed
  • Loading branch information
dkotter committed Mar 13, 2023
2 parents 01bc73a + 75fedfe commit f890b4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions includes/Classifai/Admin/PreviewClassifierData.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,8 @@ public function get_post_classifier_preview_data() {
$classifier = new \Classifai\Watson\Classifier();
$normalizer = new \Classifai\Watson\Normalizer();

$features['categories'] = (object) [];
$features['concepts'] = (object) [];
$features['entities'] = (object) [];
$features['keywords'] = [
'emotion' => false,
'sentiment' => false,
'limit' => defined( 'WATSON_KEYWORD_LIMIT' ) ? WATSON_KEYWORD_LIMIT : 10,
];

$text_to_classify = $normalizer->normalize( $post_id );
$body = $classifier->get_body( $text_to_classify, $features );
$body = $classifier->get_body( $text_to_classify );
$request_options['body'] = $body;
$request = $classifier->get_request();

Expand Down
2 changes: 1 addition & 1 deletion includes/Classifai/Watson/Classifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function get_body( $text, $options = [] ) {
'keywords' => [
'emotion' => false,
'sentiment' => false,
'limit' => 10,
'limit' => defined( 'WATSON_KEYWORD_LIMIT' ) ? WATSON_KEYWORD_LIMIT : 10,
],
'concepts' => (object) [],
'entities' => (object) [],
Expand Down

0 comments on commit f890b4d

Please sign in to comment.