Aspect-based sentiment analysis aims to extract the sentiment polarity of different aspects within a text. In recent years, most methods have relied on pre-trained language models such as BERT and Roberta to learn semantic representations from the context. However, in texts with ambiguous sentiment expression, the absence of domain knowledge guidance may lead pre-trained language models to miss critical information, and the attention mechanism might incorrectly focus on text that is irrelevant to the aspect categories. To address these issues, this study integrates the ontology of movie reviews to construct an aspect-based sentiment analysis model based on the ERNIE(OMR-EBA). We annotated a new Chinese data set focused on movie reviews to evaluate the model’s performance. Experimental results show that our model achieves 86% accuracy in aspectual sentiment analysis, which is better than other baseline models. The movie review domain ontology and aspect-based sentiment analysis model proposed in this study can provide valuable reference and guidance for research in the field of online movie reviews. It can also help movie production teams understand genuine user sentiments, aiding in subsequent marketing and production efforts.