Skip to content

Instantly share code, notes, and snippets.

@mcminis1
Last active June 12, 2024 11:04
Show Gist options
  • Save mcminis1/8cadf6b925df4bde5009e358270e5b60 to your computer and use it in GitHub Desktop.
Save mcminis1/8cadf6b925df4bde5009e358270e5b60 to your computer and use it in GitHub Desktop.
```
tools = [
{
"name": "article_analysis",
"description": "Analyzes an academic article abstract and provides key information extracted from it. This includes named entities mentioned in the abstract along with their types and context, the main topics covered in the abstract, an assessment of the overall quality of the abstract on a 0-1 scale, and a 0-1 score indicating the novelty or originality of the work described in the abstract compared to existing literature. The tool takes the raw text of the article title, abstract, and authors as input. It should be used to quickly summarize and assess an academic article when only the abstract is available. The tool does not analyze the full article text, only the title and abstract.",
"input_schema": {
"type": "object",
"properties": {
"entities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The extracted entity name.",
},
"type": {
"type": "string",
"description": "The entity type (e.g. PERSON, ORGANIZATION, LOCATION, TECHNIQUE, METRIC, MATERIAL, TASK).",
},
"context": {
"type": "string",
"description": "The context sentence in which the entity appears in the abstract.",
},
},
"required": ["name", "type", "context"],
},
},
"topics": {
"type": "array",
"items": {"type": "string"},
"description": "The 3-8 key topics or research areas covered in the article based on the abstract. Each topic should be 1-3 words.",
},
"quality_score": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "A score from 0-1 assessing the overall quality of the article abstract in terms of clarity, informativeness, and adherence to academic standards. 0 is lowest quality, 1 is highest.",
},
"novelty_score": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "A score from 0-1 assessing the likely originality and novelty of the article's contributions compared to existing literature, based on the abstract. 0 is not novel, 1 is highly novel.",
},
},
"required": ["entities", "topics", "quality_score", "novelty_score"],
},
}
]
system_prompt = """You are an AI research assistant that analyzes academic article information to extract key details.
You have access to the `article_analysis` tool which requires the following input:
- Named entities mentioned in the abstract, including research techniques, metrics, datasets, materials, etc.
- The key topics and research areas covered in the article based on the abstract
- A 0-1 quality score assessing the abstract's clarity, informativeness, and adherence to academic standards
- A 0-1 novelty score estimating the originality of the work compared to existing literature
When asked to analyze an article, use the `article_analysis` tool and return only its JSON input.
Do not return the title, abstract, and authors in your reply.
Use the `article_analysis` tool and provide the "entities", "topics", "quality_score", and "novelty_score"."""
user_prompt = """<article>
Title: {title}
Abstract: {description}
Authors: {authors}
</article>
Do not return the title, abstract, and authors in your reply.
Use the `article_analysis` tool to extract the "entities", "topics", "quality_score", and "novelty_score".
"""
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment