1 Star 0 Fork 5

l0o0/zotero-magic-for-user

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
paper-summary.yaml 6.50 KB
一键复制 编辑 原始数据 按行查看 历史
l0o0 提交于 2023-11-02 04:53 . template: 添加期刊标签信息
# 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)
}
if (Zotero.ZoteroStyle.api.renderCell) {
pubtitle = Zotero.ZoteroStyle.api.renderCell(targetNoteItem.parentItem, "PublicationTags").innerText
}
return `# Magic Zotero Paper Summary全文总结\n⏰创建时间:${new Date().toLocaleString()}` + (pubtitle ? "\n🎯期刊标签:" + pubtitle : "")
}}$
# 基本信息
${{
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()
return ""
}}$
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/l0o0/zotero-magic-for-user.git
git@gitee.com:l0o0/zotero-magic-for-user.git
l0o0
zotero-magic-for-user
zotero-magic-for-user
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385