-
Notifications
You must be signed in to change notification settings - Fork 0
/
feeding_db_parser_bot.py
27 lines (20 loc) · 1 KB
/
feeding_db_parser_bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from tqdm import tqdm
from qualitative_information_extractor_database import QualitativeInformationExtractorDatabase
class FeedingDBParserBot:
def __init__(self, dataset_folder_path) -> None:
self.dataset_folder_path = dataset_folder_path
abs_datasetdb_path = os.path.abspath("dataset/database/dataset.db")
self.informationExtractor = QualitativeInformationExtractorDatabase(abs_datasetdb_path)
def run(self):
foldernames = os.listdir(self.dataset_folder_path)
paper_folder_paths = list(
map(lambda foldername: os.path.join(self.dataset_folder_path, foldername), foldernames))
for count, foldername in enumerate(tqdm(paper_folder_paths)):
self.informationExtractor.fill_data_set(foldername, False)
if __name__ == "__main__":
print("PATH",os.path.abspath("../usable_dataset"))
"../../usable_dataset/"
qualitative_parser = FeedingDBParserBot("../usable_dataset")
print("Parser started")
qualitative_parser.run()