DEV Community

Graph + LLM or simply LLM for summarization?

The author is exploring ways to generate a summary of multiple documents based on certain criteria. They are considering two approaches: creating a graph and using a large language model (LLM) to generate a summary or answer queries, or creating summaries of individual documents and then combining them. The author has written code to fetch news articles on a topic, create a graph, and summarize the information. The code uses the DuckDuckGo search API to fetch news articles, and the Generative AI API to extract entities and relationships from the articles. The entities and relationships are used to create a graph, which is then used to generate a summary of the topic. The author is unsure if creating a graph is the best approach and is seeking opinions. The code uses the NetworkX library to create the graph and the Matplotlib library to visualize it. The author is using the Gemini 1.5 Flash 002 model to generate content, including the summary. The generated summary is a 500-800 word story that utilizes the relationships between different news articles. The author is looking to improve their approach and is open to suggestions.
favicon
dev.to
dev.to