Middle-word prompts are automatically generated text templates used to probe and extract relational knowledge from language models by extracting the words that appear between a subject entity and an object entity in natural language text. Based on the observation that intervening words frequently express the semantic relation connecting two entities, this mining-based method locates sentences containing known entity pairs and replaces those entities with placeholders while preserving the text between them. Serving as an alternative to manually written templates or dependency-tree parsing methods, middle-word prompts offer an automated and scalable approach to query pre-trained models, thereby helping to assess and retrieve the factual knowledge stored within their parameters more accurately.