$recommends = $node->filter('button[data-action="show-recommends"]');
$rate = $recommends->count() ? $recomments->text() : 0;
This is superficial and independent from validation. At best, if you let Symfony guess your field type, then the value of this option will be guessed from your validation information.
$form->isValid() === true