How can I tell the AI to just consider the text of an article?

I am trying to find the right prompt to output some questions from an article. I want that the answer is present in the text of the article. How can I do that?

I tried something like this: “Write 3 questions from the following article, using only its content: URL”

But it often outputs something that is not in the article, even if the question is related to the topic.

Thank you.

Not even sure if GPT-3 is reading the URL content? I can’t pass the body of the article to the prompt as it’s too much text though. Any thoughts?

GPT-3 is not going to open links.

GPT-3 Can not open links. It is not able to. You could write code to take the contents of the link and send it to GPT-3 but it will still have the same token limit. Your best bet is to summarise the contents of the link.

Try this: Split the content of the article into chunks and then get embeddings for the chunks and store them in a database. Embed the user input and use cosine similarity to find the top n most similar chunks, where n is the number of chunks that can fit into the prompt. Provide a prompt that includes the n chunks and instructions to use that information to answer the question.

2 Likes

I use the Python NTLK library via API to drastically reduce the size of articles up to 50% and then run them through Davinci for various tasks.
NTLK works quite well and will enable you to use articles up to approx 4000 words (reduced size will be 2300-2600 approx).

For articles larger than 4000 words you will need to use the embeddings approach mentioned by @lmccallum

Can you explain how are you doing that?

Here is a good explanatory article: