Run this model with HF Jobs
Run dllwa/gemma4-form-report-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/dllwa/gemma4-form-report-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/dllwa/gemma4-form-report-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use dllwa/gemma4-form-report-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dllwa/gemma4-form-report-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-31B-it") model = PeftModel.from_pretrained(base_model, "dllwa/gemma4-form-report-lora") - Notebooks
- Google Colab
- Kaggle
Download code/src/common/factnorm.py from dllwa/gemma4-form-report-lora: direct link, hf CLI and curl.
- Browser
- Download file 2.93 kB
-
https://huggingface.co/dllwa/gemma4-form-report-lora/resolve/main/code/src/common/factnorm.py
- Command line
-
hf download hf://dllwa/gemma4-form-report-lora/code/src/common/factnorm.py
-
curl -L -o factnorm.py https://huggingface.co/dllwa/gemma4-form-report-lora/resolve/main/code/src/common/factnorm.py
2.93 kB
| """μ¬μ€ ν ν°μ μ κ·ν β λͺ©ν 1 6μ°¨ μ±μ Β·κ²μ΄νΈ κ³΅μ© (NP-014). | |
| ## μ νμνκ° [μ€μΈ‘ 9/15 λ±λ‘] | |
| 6μ°¨ κ³μ½μ νκΈ° λ³νμ κ°λ₯΄μΉλ€: μ λ ₯ λ°ν "25λ 4μ 8μΌ 11μλΆν°" β μΆλ ₯ "2025-04-08". | |
| κΈμ κ·Έλλ‘ λΉκ΅νλ©΄ μ¬λ°λ₯Έ λ³νμ΄ νκ°μΌλ‘ μ€νλλ€. κ·Έλμ λ μ§Β·μκ°Β·μμΉλ₯Ό | |
| **μ κ·ν νν**λ‘ λ°κΏ λΉκ΅νλ€. μ±μ κΈ°μ ν©μ± κ²μ΄νΈκ° μ΄ λͺ¨λ νλλ₯Ό μν¬νΈνλ€ | |
| (λ³΅μ¬ κΈμ§ β λμ΄ μ΄κΈλλ©΄ κ²μ΄νΈλ₯Ό ν΅κ³Όν μ§μ΄ μ±μ μμ μ£½λλ€). | |
| μ κ·ν: | |
| λ μ§ ('D', λ , μ, μΌ) β λ μμΌλ©΄ 0. '25β2025 보μ (2000λ λ). | |
| μκ° ('T', μ, λΆ) | |
| μμΉ ('N', μ«μλ¬Έμμ΄, λ¨μ) β μΌν μ κ±°. λ¨μ μλ 맨μ«μ 4μ리 μ΄μλ§(μ νΒ·μ°λ λ°©μ§ μλ | |
| β μ°λλ λ μ§κ° λ¨Όμ μ§λλ€). | |
| λ¬Έμ ('S', 곡백 μ κ±° λ¬Έμμ΄) β κ΄νΈλͺ μΉΒ·λ²λ Ή λ± (γγ μ, κΈ°κ΄λͺ μ μλ) | |
| """ | |
| import re | |
| DATE = re.compile( | |
| r"(?:(\d{4})[.\-/λ ]\s*(\d{1,2})[.\-/μ]\s*(\d{1,2})[.μΌ]?" # 2025-04-08 Β· 2025.4.8 Β· 2025λ 4μ 8μΌ | |
| r"|['β](\d{2})[.\-/λ ]?\s*(\d{1,2})[.\-/μ]\s*(\d{1,2})[.μΌ]?" # '25. 4. 8. | |
| r"|(?<!\d)(\d{2})λ \s*(\d{1,2})μ\s*(\d{1,2})μΌ" # 25λ 4μ 8μΌ | |
| r"|(?<!\d)(\d{1,2})μ\s*(\d{1,2})μΌ)") # 4μ 8μΌ | |
| TIME = re.compile(r"(?<!\d)(\d{1,2})[:μ]\s*(\d{2})?λΆ?(?!\d)") | |
| NUM = re.compile(r"(\d[\d,]*\.?\d*)\s*(μ|μ΅|μ‘°|λ§|λͺ |건|κ°|λ |μ|μΌ|μκ°|ν|νΈ|μΈ΅|γ‘|λ°°|%|νΌμΌνΈ|μ|μΈ)") | |
| BARE = re.compile(r"(?<![\d,.])(\d{4,})(?![\d,.])") | |
| BRACK = re.compile(r"[γγ]([^γγ\n]{2,40})[γγ]") | |
| def facts_norm(text): | |
| """ν μ€νΈ β μ κ·ν μ¬μ€ νν μ§ν©.""" | |
| t = text or "" | |
| out = set() | |
| spans = [] | |
| for m in DATE.finditer(t): | |
| g = m.groups() | |
| if g[0]: | |
| y, mo, d = int(g[0]), int(g[1]), int(g[2]) | |
| elif g[3]: | |
| y, mo, d = 2000 + int(g[3]), int(g[4]), int(g[5]) | |
| elif g[6]: | |
| y, mo, d = 2000 + int(g[6]), int(g[7]), int(g[8]) | |
| else: | |
| y, mo, d = 0, int(g[9]), int(g[10]) | |
| if 1 <= mo <= 12 and 1 <= d <= 31: | |
| out.add(("D", y, mo, d)) | |
| out.add(("D", 0, mo, d)) # λ μλ΅ νκΈ°μλ λ§κ² β μμΌ μΆμ½νμ νμ ν¨κ» | |
| spans.append(m.span()) | |
| def covered(m): | |
| return any(a <= m.start() < b for a, b in spans) | |
| for m in TIME.finditer(t): | |
| if not covered(m): | |
| out.add(("T", int(m.group(1)), int(m.group(2) or 0))) | |
| for m in NUM.finditer(t): | |
| if not covered(m): | |
| out.add(("N", m.group(1).replace(",", ""), m.group(2))) | |
| for m in BARE.finditer(t): | |
| if not covered(m): | |
| out.add(("N", m.group(1), "")) | |
| for m in BRACK.finditer(t): | |
| out.add(("S", re.sub(r"\s+", "", m.group(1)))) | |
| return out | |