Find a specific type of text, else return null => fails constantly :-(

I’m trying to get ChatGPT 4 to analyse huge amounts of texts but only return very specific content:

Please locate a maximum of one section in the text below that is dedicated solely to recounting direct encounters and interactions with human locals of the country. For clarity, “human locals” refers to people native to the country, and the section should not include interactions with cultural or historical sites, monuments, or non-human entities. This section should vividly capture emotionally relevant aspects such as humor, sadness, cheerfulness, uncertainty, gratitude, astonishment, pity, compassion, anger, or other human emotions or states. The identified section must be at least 100 words long. If no section satisfies these criteria, return {“section”: null}.

Output as:
{"section":{"start":"[FIRST DISTINCT CHARS]","end":"[LAST DISTINCT CHARS]","summary":"[MAX 150 CHARACTERS]"}/null}

But whatever I do, it almost never returns null as a result. Instead it returns all kinds of crap that does not include any local people.

I’ve been through multiple rounds of “ChatGPT, make the prompt clearer”, now I’m out of ideas :frowning:

Any help very much appreciated!

This is not something the model is particularly well-suited to doing. You will be unlikely to be able to get it to perform this task reliably.

This task is better suited to an embedding model and a vector database using semantic search.

ChatGPT is the web product at

An API AI won’t know it is ChatGPT unless you told it that in system programming.

Assuming the document fits within context, you need to provide clear unmistakable simple rules: Demonstration:

AI Task: from provided text, extract only passages that meet criteria

  • If no text within document meets criteria, output is “none”;
  • If you find a passage exactly matching criteria, output up to 100 words of that section verbatim.

Criteria: Anthropological emotion-filled interactions with living natives

Quality analysis of prompt

The provided instruction sets a clear task for another AI, which is to extract passages from a given text that meet specific criteria. The criteria, “Anthropological emotion-filled interactions with living natives,” introduces a nuanced and specific requirement. Here’s an analysis of how this instruction and criteria would program the AI to act on documents, along with examples:


  1. Focus on Anthropological Interactions: The criteria narrows down the focus to anthropological interactions, implying that the extracted passages should primarily pertain to anthropological studies, observations, or engagements.

  2. Emotion-Filled Interactions: The criteria now introduces the element of emotions, suggesting that the extracted content should emphasize the emotional aspects of these interactions. This could include feelings, reactions, or sentiments expressed during anthropological encounters.

  3. Living Natives: The requirement specifies that these interactions should involve living native populations, further refining the scope of the extracted passages to situations where anthropologists engage with currently existing indigenous or native communities.

Examples of Passages That Would Be Extracted:

  1. Fieldwork Among the Yanomami Tribe: “During our fieldwork among the Yanomami tribe, we witnessed deeply emotion-filled interactions as the community shared their stories of resilience in the face of adversity. The natives’ expressions of pride and determination were palpable.”

  2. Interviews with Inuit Elders: “Our interviews with Inuit elders revealed heartwarming stories of their ancestral traditions. The emotional depth of their narratives provided a unique insight into the cultural heritage of these living natives.”

Examples of Passages That Would Not Be Extracted:

  1. History of Anthropology: “This document provides a historical overview of the field of anthropology, tracing its evolution from the early days to modern times.”

    • This passage discusses the history of anthropology but lacks the emotional and interactional focus on living natives.
  2. Methods in Anthropological Research: “Anthropologists use various research methods, including participant observation, ethnography, and surveys, to study different cultures.”

    • While it mentions anthropological research methods, it doesn’t emphasize emotion-filled interactions with living natives.
  3. Cultural Theories in Anthropology: “This chapter explores various cultural theories in the field of anthropology, from structuralism to postmodernism.”

    • This passage discusses cultural theories within anthropology but doesn’t delve into emotional interactions with native populations.

In this refined instruction, the AI is expected to extract passages that not only involve anthropological interactions with living natives but also highlight the emotional aspects of these interactions. This added dimension provides a more specific and nuanced context for content extraction, ensuring that the AI focuses on passages that meet these criteria.

Hello _j,

thank you so much for your helpful answer! Took me a while to implement your recommendations, but now I finally seem to get better results! Still needs some testing though…

Loved the Yanomami reference as just 2 months ago I had the pleasure of meeting 4 leaders of the tribe :hearts: