inksiyu commited on
Commit
c871381
1 Parent(s): 648f0ec

Upload 14 files

Browse files
appbf.py ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, render_template, request, jsonify, Response
2
+ import requests
3
+ import json
4
+ import logging
5
+ import re
6
+ from flask import request, jsonify, Response, stream_with_context
7
+ import subprocess
8
+
9
+
10
+
11
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s', encoding='utf-8')
12
+ logger = logging.getLogger(__name__)
13
+ app = Flask(__name__)
14
+
15
+ def generate_content(messages, model, api_key, url):
16
+ payload = json.dumps({
17
+ "model": model,
18
+ "messages": messages,
19
+ "stream": True
20
+ })
21
+ headers = {
22
+ 'Accept': 'application/json',
23
+ 'Authorization': api_key,
24
+ 'Content-Type': 'application/json'
25
+ }
26
+
27
+ decoded_payload = json.loads(payload)
28
+ logger.info(f"Request payload: {json.dumps(decoded_payload, ensure_ascii=False)}")
29
+
30
+ response = requests.post(url, headers=headers, data=payload, stream=True)
31
+
32
+ content = ""
33
+ for line in response.iter_lines():
34
+ if line:
35
+ decoded_line = line.decode('utf-8')
36
+ if "data: " in decoded_line:
37
+ data_str = decoded_line[6:]
38
+ if data_str.strip() == "[DONE]":
39
+ break
40
+ try:
41
+ data = json.loads(data_str)
42
+ if "choices" in data:
43
+ delta = data["choices"][0]["delta"]
44
+ if "content" in delta:
45
+ content_str = delta["content"]
46
+ content += content_str
47
+ yield content_str
48
+ except json.JSONDecodeError as e:
49
+ logger.error(f"JSON decode error: {e}")
50
+ elif "error" in decoded_line:
51
+ error_data = json.loads(decoded_line)
52
+ logger.error(f"Error: {error_data}")
53
+ break
54
+
55
+ def write_to_file(file_path, outline, generated_content):
56
+ with open(file_path, 'w', encoding='utf-8') as file:
57
+ for part, content in zip(outline, generated_content):
58
+ file.write(part + "\n")
59
+ if content:
60
+ file.write(content.strip() + "\n\n")
61
+
62
+ @app.route('/')
63
+ def index():
64
+ return render_template('index.html')
65
+
66
+ @app.route('/generate_outline', methods=['POST'])
67
+ def generate_outline():
68
+ data = request.get_json()
69
+ outline_model = data['outline_model']
70
+ url = (data['proxy_url'] or "https://api.openai.com/v1") + "/chat/completions"
71
+ api_key = data['api_key']
72
+ title = data['title']
73
+ doc_type = data['doc_type']
74
+ notice = data['notice']
75
+
76
+ system_prompt = ""
77
+ doc_type_name = ""
78
+ if doc_type == "1":
79
+ system_prompt = "You are ChatGPT, a large language model by OpenAI, and you are good at writing academic papers."
80
+ doc_type_name = "论文"
81
+ elif doc_type == "2":
82
+ system_prompt = "You are ChatGPT, a large language model by OpenAI, and you are good at writing reports."
83
+ doc_type_name = "报告"
84
+ elif doc_type == "3":
85
+ system_prompt = "You are ChatGPT, a large language model by OpenAI. From now on, you need to play the role of a writer. You are good at writing articles."
86
+ doc_type_name = "文章"
87
+
88
+ outline_prompt = f'我想写一个题目是"{title}"的{doc_type_name},下面是具体要求:{notice}\n请你帮我列出一个详细具体的大纲,大纲需要列出各个标题,只能用Markdown中的#和##来区分标题的层级(例如#大标题1\n##小标题1\n##小标题2\n#大标题2\n##小标题3\n##小标题4\n##小标题5\n以此类推,标题数量不固定\n注意:有且仅有大纲中绝对禁止出现"###"的组合,大纲中只能通过#和##进行标题层次的划分,之后的输出待定)。你的输出仅可包含示例中的内容,无需任何其他的解释说明'
89
+ retry_prompt = '前文已经要求过你不能输出###了,你误解了我的意思,请你直接重新生成新的outline,直接输出outline即可,无需道歉和其他任何解释'
90
+
91
+ messages = [
92
+ {"role": "system", "content": system_prompt},
93
+ {"role": "user", "content": outline_prompt}
94
+ ]
95
+ outline = "".join(list(generate_content(messages, outline_model, api_key, url)))
96
+
97
+ if re.search(r'###', outline):
98
+ temp_outline = outline
99
+ messages = [
100
+ {"role": "system", "content": system_prompt},
101
+ {"role": "user", "content": outline_prompt},
102
+ {"role": "assistant", "content": temp_outline},
103
+ {"role": "user", "content": retry_prompt}
104
+ ]
105
+ outline = "".join(list(generate_content(messages, outline_model, api_key, url)))
106
+
107
+ return jsonify({"outline": outline})
108
+
109
+ is_paused = False
110
+ @app.route('/generate_key_words', methods=['POST'])
111
+ def generate_key_words():
112
+ data = request.get_json()
113
+ key_word_model = data['key_word_model']
114
+ api_key = data['api_key']
115
+ url = (data['proxy_url'] or "https://api.openai.com/v1") + "/chat/completions"
116
+ outline = data['outline']
117
+
118
+ result = subprocess.run(['python', 'key_words.py', key_word_model, api_key, url, outline], capture_output=True, text=True)
119
+ search_key_word = result.stdout.strip()
120
+
121
+ return jsonify({"search_key_word": search_key_word})
122
+ @app.route('/search', methods=['POST'])
123
+ def search():
124
+ data = request.get_json()
125
+ selected_key_words = data['selected_key_words']
126
+ bing_api_key = data['bing_api_key']
127
+ proxy_url = data['proxy_url']
128
+ api_key =data['api_key']
129
+
130
+ print(f"Received selected key words: {', '.join(selected_key_words)}")
131
+ print(f"Received Bing API key: {bing_api_key}")
132
+
133
+ cmd = ['python', 'search.py', ','.join(selected_key_words), bing_api_key, api_key,proxy_url]
134
+ print(f"Running command: {' '.join(cmd)}")
135
+
136
+ result = subprocess.run(cmd, capture_output=True, text=True, encoding='utf-8')
137
+ search_result = result.stdout.strip()
138
+ error_output = result.stderr.strip()
139
+
140
+ print("Output from search.py:")
141
+ print(search_result)
142
+
143
+ if error_output:
144
+ print("Error output from search.py:")
145
+ print(error_output)
146
+
147
+ return jsonify({"search_result": search_result})
148
+
149
+ @app.route('/qa', methods=['POST'])
150
+ def qa():
151
+ data = request.get_json()
152
+ search_result = data['search_result']
153
+ api_key = data['api_key']
154
+ api_url_base = data['proxy_url']
155
+
156
+ import qa
157
+ qa_result = qa.main(search_result, api_key, api_url_base)
158
+ return jsonify({"qa_result": qa_result})
159
+
160
+
161
+ @app.route('/pause', methods=['POST'])
162
+ def pause():
163
+ global is_paused
164
+ is_paused = True
165
+ return jsonify({"message": "Generation paused"})
166
+
167
+ @app.route('/resume', methods=['POST'])
168
+ def resume():
169
+ global is_paused
170
+ is_paused = False
171
+ return jsonify({"message": "Generation resumed"})
172
+
173
+
174
+ @app.route('/generate_content', methods=['POST'])
175
+ def generate_article_content():
176
+ global is_paused
177
+ is_paused = False
178
+
179
+ data = request.get_json()
180
+ expand_outline = data['expand_outline']
181
+ optimize_token = data['optimize_token']
182
+ outline = data['outline']
183
+ content_model = data['content_model']
184
+ api_key = data['api_key']
185
+ url = (data['proxy_url'] or "https://api.openai.com/v1") + "/chat/completions"
186
+ doc_type = data['doc_type']
187
+ top_k = int(data['top_k'])
188
+ similarity_threshold = float(data['similarity_threshold'])
189
+
190
+ system_prompt = ""
191
+ if doc_type == "1":
192
+ system_prompt = "You are ChatGPT, a large language model by OpenAI, and you are good at writing academic papers."
193
+ elif doc_type == "2":
194
+ system_prompt = "You are ChatGPT, a large language model by OpenAI, and you are good at writing reports."
195
+ elif doc_type == "3":
196
+ system_prompt = "You are ChatGPT, a large language model by OpenAI. From now on, you need to play the role of a writer. You are good at writing articles."
197
+
198
+ outline_parts = [part for part in outline.split("\n") if part.strip()]
199
+
200
+
201
+ def generate():
202
+ messages = [
203
+ {"role": "system", "content": system_prompt},
204
+ {"role": "assistant", "content": outline}
205
+ ]
206
+ for part in outline_parts:
207
+ if is_paused:
208
+ break
209
+ if part.startswith("##"):
210
+ search_queries = [part[2:].strip()]
211
+ from getcsv import search_dataset
212
+
213
+ search_results = search_dataset(search_queries, top_k=top_k, similarity_threshold=similarity_threshold)
214
+
215
+ # 提取匹配到的QA
216
+ matched_qa = ""
217
+ for result in search_results:
218
+ question = result['question']
219
+ answer = result['answer']
220
+ matched_qa += f"Question: {question}\nAnswer: {answer}\n\n"
221
+
222
+
223
+ if expand_outline.lower() == 'n':
224
+ article_prompt = f'参考之前的整体大纲,以及已经生成的内容,为"{part}"部分扩写内容。在扩写中,严禁出现下一级小标题,要求语言通俗易懂,不要过于死板,善于使用各种修辞手法。在每次输出的开头注明小标题是哪个(要用##放到小标题前面)(不要输出其他小标题和其他小标题的内容),结尾必须换2行\n将以下内容作为你本次生成的知识库:\n{matched_qa}'
225
+ else:
226
+ article_prompt = f'参考之前的整体大纲,以及已经生成的内容,为"{part}"部分扩写内容。你需要在##小标题的基础上再扩充###小小标题,要求语言通俗易懂,不要过于死板,善于使用各种修辞手法。在每次输出的开头注明小标题是哪个(要用##放到小标题前面),结尾必须换2行\n将以下内容作为你本次生成的知识库:\n{matched_qa}'
227
+ if optimize_token.lower() == 'y':
228
+ messages = messages[:2]
229
+ messages.append({"role": "user", "content": article_prompt})
230
+ article_content = ""
231
+ for chunk in generate_content(messages, content_model, api_key, url):
232
+ # if is_paused:
233
+ # break
234
+ article_content += chunk
235
+ yield chunk
236
+ if optimize_token.lower() == 'n':
237
+ messages.append({"role": "assistant", "content": article_content})
238
+ else:
239
+ yield "\n\n"
240
+
241
+ return Response(stream_with_context(generate()), mimetype='text/plain')
242
+
243
+ @app.route('/write_to_file', methods=['POST'])
244
+ def write_to_file():
245
+ data = request.get_json()
246
+ title = data['title']
247
+ content = data['content']
248
+
249
+ file_path = f"{title}.txt"
250
+ with open(file_path, 'w', encoding='utf-8') as file:
251
+ file.write(content)
252
+
253
+ return jsonify({"message": "Content written to file successfully."})
254
+
255
+ if __name__ == '__main__':
256
+ app.run(host='0.0.0.0')
emb.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import json
3
+ import logging
4
+ from typing import List, Tuple
5
+ import pandas as pd
6
+ import uuid
7
+
8
+ # 设置日志记录
9
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
10
+
11
+ # OpenAI API配置
12
+ API_KEY = ""
13
+ API_URL = ""
14
+ MODEL = "text-embedding-ada-002"
15
+ proxies = {
16
+ "http": "http://127.0.0.1:10808",
17
+ "https": "http://127.0.0.1:10808"
18
+ }
19
+
20
+ def generate_embeddings_from_qa_pairs(qa_pairs: List[Tuple[str, str]], api_key, api_url_base):
21
+ global API_KEY, API_URL
22
+ API_KEY = api_key
23
+ API_URL = f"{api_url_base}/embeddings"
24
+
25
+ df = process_qa_pairs(qa_pairs)
26
+ random_filename = f"output/qa_embeddings_{uuid.uuid4().hex}.csv"
27
+ df.to_csv(random_filename, index=False)
28
+ print(f"Embeddings saved to {random_filename}")
29
+ print(df)
30
+
31
+ def generate_embeddings(text: str) -> List[float]:
32
+ headers = {
33
+ "Content-Type": "application/json",
34
+ "Authorization": f"Bearer {API_KEY}"
35
+ }
36
+
37
+ data = {
38
+ "input": text,
39
+ "model": MODEL
40
+ }
41
+
42
+ try:
43
+ response = requests.post(API_URL, headers=headers, json=data)
44
+ response.raise_for_status()
45
+ embedding = response.json()["data"][0]["embedding"]
46
+ except requests.exceptions.RequestException as e:
47
+ logging.error(f"OpenAI API request failed: {e}")
48
+ return []
49
+
50
+ return embedding
51
+
52
+ def process_qa_pairs(qa_pairs: List[Tuple[str, str]]) -> pd.DataFrame:
53
+ data = []
54
+ for q, a in qa_pairs:
55
+ combined_text = f"Question: {q}\nAnswer: {a}"
56
+ embedding = generate_embeddings(combined_text)
57
+ data.append({"Question": q, "Answer": a, "Combined_Text": combined_text, "Embedding": embedding})
58
+
59
+ df = pd.DataFrame(data)
60
+ return df
61
+
62
+ if __name__ == "__main__":
63
+ qa_pairs = [
64
+ ("秦始皇在中国历史的地位如何?", "秦始皇在中国历史上具有极其重要的地位,他建立了第一个中央集权国家,也是中国第一位称皇帝的君主。他在十年时间里兼并六国,结束了春秋战国五百年分裂局面,使天下归于一统。他成功的把原本七零八散的地域文明重新整合在一起,成为中国此后两千多年封建文明的基石。统一的疆域、统一的文明、统一的法制和中央集权,使中华民族以一个整体骄傲的屹立在世界东方。"),
65
+ ("秦始皇在世界历史上的地位如何?", "秦始皇在世界史上也具有一定的地位。他建立了中国历史上第一个大一统的中央集权国家,结束了兵荒马乱的战国时代。他的统一疆域、统一文明、统一法制和中央集权的成就,使得中华民族以一个整体骄傲的屹立在世界东方。"),
66
+ ("Minecraft是什么类型的游戏?", "《我的世界》(Minecraft)是一款沙盒类电子游戏。")
67
+ ]
68
+
69
+ df = process_qa_pairs(qa_pairs)
70
+ random_filename = f"output/qa_embeddings_{uuid.uuid4().hex}.csv"
71
+ df.to_csv(random_filename, index=False)
72
+ print(f"Embeddings saved to {random_filename}")
73
+ print(df)
getcsv.py ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import logging
3
+ from typing import List, Tuple
4
+ import pandas as pd
5
+ from sklearn.feature_extraction.text import TfidfVectorizer
6
+ from sklearn.metrics.pairwise import cosine_similarity
7
+ from typing import List, Tuple, Dict
8
+
9
+ # 设置日志记录
10
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
11
+
12
+ # OpenAI API配置
13
+ API_KEY = "sk-u0S4iYA2kJmaDNBgBc48D2A6Fa904fF0B6E19dF0F6A39717"
14
+ API_URL = "https://api.ltcld.cn/v1/embeddings"
15
+ MODEL = "text-embedding-ada-002"
16
+
17
+ def generate_embeddings(text: str) -> List[float]:
18
+ headers = {
19
+ "Content-Type": "application/json",
20
+ "Authorization": f"Bearer {API_KEY}"
21
+ }
22
+
23
+ data = {
24
+ "input": text,
25
+ "model": MODEL
26
+ }
27
+
28
+ try:
29
+ response = requests.post(API_URL, headers=headers, json=data)
30
+ response.raise_for_status()
31
+ embedding = response.json()["data"][0]["embedding"]
32
+ except requests.exceptions.RequestException as e:
33
+ logging.error(f"OpenAI API request failed: {e}")
34
+ return []
35
+
36
+ return embedding
37
+
38
+ def rerank_results(query: str, documents: List[str]) -> List[Tuple[str, float]]:
39
+ vectorizer = TfidfVectorizer()
40
+
41
+ tfidf_matrix = vectorizer.fit_transform(documents)
42
+
43
+ query_vector = vectorizer.transform([query])
44
+
45
+ similarity_scores = cosine_similarity(query_vector, tfidf_matrix).flatten()
46
+
47
+ reranked_results = list(zip(documents, similarity_scores))
48
+
49
+ reranked_results.sort(key=lambda x: x[1], reverse=True)
50
+
51
+ return reranked_results
52
+
53
+ def search_dataset(queries: List[str], top_k: int = 5, similarity_threshold: float = 0.5) -> List[dict]:
54
+ results = []
55
+
56
+ for query in queries:
57
+ query_embedding = generate_embeddings(query)
58
+
59
+ embeddings = df['Embedding'].tolist()
60
+ similarity_scores = cosine_similarity([query_embedding], embeddings)[0]
61
+ df['Similarity'] = similarity_scores
62
+
63
+ print(f"Similarity scores for query '{query}': {similarity_scores}")
64
+
65
+ top_results = df.sort_values('Similarity', ascending=False).head(top_k)
66
+
67
+ print(f"Top {top_k} results for query '{query}':")
68
+ print(top_results)
69
+
70
+ query_results = []
71
+ for _, row in top_results.iterrows():
72
+ if row['Similarity'] >= similarity_threshold:
73
+ query_results.append({
74
+ 'question': row['Question'],
75
+ 'answer': row['Answer'],
76
+ 'similarity': row['Similarity']
77
+ })
78
+
79
+ print(f"Filtered results for query '{query}': {query_results}")
80
+
81
+ results.append(query_results)
82
+
83
+ merged_results = []
84
+ for query_results in results:
85
+ merged_results.extend(query_results)
86
+
87
+ print(f"Merged results: {merged_results}")
88
+
89
+ for query in queries:
90
+ documents = [result['question'] + ' ' + result['answer'] for result in merged_results]
91
+ reranked_results = rerank_results(query, documents)
92
+
93
+ final_results = []
94
+ for doc, score in reranked_results:
95
+ for result in merged_results:
96
+ if doc == result['question'] + ' ' + result['answer']:
97
+ result['score'] = score
98
+ final_results.append(result)
99
+ break
100
+
101
+ unique_results = []
102
+ seen_questions = set()
103
+ seen_answers = set()
104
+ for result in final_results:
105
+ if result['question'] not in seen_questions and result['answer'] not in seen_answers:
106
+ unique_results.append(result)
107
+ seen_questions.add(result['question'])
108
+ seen_answers.add(result['answer'])
109
+
110
+ print(f"Unique results: {unique_results}")
111
+
112
+ filtered_results = [result for result in unique_results if result['similarity'] >= similarity_threshold]
113
+ print(f"Filtered results: {filtered_results}")
114
+
115
+ return filtered_results
116
+ df = pd.read_csv('output/qa_embeddings.csv')
117
+
118
+ df['Embedding'] = df['Embedding'].apply(eval)
119
+
120
+ # search_queries = ["原神","minecraft"]
121
+ # search_results = search_dataset(search_queries, top_k=1, similarity_threshold=0.5)
122
+
123
+ # for i, result in enumerate(search_results):
124
+ # print(f"Search Result {i+1}:")
125
+ # print(f"Question: {result['question']}")
126
+ # print(f"Answer: {result['answer']}")
127
+ # print(f"Similarity: {result['similarity']}")
128
+ # print(f"Rerank Score: {result['score']}")
129
+ # print("----------------------------------------------------")
key_words.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import requests
3
+ import sys
4
+
5
+ def generate_key_words(key_word_model, api_key, url, outline):
6
+ messages = [
7
+ {"role": "system", "content": "你现在正在生成一篇论文,我将提供给你一份大纲,为了论文的准确真实性,你需要根据论文要求和大纲进行相关数据以及资料的搜索,现在,请你列出你需要进行搜索的关键句。由我来代替你上网进行搜索。注意:你的回复应当有且仅有你列出的搜索关键句,多个关键句之间用英文逗号隔开,不得输出其他任何解释。示例输出:关键句1,关键句2,关键句3"},
8
+ {"role": "user", "content": f"大纲为:{outline}"}
9
+ ]
10
+
11
+ payload = json.dumps({
12
+ "model": key_word_model,
13
+ "messages": messages
14
+ })
15
+ headers = {
16
+ 'Accept': 'application/json',
17
+ 'Authorization': api_key,
18
+ 'Content-Type': 'application/json'
19
+ }
20
+
21
+ response = requests.post(url, headers=headers, data=payload)
22
+ response_data = response.json()
23
+
24
+ if 'choices' in response_data:
25
+ search_key_word = response_data['choices'][0]['message']['content']
26
+ print(search_key_word)
27
+ else:
28
+ print("Error: Unable to generate search keywords.")
29
+
30
+ if __name__ == "__main__":
31
+ key_word_model = sys.argv[1]
32
+ api_key = sys.argv[2]
33
+ url = sys.argv[3]
34
+ outline = sys.argv[4]
35
+
36
+ generate_key_words(key_word_model, api_key, url, outline)
output/11.csv ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ Question,Answer,Combined_Text,Embedding
2
+ 秦始皇在中国历史的地位如何?,"秦始皇在中国历史上具有极其重要的地位,他建立了第一个中央集权国家,也是中国第一位称皇帝的君主。他在十年时间里兼并六国,结束了春秋战国五百年分裂局面,使天下归于一统。他成功的把原本七零八散的地域文明重新整合在一起,成为中国此后两千多年封建文明的基石。统一的疆域、统一的文明、统一的法制和中央集权,使中华民族以一个整体骄傲的屹立在世界东方。","Question: 秦始皇在中国历史的地位如何?
3
+ Answer: 秦始皇在中国历史上具有极其重要的地位,他建立了第一个中央集权国家,也是中国第一位称皇帝的君主。他在十年时间里兼并六国,结束了春秋战国五百年分裂局面,使天下归于一统。他成功的把原本七零八散的地域文明重新整合在一起,成为中国此后两千多年封建文明的基石。统一的疆域、统一的文明、统一的法制和中央集权,使中华民族以一个整体骄傲的屹立在世界东方。","[0.007234594, -0.0042884815, 0.0012923528, -0.013952892, -0.017605685, -0.0030945477, -0.023207493, -0.0044724117, -0.024588585, 0.0029574065, 0.014688614, 0.01817361, -0.007931593, 0.017554056, -0.0067312056, 0.010590516, 0.016869964, -0.012313654, 0.009796712, 0.0042207176, -0.008338176, -0.03126171, -0.016005168, 0.001521459, -0.009635369, 0.031158447, 0.03046145, -0.003572121, 0.0077960654, -0.031829633, -0.0099516, 0.0131332725, -0.01717974, -0.005124235, -0.011642469, 0.0015133918, -0.014004522, -0.013333337, -0.008460796, -0.011500487, 0.005214587, 0.022858994, -0.00792514, 0.02842208, -0.0044562775, -0.0013165541, 0.0008978706, -0.033791557, -0.0064666043, 0.00254921, 0.008002584, 0.040425956, -0.023543086, -0.010861572, -0.025621176, -0.028809302, -0.03807681, 0.00948048, -0.022691198, -0.020484034, 0.006340757, 0.023517272, -0.02232979, -0.0033365611, -0.015437243, -0.0030187166, -0.0199032, 0.0033720564, 0.00858987, 0.000113746406, 0.036424663, 0.049280427, 0.012855764, 0.010151665, 0.036166515, -0.013101004, -0.0141077805, 0.0021426273, -0.025079066, -0.004688611, -0.0043949676, -0.031623114, 0.010777674, 0.0015932564, 0.009138434, 0.01644402, 0.0039303014, 0.025556639, 0.013875448, -0.014546633, -0.0015698617, 0.014701521, 0.017889647, 0.018380128, -0.00993224, 0.0124362735, -0.008544695, 0.014740244, 0.009022268, -0.027363675, 0.012681514, -0.011584385, -0.037741218, -0.010158119, -0.022949345, 0.000692159, -0.011552117, -0.026279453, 0.014882225, -0.0030477582, -0.016650537, 0.01876735, 0.0068602795, -0.027157156, 0.009415943, -0.033636667, 0.03084867, -0.005892225, 0.01131333, -0.01941272, 0.0086027775, 0.010558248, -0.005024203, -0.015230725, 0.020755088, 0.0068602795, -0.008318815, -0.0056921607, 0.0046950644, -0.014882225, -0.005785739, -0.00095918064, 0.0016537597, 0.021103589, -0.009835434, 0.0016521463, -0.013449504, -0.005443693, -0.011990968, -0.019309461, 0.016495649, 0.0037076487, -0.016134242, -0.02154244, 0.013539855, 0.009545017, -0.011590839, 0.027028082, 0.008654407, 0.00391094, 0.04078736, 0.017295906, 0.032165226, 0.0253114, 0.03376574, -0.01012585, -0.011532756, 0.0026863513, 0.015050021, -0.018547924, 0.0039657964, -0.0012221688, -0.011894163, -0.00092045846, -0.0041658613, 0.024588585, 0.027673451, 0.0076024546, -0.002602453, 0.0024733793, -0.011797357, 0.0141077805, -0.03273315, 0.0001476283, 0.022316882, -0.0016497262, 0.020780904, 0.015114558, -0.033352703, -0.005985804, -0.014908039, -0.015772834, 0.013927078, 0.021206846, -0.0086415, -0.017347537, 0.037896108, 0.0012318493, 0.017270092, -0.01455954, 0.030642152, 0.0111132655, 0.018212331, -0.00710552, -0.59394664, -0.0073313992, -0.03337852, 0.004211037, 0.01035173, 0.0019877385, 0.023878679, 0.026034212, -0.0026218144, -0.052558906, -0.011707006, 0.03585674, -0.021129403, -0.004462731, -0.04589869, -0.021245569, -0.0102097485, -0.009467573, 0.021219755, -0.0069054556, 0.0051565035, -0.009538564, -0.016198779, 0.020780904, -0.0015238791, 0.016869964, -0.005062925, -0.0044304626, -0.029738635, 0.03603744, -0.033146188, 0.0129912915, 0.025414657, 0.03996129, 0.04977091, -0.019077128, -0.025040343, 0.042646028, 0.0007982416, 0.03585674, 0.0013334951, -0.009712813, 0.012262024, -0.016108427, 0.02119394, -0.01801872, 0.0065827705, 0.00473056, 0.023000974, 0.008802842, -0.019683775, -0.034101333, 0.015024206, 0.020987421, -0.01812198, -0.018134888, -0.0021636018, -0.037947737, -0.001319781, -0.0110422755, 0.015772834, 0.020742182, 0.0030219434, -0.017141018, -0.021387551, 0.021206846, -0.037353996, 0.0031010013, 0.00124395, 0.0063923867, -0.0028702817, 0.009912878, 0.01141659, -0.023388198, 0.024085196, 0.024420789, 0.035908367, 0.004424009, -0.0038593106, 0.0018635049, 0.016495649, -0.0029235247, 0.008299454, 0.01892224, -0.0060309796, -0.017502425, -0.027002268, 0.0007575026, -0.013707652, -0.015876094, 0.00604066, -0.0050919666, -0.0028025177, -0.0010519526, -0.005046791, 0.047963873, 0.0024895135, -0.03164893, 0.027105527, -0.010726044, -0.022523401, -0.002362053, -0.0064762845, 0.014972576, 0.0044788653, 0.022445956, -0.017657313, 0.0048434995, 0.04966765, -0.010029045, 0.00013895615, 0.015062928, -0.008370444, -0.00093659275, 0.004385287, -0.014766058, 0.02520814, 0.030177485, -0.014778965, 0.010171026, 0.009054536, 0.008615685, 0.009887063, -0.026460156, -0.0027089391, 0.041613437, -0.006592451, 0.002555664, -0.008441435, 0.01976122, 0.0012350762, -0.010571155, 0.056534383, -0.007944501, 0.02163279, -0.0036882877, 0.016172964, -0.012120042, -0.024149733, 0.0078025195, -0.0018134888, -0.0047531477, 0.011842533, 0.009893517, -0.0045627635, -0.014985484, -0.0129912915, 0.003343015, -0.023904493, -0.0092997765, -0.0005017749, -0.020432403, -0.027931599, 0.013810911, -0.02510488, 0.026460156, 0.005443693, -0.0029735407, -0.010751858, -0.021968383, 0.013004199, 0.00680865, -0.04638917, -0.0054759616, 0.01614715, -0.029609561, -0.005708295, 0.01059697, -0.012352375, -0.038696364, -0.009267508, 0.017463703, 0.00022144247, -0.0020797038, -0.010396905, -0.004169088, -0.023478549, -0.03312037, 0.023246216, -0.0035172647, 0.013978707, -0.005127462, -0.026227823, -0.016534371, 0.004769282, -0.021916755, -0.02149081, 0.0026234277, -0.0033914177, 0.021387551, -0.019335276, 0.0061987755, 0.0019038406, -0.032165226, 0.021968383, -0.0049854806, 0.0063117156, 0.0052404017, 0.014843502, -0.005062925, -0.002891256, -0.0002174089, 0.008531787, -0.008964185, 0.012571801, -0.012223301, 0.014920947, -0.0032929988, 0.02297516, 0.014120689, 0.0040948708, -0.02203292, -0.02976445, -0.038102627, 0.0017683129, 0.03732818, 0.0068215574, -0.013017106, 0.011242339, 0.0036689267, -0.0036818339, -0.026950637, -0.009764443, 0.0052242675, -0.03758633, -0.0030574389, 0.0042723473, 0.0063343034, -0.0012423366, -0.0068215574, -0.03353341, -0.027957413, -0.005108101, -0.004356245, 0.008873833, 0.06572445, 0.03327526, -0.027544377, 0.016121333, -0.00977735, -0.0020232338, 0.009803166, 0.013707652, -0.026279453, 0.012739597, 0.016999038, 0.02367216, 0.014443373, 0.007241048, 0.016327852, 0.018689906, 0.010751858, -0.010016137, -0.0146627985, 0.014185226, -0.024937084, -0.012061959, -0.0073249456, 0.025659898, 0.0011519849, -0.004282028, -0.01708939, 0.0016416591, -0.0020103266, 0.040038735, -0.0073765754, 0.008215556, -0.019993553, -0.007744436, -0.01747661, -0.0067957425, 0.009106166, 0.02192966, -0.014004522, -0.0051565035, -0.00982898, 0.002768636, -0.012584709, 0.0066344, 0.0036753803, -0.0057276557, -0.0050564716, 0.00025169417, 0.037147477, 0.008034852, -0.029635375, -0.03505648, -0.0016005167, -0.021516625, 0.005321073, -0.008596324, -0.018393036, -0.025130695, -0.012662153, -0.017605685, -0.0031510175, 0.034256224, -0.0063956133, -0.011848987, -0.021645699, -0.0046853838, -0.020535663, -0.0013125206, -0.0052274945, 0.016663445, -0.0106937755, -0.013449504, 0.017437888, 0.018160703, 0.009325592, -0.026847377, -0.030538892, -0.0062891273, -0.009131981, 0.032758966, 0.0025427565, -0.0018393035, 0.006089063, 0.060613118, -0.020445311, -0.0024814464, -0.038644735, -0.024369158, -0.0024556315, 0.07388192, 0.015527594, -0.01267506, 0.024356252, -0.016611814, -0.0027621822, -0.011423043, -0.035934184, 0.018883517, -0.0037786395, -0.021516625, 0.014701521, 0.007447566, 0.017244278, 0.022058735, 0.000521136, 0.020780904, -0.021039052, -0.0071377885, 0.017566962, -0.00011767913, 0.02510488, 0.024975806, 0.044401433, -0.015114558, -0.005256536, 0.025091972, 0.0022765414, 0.018044535, -0.011126173, -0.0071829646, -0.0026105202, 0.001905454, 0.006314942, -0.017967092, 0.033585038, -0.039883845, 0.019929016, 0.004449824, -0.017502425, 0.016082613, 0.017541148, 0.018147795, -0.04158762, 0.008254278, 0.0043917405, 0.0062633124, -0.004227171, -0.015656669, -0.003244596, 0.022794457, -0.024962898, -0.040038735, -0.037224922, 0.01215231, 0.00041868357, -0.0017053894, 0.00045216212, -0.009570832, -0.0023136502, -0.008163926, -0.035495333, 0.0061406926, -0.016108427, 0.009545017, -0.013707652, -0.017205555, -0.033068743, -0.019051313, 0.011339145, 0.0020313011, -0.005124235, -0.009945147, -0.0076476308, 0.025827695, -0.0027315272, 0.01946435, -0.005705068, -0.015385613, -0.0016134242, 0.033688296, -0.030564707, -0.019077128, -0.03079704, -0.0027299137, 0.017347537, 0.010726044, 0.0007744436, 0.0040303334, -0.007770251, 0.018909331, 0.0051597306, 0.0127847735, 0.016727982, -0.015669575, -0.008686676, -0.017102296, -0.004120685, 0.008402713, -0.013449504, -0.021826401, 0.002681511, -0.002860601, -0.02297516, 0.02470475, -0.0062407246, 0.006508553, -0.0007506456, -0.03451437, -0.009919331, 0.029945152, -0.048557613, 0.0030106495, 0.0034495008, -0.019929016, 0.030564707, 0.0103001, 0.05312683, -0.002670217, -0.0069054556, 0.009403036, 0.011823173, 0.00817038, 0.024123918, -0.03972896, 0.006976446, -0.024846733, 0.027699266, -0.025672805, 0.005588901, -0.011603747, 0.050235573, 0.0067182984, 0.0152952615, -0.013062282, 0.006937724, -0.028112303, -0.0055663134, -0.006211683, -0.0028105848, -0.022768643, -0.043601174, -0.03193289, -0.02520814, 0.026034212, -0.027157156, 0.00237012, 0.00084543426, -0.013733466, -0.0062826737, -0.0150112985, -0.02020007, -0.012984837, 0.0077508898, 0.010183933, -0.019490164, -0.01564376, -0.00016507346, 0.008493065, -0.012145857, 0.013746374, 0.022149088, 0.023013882, 0.016960315, -0.0015230724, 0.010009684, -0.017786387, 0.0071571497, -0.03149404, -0.0008103423, 0.00091723166, 0.023788325, -0.01772185, 0.013068736, -0.026511787, 0.027699266, -0.005082286, 0.01831559, -0.012036145, -0.077960655, -0.014985484, 0.017115204, -0.02089707, -0.0126557, -0.017489517, -0.0066731223, 0.044582136, -0.0070603443, 0.025375936, -0.0028638279, 0.013107458, -0.032758966, 0.02154244, -0.0056921607, 0.01178445, -0.015914816, 0.018289777, -0.014895132, 0.016224593, -0.0024136826, 0.007131335, 0.034075517, -0.01787674, -0.0011931271, -0.009267508, 0.00017031709, -0.026485972, -0.00568248, -0.015695391, -0.014443373, -0.012262024, 0.011939339, 0.030513078, -0.048712503, 0.030745411, -0.013449504, -0.007079705, 0.0017392712, -0.007570186, -0.0069828997, 0.025517916, 0.012797681, 0.03536626, 0.006066475, 0.033197816, 0.0212972, 0.006050341, -0.02243305, -0.042129733, -0.0049435315, -0.012468542, 0.03361085, 0.00035797848, 0.009228786, -6.287312e-05, 0.022303976, -0.007021622, -0.01752824, -0.022291068, 0.0066537615, 0.005879318, -0.0322943, 0.0047111986, -0.00094707997, 0.03758633, -0.011526302, -0.015734112, -0.016560186, -0.055346902, -0.0018844794, -0.008486611, 0.015075835, -0.0024185227, 0.011816719, -0.018199425, -0.022007106, 0.0124362735, -0.024782196, -0.0036947413, 0.034540184, -0.035185553, 0.019077128, -0.01594063, -0.0022087777, -0.0018199425, 0.0033720564, -0.02089707, -0.011848987, -0.02847371, 0.042465325, -0.008809296, 0.0059083593, -0.0033881909, 0.019993553, 0.022007106, 0.0022313655, 0.0011947406, -0.000977735, -0.009415943, 0.012249117, 6.857053e-05, -0.0033268807, 0.004895129, -0.025259769, 0.0029267515, 0.0028767353, 0.020212978, 0.010939016, 0.0148047805, -0.00036947415, -0.027260415, 0.0030025824, -0.009454666, 0.02016135, -0.010454989, -0.0066344, -0.0007333013, 0.022988068, 0.007428205, 0.030177485, 0.0142497625, -0.011010007, -0.015682483, -0.0018602781, 0.015811557, -0.014598262, 0.014714428, -0.017979998, -0.012881579, -0.006750567, 0.026666675, -0.0026331083, 0.0056082625, -0.00043239768, 0.009628915, 0.0011172963, 0.012481449, 0.0070732515, -0.03095193, 0.023181679, 0.006237498, 0.011216525, -0.01876735, -0.01965796, 0.013785096, 0.0049499855, 0.01539852, 0.019283645, -0.029041635, -0.012010329, -0.021568254, -0.0022362059, -0.028576968, 0.011132627, -0.03288804, -0.0076411767, 0.0023798007, 0.018883517, -0.018560832, -0.009874156, 0.027544377, -0.0011447244, 0.021516625, -0.005024203, 0.021245569, -0.017670222, -0.000319458, 0.0009632142, -0.034720886, -0.0019457896, -0.016263315, 0.035985813, 0.008163926, -0.00485318, -0.02470475, 0.0072604087, -0.022923531, -0.002141014, 0.014017429, -0.0017747666, 0.028163932, 0.013823818, 0.014920947, 0.01415941, -0.01599226, 0.008628593, -0.0063472106, -0.0042594397, -0.009770897, -0.029790264, 0.0027670225, 0.012629884, 0.0032074873, -0.0024879, 0.019219108, -0.0067957425, 0.0036560192, 0.032655705, 0.004795097, 0.010945469, -0.009202971, 0.0041529536, 0.013707652, 0.01946435, 0.0042239446, -0.01812198, -0.004104551, 0.0042497595, -0.008789935, -0.02585351, 0.005214587, -0.026189102, -0.022704106, 0.012165219, 0.0029541797, -0.007015168, 0.022794457, -0.004211037, 0.01510165, 0.010855118, -0.043446288, 0.04070992, -0.0015029046, -0.00958374, -0.017644407, -0.0016247182, -0.007673445, 0.014972576, -0.013785096, -0.025414657, 0.02966119, -0.019193294, -0.004069056, -0.008899648, 0.0028218788, 0.014869317, 0.015721206, -0.031055188, 0.03164893, 0.043343026, 0.011164895, -0.0063762525, -0.010203294, -0.03451437, 0.0020183937, -0.0046821567, -0.02253631, -0.0057147485, 0.0036689267, -0.0018699586, 0.013565671, -0.010655053, -0.021826401, 0.0075056492, -0.0017957411, -0.0023426919, 0.28747347, -0.0038431764, -0.0006925623, 0.013062282, -0.002202324, 0.005175865, 0.0123652825, 0.015114558, -0.011965154, 0.0050080684, -0.023607623, 0.00473056, -0.0116682835, 0.0069699925, 0.020522755, -0.048505984, -0.008338176, -0.0037205562, -0.011352053, -0.021942569, 0.014146503, -0.018676998, -0.0025685714, -0.017244278, 0.020909978, -0.026615046, 0.009790258, 0.018289777, 0.0103452755, 0.005401744, -0.012855764, 0.012281385, 0.025040343, 0.012352375, -0.03373993, 0.005892225, 0.027596006, 0.0044756387, -0.003073573, 0.00787351, 0.006698937, -0.034591813, -0.00047838027, -0.01101646, 0.027544377, 0.016598908, -0.015798649, -0.0058405953, -0.012029691, 0.022265254, -0.024175547, -0.031184262, 0.0010221042, 0.023878679, 0.020716367, -0.0028283326, 0.032862224, 0.006698937, 0.01455954, -0.01220394, 0.0050145225, 0.030616337, -0.008919009, -0.0025185551, -0.004236852, 0.020148441, -0.05353987, 0.008738305, 0.00010467089, -0.013126819, -0.003678607, -0.042491138, -0.042052288, -0.012184579, -0.0135527635, -0.022484679, 0.05170702, 0.0054888693, 0.03484996, 0.014830595, -0.0004929011, -0.0017441115, -0.009474027, -0.008744759, 0.011093904, -0.027131341, 0.0272346, -0.0020151667, -0.02100033, 0.0126427915, -0.007292677, 0.0030880938, 0.0054178783, -0.015475965, 0.017838018, 0.005708295, 0.014972576, 0.014766058, -0.00527267, -0.004820911, -0.007899324, 0.034746703, 0.026899008, 0.019077128, -0.0074991956, 0.015876094, 0.0116682835, -0.013397874, -0.0072475015, -0.014972576, -0.0064601502, 0.019232016, 0.0034753156, -0.014933854, 0.007473381, 0.009757989, 0.00033377713, -0.023723789, 0.017696036, -0.02283318, -0.0010342048, -0.026899008, -0.0075379177, 0.014043244, -0.020948699, -0.0063343034, -0.021064866, 0.042362064, -0.013862541, -0.015359798, 0.012804134, -0.028602784, 0.013397874, 0.0033591492, -0.018263962, 0.014030336, -0.00040859968, 0.0035850285, -0.016844148, -0.01841885, -0.010016137, -0.027492749, -0.0034495008, 0.003031624, 0.01881898, -0.012778319, -0.015463057, -0.015630854, 0.015669575, -0.0090932585, -0.040658288, 0.004514361, 0.009667638, -0.029532116, 0.0010406586, 0.0072733164, -0.029970968, -0.008041306, 0.001723137, 0.043446288, 0.0038238154, -0.006340757, 0.02852534, -0.031313337, -0.011268155, 0.0014770898, -0.15963864, 0.010984192, 0.038360775, 0.002258794, -0.0003450711, 0.020909978, 0.023685066, -0.00011485563, -0.012326561, -0.01450791, 0.0150112985, -0.007492742, -0.03268152, -0.019877385, -0.0020070996, 0.0005897065, -0.033352703, -0.001555341, 0.02362053, 0.021697327, 0.011339145, 0.004875768, -0.02054857, 0.014017429, 0.027363675, 0.008957731, 0.0107647665, -0.003704422, -0.013171995, -0.015333983, -0.021103589, -0.0072216867, 0.028293006, -0.01250081, -0.003149404, 0.0054340125, 0.0034720888, -0.021800587, -0.013217171, 0.022962254, 0.026356896, 0.023284938, 0.007634723, -0.0075379177, 0.016727982, 0.024227178, -0.016844148, -0.012236209, 0.04633754, -0.004595032, -0.011629562, -0.010732498, 0.027596006, 0.0099257855, 0.034436926, 0.012223301, -0.0067118444, 0.016766705, 0.009867703, 0.011971608, -0.00033821404, -0.003149404, -0.0017150699, -0.009493388, 0.0072862236, 0.010093582, -0.0040077455, 0.013081643, -0.025479194, 0.0060793823, -0.015024206, -0.030022597, 0.03288804, -0.0020119399, 0.0003799614, -0.008305907, -0.014004522, 0.024640214, -0.012797681, 0.012287838, -0.02470475, -0.0010212975, -0.004014199, -0.014004522, -0.012668607, 0.027157156, 0.013927078, 0.014133596, -0.017128112, -0.012746051, 0.0069893533, -0.01986448, -0.055914827, 0.025517916, 0.01644402, 0.004404648, 0.010119396, 0.00020591325, -0.023685066, -0.028783487, 0.0050112954, 0.002118426, -0.0042239446, 0.0038851255, -0.00064093276, 0.0021055185, 0.011636015, 0.008564056, 0.04352373, 0.0028993231, 0.0012003876, 0.011126173, 0.0084672505, 0.03144241, 0.004104551, 0.026137471, -0.008080028, -0.011222978, 0.0032736377, 0.015333983, 0.023155864, -0.022820272, -0.0107647665, 0.018070351, -0.007860603, -0.009822526, -0.0790965, -0.009538564, 0.014882225, 0.02470475, 0.0033881909, 0.019128757, -0.0017844471, -0.014520817, 0.0019732178, 0.020522755, -0.015656669, -0.05263635, -0.005588901, 0.0029219112, 0.008544695, -0.0013464025, 0.01225557, -0.011932885, 0.016172964, 0.012300746, -0.007860603, -0.042697657, 0.015088743, -0.03758633, 0.018276868, -0.0129203005, -0.020380775, -0.0026766707, 0.012145857, 0.00787351, -0.011358506, -0.0075443713, -0.007854149, 0.0009938693, 0.021942569, 0.00946112, -0.021413365, 0.001485157, 0.031081004, -0.014933854, 0.016598908, -0.0047531477, 0.0044562775, -0.024240084, -0.0015868027, -0.0023862543, -0.03296548, -0.008247824, 0.019373998, -0.01059697, -0.036760256, 0.014843502, -0.013062282, 0.023000974, 0.012829949, -0.018367222, 0.022471773, -0.008912555, -0.013875448, 0.0076411767, 0.033662483, -0.01415941, -0.024756381, 0.0033526954, 0.0049209436, -0.0022281387, -0.008628593, -0.00031280261, -0.006866733, -0.012171672, -0.012210394, 0.0016682806, -0.019567609, 0.021581162, -0.035882555, -0.022445956, -0.01625041, -0.019722497, 0.026485972, -0.02327203, -0.008647953, -0.0044175554, 0.010171026, -0.012855764, 0.024524048, 0.024833824, -0.0049725734, -0.012584709, 0.018302685, -0.014998391, -0.019490164, 0.019774126, 0.010532433, -0.008176833, 0.039212663, 0.030977745, 0.009448212, 0.0042594397, -0.004614393, 0.02332366, -0.0011729593, -0.022704106, -0.062265266, 0.0020942246, 0.0008599551, -0.0067053908, 0.0042884815, -0.02346564, 0.033455964, -0.025724435, -0.0022491133, 0.004808004, -0.011545664, 0.012165219, 0.01225557, -0.01510165, -0.04323977, -0.006589224, 0.019399812, 0.022639569, -0.0033720564, 0.013359152, 0.015708297, -0.0054178783, 0.013488226, 0.015256539, -0.0119457925, 0.013359152, 0.006221364, -0.0006949825, -0.02728623, 0.0013568897, 0.003597936, 0.0015803489, -0.0039270744, 0.020406589, -0.0019328821, -0.023736697, -0.001072927, 0.012197487, -0.006363345, 0.06778963, 0.0030090362, -0.025814787, 0.00876412, -0.0021087455, 0.0030348508, 0.030538892, -0.014727335, 0.046621505, 0.019503072, -0.014327207, 0.005772832, 0.023891585, 0.007447566, 0.007357214, 0.021813495, -0.028835116, -0.0015626013, 0.024524048, -0.021555347, -0.016740888, 0.03748307, 0.001131817, 0.029687004, -0.008299454, 0.041871585, -0.030745411, -0.019515978, -0.0067312056, 0.026098749, -0.027905785, 0.010461442, -0.012545986, -0.0136173, 0.0032833181, -0.010809942, 0.0012697648, 0.020690551, -0.033430148, -0.0038399496, 0.028990006, 0.0033139733, 0.0039173937, -0.023594715, -0.0028622146, 0.02707971, 0.0124362735, 0.0054985494, 0.028138118, -0.012455635, 0.00083736714, -0.00055017765, 0.024046473, -0.010364637, -0.010190387, 0.000102351594, 0.0008038886, -0.014314299, 0.010816395, 0.02966119, 0.015630854, -0.020535663, 0.0036463386, 0.011403682, 0.002107132, -0.024278807, -0.001681188, -0.0065020993, -0.023478549, -0.027544377, 0.006750567, -0.019322367, 0.02480801, 0.008505972, 0.005601809, -0.01852211, 0.015088743, 0.0195547, -0.004514361, -0.024098104, 0.015979353, 0.0030977745, -0.0012842857, -0.011080997, -0.014701521, 0.0146627985, 0.010655053, -0.0021361737, -0.006231044, -0.010448535, 0.013191356, 0.012545986, 0.00032913854, -0.028706042, -0.01290094, -0.022045828, 0.010054859, -0.0022394327, 0.016521463, 0.0059051323, 0.030642152, 0.014365929, -0.02505325, 0.037792847, 0.017011944, 0.018031629, -0.003572121, 0.0060277525, -0.01250081, -0.005537272, 0.027725082, -0.032655705, -0.00022507267, -0.018793166, -0.03402389, -0.0013238145, -0.00858987, -0.001496451, -0.024007753, 0.036708627, 0.031158447, 0.0012036144, 0.026382713, -0.009183611, -0.018793166, -0.01976122, 0.037715405, -0.013539855, 0.012636338, -0.017954184, 0.013630208, -0.012913847, -0.033894815, -0.013772189, 0.008196195, 0.008312361, -0.0017796069, -0.00035394492, 0.010855118, 0.017592777, -0.004123912, 0.014598262, -0.005705068, -0.015127465, 0.0027073259, 0.007725075, 0.017889647, -0.013810911, -0.0018183291]"
4
+ 秦始皇在世界历史上的地位如何?,"秦始皇在世界史上也具有一定的地位。他建立了中国历史上第一个大一统的中央集权国家,结束了兵荒马乱的战国时代。他的统一疆域、统一文明、统一法制和中央集权的成就,使得中华民族以一个整体骄傲的屹立在世界东方。","Question: 秦始皇在世界历史上的地位如何?
5
+ Answer: 秦始皇在世界史上也具有一定的地位。他建立了中国历史上第一个大一统的中央集权国家,结束了兵荒马乱的战国时代。他的统一疆域、统一文明、统一法制和中央集权的成就,使得中华民族以一个整体骄傲的屹立在世界东方。","[0.018476626, -0.0092511615, 0.009996395, -0.014030929, -0.018528022, -0.0053547523, -0.025222264, 0.0026340114, -0.027984764, 0.005242325, 0.0070475866, 0.014557731, -0.0076900283, 0.019144766, -0.00618029, 0.021123486, 0.019607324, -0.010998604, 0.015688429, -0.0028235316, -0.0067199413, -0.030605927, -0.01247622, 0.0011804868, 0.0010351343, 0.019260405, 0.027959067, -0.0076900283, 0.013902441, -0.020840812, -0.0065657552, 0.01612529, -0.0171018, -0.0030387496, -0.010690232, 0.0027014678, -0.009443894, -0.017191742, -0.00084802316, -0.0132086035, 0.009373226, 0.029192556, -0.0026243748, 0.029629415, -0.009919302, -0.0024589458, 0.006668546, -0.034948833, -0.003196148, 0.0061931387, 0.015765522, 0.03656779, -0.0215218, -0.01142904, -0.026468601, -0.024862498, -0.036336508, 0.014416394, -0.014930347, -0.0104268305, 0.0070283134, 0.027111044, -0.025016684, -0.0026998615, -0.01951738, 0.00267577, -0.02008273, 0.008049795, 0.009835783, -6.9012303e-06, 0.04224697, 0.037698485, 0.012283487, 0.01236058, 0.039574414, -0.0021088151, -0.019286104, -0.0027641058, -0.016690638, -0.009212615, -0.0048022526, -0.034357786, 0.011454737, 0.00095322303, 0.013594069, 0.019350346, 0.0042401156, 0.031094182, 0.013748255, -0.011711714, 0.00073238363, 0.013427033, 0.02208715, 0.022575404, -0.004888982, 0.0072788657, -0.0060678627, 0.020468196, 0.0076771793, -0.0320193, 0.0046994616, -0.0047604935, -0.02957802, -0.012386277, -0.019478835, 0.000844811, -0.019247556, -0.018309591, 0.014197963, -0.0052487496, -0.02438709, 0.011332673, 0.007985552, -0.031222671, 0.013427033, -0.03962581, 0.023346335, -0.009264011, 0.015829766, -0.026211625, 0.008570174, 0.0085509, 0.0039574415, -0.019376045, 0.013889591, 0.0049724993, -0.012803865, -0.011017877, 0.00018570584, -0.015367208, -0.002659709, 0.0124184, 0.0039574415, 0.013529824, -0.00750372, 0.004860072, -0.01942744, 0.0010174672, -0.006520784, -0.028858485, 0.012437673, 0.0012294729, -0.016703486, -0.01609959, 0.0086151445, 0.012341307, -0.008775755, 0.028781392, 0.012347731, 0.0077093015, 0.03587395, 0.016485056, 0.029603718, 0.028986974, 0.027419416, -0.013067266, -0.0096109295, 0.0047733425, 0.016382266, -0.018887788, 0.0019642657, -0.009694447, -0.016279476, -0.0058301594, 0.0013732193, 0.029398136, 0.023564765, 0.006835581, -0.0070154644, -0.0015113443, -0.011114243, 0.01678058, -0.026340114, 0.008126888, 0.020982148, -0.0005966678, 0.022768138, 0.012630406, -0.019594474, -0.0013997201, -0.014840405, -0.013324243, 0.0113712195, 0.01667779, -0.008364592, -0.030169066, 0.030323252, -0.0023192149, 0.017821336, -0.014403545, 0.021097789, 0.01866936, 0.023937382, -0.006302354, -0.5990641, -0.011069272, -0.028293137, 0.0021409374, 0.012617556, 0.005181293, 0.022948021, 0.020403951, 0.005226264, -0.04823453, -0.017911278, 0.0386236, -0.02140616, -0.005226264, -0.0452536, -0.017512964, -0.011184911, -0.012161423, 0.018823545, -0.0056920345, 0.005566758, 0.0017105013, -0.014583428, 0.019119067, 0.0029520201, 0.01064526, -0.00063240365, -0.0041630226, -0.018566567, 0.03181372, -0.02901267, 0.018887788, 0.021611743, 0.046589877, 0.050907087, -0.021881567, -0.021483254, 0.032379065, -0.0019321437, 0.027881974, 0.0012824744, -0.01230276, 0.010099185, -0.011673167, 0.02350052, -0.008493081, 0.020352555, 0.0004396711, 0.026224473, 0.012983749, -0.016395114, -0.027059648, 0.020031335, 0.022588253, -0.014043777, -0.010516772, -0.0039124703, -0.033818137, -0.012508342, -0.003873924, 0.021753078, 0.016292324, -0.0026773761, -0.007118255, -0.020455347, 0.03142825, -0.037826974, 0.0016992586, 0.0028781393, 0.006687819, 0.0023127904, 0.00504638, 0.014056627, -0.023783196, 0.017641451, 0.03939453, 0.032507554, -0.0013483247, -0.010330464, 0.0036651304, 0.0075679645, -0.005033531, 0.01633087, 0.02163744, -0.003029113, -0.006302354, -0.023487672, 0.002214818, -0.007947005, -0.0034756102, 0.009373226, 0.00040855282, -0.0013049599, 0.0010287099, -0.006083924, 0.044868134, 0.00059747085, -0.030246159, 0.030991392, -0.0064501157, -0.01588116, 0.00056012894, -0.00601968, 0.016138138, -0.0023625798, 0.014943196, -0.016472207, 0.011942993, 0.04378883, -0.008120464, 0.011127092, 0.0151230795, -0.014686219, 3.9851468e-05, 0.002887776, -0.016433662, 0.019800056, 0.02901267, -0.020455347, 0.0056727612, 0.011827353, 0.005489665, 0.017692847, -0.031505346, -0.0027223472, 0.028216043, -0.003687616, 0.011570376, -0.0094310455, 0.018707905, 0.003154389, -0.018707905, 0.048285924, -0.009559534, 0.024374241, -0.011127092, 0.0051234732, -0.019376045, -0.019157615, 0.018939184, 0.005730581, -0.009071278, 0.015688429, -0.0004081513, -0.00040574215, -0.006886976, -0.00882715, 0.010137731, -0.028524416, -0.005120261, 0.0069576446, -0.02890988, -0.025286509, 0.012874533, -0.02131622, 0.02418151, 0.0075229933, -0.0030837206, -0.0150716845, -0.021701684, 0.01279744, 0.0073880805, -0.04250395, -0.0025906465, 0.014711917, -0.028190346, -0.0055731824, 0.0026324051, -0.011133516, -0.03443488, -0.0035173688, 0.007304563, -0.0022774562, 0.0030371435, -0.005492877, 0.0023192149, -0.024708312, -0.027547903, 0.020468196, -0.0059907697, 0.013915289, -0.00079743087, -0.023873137, -0.017500114, 0.003690828, -0.026121683, -0.0264943, 0.007041162, -0.0060518016, 0.020352555, -0.015752673, 0.010696656, -0.007683604, -0.028164648, 0.020262614, -0.00089379714, 0.009739418, 0.0066942433, 0.025761915, -0.000506726, -0.01324715, -0.0019385681, 0.0041565984, -0.012386277, 0.012161423, -0.015701277, 0.013272847, -0.0068741273, 0.021341916, 0.014814707, 0.0050720777, -0.017461568, -0.026263021, -0.03607953, -0.00067376083, 0.04181011, 0.011229883, -0.017949823, 0.0034723978, 0.01246337, -0.0016406358, -0.021046393, -0.010336888, 0.004882558, -0.037775576, -0.00020999816, 0.006758488, 0.014442092, -0.002749651, -0.007291714, -0.037569996, -0.021650288, -0.0005613335, 0.0023706101, 0.012244941, 0.059567202, 0.028010461, -0.028884184, 0.019041974, -0.0032073907, -0.008409563, 0.0094310455, 0.022344125, -0.02540215, 0.011820929, 0.0150973825, 0.021431858, 0.006964069, 0.0060550137, 0.009109825, 0.016716335, 0.01158965, -0.020982148, -0.017088952, 0.0039478047, -0.01877215, -0.02140616, -0.008184709, 0.022344125, -0.0012961263, -0.002781773, -0.008017673, -0.005023895, -0.0034177904, 0.03733872, -0.0051620197, 0.010709505, -0.022986567, -0.011306976, -0.020262614, -0.009649476, 0.013170057, 0.02824174, -0.016048197, -0.005030319, -0.013478429, 0.007073284, -0.013671162, 0.010041365, 0.008839999, -0.0046384297, -0.007426627, -0.0036169472, 0.040910695, 0.006919098, -0.02418151, -0.031325463, 0.00046817947, -0.02604459, 0.01170529, -0.013632615, -0.01097933, -0.021984357, -0.012951626, -0.022228487, 0.008782179, 0.030426044, -0.009308982, -0.011017877, -0.018181102, -0.0012672164, -0.019889997, -0.0056149415, -0.0011965479, 0.017692847, -0.009700871, -0.01678058, 0.010510348, 0.01644651, -0.0016173472, -0.028061857, -0.03543709, 0.003983139, -0.0033631828, 0.029321043, 0.00054768164, -0.00059064495, 0.0027223472, 0.06753348, -0.015444301, -6.13833e-05, -0.028961277, -0.017911278, -0.0032507554, 0.06799604, 0.011287702, -0.022498311, 0.023037963, -0.014827557, 0.0014671765, -0.009308982, -0.035488486, 0.012514766, 0.0035494908, -0.034486275, 0.0044489093, 0.013047993, 0.015701277, 0.017692847, 0.006546482, 0.017885579, -0.025286509, -0.0073559587, 0.021586044, -0.0015691641, 0.015598487, 0.022575404, 0.042863715, -0.012456946, 0.005239113, 0.02604459, 0.0023561553, 0.012405551, -0.023924533, -0.009540261, -0.007657906, 0.008210406, 0.0049949847, -0.021393312, 0.03929174, -0.04096209, 0.028087554, 0.011146365, -0.016960463, 0.012893807, 0.019234708, 0.015469998, -0.04643569, 0.005553909, 0.008897819, 0.0068741273, -0.0028299561, -0.01932465, 0.005550697, 0.016857672, -0.028216043, -0.041296158, -0.03798116, 0.005486453, -0.0056213657, -0.00024794237, 0.004734796, -0.0122385165, -0.0007982339, -0.005865494, -0.033741042, 0.0051620197, -0.015187324, 0.0026115258, -0.013427033, -0.012996597, -0.030297555, -0.0165493, 0.009090551, 0.007921307, -0.0019241131, -0.00519093, -0.0055378485, 0.02592895, -0.001168441, 0.023025114, 0.0023015477, -0.022716742, -0.0030532046, 0.036028136, -0.039779995, -0.027085345, -0.025286509, -0.0012559737, 0.013324243, 0.008531627, 0.0046063075, -0.0010014061, -0.009520987, 0.01951738, 0.0019642657, 0.010780173, 0.018784998, -0.011917295, -0.008081918, -0.02505523, -0.0019401743, 0.013272847, -0.012431249, -0.007914883, 0.00011312999, -0.005993982, -0.01819395, 0.023269242, -0.010677382, 0.0029455957, -0.004259389, -0.03245616, -0.013118661, 0.035951044, -0.045998834, 0.008570174, -0.0006581013, -0.00888497, 0.02770209, 0.01423651, 0.052037787, -0.007824941, -0.013337092, 0.009052005, 0.00706686, 0.002996991, 0.027624996, -0.037390113, -0.0004641642, -0.020879358, 0.024579823, -0.020815114, 0.003119055, -0.0008841605, 0.041296158, 0.009822935, 0.02341058, -0.015598487, 0.0030499925, -0.035180114, -0.004410363, 0.0016117259, -0.0012800653, -0.013337092, -0.04062802, -0.025582032, -0.02063523, 0.020802265, -0.0319936, 0.004937165, 0.0092511615, -0.009989969, -0.0024236117, -0.017153196, -0.023654707, -0.0130801145, 0.004901831, 0.003687616, -0.020570986, -0.012810289, -0.0015948617, 0.0048536477, 0.00081871176, 0.0015755885, 0.027342323, 0.01534151, 0.018797847, -0.006758488, 0.0070026154, -0.021174882, 0.005261598, -0.026545694, -0.002168241, 0.009424621, 0.020146975, -0.01622808, 0.006976918, -0.016189532, 0.023359183, -0.008351743, 0.014763312, -0.01203936, -0.083979994, -0.01346558, 0.0107609, -0.015662732, -0.010272644, -0.012874533, -0.0021329068, 0.038572207, -0.0076900283, 0.019915696, -0.009559534, 0.013940987, -0.031119881, 0.029834997, -0.014043777, 0.011101394, -0.014442092, 0.02285808, -0.010581017, 0.012598284, 0.00513311, 0.016318021, 0.03330418, -0.01689622, -0.0038096798, -0.010555319, 0.005412572, -0.012919504, -0.0050078337, -0.02118773, -0.021830171, -0.0096109295, 0.010131307, 0.030323252, -0.047720578, 0.024335695, -0.009559534, -0.0094310455, 0.0022758502, -0.0038128921, -0.00866654, 0.02592895, 0.0076964526, 0.028884184, 0.009842209, 0.0320193, 0.026854066, -0.0014278269, -0.024862498, -0.045279298, -0.00921904, -0.010330464, 0.02847302, -0.004381453, 0.008133313, 0.000645654, 0.02018552, -0.00805622, -0.02163744, -0.018283894, 0.001013452, 0.008146162, -0.030040579, 0.0093282545, -0.0027721364, 0.038495112, -0.0019273254, -0.0105039235, -0.010336888, -0.05807674, 0.0026227685, -0.011891598, 0.014108022, -0.0017940187, 0.0204168, -0.022279881, -0.014634824, 0.004047383, -0.027933368, 1.6450023e-05, 0.027316624, -0.032610346, 0.013709708, -0.021573195, -0.0094310455, 0.000522787, 0.01064526, -0.01678058, -0.008030523, -0.016433662, 0.043429065, -0.01379965, 0.0061224704, -0.0034852468, 0.014596278, 0.017731393, -0.0017361989, 0.00030997818, 0.0006520784, -0.013311394, 0.019684417, 0.0077799703, -0.0027544692, 0.0035880373, -0.017384475, -0.0004501108, -0.004089142, 0.0072467434, 0.009026308, 0.014866103, -0.0030580228, -0.02515802, 0.0075229933, -0.012553313, 0.022138543, -0.010131307, -0.0067713363, 0.002707892, 0.020545289, -0.003488459, 0.028858485, 0.0050720777, -0.006042165, -0.021470405, -0.0021553922, 0.00916122, -0.017500114, 0.015649881, -0.021624591, -0.0026805883, -0.003995988, 0.013735405, -0.0038096798, -0.0023417003, 0.0038771362, 0.018309591, 0.006029316, 0.0149945915, -0.008705086, -0.025517788, 0.023089359, 0.003122267, 0.015431452, -0.01141619, -0.022613952, 0.015701277, 0.0033214241, 0.011435464, 0.029321043, -0.027419416, -0.009482441, -0.020429648, 0.007073284, -0.029475229, 0.010150581, -0.037492905, -0.004673764, 0.0016623181, 0.023423428, -0.023127904, -0.0013804468, 0.0320193, 0.009231889, 0.017114649, -0.005457543, 0.013337092, -0.02515802, 0.0050849267, 0.0032186334, -0.030477438, 0.0022067875, -0.0074651735, 0.043891624, 0.0093796505, -9.646665e-05, -0.022652498, 0.005348328, -0.02019837, 0.004821526, 0.014647673, 0.0016213625, 0.030246159, 0.017474417, 0.004134113, 0.022279881, -0.015688429, -0.0033953048, 0.00088978186, -0.009630202, -0.022279881, -0.030143369, -0.0011853051, 0.019080522, -0.0018197164, -0.0084352605, 0.013825348, -0.01500744, 0.003122267, 0.02283238, 0.0058911913, 0.0015121474, -0.009790813, 0.0034659735, 0.015264417, 0.024811102, -0.0035430666, -0.011673167, -0.0071054064, -0.00049307407, -0.012129301, -0.029089764, -0.004166235, -0.030554531, -0.025774764, 0.0083581675, 0.0040313224, -0.012938778, 0.013632615, -0.0055571217, 0.018155405, 0.004824738, -0.041553136, 0.041219067, -0.008807877, -0.002168241, -0.024708312, -0.017808486, -0.009122673, 0.021727381, -0.01324715, -0.028858485, 0.02901267, -0.009983545, -0.005688822, -0.00618029, -0.007792819, 0.0053611766, 0.008955639, -0.031736623, 0.034280695, 0.039317437, 0.012020086, -0.017371627, -0.010972906, -0.033535462, 0.00513311, -0.0062670195, -0.012219243, 0.006822732, 0.00036237732, 0.00066613185, 0.010034941, -0.010413981, -0.022485463, 0.006668546, -0.00089861546, 0.0047733425, 0.29130882, 0.003610523, 0.0035848252, 0.014686219, 0.004513154, 0.0057402174, 0.025106626, 0.008248952, -0.010690232, 0.00038727195, -0.014480638, 0.012373429, -0.014352149, 0.009900028, 0.016459359, -0.04913395, -0.014210813, -0.0003362781, -0.0075872377, -0.021881567, 0.004355755, -0.015855463, -0.009058429, -0.015804067, 0.024772555, -0.033149995, 0.0032379066, 0.014866103, 0.008094766, 0.00872436, -0.014313603, 0.0018807483, 0.025453543, 0.018052615, -0.03885488, -0.0025713732, 0.018977731, 0.006835581, 0.002966475, 0.009578807, 0.007792819, -0.039343134, -0.0040987786, -0.007150377, 0.033843834, 0.017397324, -0.016266625, -0.008242528, -0.009565959, 0.0275993, -0.020943603, -0.027162438, 0.01257901, 0.037724182, 0.017345928, -0.0047572814, 0.024245754, 0.007966278, 0.008750057, -0.011146365, -0.0006103197, 0.02118773, -0.013195754, 0.005730581, -0.013427033, 0.010510348, -0.04625581, 0.00794058, 0.004365392, -0.008441685, -0.005181293, -0.039779995, -0.03762139, -0.015110231, -0.015637033, -0.01445494, 0.040576622, 0.017692847, 0.035694066, 0.008467383, -0.0021441495, 0.001491268, -0.017461568, 0.006395508, 0.008576598, -0.027856275, 0.024554126, -0.0038899851, -0.014660521, 0.010497499, -0.017500114, -0.007516569, 0.00023951034, -0.014776161, 0.013940987, 0.007118255, 0.016703486, 0.012354156, -0.0074972957, -0.0074202027, -0.006777761, 0.034614764, 0.021714533, 0.015135929, 0.0045420635, 0.01423651, 0.01308654, -0.011082121, -0.0073880805, -0.021033544, -0.0052005663, 0.014442092, 0.0012214425, -0.013221452, -0.0015876343, 0.014981743, -0.01158965, -0.022716742, 0.024566974, -0.014750464, 0.010214824, -0.026160229, -0.0035623398, 0.012630406, -0.012656103, -0.01038186, -0.010169853, 0.04605023, -0.018566567, -0.025247963, 0.0094567435, -0.02659709, 0.00932183, 0.010863691, -0.0148918005, 0.014840405, -0.00971372, -0.0056631244, -0.009167644, -0.020506741, -0.006996191, -0.02991209, -0.004966075, 0.0055153626, 0.02407872, -0.010927935, -0.013118661, -0.017294534, 0.0071760747, -0.009867906, -0.053502552, 0.011788807, 0.010561743, -0.028935578, 0.0005529015, 0.008139738, -0.023372032, -0.018309591, 0.00064163876, 0.039266042, -0.004291511, 7.071879e-05, 0.026314415, -0.034511972, -0.008306772, -0.0053001447, -0.1589144, 0.016305173, 0.03607953, 0.0040024123, -0.004044171, 0.019440288, 0.029834997, 0.0012527615, -0.010568167, -0.01600965, 0.0150973825, -0.017307382, -0.030348951, -0.00839029, -0.0031431464, -0.0021248762, -0.026237322, -0.00086488726, 0.021830171, 0.024708312, 0.014981743, 0.006668546, -0.028216043, 0.0193118, 0.027830578, 0.009488866, 0.01689622, 0.005637427, -0.014467789, -0.012148574, -0.021894416, -0.007362383, 0.03299581, -0.005335479, -0.012450522, 0.010793022, -0.0044521214, -0.030477438, -0.017924126, 0.0019080521, 0.021251975, 0.025016684, 0.019106219, -0.003610523, 0.018939184, 0.01755151, -0.026263021, -0.009514563, 0.03921465, -0.006395508, -0.014557731, -0.019106219, 0.021868719, 0.013137935, 0.037492905, 0.0050945636, 0.002182696, 0.01909337, 0.00466734, 0.01109497, -0.0010768931, -0.005852645, -0.006623575, -0.0035013077, 0.011332673, 0.010902237, -0.0025761917, 0.010690232, -0.028884184, 0.0021184518, -0.016318021, -0.034511972, 0.024888195, -0.0051042, 0.002290305, -0.0045260023, -0.0023031537, 0.021239126, -0.018026916, 0.010529621, -0.022202788, 0.0025938586, -0.0038482263, -0.017371627, -0.01842523, 0.023192149, 0.00538045, 0.0085509, -0.018348137, -0.0149688935, 0.011955841, -0.022986567, -0.062445343, 0.025980346, 0.010285493, 0.0017618967, 0.008576598, 0.0035848252, -0.028190346, -0.02659709, 0.007349534, 0.0067970343, -0.002444491, 0.0015434664, 0.001167638, 0.004076293, 0.007638633, 0.0030210826, 0.039702903, 0.003918895, -0.0014334483, 0.009925726, 0.005791613, 0.034948833, 0.0015547092, 0.027033951, -0.0021987571, -0.010998604, 0.00035153612, 0.006886976, 0.018258195, -0.025119474, -0.014544882, 0.00827465, -0.009604505, -0.011197761, -0.080073945, -0.013092964, 0.02108494, 0.023320638, 0.01263683, 0.024322847, -4.6275887e-05, -0.013581219, 0.009148371, 0.024245754, -0.011557528, -0.058899064, -0.0004946802, 2.8784403e-05, 0.028575812, -0.0093796505, 0.009732993, -0.019620173, 0.008300348, 0.017166045, -0.0092511615, -0.0419386, 0.015739825, -0.034820344, 0.019491684, -0.0046320055, -0.016690638, 0.0018341714, 0.017166045, 0.0045420635, -0.016870521, -0.0055282116, -0.0048504355, 0.0047090985, 0.027290927, 0.001276853, -0.031299762, -0.0004336482, 0.03818674, -0.02360331, 0.015714126, 0.00036277884, -0.00017084937, -0.024579823, -0.0028187134, -0.005807674, -0.033972323, -0.0035173688, 0.015495696, -0.0096559, -0.032507554, 0.012514766, -0.009707295, 0.02726523, 0.011686016, -0.012077906, 0.0215218, -0.011814505, -0.010201976, 0.02129052, 0.02813895, -0.0084352605, -0.029218253, 0.005611729, 0.0010046184, 0.008454534, -0.004888982, 0.0017442295, -0.001598877, -0.014493487, -0.017500114, 0.009887179, -0.014519185, 0.03001488, -0.042786624, -0.024913892, -0.021971509, -0.014082324, 0.027111044, -0.026018893, -0.0037486479, -0.0047283717, 0.007208197, -0.014146568, 0.024091568, 0.023461975, -0.008242528, -0.008107616, 0.012617556, -0.023333486, -0.025813311, 0.024811102, 0.014480638, -0.010831568, 0.04335197, 0.024566974, 0.013414185, 0.002659709, -0.0054543307, 0.0259418, 0.005798037, -0.023770347, -0.06717371, 0.011506133, 0.002566555, -6.946402e-05, 0.0056727612, -0.01942744, 0.03882918, -0.030169066, 0.003119055, -0.0013049599, -0.011641045, 0.015033138, 0.010908661, -0.015020289, -0.04612732, -0.00993215, 0.017718544, 0.026263021, -0.0075551155, 0.016073894, 0.015547091, -0.009392499, 0.016767731, 0.006899825, -0.0113969175, 0.02153465, -0.00045372453, 0.006013255, -0.028524416, 0.0011459555, 0.006829156, -0.005120261, -0.013388487, 0.022883777, 0.00084802316, -0.02341058, -0.007131104, 0.01153183, -0.0064276303, 0.06234255, -0.011698865, -0.016986161, 0.009989969, -0.005332267, 0.0032619983, 0.026211625, -0.012713923, 0.040576622, 0.023770347, -0.014223661, 0.008846424, 0.026391508, 0.009880755, 0.007812092, 0.02395023, -0.02803616, -0.0015298146, 0.025582032, -0.008004825, -0.020031335, 0.033278484, 0.008306772, 0.016716335, -0.005030319, 0.03674767, -0.021033544, -0.022022905, -0.008968487, 0.015187324, -0.029552322, 0.0037422234, -0.017410172, -0.015135929, -0.0057562785, -0.01688337, -0.00039449942, 0.020429648, -0.027547903, -0.0077028773, 0.024361392, 0.003690828, 0.0094310455, -0.029603718, 0.0027111045, 0.026288718, 0.011743836, -0.0018261408, 0.019041974, -0.0072338944, 0.0032459372, 0.0025697672, 0.021264823, -0.01291308, -0.0029953849, -0.0038835607, -0.004509941, -0.015919708, 0.013812498, 0.026571393, 0.019478835, -0.021727381, 0.003043568, 0.007529418, -0.0065272087, -0.029706508, -0.0002391088, -0.012328458, -0.019671567, -0.026006043, 0.0070989816, -0.008685813, 0.021945812, 0.006906249, -0.0011660318, -0.008338895, 0.013889591, 0.02174023, -0.0035623398, -0.030297555, 0.014776161, -0.004153386, -0.002320821, -0.011724562, -0.011390493, 0.010336888, 0.009565959, 0.0015306176, -0.008313197, -0.012746045, 0.01590686, 0.018489474, -0.003902834, -0.023796044, -0.01457058, -0.02131622, 0.0032828776, -0.0056342147, 0.021020696, -0.0015177687, 0.023436276, 0.02251116, -0.019658718, 0.038263835, 0.011274854, 0.0242843, 0.0024509155, 0.008576598, -0.011461162, -0.0040505957, 0.032507554, -0.032353368, 0.0037775578, -0.023770347, -0.0319936, 0.0037936189, -0.012900231, -0.005708095, -0.025954649, 0.03255895, 0.029706508, 0.00070829206, 0.023526218, -0.011268429, -0.020982148, -0.017500114, 0.03330418, -0.0061385315, 0.01864366, -0.012906656, 0.024040172, -0.0056020925, -0.03147965, -0.014943196, 0.018977731, 0.005210203, 0.0008327652, 0.0009941787, 0.023256393, 0.005332267, -0.006919098, 0.004966075, -0.007824941, -0.019825753, 0.003995988, -0.0006512754, 0.013324243, -0.011159214, -0.011133516]"
6
+ Minecraft是什么类型的游戏?,《我的世界》(Minecraft)是一款沙盒类电子游戏。,"Question: Minecraft是什么类型的游戏?
7
+ Answer: 《我的世界》(Minecraft)是一款沙盒类电子游戏。","[-0.00040432002, -0.021055095, 0.013438331, -0.027286993, -0.03085174, -0.0034172854, -0.025927773, -0.02546615, -0.01415641, -0.02582519, 0.012989532, 0.024671134, -0.012374036, -0.019542001, -0.0048983227, 0.021016626, 0.016426051, 0.0005465733, 0.026876662, -0.0069243307, -0.007725758, 0.039366104, 0.0095850695, -0.022568189, -0.006523617, 0.007668055, 0.005273391, -0.016182417, 0.0035294853, 0.008790053, 0.014720614, -0.007879632, -0.0023610045, -0.015656682, -0.0042764153, 0.012194516, -0.007475713, -0.010694244, 0.0014577961, -0.0028338465, 0.02600471, 0.034365196, -0.0014369589, 0.007853987, -0.019516354, 0.022452785, -0.0052124825, -0.04390539, -0.027671678, 0.0016717771, 0.0094632525, 0.02641504, -0.00062230823, -0.01592596, -0.0027697324, -0.02238867, -0.012047053, 0.011367443, 0.028466694, -0.020708878, 0.0023610045, 0.03180063, -0.036391206, -0.003773119, -0.006097258, 0.013098526, 0.009399138, -0.009758177, 0.0061902236, 0.007623175, 0.020516535, 0.024478791, 0.03185192, 0.015849024, 0.03126207, 0.018131489, -0.025222516, 0.008969573, 0.016541457, -0.0023145217, -0.0025549498, -0.02067041, -0.014079473, 0.019118847, 0.009790234, 0.029646395, 0.013617851, 0.013925599, 0.01130974, -0.00918115, 0.004173833, -0.0024587787, 0.037647843, 0.015156591, -0.021568008, 0.02967204, 0.0153745795, 0.023273446, 0.005468939, -0.019298367, 0.013925599, -0.008899047, -0.020183142, -0.0066165826, -0.034596007, 0.018823922, 0.017298004, -0.0049432027, 0.038750608, -0.02383765, -0.025696961, 0.0029332235, 0.032082733, -0.045213316, -0.020234434, 0.007700112, 0.026312457, -0.0061806063, -0.004523255, 0.01863158, 0.003741062, 0.019041909, 0.008604122, -0.023812005, 0.012835658, 0.01827254, -0.0432386, 0.002530907, 0.025607202, -0.021593655, 0.006834571, -0.0023946643, 0.00755265, 0.0043116785, -0.017900677, 0.009745355, -0.0045264605, -0.0068730395, -0.021311551, -0.016951788, 0.0109250555, 0.0061453437, 0.002926812, -0.017567284, -0.013194697, -0.00024824208, 0.003795559, 0.012745898, 0.008180968, 0.0013776533, 0.027748615, 0.00020857142, 0.008341254, 0.020708878, 0.00050009054, 0.013297279, -0.006106875, 0.008289963, 0.006161372, -0.02040113, 0.01524635, 0.01474626, 0.0066486397, -0.007860398, 0.005962618, 0.03292904, 0.018157134, -0.0026719582, 0.026017532, -0.0023561958, -0.0038692905, -0.00018633182, -0.03085174, 0.025927773, -0.012136813, 0.030954324, 0.012354801, 0.011591842, -0.018259717, -0.0036128338, -0.0458801, -0.015079654, -0.0021830876, 0.016272178, -0.020016445, -0.026543269, 0.022991342, 0.0006527624, 0.007847575, 0.0037891478, 0.028800087, 0.0497526, 0.0131818745, 0.02501735, -0.60154486, -0.006517206, 0.0016813942, -0.029877204, 0.01895215, 0.019618938, 0.032108378, 0.03646814, 0.010367262, -0.04536719, -0.013566559, 0.027851198, 0.011040461, -0.021721883, -0.007520593, -0.028953962, -0.011457203, 0.0008455057, -0.041289527, 0.0017086427, -0.02926171, 0.015310464, 0.007494947, -0.013143405, -0.0009528969, 0.02646633, 0.007879632, -0.01311776, -0.0018657225, 0.026389394, -0.018439237, 0.005526642, 0.0014866474, 0.017644221, 0.045777522, -0.007360307, -0.009982577, 0.03274952, 0.002575787, 0.010476256, -0.009668417, 0.014284638, 0.032800812, -0.0039141704, -0.010822473, -0.0028899463, 0.03510892, 0.0063344804, 0.020785816, 0.018900858, -0.0113995, -0.021875756, -0.011476438, -0.004125747, -0.0057927156, 0.0033659942, 0.0379043, -0.03954562, 0.009193973, 0.0068794508, 0.008629768, 0.02040113, -0.026312457, 0.011040461, -0.015079654, 0.022106567, -0.0065107946, -0.013156229, 0.0075013586, -0.012508675, 0.00068441883, 0.0069307424, -0.018464882, -0.024978882, 0.0068858624, 0.015079654, 0.013322925, 0.0052317167, -0.0059337667, 0.0058375956, 0.027030537, -0.014464158, 0.0025485384, -0.009450429, 0.026902307, -0.021606477, 0.0055074077, 0.0005726197, -0.0027537039, 0.0144000435, 0.018464882, -0.0040231645, -0.00023982709, -0.026209874, -0.03957127, 0.00592415, -0.02818459, -0.0151053, 0.013617851, -0.011418735, -0.006350509, -0.0008695485, -0.015143768, 0.01768269, -0.00949531, 0.009822291, -0.02197834, 0.012835658, 0.04590575, -0.021773174, 0.010687833, -0.014502626, 0.0021077534, 0.0015732015, -0.0026895895, -0.02546615, 0.014977071, -0.02058065, 0.007385953, -0.0056708986, 0.023209332, 0.011053284, 0.0010779196, -0.00850154, -0.016195241, 0.0050650197, -0.0071230847, 0.0028562865, -0.017182598, -0.0074115987, 0.00044719636, 0.009681241, 0.0039686672, -0.010033868, -0.0023353589, 0.0005754247, 0.028056363, -0.011059695, -0.00053214765, 0.010367262, 0.016336292, -0.015836202, 0.0049239686, 0.007475713, 0.0040488103, -0.016349114, -0.013630673, -0.017721158, -0.0097068865, -0.009809469, 0.0006976424, -0.011809831, 0.025850834, 0.022606658, -0.008289963, 0.015066831, 0.003277837, -0.008078386, -0.020195965, -0.024324918, 0.0120214075, 0.010598073, -0.026568914, -0.029569458, -0.015502808, -0.01596443, -0.029236063, 0.01307288, -0.02628681, -0.033954866, 0.02017032, 0.009258087, -0.0053310934, -0.0007894058, -0.029338647, -0.005273391, -0.011764951, -0.028569276, -0.00949531, -0.013797371, -0.016131125, -0.016913319, 0.007950158, 0.0031864746, -0.009540189, 0.004359764, 0.02220915, 0.038827546, -0.020837106, 0.023542725, 0.03328808, 0.02985156, -0.013669142, -0.00759753, -0.0022375847, 0.014015359, 0.026774079, 0.0097068865, 0.0016349114, 0.016759446, 0.0020051708, 0.021414135, -0.020157497, 0.009309378, 0.009270909, -0.037878655, 0.0049816715, -0.005577933, 0.031467237, 0.0028306409, 0.021234615, -0.03398051, -0.0026543268, -0.009629949, 0.014130764, 0.02890267, -0.014412866, -0.011893179, -0.017298004, 0.018746985, 0.0044976096, 0.019016264, -0.0038917304, 0.015156591, -0.015900316, 0.041007426, -0.0008719528, 0.03221096, -0.0112007465, -0.021003803, -0.025273807, -0.020785816, 0.015323288, -0.009758177, -0.0026286812, -0.009597892, 0.04980389, -0.017759627, 0.014220524, -0.0037218279, -0.013021589, 0.035570543, 0.013245989, -0.015554098, 0.028235883, -0.0049175574, 0.023940234, 0.021183323, -0.0026543268, 0.038006883, -0.014207701, -0.024453146, -0.040827908, -0.024491616, 0.00045040206, -0.0058183614, -0.028235883, -0.001392079, 0.0065652914, 0.023953056, -0.019298367, 0.018541818, -0.0070589706, -0.004433495, -0.012630492, 0.008924693, -0.007668055, -0.02081146, 0.011662369, -0.012912595, -0.011521317, 0.006110081, 0.0239787, -0.017246714, -0.000603074, -0.0068858624, -0.0008951942, -0.0052188938, 0.0029973376, -0.0009881597, -0.023427319, -0.013361394, -0.0105596045, 0.022670772, 0.01121998, -0.020029267, -0.036698952, -0.00043196924, -0.02143978, 0.015118122, -0.024414677, 0.01859311, -0.012611258, 0.0038692905, -0.008713116, -0.0063889776, 0.01700308, 0.0027937752, -0.033672765, -0.0030213804, -0.005061814, 0.0021430163, -0.005347122, -0.02176035, 0.03559619, 0.0033691998, -0.0003347962, 0.01592596, 0.0045617237, -0.014258993, -0.01501554, 0.0018000054, 0.0019298367, -0.03903271, -0.024581375, 0.021414135, -0.011931648, -0.03133901, 0.036929764, 0.016028544, 0.0048790886, -0.008463071, -0.024094107, -0.015579744, 0.03867367, 0.0020404337, 0.0049816715, 0.011373854, -0.021721883, -0.009193973, -0.030415764, -0.0127843665, 0.0020083764, 0.0012758721, -0.008732351, 0.02890267, 0.018144311, 0.010206977, 0.00850154, 0.009520954, 0.011412323, -0.015733618, -0.014553918, -0.011502082, 0.0043854094, 0.006251132, 0.011713659, 0.02401717, -0.020208787, -0.014271815, 0.0010578838, 0.0017679484, -0.010373673, -0.032441773, 0.01501554, -0.019221429, 0.0034012569, -0.020657588, 0.0017679484, 0.03685283, -0.0070589706, 0.03649379, -0.0008166543, 0.0043084724, 0.0059369723, 0.023376027, 0.005215688, -0.020183142, -0.014233347, -0.015079654, 0.0146565, 0.0065460573, -0.014797552, -0.002067682, 0.0035583368, 0.0022584219, -0.033749703, -0.016041366, -0.007635998, -0.005693339, -0.019247076, 0.008725939, -0.0016076629, -0.03546796, -0.0010498696, -0.019836925, -0.0069820336, 0.0037218279, -0.022593835, -0.022337379, 0.0025902127, -0.015849024, 0.0008943927, -0.0063921832, -0.001386469, -0.0054208534, -0.0067319884, -0.03541667, 0.01049549, 0.01614395, 0.034749884, 0.009200384, -0.02058065, 0.013643497, 0.017221067, -0.0007781858, 0.0012630492, -0.026748434, -0.002309713, -0.005241334, -0.021067917, -0.0049496144, -0.0025886097, 0.012457384, 0.0111686895, 0.015182236, 0.027774261, 0.007757815, 0.010841707, -0.0022616275, -0.012585612, 0.01076477, -0.0032409716, -0.0017374941, -0.0020324194, -0.051009238, -0.0154643385, -0.010816061, 0.00574463, -0.023709422, 0.0031399918, 0.018221248, -0.011803419, -0.0057286015, 0.0010322382, -0.016220886, 0.028261527, -0.016682507, 0.00972612, 0.029313, 0.019888217, 0.027210055, -0.006154961, 0.004542489, 0.0013656319, -0.034185678, -5.6700974e-05, 0.019426595, -0.041776795, 0.0010851324, -0.0051804255, -0.028569276, -0.016131125, -0.0018625167, -0.0024796156, 0.016028544, -0.011470025, -0.0058696526, -0.032057088, -0.0033756113, 0.010751947, 0.017605752, 0.013810193, -0.004052016, -0.007219256, 0.004039193, -0.0062703663, 0.014194878, 0.02628681, -0.02790249, -0.033672765, 0.025260985, -0.0027617181, 0.022003984, -0.002421913, 0.010200565, -0.0006804117, -0.007674467, 0.008552831, -0.041853733, -0.02818459, -0.026107293, 0.023452966, 0.020298548, 0.023812005, 0.02967204, 0.021811642, -0.0029460464, 0.0029748976, -0.0016405215, -0.01972152, -0.0012197722, -0.027210055, 0.0031335803, 0.022055276, -0.0036513023, 0.01080965, 0.009642771, 0.008931104, 0.00040371894, 0.012354801, 0.02514558, -0.026543269, -0.03690412, -0.0045649293, 0.008783642, -0.00046082062, -0.0079373345, -0.01981128, -0.024235157, 0.023093926, -0.0376222, 0.0065075886, -0.011816243, 2.1325477e-05, -0.022786178, 0.011636723, -0.022542544, 0.012707429, -0.002003568, 0.011598255, -0.02736393, -0.008520774, 0.00043557567, 0.0026911926, 0.024991706, -0.006417829, -0.014079473, -0.0016092658, 0.02641504, -0.021375665, 0.016490165, 0.0071294964, -0.017567284, 0.0018657225, -0.008610534, 0.001106771, -0.020413954, 0.026979245, 0.02682537, -0.02040113, 0.003478194, -0.011149455, 0.0072897817, 0.023773536, -0.00243153, 0.033749703, -0.018157134, 0.027056182, 0.03162111, 0.01175854, 0.0024748072, -0.05216329, 0.0061132866, 0.011470025, 0.04957308, 0.0142461695, -0.0030630548, -0.012316333, 0.011809831, -0.023850473, 0.007744992, -0.023440143, -0.004677129, -0.00018012075, -0.0072256676, -0.026312457, -0.002026008, -0.0023626073, 0.011784186, -0.029313, -0.025838012, -0.051804252, -0.018477704, -0.012630492, 0.019862572, -0.001859311, 0.01696461, 0.0302106, -0.010739124, 0.0045585176, -0.0007753808, -0.013245989, 0.0021542362, -0.0056003733, 0.026107293, -0.007078205, -0.012502264, 0.011104575, 0.023991523, -0.017259536, -0.005305448, 0.00012351996, 0.044495236, -0.0010065925, 0.0030229834, -0.01574644, 0.012354801, 0.022247618, 0.009296555, 0.010367262, -0.011027638, -0.014874488, -0.018746985, 0.03133901, -0.008104032, 0.0020772992, -0.014130764, -0.001947468, -0.013861485, -0.026568914, 0.002232776, 0.005010523, -0.011771362, -0.022016808, -0.021247437, -0.017015902, -0.0045521064, 0.0014465761, 0.012047053, 0.0068153366, 0.014015359, -0.005151574, 0.022452785, 0.02410693, 0.008591299, -0.007494947, 0.001557173, 0.0035262797, -0.033365015, 0.008257906, -0.01175854, 0.0019057938, -0.032723874, -0.009597892, -0.00895675, -0.030723512, -0.0144000435, 0.04659818, 0.00818738, 0.008540008, -0.0118483, -0.019247076, 0.023722244, -0.012976709, -0.009912051, 0.011771362, 0.0063440977, 0.004645072, -0.00583439, 0.008674648, -0.0017326856, -0.048855, -0.027851198, -0.0033756113, 0.007796284, -0.013797371, -0.0052637737, -0.038955774, -0.009379904, -0.016118303, -0.011380266, -0.014028181, 0.0067961025, 0.026543269, 0.033441953, 0.010136451, -0.0065396456, 0.0067704567, 9.3566625e-05, -0.021067917, -0.026902307, -0.033365015, 0.008437426, -0.008264317, 0.04993212, -0.002389856, 0.0036000109, -0.037057992, 0.014015359, -0.032185316, -0.014502626, 0.011841888, 0.02908219, 0.0239787, 0.004193067, 0.003776325, 0.03854544, -0.0146436775, -0.0007898065, -0.003478194, -0.015554098, -0.019439418, -0.009956932, -0.0244275, -0.008482305, -0.01696461, 0.004128953, 0.010008222, -0.0074564787, -0.009617127, 0.01492578, 0.014169233, -0.027235702, -0.017028725, 0.015348934, -0.018131489, -0.009270909, 0.01723389, -0.016310645, -0.013297279, -0.015259174, 0.018605933, -0.01592596, -0.0008671442, -0.010392908, -0.009379904, 0.007661644, 0.008533597, -0.0034333142, 0.006549263, -0.0020532564, -0.003987902, 0.0017727569, 0.0037122108, 0.01768269, -0.008661825, -0.005795921, 0.0006760038, -0.0061998405, -0.03646814, 0.007719347, -0.013733257, 0.0022359819, 0.013399863, 0.0061036693, -0.00782193, -0.013720433, -0.011482849, 0.008418191, -0.0043661753, -0.009617127, 0.015874669, 0.0010538767, 0.027492158, 0.006296012, 0.002256819, -0.007469301, 0.02283747, -0.013899953, 0.008354077, -0.011591842, 0.0034044627, 0.00596903, 0.0088221105, 0.018477704, 0.021914225, 0.017605752, 0.016297823, 0.025991887, 0.2872315, 0.010508313, -0.0071487306, 0.015887493, 0.021183323, 0.020837106, 0.03387793, -0.0067704567, 0.008937516, 0.020029267, -0.0075013586, 0.0063793603, -0.009687652, 0.0071038506, -0.025478972, -0.03741703, -0.0059850584, -0.017541638, 0.010546782, -0.02017032, 0.03967385, -0.0043854094, -0.0050650197, -0.03039012, 0.012341979, -0.026312457, -0.013810193, -0.00062871963, 0.026748434, 0.019747166, -0.018785452, 0.01474626, -0.0071936105, 0.017567284, -0.02949252, -0.0080591515, 0.010104394, -0.012508675, 0.0244275, 0.033390664, -0.0034108742, -0.00013053245, -0.013060058, 0.009251676, 0.022003984, 0.029979788, -0.028235883, -0.012059876, -0.0016413229, 0.009988989, -0.01574644, -0.025030173, 0.005911327, 0.03890448, -0.002146222, 0.009751766, 0.0022856703, -0.0029460464, -0.0038372334, -0.014092295, -0.010155685, 0.018746985, -0.005645253, 0.025696961, -0.016951788, 0.013387039, -0.045777522, 0.008847756, 0.009745355, -0.006680697, -0.023260623, -0.016336292, 0.01008516, -0.0067961025, -0.010745536, -0.036929764, 0.029338647, 0.011296918, 0.023042634, 0.02333756, -0.024324918, -0.0011981337, -0.0004451928, -0.00012542335, -0.012777955, -0.012995943, 0.024542905, -0.01886239, -0.030774804, -0.009386315, -0.0041225413, 0.004632249, 0.0062703663, -0.012470207, 0.027081827, 0.044726048, 0.023029812, 0.026120115, -0.01949071, -0.0013399862, -0.032390483, 0.04067403, 0.0015475559, 0.018477704, 0.0037442679, 0.0053214766, -0.009597892, 0.022914406, 0.0037122108, -0.008584888, 0.0154643385, -0.02126026, -0.010604484, -0.02831282, 0.0072577246, 0.0020532564, -0.023683775, -0.028338466, -0.018849567, -0.0045617237, 0.018605933, -0.036288623, 0.0011091753, -0.006263955, -0.01406665, -0.024491616, -0.0038660846, 0.014951426, 0.006219075, -0.02179882, 0.010655776, -0.02967204, 0.0063537145, -0.005359945, 0.023324737, 0.03341631, 0.006478737, -0.001243815, 0.009482486, 0.011470025, 0.016490165, -0.0016749828, 0.009687652, 0.02790249, 0.0041449815, -0.005920944, 0.010348028, 0.0033724057, 0.0061036693, -0.01705437, -0.05021422, -0.007571884, 0.007668055, -0.022080922, 0.01080965, -0.011732894, -0.004478375, -0.014425689, -0.0068922737, 0.021734705, -0.032031443, -0.011341797, 0.020478068, -0.013476799, -0.018195603, 0.0153745795, -0.15941349, 0.013008766, 0.027415222, -0.005568316, 0.03428826, -0.0062126634, -0.0071166735, 0.01827254, -0.009431195, -0.009963343, 0.0013063264, -0.017631399, -0.007828341, 0.018977795, 0.006110081, 0.027825551, -0.022824647, 0.008527185, 0.010360851, 0.0059497952, 0.04482863, 0.029646395, -0.01841359, 0.01298312, 0.020285726, 0.012181693, 0.013848661, 0.013694787, 0.01773398, -0.02772297, 0.001585223, -0.025722606, 0.0063537145, 0.0037025935, 0.024594197, -0.0019025882, 0.009155504, -0.008225849, -0.01610548, -0.0033916398, -0.012431739, 0.01995233, -0.0018448854, 0.010751947, 0.017567284, 0.011290506, -0.017285181, -0.014117941, 0.007437244, -0.00746289, 0.008668236, -0.012521498, 0.0025597585, 0.0052894196, 0.05188119, 0.012002174, 0.0088221105, 0.030569639, 0.0004395828, -0.0053086537, -0.035211504, -0.02469678, 0.013348571, -4.415363e-05, -0.0018833539, -0.0015251159, 0.0070717935, 0.0097966455, -0.035750065, -0.008398957, -0.0041770386, -0.029184772, 0.03192886, 0.010251856, -0.007866809, 0.009232441, 0.002223159, 0.013284457, -0.008360488, -0.0018865595, -0.023106748, 0.010065925, -0.031467237, -0.0122650415, 0.011598255, 0.01148926, -0.02067041, -0.011264861, -0.012559967, -0.005468939, 0.03128772, -0.034672946, -0.027133118, -0.004722009, 5.805338e-05, 0.0047252146, -0.013502445, -0.014502626, -0.01859311, -0.009764588, 0.02496606, -0.0042764153, 0.025440505, 0.00019184164, 0.023376027, -0.0063248635, 0.04600833, 0.0087002935, 0.0435207, -0.0031784603, -0.00012953067, -0.0026447098, 0.030056724, 0.03400616, 0.021850111, -0.0020179937, 0.0060684066, -0.032416128, 0.025299454, 0.008751585, -0.021657769, -0.01230351, 0.016387584, 0.027466513, -0.011001992, -0.0073346617, -0.06514, -0.014707792, 0.009553012, 0.014823197, -0.014682146, 0.035288442, 0.0006311239, 0.02108074, 0.027671678, 0.01984975, -0.0031832687, -0.024709603, -0.0004568135, 0.015041186, -0.0179135, -0.04803434, 0.009431195, -0.010623719, -0.015951607, 0.026774079, -0.011803419, -0.0014906545, -0.012130402, 0.0014217318, 0.014682146, 0.010130039, -0.015477162, 0.024145398, 0.035750065, -0.009783823, 0.01949071, -0.040494513, -0.02949252, -0.013233165, 0.017708335, 0.0016637628, 0.0016974228, -0.00909139, 0.0376222, -0.014810374, 0.0014497818, -0.0026591355, 0.0132716345, -0.009290144, -0.0040680445, -0.0047925347, -0.025478972, 0.02754345, -0.0026591355, -0.031185135, -0.020683233, -0.019362481, -0.016451698, 0.02049089, 0.0034172854, -0.011014815, -0.00041393714, -0.004356558, -0.018464882, 0.011239215, 0.008995219, -0.010348028, -0.03741703, -0.008770819, 0.01085453, 0.013733257, 0.00031415946, 0.015887493, 0.018439237, -0.028594922, -0.02058065, 0.030569639, -0.016079836, 0.018259717, -0.033031624, -0.03731445, -0.012611258, 0.002211939, 0.018221248, 0.0018528997, -0.02564567, -0.0071679647, -0.0074244216, -0.024863478, 0.04193067, 0.016438873, -0.011393089, -0.007546238, 0.0075013586, -0.031826276, -0.024735248, 0.009193973, 0.013060058, -0.011829065, 0.016438873, -0.017515993, 0.01773398, 0.016349114, 0.016246531, 0.0042956495, 0.010386496, -0.040366285, -0.083143264, 0.0101620965, -0.0024812187, 0.011155866, 0.024850653, -0.01582338, 0.020965336, -0.025863659, 0.0015675916, 0.004260387, -0.031774987, -0.0025116727, 0.014335929, 0.01148926, -0.019747166, 0.024889123, -0.013617851, 0.021914225, 0.01257279, 0.014271815, -0.00486306, -0.02152954, 0.02076017, -0.00050930696, -0.02682537, 0.011546963, -0.012271453, 0.0048149745, -0.02614576, -0.013656319, 0.013297279, -0.02469678, 0.00981588, 0.029210418, -0.028620567, -0.014130764, -0.02093969, 0.026902307, -0.0005233319, 0.055958852, -0.018349476, -0.032236606, 0.016272178, -0.01723389, -0.01542587, -0.0112007465, -0.026876662, -0.005860036, 0.028235883, -0.023004165, 0.007860398, 0.01564386, -0.026722789, -0.014015359, -0.03215967, -0.023619661, 0.023170862, 0.0069948565, 0.0088221105, -0.022247618, 0.03067222, 0.026722789, 0.002045242, -0.020003622, -0.01886239, 0.00030574447, -0.014605209, 0.00644668, 0.027286993, -0.010905821, 0.007738581, -0.028056363, 0.017451879, -0.0008575271, -0.018439237, 0.015489984, 0.016579926, 0.002202322, -0.022196326, 0.014182055, 0.020772992, 0.009578657, -0.037391387, 0.0155284535, 0.0153745795, 0.029056543, -0.024530083, 0.01845206, -0.028389756, -0.020208787, 0.0030534375, 0.0059530013, -0.02754345, 0.021875756, 0.0022968904, 0.004468758, -0.009322201, -0.0017406999, 0.021593655, 0.021055095, -0.0031063317, -0.004212301, -0.0089439275, -0.021862933, -0.017169775, 0.003157623, -0.009411961, -0.03885319, -0.016951788, 0.009238852, 0.004574546, 0.011059695, -0.0302106, 0.0060555837, -0.0094632525, 0.0322879, 0.002607844, 0.0005129134, -0.031415947, 0.02664585, -0.01008516, 0.011585431, 0.019836925, -0.027235702, 0.017964792, 0.0016797914, -0.0060587893, -0.017105661, 0.023594016, -0.014207701, -0.0063440977, 0.017387765, 0.020516535, -0.008565654, -0.010642953, -0.00236421, 0.00095369836, 0.026979245, -0.016913319, 0.022350201, 0.022350201, 0.0065717027, 0.018541818, 0.010181331, 0.015348934, 0.033390664, 0.008790053, 0.00016419239, -0.031595465, -0.005795921, -0.012675372, 0.011059695, -0.025248162, -0.047470134, 0.018195603, -0.029338647, 0.00963636, -0.035391025, 0.034724236, 0.02505582, 0.008565654, 0.037750427, 0.015797732, -0.010514725, 0.015156591, 0.035288442, -0.008379723, -0.021785997, -0.031774987, 0.015271996, -0.021196146, -0.02383765, -0.032723874, 0.025440505, -0.0028322437, 0.013008766, 0.0043180897, 0.029159127, 0.020298548, -0.0039782845, -0.0047316262, -0.008315609, -0.020901222, 0.00076175656, -0.021452602, -0.021324374, -0.014284638, -0.011367443]"
output/qa_embeddings.csv ADDED
@@ -0,0 +1 @@
 
 
1
+
output/qaq.csv ADDED
The diff for this file is too large to render. See raw diff
 
qa.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ import sys
3
+ import requests
4
+ import logging
5
+ from typing import List, Tuple
6
+ from emb import generate_embeddings_from_qa_pairs
7
+
8
+ # 设置日志记录
9
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
10
+
11
+ # OpenAI API配置
12
+ API_URL = ""
13
+ API_KEY = ""
14
+ MODEL = "gpt-3.5-turbo"
15
+
16
+ # 问答提示模板
17
+ Prompt_AgentQA = {
18
+ "description": "<Context></Context> 标记中是一段文本,学习和分析它,并整理学习成果:\n- 提出问题并给出每个问题的答案。\n- 你的拆分整理不得包含除了文本以外的知识内容,你的所有答案都只能从文本中获取\n- 答案需详细完整,尽可能保留原文描述。\n- 答案可以包含普通文字、链接、代码、表格、公示、媒体链接等 Markdown 元素。\n- 最多提出 40 个问题。\n",
19
+ "fixedText": "请按以下格式整理学习成果:\n<Context>\n文本\n</Context>\nQ1: 问题。\nA1: 答案。\nQ2:\nA2:\n\n------\n\n我们开始吧!\n\n<Context>\n{{{(text)}}}\n</Context>\n"
20
+ }
21
+
22
+ def replace_variable(text: str, obj: dict) -> str:
23
+ for key, val in obj.items():
24
+ if isinstance(val, (str, int)):
25
+ text = text.replace(f"{{{{({key})}}}}", str(val))
26
+ return text or ''
27
+
28
+ def generate_qa(text: str) -> List[Tuple[str, str]]:
29
+ system_prompt = f"{Prompt_AgentQA['description']}"
30
+ user_prompt = f"{replace_variable(Prompt_AgentQA['fixedText'], {'text': text})}"
31
+ headers = {
32
+ "Content-Type": "application/json",
33
+ "Authorization": f"Bearer {API_KEY}"
34
+ }
35
+
36
+ data = {
37
+ "model": MODEL,
38
+ "messages": [
39
+ {
40
+ "role": "system",
41
+ "content": system_prompt
42
+ },
43
+ {
44
+ "role": "user",
45
+ "content": user_prompt
46
+ }
47
+ ],
48
+ "temperature": 0.3,
49
+ "stream": False
50
+ }
51
+
52
+ try:
53
+ response = requests.post(API_URL, headers=headers, json=data)
54
+ response.raise_for_status()
55
+ answer = response.json()["choices"][0]["message"]["content"]
56
+ except requests.exceptions.RequestException as e:
57
+ logging.error(f"OpenAI API request failed: {e}")
58
+ return []
59
+
60
+ return format_split_text(answer, text)
61
+
62
+ def format_split_text(text: str, raw_text: str) -> List[Tuple[str, str]]:
63
+ text = text.replace(r"\\n", "\n")
64
+ regex = r"Q\d+:(\s*)(.*)(\s*)A\d+:(\s*)([\s\S]*?)(?=Q\d|$)" # 匹配Q和A的正则表达式
65
+ matches = re.findall(regex, text)
66
+
67
+ result = []
68
+ for match in matches:
69
+ q = match[1].strip()
70
+ a = match[4].strip()
71
+ if q:
72
+ result.append((q, a))
73
+
74
+ # 如果结果为空,直接将原文本拆分为块
75
+ if not result:
76
+ chunks = [raw_text[i:i+512] for i in range(0, len(raw_text), 512)]
77
+ result = [(chunk, '') for chunk in chunks]
78
+
79
+ return result
80
+
81
+ def main(text, api_key, api_url_base):
82
+ global API_KEY, API_URL
83
+ API_KEY = api_key
84
+ API_URL = f"{api_url_base}/chat/completions"
85
+
86
+ qa_pairs = generate_qa(text)
87
+ generate_embeddings_from_qa_pairs(qa_pairs, api_key, api_url_base)
88
+ return qa_pairs
89
+
90
+ if __name__ == "__main__":
91
+ text = sys.argv[1] # 从命令行获取搜索结果作为text变量
92
+ api_key = sys.argv[2]
93
+ api_url_base = sys.argv[3]
94
+ main(text, api_key, api_url_base)
95
+
96
+
requirements.txt ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ aiohttp==3.9.3
3
+ aiosignal==1.3.1
4
+ altgraph==0.17.4
5
+ annotated-types==0.6.0
6
+ anthropic==0.18.1
7
+ anyio==3.7.1
8
+ arxiv==2.1.0
9
+ async-timeout==4.0.3
10
+ asyncio==3.4.3
11
+ attrs==23.2.0
12
+ Babel==2.14.0
13
+ bce-python-sdk==0.9.6
14
+ beautifulsoup4==4.12.3
15
+ bidict==0.23.1
16
+ blinker==1.7.0
17
+ Brotli==1.1.0
18
+ cachetools==5.3.3
19
+ certifi==2023.7.22
20
+ cffi==1.16.0
21
+ charset-normalizer==3.3.2
22
+ click==8.1.7
23
+ colorama==0.4.6
24
+ colorlog==6.8.2
25
+ contourpy==1.2.0
26
+ cssselect==1.2.0
27
+ cssselect2==0.7.0
28
+ curl_cffi==0.6.2
29
+ cycler==0.12.1
30
+ dataclasses-json==0.6.4
31
+ datasets==2.18.0
32
+ dill==0.3.4
33
+ distro==1.8.0
34
+ docopt==0.6.2
35
+ docx==0.2.4
36
+ duckduckgo_search==5.1.0
37
+ exceptiongroup==1.1.3
38
+ fastapi==0.110.0
39
+ feedfinder2==0.0.4
40
+ feedparser==6.0.10
41
+ filelock==3.13.1
42
+ Flask==3.0.2
43
+ flask-babel==4.0.0
44
+ Flask-SocketIO==5.3.6
45
+ fonttools==4.50.0
46
+ frozenlist==1.4.1
47
+ fsspec==2024.2.0
48
+ func_timeout==4.3.5
49
+ future==1.0.0
50
+ google==3.0.0
51
+ google-ai-generativelanguage==0.4.0
52
+ google-api-core==2.18.0
53
+ google-auth==2.29.0
54
+ google-generativeai==0.4.1
55
+ googleapis-common-protos==1.63.0
56
+ greenlet==3.0.3
57
+ grpcio==1.62.1
58
+ grpcio-status==1.62.1
59
+ h11==0.14.0
60
+ html5lib==1.1
61
+ htmldocx==0.0.6
62
+ httpcore==1.0.2
63
+ httpx==0.25.1
64
+ huggingface-hub==0.21.3
65
+ idna==3.4
66
+ itsdangerous==2.1.2
67
+ jieba==0.42.1
68
+ jieba3k==0.35.1
69
+ Jinja2==3.1.3
70
+ joblib==1.3.2
71
+ jsonpatch==1.33
72
+ jsonpointer==2.4
73
+ kiwisolver==1.4.5
74
+ langchain==0.1.13
75
+ langchain-community==0.0.30
76
+ langchain-core==0.1.37
77
+ langchain-google-genai==1.0.1
78
+ langchain-openai==0.1.1
79
+ langchain-text-splitters==0.0.1
80
+ langsmith==0.1.35
81
+ loguru==0.7.2
82
+ lxml==5.1.0
83
+ Markdown==3.6
84
+ markdown-it-py==3.0.0
85
+ markdown2==2.4.13
86
+ MarkupSafe==2.1.5
87
+ marshmallow==3.21.1
88
+ matplotlib==3.8.3
89
+ md2pdf==1.0.1
90
+ mdurl==0.1.2
91
+ mistune==3.0.2
92
+ multidict==6.0.5
93
+ multiprocess==0.70.12.2
94
+ mypy-extensions==1.0.0
95
+ newspaper3k==0.2.8
96
+ nltk==3.8.1
97
+ numpy==1.26.4
98
+ onnx==1.16.0
99
+ openai==1.14.3
100
+ orjson==3.10.0
101
+ outcome==1.3.0.post0
102
+ packaging==23.2
103
+ paddle2onnx==1.0.6
104
+ paddlefsl==1.1.0
105
+ paddlenlp==2.6.1
106
+ pandas==2.2.1
107
+ pefile==2023.2.7
108
+ pillow==10.2.0
109
+ playwright==1.42.0
110
+ plotly==5.20.0
111
+ proto-plus==1.23.0
112
+ protobuf==3.20.2
113
+ psutil==5.9.8
114
+ pyarrow==15.0.2
115
+ pyarrow-hotfix==0.6
116
+ pyasn1==0.6.0
117
+ pyasn1_modules==0.4.0
118
+ pycparser==2.21
119
+ pycryptodome==3.20.0
120
+ pydantic==2.4.2
121
+ pydantic_core==2.10.1
122
+ pydyf==0.9.0
123
+ pyee==11.0.1
124
+ Pygments==2.17.2
125
+ pyinstaller==6.5.0
126
+ pyinstaller-hooks-contrib==2024.3
127
+ PyMuPDF==1.24.0
128
+ PyMuPDFb==1.24.0
129
+ pyparsing==3.1.2
130
+ pypdf==4.1.0
131
+ pyperclip==1.8.2
132
+ pyphen==0.14.0
133
+ PySocks==1.7.1
134
+ python-dateutil==2.9.0.post0
135
+ python-docx==1.1.0
136
+ python-dotenv==1.0.1
137
+ python-engineio==4.9.0
138
+ python-multipart==0.0.9
139
+ python-socketio==5.11.2
140
+ pytz==2024.1
141
+ pywin32-ctypes==0.2.2
142
+ PyYAML==6.0.1
143
+ rarfile==4.1
144
+ regex==2023.12.25
145
+ requests==2.31.0
146
+ requests-file==2.0.0
147
+ rich==13.7.1
148
+ rsa==4.9
149
+ safetensors==0.4.2
150
+ scikit-learn==1.4.1.post1
151
+ scipy==1.12.0
152
+ selenium==4.18.1
153
+ sentencepiece==0.2.0
154
+ seqeval==1.2.2
155
+ sgmllib3k==1.0.0
156
+ shellingham==1.5.4
157
+ simple-websocket==1.0.0
158
+ six==1.16.0
159
+ smsactivate==1.5
160
+ sniffio==1.3.0
161
+ sortedcontainers==2.4.0
162
+ soupsieve==2.5
163
+ SQLAlchemy==2.0.29
164
+ starlette==0.36.3
165
+ tavily-python==0.3.1
166
+ tenacity==8.2.3
167
+ threadpoolctl==3.4.0
168
+ tiktoken==0.5.2
169
+ tinycss2==1.2.1
170
+ tinysegmenter==0.3
171
+ tldextract==5.1.2
172
+ tokenizers==0.15.2
173
+ tqdm==4.66.1
174
+ trio==0.24.0
175
+ trio-websocket==0.11.1
176
+ typer==0.12.0
177
+ typer-cli==0.12.0
178
+ typer-slim==0.12.0
179
+ typing-inspect==0.9.0
180
+ typing_extensions==4.10.0
181
+ tzdata==2024.1
182
+ urllib3==2.2.1
183
+ uvicorn==0.29.0
184
+ visualdl==2.5.3
185
+ weasyprint==61.2
186
+ webdriver-manager==4.0.1
187
+ webencodings==0.5.1
188
+ Werkzeug==3.0.1
189
+ win32-setctime==1.1.0
190
+ wsproto==1.2.0
191
+ xxhash==3.4.1
192
+ yarl==1.9.4
193
+ zopfli==0.2.3
search.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import json
3
+ import sys
4
+ import sys
5
+ import io
6
+ import sys
7
+ sys.stdout.reconfigure(encoding='utf-8')
8
+
9
+ def search_bing(key_word, bing_api_key):
10
+ headers = {
11
+ "Ocp-Apim-Subscription-Key": bing_api_key,
12
+ "X-MSEdge-ClientID": "00B4230B74496E7A13CC2C1475056FF4",
13
+ "X-MSEdge-ClientIP": "11.22.33.44",
14
+ "X-Search-Location": "lat:55;long:-111;re:22",
15
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36"
16
+ }
17
+ url = "https://api.bing.microsoft.com/v7.0/search"
18
+ params = {"q": key_word, "mkt": "zh-CN", "count": "2"}
19
+
20
+ proxies = {
21
+ "http": "http://127.0.0.1:10809",
22
+ "https": "http://127.0.0.1:10809"
23
+ }
24
+
25
+ response = requests.get(url, headers=headers, params=params, proxies=proxies)
26
+ json_data = response.json()
27
+
28
+ search_result = ""
29
+ for item in json_data.get("webPages", {}).get("value", []):
30
+ name = item.get("name", "")
31
+ snippet = item.get("snippet", "")
32
+ search_result += f"Name: {name}\nSnippet: {snippet}\n\n"
33
+
34
+ return search_result
35
+
36
+ if __name__ == "__main__":
37
+ key_words_str = sys.argv[1] # 将关键字作为一个字符串获取
38
+ bing_api_key = sys.argv[2]
39
+ api_key = sys.argv[3]
40
+ api_url_base = sys.argv[4]
41
+
42
+ key_words = key_words_str.split(',') # 在代码中手动拆分关键字
43
+
44
+ search_result = ""
45
+ for key_word in key_words:
46
+ search_result += search_bing(key_word, bing_api_key)
47
+
48
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
49
+
50
+ # 直接调用qa.py,并将search_result作为参数传递
51
+ # import qa
52
+ # qa.main(search_result, api_key, api_url_base)
53
+ print(search_result)
static/css/style.css ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ :root {
2
+ --primary-color: #2196f3;
3
+ --secondary-color: #64b5f6;
4
+ --text-color: #e0e0e0;
5
+ --bg-color: #121212;
6
+ --input-bg-color: #1e1e1e;
7
+ --button-hover-color: #1976d2;
8
+ --delete-button-color: #f44336;
9
+ --accent-color: #ff9800;
10
+ --border-color: #424242;
11
+ }
12
+
13
+ body {
14
+ font-family: 'Roboto', sans-serif;
15
+ background-color: var(--bg-color);
16
+ color: var(--text-color);
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ .container {
22
+ max-width: 960px;
23
+ margin: 60px auto;
24
+ padding: 40px;
25
+ background-color: #1e1e1e;
26
+ border-radius: 12px;
27
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
28
+ border: 2px solid var(--border-color);
29
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
30
+ }
31
+
32
+ .container:hover {
33
+ transform: translateY(-5px);
34
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
35
+ }
36
+
37
+ h1 {
38
+ text-align: center;
39
+ color: var(--primary-color);
40
+ font-size: 48px;
41
+ margin-bottom: 60px;
42
+ text-transform: uppercase;
43
+ letter-spacing: 3px;
44
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
45
+ transition: color 0.3s ease, text-shadow 0.3s ease;
46
+ }
47
+
48
+ h1:hover {
49
+ color: var(--accent-color);
50
+ text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
51
+ }
52
+
53
+ .form-group {
54
+ margin-bottom: 30px;
55
+ }
56
+
57
+ label {
58
+ display: block;
59
+ font-weight: 500;
60
+ margin-bottom: 10px;
61
+ color: var(--text-color);
62
+ font-size: 18px;
63
+ text-transform: uppercase;
64
+ letter-spacing: 1px;
65
+ transition: color 0.3s ease;
66
+ }
67
+
68
+ label:hover {
69
+ color: var(--accent-color);
70
+ }
71
+
72
+ input[type="text"],
73
+ select,
74
+ textarea {
75
+ width: 100%;
76
+ padding: 15px;
77
+ border: none;
78
+ border-radius: 8px;
79
+ background-color: var(--input-bg-color);
80
+ color: var(--text-color);
81
+ font-size: 16px;
82
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
83
+ transition: box-shadow 0.3s ease, background-color 0.3s ease;
84
+ }
85
+
86
+ input[type="text"]:focus,
87
+ select:focus,
88
+ textarea:focus {
89
+ outline: none;
90
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px var(--secondary-color);
91
+ background-color: #2d2d2d;
92
+ }
93
+
94
+ button {
95
+ padding: 15px 30px;
96
+ background-color: var(--primary-color);
97
+ color: #fff;
98
+ border: none;
99
+ border-radius: 8px;
100
+ cursor: pointer;
101
+ transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
102
+ font-size: 18px;
103
+ text-transform: uppercase;
104
+ letter-spacing: 2px;
105
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
106
+ }
107
+
108
+ button:hover {
109
+ background-color: var(--button-hover-color);
110
+ transform: translateY(-2px);
111
+ box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
112
+ }
113
+
114
+ button:active {
115
+ transform: translateY(0);
116
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
117
+ }
118
+
119
+ #outline-container,
120
+ #content-container,
121
+ #key-word-container,
122
+ #search-result-container {
123
+ margin-top: 60px;
124
+ border: 2px solid var(--border-color);
125
+ border-radius: 12px;
126
+ padding: 30px;
127
+ transition: border-color 0.3s ease, box-shadow 0.3s ease;
128
+ }
129
+
130
+ #outline-container:hover,
131
+ #content-container:hover,
132
+ #key-word-container:hover,
133
+ #search-result-container:hover {
134
+ border-color: var(--accent-color);
135
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
136
+ }
137
+
138
+ h2 {
139
+ color: var(--secondary-color);
140
+ font-size: 36px;
141
+ margin-bottom: 30px;
142
+ text-transform: uppercase;
143
+ letter-spacing: 2px;
144
+ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
145
+ position: relative;
146
+ display: inline-block;
147
+ transition: color 0.3s ease, text-shadow 0.3s ease;
148
+ }
149
+
150
+ h2::after {
151
+ content: '';
152
+ position: absolute;
153
+ bottom: -5px;
154
+ left: 0;
155
+ width: 100%;
156
+ height: 2px;
157
+ background-color: var(--accent-color);
158
+ transform: scaleX(0);
159
+ transition: transform 0.3s ease;
160
+ }
161
+
162
+ h2:hover {
163
+ color: var(--accent-color);
164
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
165
+ }
166
+
167
+ h2:hover::after {
168
+ transform: scaleX(1);
169
+ }
170
+
171
+ #outline,
172
+ #content,
173
+ #search-result {
174
+ width: 100%;
175
+ min-height: 300px;
176
+ padding: 20px;
177
+ border: none;
178
+ border-radius: 8px;
179
+ background-color: var(--input-bg-color);
180
+ color: var(--text-color);
181
+ font-size: 16px;
182
+ line-height: 1.8;
183
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
184
+ resize: vertical;
185
+ transition: box-shadow 0.3s ease, background-color 0.3s ease;
186
+ }
187
+
188
+ #outline:focus,
189
+ #content:focus,
190
+ #search-result:focus {
191
+ outline: none;
192
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px var(--secondary-color);
193
+ background-color: #2d2d2d;
194
+ }
195
+
196
+ .key-word-button {
197
+ display: inline-block;
198
+ margin: 5px;
199
+ padding: 8px 16px;
200
+ background-color: #424242;
201
+ border: none;
202
+ border-radius: 20px;
203
+ cursor: pointer;
204
+ color: var(--text-color);
205
+ font-size: 14px;
206
+ text-transform: uppercase;
207
+ letter-spacing: 1px;
208
+ transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
209
+ }
210
+
211
+ .key-word-button:hover {
212
+ background-color: var(--secondary-color);
213
+ transform: translateY(-2px);
214
+ color: #fff;
215
+ }
216
+
217
+ .key-word-button.selected {
218
+ background-color: var(--primary-color);
219
+ color: #fff;
220
+ }
221
+
222
+ .delete-button {
223
+ background-color: var(--delete-button-color);
224
+ color: #fff;
225
+ border: none;
226
+ border-radius: 50%;
227
+ width: 24px;
228
+ height: 24px;
229
+ line-height: 24px;
230
+ text-align: center;
231
+ font-size: 14px;
232
+ cursor: pointer;
233
+ margin-left: 8px;
234
+ transition: background-color 0.3s ease, transform 0.3s ease;
235
+ }
236
+
237
+ .delete-button:hover {
238
+ background-color: #d32f2f;
239
+ transform: scale(1.1);
240
+ }
241
+
242
+ #qa-result-container {
243
+ margin-top: 40px;
244
+ padding: 30px;
245
+ background-color: var(--input-bg-color);
246
+ border-radius: 8px;
247
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
248
+ border: 2px solid var(--border-color);
249
+ transition: border-color 0.3s ease, box-shadow 0.3s ease;
250
+ }
251
+
252
+ #qa-result-container:hover {
253
+ border-color: var(--accent-color);
254
+ box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
255
+ }
256
+
257
+ .qa-item {
258
+ margin-bottom: 40px;
259
+ padding-bottom: 20px;
260
+ border-bottom: 1px solid var(--border-color);
261
+ transition: border-color 0.3s ease;
262
+ }
263
+
264
+ .qa-item:last-child {
265
+ margin-bottom: 0;
266
+ padding-bottom: 0;
267
+ border-bottom: none;
268
+ }
269
+
270
+ .qa-item:hover {
271
+ border-color: var(--accent-color);
272
+ }
273
+
274
+ .qa-item h3 {
275
+ color: var(--accent-color);
276
+ font-size: 24px;
277
+ margin-bottom: 15px;
278
+ text-transform: uppercase;
279
+ letter-spacing: 1px;
280
+ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
281
+ transition: color 0.3s ease, text-shadow 0.3s ease;
282
+ }
283
+
284
+ .qa-item h3:hover {
285
+ color: var(--secondary-color);
286
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
287
+ }
288
+
289
+ .qa-item p {
290
+ color: var(--text-color);
291
+ font-size: 16px;
292
+ line-height: 1.8;
293
+ transition: color 0.3s ease;
294
+ }
295
+
296
+ .qa-item p:hover {
297
+ color: #fff;
298
+ }
299
+
300
+ /* 动画效果 */
301
+ @keyframes fadeIn {
302
+ 0% {
303
+ opacity: 0;
304
+ transform: translateY(20px);
305
+ }
306
+ 100% {
307
+ opacity: 1;
308
+ transform: translateY(0);
309
+ }
310
+ }
311
+
312
+ .container {
313
+ animation: fadeIn 0.6s ease;
314
+ }
315
+
316
+ @keyframes slideIn {
317
+ 0% {
318
+ opacity: 0;
319
+ transform: translateX(-20px);
320
+ }
321
+ 100% {
322
+ opacity: 1;
323
+ transform: translateX(0);
324
+ }
325
+ }
326
+
327
+ h1, h2, .form-group, #outline-container, #content-container, #key-word-container, #search-result-container, #qa-result-container {
328
+ animation: slideIn 0.6s ease;
329
+ }
330
+
331
+ /* 响应式设计 */
332
+ @media screen and (max-width: 1024px) {
333
+ .container {
334
+ max-width: 90%;
335
+ padding: 30px;
336
+ }
337
+
338
+ h1 {
339
+ font-size: 36px;
340
+ margin-bottom: 40px;
341
+ }
342
+
343
+ h2 {
344
+ font-size: 30px;
345
+ margin-bottom: 20px;
346
+ }
347
+
348
+ input[type="text"],
349
+ select,
350
+ textarea {
351
+ font-size: 14px;
352
+ }
353
+
354
+ button {
355
+ font-size: 16px;
356
+ padding: 12px 24px;
357
+ }
358
+
359
+ .qa-item h3 {
360
+ font-size: 20px;
361
+ }
362
+
363
+ .qa-item p {
364
+ font-size: 14px;
365
+ }
366
+ }
367
+
368
+ @media screen and (max-width: 768px) {
369
+ .container {
370
+ margin: 30px auto;
371
+ padding: 20px;
372
+ }
373
+
374
+ h1 {
375
+ font-size: 30px;
376
+ margin-bottom: 30px;
377
+ }
378
+
379
+ h2 {
380
+ font-size: 24px;
381
+ margin-bottom: 15px;
382
+ }
383
+
384
+ input[type="text"],
385
+ select,
386
+ textarea {
387
+ padding: 10px;
388
+ font-size: 12px;
389
+ }
390
+
391
+ button {
392
+ font-size: 14px;
393
+ padding: 10px 20px;
394
+ }
395
+
396
+ .qa-item h3 {
397
+ font-size: 18px;
398
+ }
399
+
400
+ .qa-item p {
401
+ font-size: 12px;
402
+ }
403
+ }
static/img/favicon.ico ADDED
static/js/script.js ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ const form = document.getElementById('article-form');
3
+ const outlineContainer = document.getElementById('outline-container');
4
+ const outlineElement = document.getElementById('outline');
5
+ const expandOutlineElement = document.getElementById('expand-outline');
6
+ const generateContentButton = document.getElementById('generate-content');
7
+ const contentContainer = document.getElementById('content-container');
8
+ const contentElement = document.getElementById('content');
9
+ const docType = document.getElementById('doc-type').value; // 获取文档类型
10
+ const pauseContentButton = document.getElementById('pause-content');
11
+
12
+
13
+ let isPaused = false;
14
+ let eventSource;
15
+ let controller = new AbortController();
16
+
17
+ form.addEventListener('submit', function(event) {
18
+ event.preventDefault();
19
+
20
+ const formData = new FormData(form);
21
+ const requestData = {
22
+ outline_model: formData.get('outline_model'),
23
+ content_model: formData.get('content_model'),
24
+ proxy_url: formData.get('proxy_url'),
25
+ api_key: formData.get('api_key'),
26
+ title: formData.get('title'),
27
+ doc_type: formData.get('doc_type'),
28
+ notice: formData.get('notice'),
29
+ };
30
+
31
+ outlineElement.value = '';
32
+ outlineContainer.style.display = 'block';
33
+
34
+ // 添加加载状态
35
+ const generateOutlineButton = this.querySelector('button[type="submit"]');
36
+ generateOutlineButton.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Generating Outline...';
37
+ generateOutlineButton.disabled = true;
38
+
39
+ fetch('/generate_outline', {
40
+ method: 'POST',
41
+ headers: {
42
+ 'Content-Type': 'application/json'
43
+ },
44
+ body: JSON.stringify(requestData)
45
+ })
46
+ .then(response => response.json())
47
+ .then(data => {
48
+ outlineElement.value = data.outline;
49
+
50
+ // 移除加载状态
51
+ generateOutlineButton.innerHTML = 'Generate Outline';
52
+ generateOutlineButton.disabled = false;
53
+ })
54
+ .catch(error => {
55
+ console.error('Error:', error);
56
+ outlineElement.value = 'Failed to generate outline. Please check the console for more details.';
57
+
58
+ // 移除加载状态
59
+ generateOutlineButton.innerHTML = 'Generate Outline';
60
+ generateOutlineButton.disabled = false;
61
+ });
62
+ });
63
+
64
+ generateContentButton.addEventListener('click', function() {
65
+ const expandOutline = expandOutlineElement.value;
66
+ const optimizeToken = document.getElementById('optimize-token').value;
67
+ const outline = outlineElement.value;
68
+ const title = document.getElementById('title').value;
69
+ const contentModel = document.getElementById('content-model').value;
70
+ const apiKey = document.getElementById('api-key').value;
71
+ const proxyUrl = document.getElementById('proxy-url').value;
72
+ const topK = document.getElementById('top-k').value;
73
+ const similarityThreshold = document.getElementById('similarity-threshold').value;
74
+ eventSource = new EventSource('/generate_content');
75
+
76
+ const requestData = {
77
+ expand_outline: expandOutline,
78
+ //expand_outline: expandOutline,
79
+ optimize_token: optimizeToken,
80
+ outline: outline,
81
+ title: title,
82
+ content_model: contentModel,
83
+ api_key: apiKey,
84
+ proxy_url: proxyUrl,
85
+ doc_type: docType,
86
+ top_k: topK,
87
+ similarity_threshold: similarityThreshold
88
+ };
89
+
90
+ contentElement.innerText = 'Generating content...';
91
+ contentContainer.style.display = 'block';
92
+ pauseContentButton.style.display = 'inline-block';
93
+ controller = new AbortController();
94
+ const signal = controller.signal;
95
+
96
+
97
+ fetch('/generate_content', {
98
+ method: 'POST',
99
+ headers: {
100
+ 'Content-Type': 'application/json'
101
+ },
102
+ body: JSON.stringify(requestData),
103
+ signal: signal
104
+ })
105
+ .then(response => {
106
+ if (!response.ok) {
107
+ throw new Error('Network response was not ok');
108
+ }
109
+ return response.body;
110
+ })
111
+ .then(body => {
112
+ const reader = body.getReader();
113
+ const decoder = new TextDecoder('utf-8');
114
+ return new ReadableStream({
115
+ start(controller) {
116
+ function push() {
117
+ reader.read().then(({ done, value }) => {
118
+ if (done) {
119
+ controller.close();
120
+ return;
121
+ }
122
+ controller.enqueue(decoder.decode(value));
123
+ push();
124
+ });
125
+ }
126
+ push();
127
+ }
128
+ });
129
+ })
130
+ .then(stream => {
131
+ const reader = stream.getReader();
132
+ let fullContent = '';
133
+ function read() {
134
+ if (isPaused) {
135
+ pauseContentButton.innerText = 'Resume Output';
136
+ return;
137
+ }
138
+ reader.read().then(({ done, value }) => {
139
+ if (done) {
140
+ //pauseContentButton.style.display = 'none';
141
+ // 内容生成完成后,将其发送到后端进行文件写入
142
+ const title = document.getElementById('title').value;
143
+ fetch('/write_to_file', {
144
+ method: 'POST',
145
+ headers: {
146
+ 'Content-Type': 'application/json'
147
+ },
148
+ body: JSON.stringify({ title: title, content: fullContent })
149
+ })
150
+ .then(response => response.json())
151
+ .then(data => {
152
+ console.log(data.message);
153
+ })
154
+ .catch(error => {
155
+ console.error('Error:', error);
156
+ });
157
+ return;
158
+ }
159
+ fullContent += value;
160
+ contentElement.innerText += value;
161
+ read();
162
+ });
163
+ }
164
+ read();
165
+ })
166
+ .catch(error => {
167
+ console.error('Error:', error);
168
+ contentElement.innerText = 'Failed to generate content. Please check the console for more details.';
169
+ });
170
+ });
171
+
172
+ pauseContentButton.addEventListener('click', function() {
173
+ if (isPaused) {
174
+ fetch('/resume', { method: 'POST' })
175
+ .then(() => {
176
+ isPaused = false;
177
+ pauseContentButton.innerText = 'Pause Output';
178
+ });
179
+ } else {
180
+ controller.abort();
181
+ fetch('/pause', { method: 'POST' })
182
+ .then(() => {
183
+ isPaused = true;
184
+ pauseContentButton.innerText = 'Resume Output';
185
+
186
+ // 在暂停时保存文件
187
+ const title = document.getElementById('title').value;
188
+ const content = contentElement.innerText;
189
+ fetch('/write_to_file', {
190
+ method: 'POST',
191
+ headers: {
192
+ 'Content-Type': 'application/json'
193
+ },
194
+ body: JSON.stringify({ title: title, content: content })
195
+ })
196
+ .then(response => response.json())
197
+ .then(data => {
198
+ console.log(data.message);
199
+ })
200
+ .catch(error => {
201
+ console.error('Error:', error);
202
+ });
203
+ });
204
+ }
205
+ });
206
+ document.getElementById('generate-key-words').addEventListener('click', function() {
207
+ const keyWordModel = document.getElementById('key-word-model').value;
208
+ const apiKey = document.getElementById('api-key').value;
209
+ const proxyUrl = document.getElementById('proxy-url').value;
210
+ const outline = outlineElement.value;
211
+
212
+ const requestData = {
213
+ key_word_model: keyWordModel,
214
+ api_key: apiKey,
215
+ proxy_url: proxyUrl,
216
+ outline: outline
217
+ };
218
+
219
+ // 添加加载状态
220
+ const button = this;
221
+ button.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Generating Key Words...';
222
+ button.disabled = true;
223
+
224
+ fetch('/generate_key_words', {
225
+ method: 'POST',
226
+ headers: {
227
+ 'Content-Type': 'application/json'
228
+ },
229
+ body: JSON.stringify(requestData)
230
+ })
231
+ .then(response => response.json())
232
+ .then(data => {
233
+ const keyWordContainer = document.getElementById('search-key-word-container');
234
+ keyWordContainer.innerHTML = ''; // 清空容器
235
+
236
+ const keyWords = data.search_key_word.split(',');
237
+ keyWords.forEach(keyWord => {
238
+ const keyWordButton = document.createElement('button');
239
+ keyWordButton.innerText = keyWord;
240
+ keyWordButton.classList.add('key-word-button');
241
+ keyWordButton.addEventListener('click', function() {
242
+ this.classList.toggle('selected');
243
+ });
244
+ keyWordContainer.appendChild(keyWordButton);
245
+ });
246
+
247
+ // 移除加载状态
248
+ button.innerHTML = 'Generate Key Words';
249
+ button.disabled = false;
250
+ })
251
+ .catch(error => {
252
+ console.error('Error:', error);
253
+
254
+ // 移除加载状态
255
+ button.innerHTML = 'Generate Key Words';
256
+ button.disabled = false;
257
+ });
258
+ });
259
+ document.getElementById('use-bing-search').addEventListener('change', function() {
260
+ const useBingSearch = this.value;
261
+ const keyWordContainer = document.getElementById('key-word-container');
262
+
263
+ if (useBingSearch === 'y') {
264
+ keyWordContainer.style.display = 'block';
265
+ } else {
266
+ keyWordContainer.style.display = 'none';
267
+ }
268
+ });
269
+ document.getElementById('add-custom-key-word').addEventListener('click', function() {
270
+ const customKeyWord = document.getElementById('custom-key-word').value;
271
+ if (customKeyWord) {
272
+ const keyWordButton = document.createElement('button');
273
+ keyWordButton.innerText = customKeyWord;
274
+ keyWordButton.classList.add('key-word-button');
275
+ keyWordButton.addEventListener('click', function() {
276
+ this.classList.toggle('selected');
277
+ });
278
+
279
+ document.getElementById('search-key-word-container').appendChild(keyWordButton);
280
+ document.getElementById('custom-key-word').value = '';
281
+ }
282
+ });
283
+ document.getElementById('print-selected-key-words').addEventListener('click', function() {
284
+ const selectedKeyWords = Array.from(document.querySelectorAll('.key-word-button.selected')).map(button => button.innerText);
285
+ console.log('Selected Key Words:', selectedKeyWords);
286
+
287
+ const bingApiKey = document.getElementById('bing-api-key').value;
288
+ const proxyUrl = document.getElementById('proxy-url').value;
289
+ const apiKey = document.getElementById('api-key').value;
290
+
291
+ // 添加加载状态
292
+ this.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Searching...';
293
+ this.disabled = true;
294
+
295
+ fetch('/search', {
296
+ method: 'POST',
297
+ headers: {
298
+ 'Content-Type': 'application/json'
299
+ },
300
+ body: JSON.stringify({ selected_key_words: selectedKeyWords, bing_api_key: bingApiKey, proxy_url: proxyUrl, api_key: apiKey })
301
+ })
302
+ .then(response => response.json())
303
+ .then(data => {
304
+ console.log('Search result:', data.search_result);
305
+ document.getElementById('search-result').value = data.search_result;
306
+ document.getElementById('search-result-container').style.display = 'block';
307
+
308
+ // 移除加载状态
309
+ this.innerHTML = 'Search with Bing';
310
+ this.disabled = false;
311
+ })
312
+ .catch(error => {
313
+ console.error('Error:', error);
314
+
315
+ // 移除加载状态
316
+ this.innerHTML = 'Search with Bing';
317
+ this.disabled = false;
318
+ });
319
+ });
320
+
321
+
322
+ const qaResultContainer = document.getElementById('qa-result-container');
323
+ const generateQABtn = document.getElementById('generate-qa-btn');
324
+
325
+ generateQABtn.addEventListener('click', function() {
326
+ const searchResult = document.getElementById('search-result').value;
327
+ const apiKey = document.getElementById('api-key').value;
328
+ const proxyUrl = document.getElementById('proxy-url').value;
329
+ const topK = document.getElementById('top-k').value;
330
+ const similarityThreshold = document.getElementById('similarity-threshold').value;
331
+
332
+ // 添加加载状态
333
+ const button = this;
334
+ button.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Generating QA...';
335
+ button.disabled = true;
336
+
337
+ fetch('/qa', {
338
+ method: 'POST',
339
+ headers: {
340
+ 'Content-Type': 'application/json'
341
+ },
342
+ body: JSON.stringify({
343
+ search_result: searchResult,
344
+ api_key: apiKey,
345
+ proxy_url: proxyUrl,
346
+ top_k: topK,
347
+ similarity_threshold: similarityThreshold
348
+ })
349
+ })
350
+ .then(response => response.json())
351
+ .then(data => {
352
+ const qaResult = data.qa_result;
353
+ qaResultContainer.innerHTML = '';
354
+
355
+ qaResult.forEach(([question, answer]) => {
356
+ const qaItem = document.createElement('div');
357
+ qaItem.classList.add('qa-item');
358
+
359
+ const questionElement = document.createElement('h3');
360
+ questionElement.textContent = question;
361
+
362
+ const answerElement = document.createElement('p');
363
+ answerElement.textContent = answer;
364
+
365
+ qaItem.appendChild(questionElement);
366
+ qaItem.appendChild(answerElement);
367
+ qaResultContainer.appendChild(qaItem);
368
+ });
369
+
370
+ // 移除加载状态
371
+ button.innerHTML = 'Generate QA';
372
+ button.disabled = false;
373
+ })
374
+ .catch(error => {
375
+ console.error('Error:', error);
376
+
377
+ // 移除加载状态
378
+ button.innerHTML = 'Generate QA';
379
+ button.disabled = false;
380
+ });
381
+ });
382
+
383
+
384
+ });
templates/index.html ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Article Generator</title>
7
+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
9
+ </head>
10
+ <body>
11
+ <div class="container">
12
+ <h1>Article Generator</h1>
13
+ <form id="article-form">
14
+ <div class="form-group">
15
+ <label for="outline-model">Outline Model:</label>
16
+ <input type="text" id="outline-model" name="outline_model" required>
17
+ </div>
18
+ <div class="form-group">
19
+ <label for="content-model">Content Generation Model:</label>
20
+ <input type="text" id="content-model" name="content_model" required>
21
+ </div>
22
+ <div class="form-group">
23
+ <label for="proxy-url">Proxy URL:</label>
24
+ <input type="text" id="proxy-url" name="proxy_url" required>
25
+ </div>
26
+ <div class="form-group">
27
+ <label for="api-key">API Key:</label>
28
+ <input type="text" id="api-key" name="api_key" required>
29
+ </div>
30
+ <div class="form-group">
31
+ <label for="title">Title:</label>
32
+ <input type="text" id="title" name="title" required>
33
+ </div>
34
+ <div class="form-group">
35
+ <label for="doc-type">Document Type:</label>
36
+ <select id="doc-type" name="doc_type" required>
37
+ <option value="1">论文</option>
38
+ <option value="2">报告</option>
39
+ <option value="3">文章</option>
40
+ </select>
41
+ </div>
42
+ <div class="form-group">
43
+ <label for="notice">Notice for AI:</label>
44
+ <textarea id="notice" name="notice" rows="4" required></textarea>
45
+ </div>
46
+ <button type="submit">Generate Outline</button>
47
+ </form>
48
+
49
+ <div id="outline-container" style="display: none;">
50
+ <h2>Generated Outline:</h2>
51
+ <textarea id="outline" rows="10"></textarea>
52
+ <div class="form-group">
53
+ <label for="expand-outline">Do you want to expand the outline further?</label>
54
+ <select id="expand-outline" name="expand_outline" required>
55
+ <option value="y">Yes</option>
56
+ <option value="n">No</option>
57
+ </select>
58
+ </div>
59
+ <div class="form-group">
60
+ <label for="optimize-token">是否开启token优化?</label>
61
+ <select id="optimize-token" name="optimize_token" required>
62
+ <option value="y">开启</option>
63
+ <option value="n">不开启</option>
64
+ </select>
65
+ </div>
66
+ <div class="form-group">
67
+ <label for="use-bing-search">是否启用调用外部 Bing 搜索 API?</label>
68
+ <select id="use-bing-search" name="use_bing_search" required>
69
+ <option value="n">否</option>
70
+ <option value="y">是</option>
71
+ </select>
72
+ </div>
73
+
74
+
75
+ <div id="key-word-container" style="display: none;">
76
+ <div class="form-group">
77
+ <label for="key-word-model">关键词模型:</label>
78
+ <input type="text" id="key-word-model" name="key_word_model" required>
79
+ </div>
80
+ <button id="generate-key-words">Generate Key Words</button>
81
+ <div id="search-key-word-container"></div>
82
+ <div class="form-group">
83
+ <label for="custom-key-word">Custom Key Word:</label>
84
+ <input type="text" id="custom-key-word" name="custom_key_word">
85
+ <button id="add-custom-key-word">Add</button>
86
+ </div>
87
+ <div class="form-group">
88
+ <label for="bing-api-key">Bing API Key:</label>
89
+ <input type="text" id="bing-api-key" name="bing_api_key" required>
90
+ </div>
91
+ <div class="form-group">
92
+ <label for="top-k">Top K:</label>
93
+ <input type="number" id="top-k" name="top_k" value="5">
94
+ </div>
95
+ <div class="form-group">
96
+ <label for="similarity-threshold">Similarity Threshold:</label>
97
+ <input type="number" id="similarity-threshold" name="similarity_threshold" step="0.1" value="0.5">
98
+ </div>
99
+ <div id="search-result-container" style="display: none;">
100
+ <h2>Search Result:</h2>
101
+ <textarea id="search-result" rows="10"></textarea>
102
+ </div>
103
+ <button id="print-selected-key-words">Search with Bing</button>
104
+ <button id="generate-content">Generate Content</button>
105
+
106
+ </div>
107
+
108
+ <button id="generate-qa-btn">Generate QA</button>
109
+ <div id="qa-result-container"></div>
110
+ </div>
111
+
112
+ <div id="content-container" style="display: none;">
113
+ <h2>Generated Content:</h2>
114
+ <div id="content"></div>
115
+ </div>
116
+
117
+ <button id="pause-content" style="display: none;">Pause Output</button>
118
+
119
+ </div>
120
+
121
+ <script src="{{ url_for('static', filename='js/script.js') }}"></script>
122
+ </body>
123
+ </html>