Skip to content

Commit 275dac7

Browse files
committed
feat: feat
1 parent ab44154 commit 275dac7

6 files changed

+96
-24
lines changed

_posts/2020-01-07-how_big_data_transforming_predictive_maintenance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ title: How Big Data is Transforming Predictive Maintenance
5656
---
5757
author_profile: false
5858
categories:
59-
- Big Data
59+
- Data Science
6060
classes: wide
6161
date: '2020-01-07'
6262
excerpt: Big Data is revolutionizing predictive maintenance by offering unprecedented

_posts/2021-06-01-customer_segmentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ header:
1515
teaser: /assets/images/data_science_9.jpg
1616
twitter_image: /assets/images/data_science_1.jpg
1717
keywords:
18-
- Customer Analytics
18+
- Customer analytics
1919
- Customer segmentation
2020
- Unsupervised learning
2121
- Data science

_posts/2024-07-31-Custom_libraries.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
---
2-
title: 'Building Custom Python Libraries for Your Industry Needs'
2+
author_profile: false
33
categories:
44
- Python
5-
tags:
6-
- Python libraries
7-
- Custom software
8-
- Industry solutions
9-
- Software development
10-
- Automation
11-
- Python
12-
author_profile: false
5+
classes: wide
136
date: '2024-07-31'
7+
excerpt: A guide on developing custom Python libraries to meet specific industry needs, focusing on software development and automation.
148
header:
159
image: /assets/images/data_science_4.jpg
1610
og_image: /assets/images/data_science_5.jpg
1711
overlay_image: /assets/images/data_science_4.jpg
1812
show_overlay_excerpt: false
1913
teaser: /assets/images/data_science_4.jpg
2014
twitter_image: /assets/images/data_science_5.jpg
21-
seo_title: 'Building Custom Python Libraries for Industry-Specific Solutions'
22-
seo_description: 'Learn how to create custom Python libraries tailored to your industry needs. This article covers strategies for software development and automation using Python.'
23-
excerpt: 'A guide on developing custom Python libraries to meet specific industry needs, focusing on software development and automation.'
24-
summary: 'This article explores the process of building custom Python libraries, offering insights into Python’s versatility for developing industry-specific software solutions and automation tools.'
25-
keywords:
15+
keywords:
2616
- Python libraries
2717
- Custom software development
2818
- Automation
2919
- Industry solutions
30-
classes: wide
20+
- python
21+
seo_description: Learn how to create custom Python libraries tailored to your industry needs. This article covers strategies for software development and automation using Python.
22+
seo_title: Building Custom Python Libraries for Industry-Specific Solutions
23+
seo_type: article
24+
summary: This article explores the process of building custom Python libraries, offering insights into Python’s versatility for developing industry-specific software solutions and automation tools.
25+
tags:
26+
- Python libraries
27+
- Custom software
28+
- Industry solutions
29+
- Software development
30+
- Automation
31+
- Python
32+
- python
33+
title: Building Custom Python Libraries for Your Industry Needs
3134
---
3235

3336
## Overview

_posts/2024-09-12-importance_sampling.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ Estimating credit risk in portfolios containing loans or bonds is crucial for fi
5555
---
5656
author_profile: false
5757
categories:
58-
- Finance
59-
- Risk Management
58+
- Statistics
6059
classes: wide
6160
date: '2024-09-12'
6261
excerpt: Importance Sampling offers an efficient alternative to traditional Monte
@@ -122,8 +121,7 @@ In this model, each obligor’s default is influenced by a set of **systematic f
122121
---
123122
author_profile: false
124123
categories:
125-
- Finance
126-
- Risk Management
124+
- Statistics
127125
classes: wide
128126
date: '2024-09-12'
129127
excerpt: Importance Sampling offers an efficient alternative to traditional Monte
@@ -201,8 +199,7 @@ When obligors are dependent (i.e., influenced by common risk factors), IS become
201199
---
202200
author_profile: false
203201
categories:
204-
- Finance
205-
- Risk Management
202+
- Statistics
206203
classes: wide
207204
date: '2024-09-12'
208205
excerpt: Importance Sampling offers an efficient alternative to traditional Monte

_posts/2024-09-17-ml_healthcare.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ keywords:
2222
- Personalized medicine
2323
- Predictive analytics
2424
- Healthcare
25-
- Machine Learning
2625
- Healthcare data privacy
2726
- Clinical implementation challenges
2827
- Predictive patient outcomes

capitalized_keywords.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import os
2+
import yaml
3+
import re
4+
5+
# Define the folder where the markdown files are stored
6+
folder_path = './_posts' # Change this to your folder path
7+
8+
# List of stop words to exclude from capitalization
9+
stop_words = {'at', 'vs', 'and', 'or', 'the', 'of', 'in', 'on', 'for', 'to', 'a'}
10+
11+
# Function to capitalize keywords based on your rules
12+
def capitalize_keywords(keywords):
13+
def capitalize_word(word, first_word=False):
14+
# Only capitalize if it's not a stop word or it's the first word
15+
if word in stop_words and not first_word:
16+
return word
17+
else:
18+
return word.capitalize()
19+
20+
def process_phrase(phrase):
21+
words = phrase.split()
22+
# Capitalize each word as per rules, first word always capitalized
23+
return ' '.join(capitalize_word(word, i == 0) for i, word in enumerate(words))
24+
25+
return [process_phrase(phrase) for phrase in keywords]
26+
27+
# Function to process each markdown file
28+
def process_markdown_file(file_path):
29+
with open(file_path, 'r', encoding='utf-8') as file:
30+
content = file.read()
31+
32+
# Use regex to extract the front matter (between '---' lines)
33+
front_matter_match = re.match(r'---(.*?)---', content, re.DOTALL)
34+
if not front_matter_match:
35+
print(f"No front matter found in {file_path}")
36+
return
37+
38+
front_matter = front_matter_match.group(1)
39+
40+
# Parse the front matter using YAML
41+
try:
42+
front_matter_dict = yaml.safe_load(front_matter)
43+
except yaml.YAMLError as exc:
44+
print(f"Error parsing YAML in {file_path}: {exc}")
45+
return
46+
47+
# If 'keywords' exists in front matter, process it
48+
if 'keywords' in front_matter_dict:
49+
original_keywords = front_matter_dict['keywords']
50+
updated_keywords = capitalize_keywords(original_keywords)
51+
front_matter_dict['keywords'] = updated_keywords
52+
53+
# Replace the front matter in the content
54+
updated_front_matter = yaml.dump(front_matter_dict, default_flow_style=False)
55+
updated_content = re.sub(r'---(.*?)---', f'---\n{updated_front_matter}---', content, flags=re.DOTALL)
56+
57+
# Save the updated content back to the file
58+
with open(file_path, 'w', encoding='utf-8') as file:
59+
file.write(updated_content)
60+
61+
print(f"Updated keywords in {file_path}")
62+
else:
63+
print(f"No 'keywords' found in {file_path}")
64+
65+
# Function to process all markdown files in the folder
66+
def process_all_markdown_files(folder_path):
67+
for filename in os.listdir(folder_path):
68+
if filename.endswith(".md"): # Check if it's a markdown file
69+
file_path = os.path.join(folder_path, filename)
70+
process_markdown_file(file_path)
71+
72+
# Run the function for the specified folder
73+
process_all_markdown_files(folder_path)

0 commit comments

Comments
 (0)