quoc-khanh commited on
Commit
03cd284
·
verified ·
1 Parent(s): 53833ab

Update file_loader.py

Browse files
Files changed (1) hide show
  1. file_loader.py +12 -12
file_loader.py CHANGED
@@ -29,20 +29,20 @@ def get_vectorstore():
29
  # ['https://nct.neu.edu.vn/', 'https://fsf.neu.edu.vn/', 'https://mfe.neu.edu.vn/', 'https://mis.neu.edu.vn/', 'https://fda.neu.edu.vn/', 'https://khoathongke.neu.edu.vn/', 'https://fit.neu.edu.vn/']
30
 
31
 
32
- # website_contents = get_web_documents(base_urls=base_urls)
33
- # all_splits += website_contents
34
 
35
- # print('Feeding .docx files')
36
- # for i, file_path in enumerate(tqdm(docx_files, desc="Đang xử lý", unit="file")):
37
- # output_json_path = f"output_{i}.json"
38
- # splits = get_splits(file_path, output_json_path)
39
- # all_splits += splits
40
 
41
- # print('Feeding .json files')
42
- # # Xử lý FAQ
43
- # FAQ_path = "syllabus_nct_word_format/FAQ.json"
44
- # FAQ_splits = get_json_splits_only(FAQ_path)
45
- # all_splits += FAQ_splits
46
 
47
  FAQ_path = "syllabus_nct_word_format/FAQ2.json"
48
  FAQ_splits = get_json_splits_only(FAQ_path)
 
29
  # ['https://nct.neu.edu.vn/', 'https://fsf.neu.edu.vn/', 'https://mfe.neu.edu.vn/', 'https://mis.neu.edu.vn/', 'https://fda.neu.edu.vn/', 'https://khoathongke.neu.edu.vn/', 'https://fit.neu.edu.vn/']
30
 
31
 
32
+ website_contents = get_web_documents(base_urls=base_urls)
33
+ all_splits += website_contents
34
 
35
+ print('Feeding .docx files')
36
+ for i, file_path in enumerate(tqdm(docx_files, desc="Đang xử lý", unit="file")):
37
+ output_json_path = f"output_{i}.json"
38
+ splits = get_splits(file_path, output_json_path)
39
+ all_splits += splits
40
 
41
+ print('Feeding .json files')
42
+ # Xử lý FAQ
43
+ FAQ_path = "syllabus_nct_word_format/FAQ.json"
44
+ FAQ_splits = get_json_splits_only(FAQ_path)
45
+ all_splits += FAQ_splits
46
 
47
  FAQ_path = "syllabus_nct_word_format/FAQ2.json"
48
  FAQ_splits = get_json_splits_only(FAQ_path)