/** @var \Magento\Eav\Api\AttributeSetRepositoryInterface $attributeSet **/
protected $attributeSet;
public function __construct(
......
\Magento\Eav\Api\AttributeSetRepositoryInterface $attributeSet
......
) {
......
$this->attributeSet = $attributeSet;
}
//Build method to get attribute set
public function getAttributeSetName() {
$product = $this->getProduct();
$attributeSetRepository = $this->attributeSet->get($product->getAttributeSetId());
return $attributeSetRepository->getAttributeSetName();
}