Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bench): evaluate review writing in ReviewBench #917

Merged
merged 22 commits into from
Jan 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
init
timsanders256 committed Nov 30, 2024
commit c0a359cc45821ad6653ac39190ce04188fc27f99
38 changes: 38 additions & 0 deletions research_bench/review_writing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
Review Writing Process Evaluation
Input: Real-world Papers
Process: Match Reviewers to Papers with Similar Interests
Evaluate Reviewers' Reviews using Similarity Metrics
Output: Reviewers' Similarity Scores
"""

from typing import List

from research_town.agents import AgentManager
from research_town.configs import Config
from research_town.data import Profile
from research_town.dbs import LogDB, PaperDB, ProfileDB, ProgressDB
from research_town.envs import ReviewWritingEnv
from research_town.utils.model_prompting import model_prompting

# Baseline
def write_proposal_with_only_citations(intro: str, ref_contents: List[str], config: Config) -> str:
ref_strs = '\n'.join([ref for ref in ref_contents if ref is not None])

prompt = [
{
'role': 'user',
'content': (
'Here is the introduction of a paper:\n'
f'{intro}\n'
'Here are the references of the paper:\n'
f'{ref_strs}\n'
'Please write a proposal based on the introduction and references. You should write two paragraphs, each of approximately 200 words.\n'
'First paragraph should start with Strength -\n'
'Second paragraph should start with Weakness -\n'
),
}
]
response = model_prompting(config.param.base_llm, prompt, max_token_num=config.param.max_token_num)[0]
return response