Skip to content
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ repos:
- id: check-docstring-first

- repo: https://github.com/pre-commit/pre-commit
rev: v4.6.0
rev: v4.7.0
hooks:
- id: validate_manifest

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.16
rev: v0.17.5
hooks:
- id: ruff
args: [ --fix, --config=./pyproject.toml ]
Expand All @@ -28,6 +28,6 @@ repos:

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.19
rev: 0.13.8
hooks:
- id: uv-lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Name: {g.person_name(name="name")}
Email: {g.e_mail(name="email")}"""

result = model(query, use_gim_prompt=True)
result.tags["name"].content # → "John Smith"
result.tags["name"].content # → "John Smith"
result.tags["email"].content # → "john@gmail.com"
```

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ result = model(query, use_gim_prompt=True)
## 4. Access results

```python
print(result.tags["name"].content) # e.g. Alice
print(result.tags["name"].content) # e.g. Alice
print(result.tags["email"].content) # e.g. alice@example.com
print(result.tags["color"].content) # red | green | blue
```
2 changes: 1 addition & 1 deletion docs/quickstart.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ result = model(query, use_gim_prompt=True)
## 4. 访问结果

```python
print(result.tags["name"].content) # 例如 Alice
print(result.tags["name"].content) # 例如 Alice
print(result.tags["email"].content) # 例如 alice@example.com
print(result.tags["color"].content) # red | green | blue
```
16 changes: 10 additions & 6 deletions docs/use-cases/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ These examples are practical domain use cases beyond classic IE tasks.
## Resume and CV Parsing

```python
text = "Dr. Sarah Chen, PhD in Computer Science from MIT. 10 years of experience in machine learning."
text = (
"Dr. Sarah Chen, PhD in Computer Science from MIT. 10 years of experience in machine learning."
)

query = f"""Parse the resume information:

Expand All @@ -23,7 +25,9 @@ result = model(query, use_gim_prompt=True)
## Product Review Extraction

```python
text = "The iPhone 15 Pro costs $999. It has an amazing camera but the battery life could be better."
text = (
"The iPhone 15 Pro costs $999. It has an amazing camera but the battery life could be better."
)

query = f"""Extract product review information:

Expand Down Expand Up @@ -57,7 +61,7 @@ result = model(query, use_gim_prompt=True)

```python
question = """24 = 24 {} 24 {} 24 {} 0""".format(
*[g(desc="a single math operator") for _ in range(3)]
*[g(desc="a single math operator") for _ in range(3)]
)

result = model(question, use_gim_prompt=True)
Expand Down Expand Up @@ -115,9 +119,9 @@ result = model(question, use_gim_prompt=True)

```python
question = "On a screen, mixing #{} and #{} results in the color #{}.".format(
g(desc="Hex color of Red", regex=r"[0-9a-fA-F]{6}"),
g(desc="Hex color of Green", regex=r"[0-9a-fA-F]{6}"),
g(desc="Hex color after mixing", regex=r"[0-9a-fA-F]{6}"),
g(desc="Hex color of Red", regex=r"[0-9a-fA-F]{6}"),
g(desc="Hex color of Green", regex=r"[0-9a-fA-F]{6}"),
g(desc="Hex color after mixing", regex=r"[0-9a-fA-F]{6}"),
)

result = model(question, use_gim_prompt=True)
Expand Down
10 changes: 4 additions & 6 deletions docs/use-cases/others.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ result = model(query, use_gim_prompt=True)
## 24 点问答

```python
question = """24 = 24 {} 24 {} 24 {} 0""".format(
*[g(desc="一个数学运算符") for _ in range(3)]
)
question = """24 = 24 {} 24 {} 24 {} 0""".format(*[g(desc="一个数学运算符") for _ in range(3)])

result = model(question, use_gim_prompt=True)
```
Expand Down Expand Up @@ -115,9 +113,9 @@ result = model(question, use_gim_prompt=True)

```python
question = "On a screen, mixing #{} and #{} results in the color #{}.".format(
g(desc="红色十六进制色值", regex=r"[0-9a-fA-F]{6}"),
g(desc="绿色十六进制色值", regex=r"[0-9a-fA-F]{6}"),
g(desc="混合后的十六进制色值", regex=r"[0-9a-fA-F]{6}"),
g(desc="红色十六进制色值", regex=r"[0-9a-fA-F]{6}"),
g(desc="绿色十六进制色值", regex=r"[0-9a-fA-F]{6}"),
g(desc="混合后的十六进制色值", regex=r"[0-9a-fA-F]{6}"),
)

result = model(question, use_gim_prompt=True)
Expand Down
Loading