Spaces:
Runtime error
Runtime error
Update utility/utils.py
Browse files- utility/utils.py +15 -0
utility/utils.py
CHANGED
|
@@ -400,6 +400,21 @@ def process_extracted_text(extracted_text):
|
|
| 400 |
|
| 401 |
return combined_results_json
|
| 402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 403 |
# Process the model output for parsed result
|
| 404 |
def process_resume_data(LLMdata,cont_data,extracted_text):
|
| 405 |
|
|
|
|
| 400 |
|
| 401 |
return combined_results_json
|
| 402 |
|
| 403 |
+
# Function to remove duplicates (case-insensitive) from each list in the dictionary
|
| 404 |
+
def remove_duplicates_case_insensitive(data_dict):
|
| 405 |
+
for key, value_list in data_dict.items():
|
| 406 |
+
seen = set()
|
| 407 |
+
unique_list = []
|
| 408 |
+
|
| 409 |
+
for item in value_list:
|
| 410 |
+
if item.lower() not in seen:
|
| 411 |
+
unique_list.append(item) # Add original item (preserving its case)
|
| 412 |
+
seen.add(item.lower()) # Track lowercase version
|
| 413 |
+
|
| 414 |
+
# Update the dictionary with unique values
|
| 415 |
+
data_dict[key] = unique_list
|
| 416 |
+
return data_dict
|
| 417 |
+
|
| 418 |
# Process the model output for parsed result
|
| 419 |
def process_resume_data(LLMdata,cont_data,extracted_text):
|
| 420 |
|