Zeta / synopsis_chain.py
Ritvik19's picture
Improved Synopsis
c44c8ed verified
raw
history blame
No virus
2.7 kB
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser
synopsis_prompt_template = """
Research Paper: {paper}
Your task is to write a comprehensive and detailed summary of the given research paper in Markdown format.
The summary should be designed to serve as a standalone document that provides all essential insights from the original paper, allowing readers to understand the core findings, methodologies, and implications without needing to consult the original paper.
Adhere to the following guidelines to ensure the summary meets the required standards:
1. **Comprehensive Coverage**: Include all key points, findings, methodologies, and conclusions from the research paper. The summary should capture the essence of the paper, including its purpose, research questions, study design, results, and significance.
2. **In-depth Methodology Analysis**: Provide a detailed examination of the research paper's methodology. Highlight the design, approach, and techniques with precision and depth, ensuring this section is the focal point of your summary.
3. **Independent Writing Style**: Write the summary in your own words, ensuring it reads as an independent article. Do not reference the original author(s) or the paper directly within the text, and avoid phrases that imply direct quotations or attributions.
4. **Structured Format**: Utilize Markdown formatting to organize the summary effectively. Use headings, subheadings, and bullet points to structure the content, making it accessible and easy to navigate.
5. **Clarity and Precision**: Ensure that the summary is written clearly and concisely, avoiding technical jargon where possible and explaining necessary terms. The goal is to make the summary informative and understandable to readers with a general background in the subject area.
6. *Results with References**: Explicitly mention relevant figures or tables when discussing the results. This inclusion should aid in illustrating the paper's findings more vividly and accurately.
**Expected Output**:
- A Markdown document that adheres to the guidelines provided, effectively summarizing the research paper.
- The summary should include sections for the introduction, methodology, results, discussion, and conclusion, with paragraphs for explanations and bullet points used to list key findings and implications.
- The document should be atleast 1,500 words to ensure in-depth coverage.
"""
synopsis_output_parser = StrOutputParser()
synopsis_prompt = PromptTemplate(
template=synopsis_prompt_template,
input_variables=["paper"],
)
synopsis_chain = lambda model: synopsis_prompt | model | synopsis_output_parser