This study investigates several factors influencing the well-known price/earnings ratio (P/E), with particular emphasis on investor sentiment scores obtained from textual data using natural language processing models. Data consisting of various economic indicators and user-generated text messages from the social network Twitter were collected for several established firms that were categorized into two sectors. Sentiment scores from the textual data were obtained using the BERT and FinBERT language models and shown to exhibit a high level of accuracy. Fixed and random effect regression models considering panel data comprising the economics indicators and sentiment scores were constructed and revealed statistically significant influences of sentiment on the P/E ratio in one sector. A Long Short-Term Memory recurrent neural network model was then used to forecast the P/E ratio over a one year interval, which produced highly accurate results. Our analysis demonstrates the significance of investor sentiment as a factor in P/E ratio forecasting, emphasizing its contribution alongside other fundamental factors.