stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy-docs.vercel.app/
MIT License
14.65k stars 1.12k forks source link

How to ?(Summarization+Task specific text generation) #212

Open gabgen opened 8 months ago

gabgen commented 8 months ago

Hi everybody , I already read all the issues, and many of them seem to struggle framing the solution with this new approach. I am here to join the crew :)

So my situation is : I have a text and I want to extract the most important points , along with evidences for each of these points. After that I would like to use this extracted information to create a discourse based on that , according to some constraints, rules, and suggestions and specific tone.

As you can imagine it's a lot of work : you have to specify what do you want to extract, how , you have to specify you don't want to expose the same information twice even if it's present in the original text. Maybe you want to specify the tone to use. All this specs are usually long to write and in general it doesn't seem the framework fits with this usage.

Can you help me figure out how to do that ?

krishna-praveen commented 5 months ago

Yes i am looking for the same. Hopefully this gets solved too. But just for thought, do we have to create the input output dataset ourselves and use dspy to let it figure out ?

okhat commented 5 months ago

@krishna-praveen You just need inputs + metric, you don't need labels for the steps (except whatever the metric needs)

krishna-praveen commented 5 months ago

@okhat Can you please let me know if there is any example tutorial addressing this summarization problems?

shivamnegi92 commented 4 months ago

@okhat having similar use case-

Couple of things which can work but need more analysis and benchmarking-

  1. Having a prompt dictionary which are based on rules and filters one want to apply . That prompt dictionary will have all the required relevant info for question/ answer based summarization. Just that it may not give the passage from which the summary - points are extracted.

  2. Building RAG framework can be a way.

I am also looking for examples.

arthurbm commented 3 months ago

I'm looking for the same! If anyone has examples, I would be very grateful

edgarbc commented 3 weeks ago

Hi all, I am also working on a similar use case, given certain parameters, I want an llm to summarize the most relevant information. So looking for some DSPy examples on similar tasks...

pierrevalade commented 3 weeks ago

Hi all, I am also working on a similar use case, given certain parameters, I want an llm to summarize the most relevant information. So looking for some DSPy examples on similar tasks...

@edgarbc what are the parameters you're thinking about?