This research pioneers a text-guided deep learning approach for the efficient and precise identification of maceral components in coal, addressing the challenges of sparse data and unbalanced categories. Leveraging advancements in information technology, particularly deep learning and natural language processing, this method surpasses traditional manual inspection techniques in speed, accuracy, and objectivity. By integrating image and text information, the study enhances the analysis of coal rock microscopic images, significantly contributing to the clean and efficient utilization of coal resources. Experimental results, validated through metrics like mean pixel accuracy (mPa) and mean intersection over union (mIou), demonstrate the method's effectiveness over conventional approaches. This work marks a significant advancement in coal petrology, offering new perspectives for sustainable energy production.