|
|
@@ -7,7 +7,7 @@ async function runScript(){
|
|
7
|
7
|
try {
|
|
8
|
8
|
|
|
9
|
9
|
//按照高频单词的使用频率排序,列出所有单词
|
|
10
|
|
- const sql="select * from Words where BookID=110 and (ExampleSentence is null or ExampleSentence='') order by ID;"
|
|
|
10
|
+ const sql="select * from Words where BookID=110 and (TranslateEng is null or TranslateEng='') order by ID;"
|
|
11
|
11
|
let list = await commonModel.RunSql(null,sql);
|
|
12
|
12
|
let count=list.length;
|
|
13
|
13
|
|
|
|
@@ -25,28 +25,21 @@ async function runScript(){
|
|
25
|
25
|
const word=item.Word;
|
|
26
|
26
|
|
|
27
|
27
|
let content={
|
|
28
|
|
- "instruction": "用单词"+word+"生成例句,中国学生学习英文使用",
|
|
|
28
|
+ "instruction": "用单词"+word+"生成英英翻译",
|
|
29
|
29
|
"requirements": [
|
|
30
|
|
- "判断单词在CEFR的最低级别,比如experience是B1",
|
|
31
|
|
- "用单词最常用的含义生成最低级别到C1各两句例句,比如experience生成B1、B2、C1各两句",
|
|
32
|
|
- "单词允许类似过去式、复数等变形",
|
|
33
|
|
- "提供例句翻译",
|
|
34
|
|
- "格式要求是JSON格式,完全遵循output_format,另外生成不要有重复“\"”",
|
|
|
30
|
+ "中国学生学习英文使用",
|
|
|
31
|
+ "如果有多个含义,生成一到三个最常用的不同翻译",
|
|
|
32
|
+ "每个翻译前面要有词性(可以多个词性)",
|
|
|
33
|
+ "尽量用A1、A2单词作为翻译的单词",
|
|
|
34
|
+ "格式要求是JSON格式,完全遵循output_format样例格式,另外生成不要有重复“\"”",
|
|
35
|
35
|
"如果有多个方案,直接给最好的"
|
|
36
|
36
|
],
|
|
37
|
37
|
"output_format":{
|
|
38
|
|
- "word":"单词",
|
|
39
|
|
- "CEFR_Level":"A1",
|
|
40
|
|
- "Sentences": [
|
|
41
|
|
- {
|
|
42
|
|
- "Sentence":"句子1",
|
|
43
|
|
- "Translate": "翻译1",
|
|
44
|
|
- "Level": "A1",
|
|
45
|
|
- },{
|
|
46
|
|
- "Sentence":"句子2",
|
|
47
|
|
- "Translate": "翻译2",
|
|
48
|
|
- "Level": "A2",
|
|
49
|
|
- },
|
|
|
38
|
+ "word":"spring",
|
|
|
39
|
+ "Translate": [
|
|
|
40
|
+ 'n. the season of the year between winter and summer, lasting from March to June north of the equator, and from September to December south of the equator, when the weather becomes warmer, leaves and plants start to grow again and flowers appear',
|
|
|
41
|
+ 'n. a piece of curved or bent metal that can be pressed into a smaller space but then returns to its usual shape',
|
|
|
42
|
+ 'n. a place where water naturally flows out from the ground'
|
|
50
|
43
|
]
|
|
51
|
44
|
}
|
|
52
|
45
|
};
|
|
|
@@ -93,7 +86,7 @@ async function runScript(){
|
|
93
|
86
|
|
|
94
|
87
|
|
|
95
|
88
|
//console.log(result);
|
|
96
|
|
- let sql2="update Words set ExampleSentence=? where ID="+item.ID+";";
|
|
|
89
|
+ let sql2="update Words set TranslateEng=? where ID="+item.ID+";";
|
|
97
|
90
|
await commonModel.RunSql(result,sql2);
|
|
98
|
91
|
|
|
99
|
92
|
console.log( i +"/"+ list.length+" "+word);
|