(library_name, folder="Agreements")
| 43 | |
| 44 | |
| 45 | def build_lib (library_name, folder="Agreements"): |
| 46 | |
| 47 | # Step 1 - Create library which is the main 'organizing construct' in llmware |
| 48 | print ("\nupdate: Step 1 - Creating library: {}".format(library_name)) |
| 49 | |
| 50 | library = Library().create_new_library(library_name) |
| 51 | |
| 52 | # Step 2 - Pull down the sample files from S3 through the .load_sample_files() command |
| 53 | # --note: if you need to refresh the sample files, set 'over_write=True' |
| 54 | print ("update: Step 2 - Downloading Sample Files") |
| 55 | |
| 56 | sample_files_path = Setup().load_sample_files(over_write=False) |
| 57 | |
| 58 | # Step 3 - point ".add_files" method to the folder of documents that was just created |
| 59 | # this method parses the documents, text chunks, and captures in MongoDB |
| 60 | print("update: Step 3 - Parsing and Text Indexing Files") |
| 61 | |
| 62 | # options: Agreements | UN-Resolutions-500 |
| 63 | library.add_files(input_folder_path=os.path.join(sample_files_path, folder)) |
| 64 | |
| 65 | return library |
| 66 | |
| 67 | |
| 68 | # start script |
no test coverage detected