Skip to content

Commit 6699470

Browse files
committed
refactor directories for better understanding of the project
1 parent 8025cad commit 6699470

File tree

561 files changed

+20
-55819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

561 files changed

+20
-55819
lines changed

backend/dendogram_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def generate_dendogram_from_csv():
9191
return make_response("CSV file is required", 400)
9292

9393
file = request.files['file']
94-
if not file.filename.endswith('.csv'):
94+
if not file.filename.endswith('.model_embeddings'):
9595
return make_response("File must be a CSV", 400)
9696

9797
features = []

backend/dendogram_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313

1414
load_dotenv()
1515
def preprocessed_app(app_name):
16-
file_path = f"data/Stage 2 - Hierarchical Clustering/preprocessed_jsons/{app_name}Features.json"
16+
file_path = f"data/Stage 2 - Hierarchical Clustering/preprocessed_features_jsons/{app_name}Features.json"
1717
return os.path.exists(file_path) and os.path.getsize(file_path) > 0
1818

1919
def save_preprocessed_features(features, app_name):
20-
file_path = f"data/Stage 2 - Hierarchical Clustering/preprocessed_jsons/{app_name}Features.json"
20+
file_path = f"data/Stage 2 - Hierarchical Clustering/preprocessed_features_jsons/{app_name}Features.json"
2121
os.makedirs(os.path.dirname(file_path), exist_ok=True)
2222
with open(file_path, "w") as json_file:
2323
json.dump(features, json_file)
2424

2525
def load_saved_preprocessed_features(app_name):
26-
file_path = os.path.join(BASE_DIR, "data", "Stage 2 - Hierarchical Clustering", "preprocessed_jsons", f"{app_name}Features.json")
26+
file_path = os.path.join(BASE_DIR, "data", "Stage 2 - Hierarchical Clustering", "preprocessed_features_jsons", f"{app_name}Features.json")
2727
if not os.path.exists(file_path):
2828
return None
2929
with open(file_path, "r") as json_file:

backend/preprocessing_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ def preprocess():
3333
return jsonify({"error": str(e)}), 500
3434

3535
def preprocessed_app(app_name):
36-
file_path = f"static/preprocessed_jsons/{app_name}Features.json"
36+
file_path = f"data/Stage 3 - Topic Modelling/preprocessed_features_jsons/{app_name}Features.json"
3737
return os.path.exists(file_path) and os.path.getsize(file_path) > 0
3838

3939
def save_preprocessed_features(features, app_name):
40-
file_path = f"static/preprocessed_jsons/{app_name}Features.json"
40+
file_path = f"data/Stage 3 - Topic Modelling/preprocessed_features_jsons/{app_name}Features.json"
4141
os.makedirs(os.path.dirname(file_path), exist_ok=True)
4242
with open(file_path, "w") as json_file:
4343
json.dump(features, json_file)
4444

4545
def load_saved_preprocessed_features(app_name):
46-
file_path = f"static/preprocessed_jsons/{app_name}Features.json"
46+
file_path = f"data/Stage 3 - Topic Modelling/preprocessed_features_jsons/{app_name}Features.json"
4747
if os.path.exists(file_path):
4848
with open(file_path, "r") as json_file:
4949
return json.load(json_file)

backend/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
STAGE_2_MODEL_DIRECTORY_PATH = os.path.join(STAGE_2_OUTPUT_PATH)
1212
STAGE_3_MODEL_DIRECTORY_PATH = os.path.join(STAGE_3_INPUT_PATH)
1313

14-
MODEL_DIRECTORY_CSV_PATH = os.path.join(STAGE_2_OUTPUT_PATH, 'csv')
15-
MODEL_DIRECTORY_CSV_EMBEDDINGS_PATH = os.path.join('static', 'csv', 'embeddings')
14+
MODEL_DIRECTORY_CSV_PATH = os.path.join(STAGE_2_OUTPUT_PATH, 'model_embeddings')
15+
MODEL_DIRECTORY_CSV_EMBEDDINGS_PATH = os.path.join('data', 'model_embeddings', 'embeddings')
1616

1717
class Utils:
1818
@staticmethod

backend/visualization_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def generate_dynamic_label(cluster_labels):
4949
unique_labels = list(set(cluster_labels))
5050
few_shot_input_text = (
5151
"Generate a single concise label summarizing the following actions:\n\n"
52-
"Examples:\n"
52+
"Input_Examples:\n"
5353
"Video meeting, online meeting, team video chat, conference call\n"
5454
"Label: Virtual Team Communication\n\n"
5555
"Secure chat, encrypted messaging, private message\n"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
obj_weights = [0.9, 0.75, 0.669, 0.5, 0.25, 0.1]
1212
affinity_models = ['bert', 'tf-idf', 'paraphrase']
1313

14-
json_file_path = "body.json"
14+
json_file_path = "small_whatsapp_example.json"
1515
with open(json_file_path, 'r') as json_file:
1616
json_data = json.load(json_file)
1717

scripts/Stage 1 - Feature extraction/feature_extraction_t-frex.py renamed to cli-client/scripts/Stage 1 - Feature extraction/feature_extraction_t-frex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def process_folder(input_folder, output_folder):
6060

6161
# Process each CSV file in the input folder
6262
for file_name in os.listdir(input_folder):
63-
if file_name.endswith('.csv'):
63+
if file_name.endswith('.model_embeddings'):
6464
input_file = os.path.join(input_folder, file_name)
6565
output_file = os.path.join(output_folder, file_name)
6666
print(f"Processing {input_file} -> {output_file}")

scripts/Stage 1 - Feature extraction/feature_extraction_transfeatex.py renamed to cli-client/scripts/Stage 1 - Feature extraction/feature_extraction_transfeatex.py

File renamed without changes.

0 commit comments

Comments
 (0)