Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions _posts/-_ideas/2030-01-01-health_articles.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ tags: []
- **Overview**: Discuss how AI and machine learning are accelerating the drug discovery process by analyzing massive datasets, identifying potential drug candidates, and predicting drug interactions.
- **Focus**: Case studies where AI has significantly reduced the time and cost of bringing new drugs to market.

### 7. Using Wearable Technology and Big Data for Health Monitoring
- **Overview**: Explore how wearable devices (e.g., smartwatches, fitness trackers) generate real-time health data and how big data analytics can provide insights into personal health.
- **Focus**: How wearables are used in chronic disease monitoring, early diagnosis, and preventive healthcare.


### 8. The Role of Machine Learning in Medical Imaging: From Detection to Treatment Planning
- **Overview**: Discuss how machine learning models are applied to medical imaging (MRI, CT scans, X-rays) to improve the accuracy of diagnosis and assist in treatment planning.
Expand Down Expand Up @@ -82,9 +80,6 @@ tags: []
- **Overview**: Explore how data science is helping researchers analyze patterns of antibiotic use and resistance, contributing to the fight against superbugs.
- **Focus**: Predictive modeling and pattern analysis to identify misuse of antibiotics and propose effective intervention strategies.

### 20. Evaluating the Ethical Implications of AI and Big Data in Healthcare
- **Overview**: Provide an in-depth analysis of the ethical concerns surrounding the use of AI, big data, and machine learning in healthcare, particularly regarding patient privacy, data bias, and decision transparency.
- **Focus**: How healthcare institutions can ensure responsible and ethical use of these technologies while improving patient care.

---

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

41 changes: 29 additions & 12 deletions markdown_file_processor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import string

# List of stop words to remove from file names
STOP_WORDS = {
Expand All @@ -17,13 +18,25 @@
"of",
"for",
"to",
"by",
"at",
"as",
"from",
"it",
"be",
"are",
"was",
"were",
"will",
"has",
"have",
}


def rename_markdown_file(file_path: str):
def rename_markdown_file(file_path: str) -> str:
"""
Renames the markdown file so that the name part after the date is in lowercase,
spaces are replaced with underscores, and certain stop words are removed.
spaces are replaced with underscores, stop words are removed, and special symbols
are excluded from the title.
Args:
file_path (str): The original file path of the markdown file.
Expand All @@ -35,12 +48,17 @@ def rename_markdown_file(file_path: str):
filename = os.path.basename(file_path)

# Split the filename to get the date and the name parts
date_part, name_part = filename.split("-", 2)[:2], filename.split("-", 2)[2]
date_part, name_part = filename.split("-", 3)[:3], filename.split("-", 3)[3]
name_part = os.path.splitext(name_part)[0] # Remove the .md extension

# Split name into words, remove stop words, and replace spaces with underscores
name_words = name_part.lower().split()
name_words = name_part.lower().split("_")
filtered_name = [word for word in name_words if word not in STOP_WORDS]

# Remove special symbols from each word
filtered_name = [word.translate(str.maketrans('', '', string.punctuation)) for word in filtered_name]

# Construct the formatted name by joining with underscores
formatted_name = "_".join(filtered_name)

# Construct the new filename
Expand All @@ -52,10 +70,9 @@ def rename_markdown_file(file_path: str):
print(f"Renamed '{filename}' to '{new_filename}'")
return new_file_path


def replace_latex_syntax_in_file(file_path: str):
"""
This function reads a markdown file, finds LaTeX delimiters and replaces them
Reads a markdown file, finds LaTeX delimiters, and replaces them
with double dollar signs for compatibility with a different LaTeX rendering system.
Args:
Expand All @@ -69,16 +86,15 @@ def replace_latex_syntax_in_file(file_path: str):
content = file.read()

# Define the patterns to be replaced
content = re.sub(r"\\\[", "$$", content) # Replaces \[ with $$
content = re.sub(r"\\\]", "$$", content) # Replaces \] with $$
content = re.sub(r"\\\(", "$$", content) # Replaces \( with $$
content = re.sub(r"\\\)", "$$", content) # Replaces \) with $$
content = re.sub(r"\\\\\[", "$$", content) # Replaces \[ with $$
content = re.sub(r"\\\\\]", "$$", content) # Replaces \] with $$
content = re.sub(r"\\\\\(", "$$", content) # Replaces \( with $$
content = re.sub(r"\\\\\)", "$$", content) # Replaces \) with $$

# Write the updated content back to the file
with open(file_path, "w", encoding="utf-8") as file:
file.write(content)


def process_markdown_files_in_folder(folder_path: str):
"""
Processes all markdown files in a given folder, renaming them and
Expand Down Expand Up @@ -106,5 +122,6 @@ def process_markdown_files_in_folder(folder_path: str):
print(f"Finished processing file: {new_file_path}")


# Path to the folder containing markdown files
folder_path = "./_posts"
process_markdown_files_in_folder(folder_path)
Loading