代码拉取完成,页面将自动刷新
# This template is specifically for importing/sharing, using better
# notes 'import from clipboard': copy the content and
# goto Zotero menu bar, click Edit->New Template from Clipboard.
# Do not copy-paste this to better notes template editor directly.
name: "[text] Paper Summary"
content: |-
// @use-markdown
// @author Polygon
// @link https://gitee.com/zotero-chinese/zotero-magic-for-user/blob/master/paper-summary.yaml
// @warning 文献的基本结构包括: 1. introduction, 2. method,3. result, 4 discussion
${{
// ✍️可修改[0]为[1]
sharedObj.by = ["Magic", "Grobid"][0]
// ✍️可修改"简体中文"为"其它语言"
sharedObj.language = "简体中文"
sharedObj.itemID = targetNoteItem ? (await targetNoteItem.parentItem.getBestAttachment()).id: undefined;
sharedObj.setGPTText = async (text) => {
const window = Zotero.getMainWindow()
await window.Meet.Global.views.show()
window.Meet.Global.views.inputContainer.querySelector("input").value = text
}
sharedObj.getBasicInfo = async () => {
return await Zotero.ZoteroMagic.api.paperSummary.getBasicInfo(sharedObj.by, sharedObj.itemID)
}
sharedObj.getSectionInfo = async (keywords) => {
return await Zotero.ZoteroMagic.api.paperSummary.getSectionInfo(keywords, sharedObj.by, sharedObj.itemID)
}
sharedObj.setGPTSystemMsg = () => {
const window = Zotero.getMainWindow()
window.Meet.Global.views.messages = [
{
"role": "system",
"content": "You are a researcher in the field of [___studyField___] who is good at summarizing papers using concise statements"
}
]
}
sharedObj.getGPTResponseText = async (question) => {
if (_env.dryRun) {return "GPT回答内容"}
const window = Zotero.getMainWindow()
return await window.Meet.Global.views.execText(question)
}
return `# Magic Zotero Paper Summary全文总结\n⏰创建时间:${new Date().toLocaleString()}`
}}$
# 基本信息
${{
await sharedObj.setGPTText("GPT正在总结[基本信息]...")
const basicInfo = await sharedObj.getBasicInfo();
const text = JSON.stringify(basicInfo);
sharedObj.setGPTSystemMsg()
// ✍️可修改以下内容
return await sharedObj.getGPTResponseText(`
This is the title, author, link, abstract and introduction of an English document. I need your help to read and summarize the following questions:
${text}
---
- 📰标题: (这里填充本文标题,翻译成中文后的)
- 🖋️作者: (填充本文第一作者,英文形式)
- 🏛️机构: (填写第一作者所属单位,英文+中文)
- 🔥关键词: (填写本文关键词,英文形式)
## 摘要概述
(这里务必空两行)
---
(
简要概述本文摘要填充下列markdown表格,如未提及请用"-"表示,markdown格式输出,这句话不要输出,仅仅输出表格
|项目|内容|
|--|--|
|📖研究背景||
|🎯研究目的||
|✍️研究方法||
|🕊️研究对象||
|🔍研究结论||
|⭐创新点||
)
请用 ${sharedObj.language} 作答(专业词汇仍使用英语), statements as concise and academic as possible, 请不要将括号内要求输出。输出内容根据\n换行,严格按照上述格式输出。
`)
}}$
# 背景
${{
await sharedObj.setGPTText("GPT正在总结[背景]...")
// ✍️可修改["intro"]为["有关背景的副标题1", "有关背景的副标题2"]
const sectionInfo = await sharedObj.getSectionInfo(["intro"])
const text = JSON.stringify(sectionInfo);
// ✍️可修改以下内容
return await sharedObj.getGPTResponseText(`
This is the <introduction> part of an English literature, I need your help to summarize the following questions:
${text}
---
按照如下格式概括:
- 研究背景: (What is the research background of this article?)
- 过去方案: (What are the past methods? What are the problems with them? Is the approach well motivated?)
- 研究动机: (为什么要开展本研究)
请用 ${sharedObj.language} 作答(专业词汇仍使用英语), statements as concise and academic as possible, 请不要将括号内要求输出。
`)
}}$
# 方法
${{
await sharedObj.setGPTText("GPT正在总结[方法]...")
// ✍️可修改["method"]为["有关方法的副标题1", "有关方法的副标题2"]
const sectionInfo = await sharedObj.getSectionInfo(["method"])
const text = JSON.stringify(sectionInfo);
// ✍️可修改以下内容
return await sharedObj.getGPTResponseText(`
This is the <Method> part of an English document, I need your help to read and summarize the following questions.
${text}
---
Describe in detail the methodological idea of this article. 按照如下格式输出:
- 理论背景: (这里概述本研究的理论基础)
- 技术路线: (这里概述本研究的实现过程)
请用 ${sharedObj.language} 作答(专业词汇仍使用英语), statements as concise and academic as possible, 请不要将括号内要求输出。
`)
}}$
# 结论
${{
await sharedObj.setGPTText("GPT正在总结[结论]...")
// ✍️可修改["conclu", "result", "disscuss"]为["有关结论的副标题1", "有关结论的副标题2"]
const sectionInfo = await sharedObj.getSectionInfo(["conclu", "result", "disscuss"])
const text = JSON.stringify(sectionInfo);
// ✍️可修改以下内容
return await sharedObj.getGPTResponseText(`
This is the <conclusion> part of an English literature, I need your help to summarize the following questions:
${text}
---
按照下面格式输出:
- (此处概述本文的研究意义)
- (此处总结研究的优缺点,未提及则不用回答)
- 主要结论: (1)xxx; (2)xxx; ... (此处依次罗列文章的主要结论,如果没有不用回答)
请用 ${sharedObj.language} 作答(专业词汇仍使用英语), statements as concise and academic as possible, 请不要将括号内要求输出。
`)
}}$
${{
const window = Zotero.getMainWindow()
await Zotero.Promise.delay(1000)
window.Meet.Global.views.hide()
let model = window.Meet.Connector ? window.Meet.Connector.AI : Zotero.Prefs.get("extensions.zotero.zoterogpt.model", true);
targetNoteItem.setTags([{tag: "🤖全文总结"},{ tag: `🤖${model}`}]);
await targetNoteItem.saveTx();
return ""
}}$
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。