Aye10032 commited on
Commit
464f480
·
1 Parent(s): 3fa928f

修改提示词

Browse files
Files changed (1) hide show
  1. pages/AcademicTranslate.py +3 -4
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="You are an AI academic assistant and should answer user questions rigorously."),
43
- HumanMessage(content="你的任务是以**学术论文的风格**将一段英文文本翻译为中文,不能漏翻或错翻。\n"
44
- "对于文中的专有名词或公式等,可以保持原有英文不做翻译。下面是你需要翻译的句子:\n{original_text}")
45
  ]
46
  )
47
  else:
48
  _prompt = ChatPromptTemplate.from_messages(
49
  [
50
  SystemMessage(content="你的任务是以**学术论文的风格**将用户给出的中文文本翻译成英文,务必注意不能漏翻或错翻。"),
51
- HumanMessage(content="这是你需要翻译的句子,你只需要给出翻译后的英文文本,不需要回答其他的内容:\n{original_text}")
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