hard问题分类
This commit is contained in:
@@ -12,7 +12,8 @@ API_KEY="sk-oYh3Xrhg8oDY2gW02c966f31C84449Ad86F9Cd9dF6E64a8d"
|
|||||||
BASE_URL="https://vip.apiyi.com/v1"
|
BASE_URL="https://vip.apiyi.com/v1"
|
||||||
MODEL_DEEPSEEK_V3 = "deepseek-chat"
|
MODEL_DEEPSEEK_V3 = "deepseek-chat"
|
||||||
CATEGORIES = ['Atomic Structure and Interatomic Bonding', 'The Structure of Solids', 'Imperfections in Solids', 'Mechanical Properties of Metals','Dislocations and Strengthening Mechanisms','Failure','Phase Transformations: Development of Microstructure and Alteration of Mechanical Properties','Applications and Processing of Materials','Corrosion and Degradation of Materials','Functional Properties of Materials','Unknown']
|
CATEGORIES = ['Atomic Structure and Interatomic Bonding', 'The Structure of Solids', 'Imperfections in Solids', 'Mechanical Properties of Metals','Dislocations and Strengthening Mechanisms','Failure','Phase Transformations: Development of Microstructure and Alteration of Mechanical Properties','Applications and Processing of Materials','Corrosion and Degradation of Materials','Functional Properties of Materials','Unknown']
|
||||||
|
FILE_PATH = '/home/ubuntu/50T/fsy/A/MatBench/layer2/PGEE/code/stepz_final_choice_questions_filtered_only_hard.json'
|
||||||
|
OUTPUT_PATH='/home/ubuntu/50T/fsy/A/MatBench/layer2/PGEE/code/stepz_classified_only_hard.json'
|
||||||
# Thread-local storage for OpenAI clients
|
# Thread-local storage for OpenAI clients
|
||||||
local = threading.local()
|
local = threading.local()
|
||||||
|
|
||||||
@@ -133,8 +134,7 @@ def process_item(args):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
# 加载数据
|
# 加载数据
|
||||||
file_path = '/home/ubuntu/50T/fsy/MatBench/layer2/PGEE/code/stepz_final_choice_questions_filtered.json'
|
data = load_data(FILE_PATH)
|
||||||
data = load_data(file_path)
|
|
||||||
data_length = len(data)
|
data_length = len(data)
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
@@ -143,7 +143,7 @@ def main():
|
|||||||
args_list = [(i, data_length, item) for i, item in enumerate(data)]
|
args_list = [(i, data_length, item) for i, item in enumerate(data)]
|
||||||
|
|
||||||
# 设定线程数,根据实际API限制和服务器性能调整
|
# 设定线程数,根据实际API限制和服务器性能调整
|
||||||
num_threads = 10 # 根据需要调整线程数
|
num_threads = 20 # 根据需要调整线程数
|
||||||
|
|
||||||
print(f"Starting classification with {num_threads} threads...")
|
print(f"Starting classification with {num_threads} threads...")
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ def main():
|
|||||||
results = futures
|
results = futures
|
||||||
|
|
||||||
# 保存最终结果
|
# 保存最终结果
|
||||||
with open('/home/ubuntu/50T/fsy/MatBench/layer2/PGEE/code/stepz_classified.json', 'w', encoding='utf-8') as f:
|
with open(OUTPUT_PATH, 'w', encoding='utf-8') as f:
|
||||||
json.dump(results, f, ensure_ascii=False, indent=4)
|
json.dump(results, f, ensure_ascii=False, indent=4)
|
||||||
|
|
||||||
# 分析结果
|
# 分析结果
|
||||||
@@ -163,7 +163,7 @@ def main():
|
|||||||
print("\nFinal distribution of questions by category:")
|
print("\nFinal distribution of questions by category:")
|
||||||
print(category_counts_final)
|
print(category_counts_final)
|
||||||
|
|
||||||
print("\nTask completed. Results saved to '/home/ubuntu/50T/fsy/MatBench/layer2/PGEE/code/stepz_classified.json'")
|
print(f"\nTask completed. Results saved to {OUTPUT_PATH}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
1653
layer2/PGEE/code/classify_muti_only_hard.log
Normal file
1653
layer2/PGEE/code/classify_muti_only_hard.log
Normal file
File diff suppressed because it is too large
Load Diff
29062
layer2/PGEE/code/stepz_classified_only_hard.json
Normal file
29062
layer2/PGEE/code/stepz_classified_only_hard.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user