INNER CODE UNIT · Python

clean_inline

gokayfem/awesome-vlm-architectures · scripts/build_release_timeline.py:366

def clean_inline(text: str) -> str:
    text = re.sub(r"\[([^]]+)]\([^)]+\)", r"\1", text)
    text = text.replace("**", "").replace("`", "")
    return re.sub(r"\s+", " ", text).strip().replace("|", "\\|")


def parse_sections(text: str) -> list[dict[str, object]]:
    start = text.index("## Architectures")
    end = text.index("## Important References", start)
    body = text[start:end]
    matches = list(re.finditer(r"(?m)^### \*\*(.+?)\*\*\s*$", body))
    sections: list[dict[str, object]] = []
    for position, match in enumerate(matches):
        section_end = (
            matches[position + 1].start() if position + 1 < len(matches) else len(body)
        )
        raw = body[match.start() : section_end]
        paragraphs = [part.strip() for part in re.split(r"\n\s*\n", raw)]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…