给定一个字符串，请写一个Python函数，将其转换为标题格式（所有单词首字母大写），但跳过单词“and”、“the”和“of”。

“the rise of artificial intelligence and machine learning”
```python
def to_title_case(s: str) -> str:
    exceptions = {"and", "the", "of"}
    return " ".join(w.capitalize() if w.lower() not in exceptions else w for w in s.split())
```