Improved paraphrases for single sentences

so i have a prompt created that allows you to paraphrase a paragraph of text but what im having an issue with is being able to only paraphrase a sentence at a time inside of an application we built that still keeps the context of whats going on around it. Is there any way to only send off or paraphrase one sentence out of a paragraph and give it some context from the sentences around it so that its still on topic.

Do you use the playground or the openai API?

If you use the openai API, you can paraphrase the entire paragraph with completions API and then

  1. Split the output into sentences
  2. Pass each output sentence as documents and compare it’s similarity with the sentence you want to paraphrase by using the semantic search API.
  3. Return the output sentence with the highest similarity to the original sentence you want to paraphrase. If the paraphrase mean the same thing as the original sentence then it will give you a very high similarity score!

Hope that helps!

1 Like

This is a non-trivial problem which I address in my book. You will need to use prompt-chaining or metaprompting, as well as using a recall service to achieve this.

But before going that far, why are you trying to paraphrase individual sentences without the context of their neighboring sentences? This goal doesn’t make much sense to me. Whatever it is that you’re trying to achieve can probably be accomplished through other means. It’s unlikely that you have to delve into such fine jiggery pokery to get the results you want.

Abel and Dave,

I just did a search for this exact scenario, and I have the same requirements.

There are use cases where paraphrasing individual sentences (while retaining contextual relevance) is important. In fact, in my use case, even the word count of each sentence is important (which can obviously be done on the collected output).

Dave - You mentioned that this could probably be accomplished through other means. Could you elaborate on that a bit? Thx!

Fine-tuning, but I’d need examples because this use case does not make any sense to me.

Without getting into details, let’s say that someone was using GPT-3 to create a Trivial Pursuit style word game (or more like that Pyramid game show where questions are on a specific topic), and needed output that was shorter than paragraphs, but on-topic more than an isolated sentence island.

The actual use case is nothing like that, but that’s a reasonably good analogy. I’d be happy to go into further detail over email.

1 Like

It’s not a secret, it’s just complicated.

It’s much easier to discuss something similar, but simpler.

1 Like