CoolFace
Apppublic

fufa/chatgpt

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
functional.py55 linesDownload Raw Back to root
1# 'primary' 颜色对应 theme.py 中的 primary_hue2# 'secondary' 颜色对应 theme.py 中的 neutral_hue3# 'stop' 颜色对应 theme.py 中的 color_er4# 默认按钮颜色是 secondary5from toolbox import clear_line_break6 7def get_functionals():8    return {9        "英语学术润色": {10            # 前言11            "Prefix":   r"Below is a paragraph from an academic paper. Polish the writing to meet the academic style, " +12                        r"improve the spelling, grammar, clarity, concision and overall readability. When neccessary, rewrite the whole sentence. " +13                        r"Furthermore, list all modification and explain the reasons to do so in markdown table." + "\n\n",14            # 后语 15            "Suffix":   r"",16            "Color":    r"secondary",    # 按钮颜色17        },18        "中文学术润色": {19            "Prefix":   r"作为一名中文学术论文写作改进助理,你的任务是改进所提供文本的拼写、语法、清晰、简洁和整体可读性," + 20                        r"同时分解长句,减少重复,并提供改进建议。请只提供文本的更正版本,避免包括解释。请编辑以下文本" + "\n\n",21            "Suffix":   r"",22        },23        "查找语法错误": {24            "Prefix":   r"Below is a paragraph from an academic paper. " +25                        r"Can you help me ensure that the grammar and the spelling is correct? " +26                        r"Do not try to polish the text, if no mistake is found, tell me that this paragraph is good." + 27                        r"If you find grammar or spelling mistakes, please list mistakes you find in a two-column markdown table, " + 28                        r"put the original text the first column, " +29                        r"put the corrected text in the second column and highlight the key words you fixed." + "\n\n",30            "Suffix":   r"",31            "PreProcess": clear_line_break,    # 预处理:清除换行符32        },33        "中译英": {34            "Prefix":   r"Please translate following sentence to English:" + "\n\n",35            "Suffix":   r"",36        },37        "学术中译英": {38            "Prefix":   r"Please translate following sentence to English with academic writing, and provide some related authoritative examples:" + "\n\n",39            "Suffix":   r"",40        },41        "英译中": {42            "Prefix":   r"请翻译成中文:" + "\n\n",43            "Suffix":   r"",44        },45        "找图片": {46            "Prefix":   r"我需要你找一张网络图片。使用Unsplash API(https://source.unsplash.com/960x640/?<英语关键词>)获取图片URL," +47                        r"然后请使用Markdown格式封装,并且不要有反斜线,不要用代码块。现在,请按以下描述给我发送图片:" + "\n\n",48            "Suffix":   r"",49        },50        "解释代码": {51            "Prefix":   r"请解释以下代码:" + "\n```\n",52            "Suffix":   "\n```\n",53        },54    }55