Aye10032
commited on
Commit
·
464f480
1
Parent(s):
3fa928f
修改提示词
Browse files
pages/AcademicTranslate.py
CHANGED
@@ -39,16 +39,15 @@ def ac_translate(original_text: str, is_en2zh: bool):
|
|
39 |
if is_en2zh:
|
40 |
_prompt = ChatPromptTemplate.from_messages(
|
41 |
[
|
42 |
-
SystemMessage(content="
|
43 |
-
|
44 |
-
"对于文中的专有名词或公式等,可以保持原有英文不做翻译。下面是你需要翻译的句子:\n{original_text}")
|
45 |
]
|
46 |
)
|
47 |
else:
|
48 |
_prompt = ChatPromptTemplate.from_messages(
|
49 |
[
|
50 |
SystemMessage(content="你的任务是以**学术论文的风格**将用户给出的中文文本翻译成英文,务必注意不能漏翻或错翻。"),
|
51 |
-
|
52 |
]
|
53 |
)
|
54 |
|
|
|
39 |
if is_en2zh:
|
40 |
_prompt = ChatPromptTemplate.from_messages(
|
41 |
[
|
42 |
+
SystemMessage(content="你的任务是以**学术论文的风格**将用户给出的英文文本翻译为中文,务必注意不能漏翻或错翻。对于专有名词或公式等,若没有合适的译文可以保留原本英文文本不做翻译。"),
|
43 |
+
("human", "这是你需要翻译的句子:\n{original_text}\n\n注意你的回答只需要给出翻译后的英文文本,不要包含其他东西")
|
|
|
44 |
]
|
45 |
)
|
46 |
else:
|
47 |
_prompt = ChatPromptTemplate.from_messages(
|
48 |
[
|
49 |
SystemMessage(content="你的任务是以**学术论文的风格**将用户给出的中文文本翻译成英文,务必注意不能漏翻或错翻。"),
|
50 |
+
("human", "这是你需要翻译的句子:\n{original_text}\n\n注意你的回答只需要给出翻译后的英文文本,不要包含其他东西")
|
51 |
]
|
52 |
)
|
53 |
|