This commit is contained in:
lzy
2025-06-03 11:21:50 +08:00
3 changed files with 30721 additions and 6 deletions

View File

@@ -12,7 +12,8 @@ API_KEY="sk-oYh3Xrhg8oDY2gW02c966f31C84449Ad86F9Cd9dF6E64a8d"
BASE_URL="https://vip.apiyi.com/v1"
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']
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
local = threading.local()
@@ -133,8 +134,7 @@ def process_item(args):
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)
results = []
@@ -143,7 +143,7 @@ def main():
args_list = [(i, data_length, item) for i, item in enumerate(data)]
# 设定线程数根据实际API限制和服务器性能调整
num_threads = 10 # 根据需要调整线程数
num_threads = 20 # 根据需要调整线程数
print(f"Starting classification with {num_threads} threads...")
@@ -154,7 +154,7 @@ def main():
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)
# 分析结果
@@ -163,7 +163,7 @@ def main():
print("\nFinal distribution of questions by category:")
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__":
main()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff