Text this: Enhancing environmental sustainability with federated LSTM models for AI-driven optimization