This patent discloses techniques for adapting previously-annotated training examples into updated training examples for training machine learning models. The core idea involves identifying a specific part (the "find expression") within a targeted subset of training examples (defined by a "filtering constraint") and replacing it with a new part (the "replacement expression"). This process allows for efficient modification of existing training data to reflect changes in system capabilities, user expectations, or to correct inaccuracies.