Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,29 @@
|
|
1 |
-
---
|
2 |
-
license: cc-by-nc-sa-4.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-sa-4.0
|
3 |
+
---
|
4 |
+
|
5 |
+
prompt格式:
|
6 |
+
```python
|
7 |
+
gpt_dict = [{
|
8 |
+
"src": "原文1",
|
9 |
+
"dst": "译文1",
|
10 |
+
"info": "注释信息1",
|
11 |
+
},]
|
12 |
+
gpt_dict_text_list = []
|
13 |
+
for gpt in gpt_dict:
|
14 |
+
src = gpt['src']
|
15 |
+
dst = gpt['dst']
|
16 |
+
info = gpt['info'] if "info" in gpt.keys() else None
|
17 |
+
if info:
|
18 |
+
single = f"{src}->{dst} #{info}"
|
19 |
+
else:
|
20 |
+
single = f"{src}->{dst}"
|
21 |
+
gpt_dict_text_list.append(single)
|
22 |
+
|
23 |
+
gpt_dict_raw_text = "\n".join(gpt_dict_text_list)
|
24 |
+
|
25 |
+
user_prompt = "根据以下术语表(可以为空):\n" + gpt_dict_raw_text + "\n" + "将下面的日文文本根据对应关系和备注翻译成中文:" + japanese
|
26 |
+
prompt = "<|im_start|>system\n你是一个轻小说翻译模型,可以流畅通顺地以日本轻小说的风格将日文翻译成简体中文,并联系上下文正确使用人称代词,不擅自添加原文中没有的代词。<|im_end|>\n" \ # system prompt
|
27 |
+
+ "<|im_start|>user\n" + user_prompt + "<|im_end|>\n" \ # user prompt
|
28 |
+
+ "<|im_start|>assistant\n" # assistant prompt start
|
29 |
+
```
|