Retrieve a top x list out of a large list

I’ve got a bunch of items in a big list, and each item has some info like a name, rank, grade, and description. My task is to pick out the top 10 items from this list, following the instructions I’ve been given for chat completion.

Here’s a simpler prompt:

{
    "role": "system", "content": "You act as a filter service."
},
{
    "role": "user",
    "content": f"Given a list of students ranking: {students}, please filter out the top 10 most promissing students. Please retrieve the list in the same format you got it without any further dialogue.",
}

I’ve tried splitting up the list because it’s so long, but that just made things messy and slow. Any thoughts or ideas on how to deal with this problem would be really helpful!

Hi and welcome to the Developer Forum!

Assuming this is a fixed format list of items then AI is not the way to solve this problem, traditional code can perform this task using almost no compute and with perfect accuracy.

AI is good at tasks that humans are good at and bad at the same things we are bad at, long lists of things, big groups of numbers, etc. are classical code friendly.

The best use of AI in this instance would be to ask ChatGPT to write the python code to do this classically and give it a small section of the list as a guide to the data types and format.

1 Like

You are correct,
my example was not good at all.

What I’m trying to achieve is a ‘most relevant objects’ from a list of objects in regards to some specific topic.

For example (hopefully this will make more sense), let’s say the topic is ‘what should I take to my trip to Africa’, and the list of objects is many different type of things i can take to a trip (or maybe even not only to a trip) such as backpack, books, tools or whatever, and also having some data regarding each item like price, where to buy or something like that.

But the list is so long that for me to go over that list and pick the top 10 things will not only require research on every object but can also take a lot of time, not to mention that I honestly can’t think of a way to solve it using traditional code.

It’s true that the AI might not retrieve the most optimal list, but what essentially I’m trying to do here, is to give the AI a list of objects with metrics and data on every object and ask it to return me the list of the top objects that would be the most relevant to a specific given topic.

I hope that makes it more clear:)