Text Classification
Transformers
English
Japanese
hallucination-detection
groundedness
rag
guardrails
rule-based
not-a-neural-model
Instructions to use NagaYu/claimcheck-rules with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NagaYu/claimcheck-rules with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="NagaYu/claimcheck-rules")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("NagaYu/claimcheck-rules", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download rules/dates.json from NagaYu/claimcheck-rules: direct link, hf CLI and curl.
- Browser
- Download file 2.75 kB
-
https://huggingface.co/NagaYu/claimcheck-rules/resolve/main/rules/dates.json
- Command line
-
hf download hf://NagaYu/claimcheck-rules/rules/dates.json
-
curl -L -o dates.json https://huggingface.co/NagaYu/claimcheck-rules/resolve/main/rules/dates.json
2.75 kB
| { | |
| "rules_version": "1.1.0", | |
| "description": "Date recognition and ISO normalisation.", | |
| "patterns": [ | |
| "(?:令和|平成|昭和|大正|明治)\\s*(?:\\d{1,2}|元)\\s*年(?:\\s*\\d{1,2}\\s*月(?:\\s*\\d{1,2}\\s*日)?)?", | |
| "\\d{4}\\s*年\\s*\\d{1,2}\\s*月\\s*\\d{1,2}\\s*日", | |
| "\\d{4}\\s*年\\s*\\d{1,2}\\s*月", | |
| "(?<![0-9A-Za-z])\\d{4}[-/.]\\d{1,2}[-/.]\\d{1,2}(?![0-9A-Za-z])", | |
| "(?<![0-9A-Za-z])\\d{4}[-/]\\d{1,2}(?![-/.\\d])", | |
| "(?<![0-9A-Za-z])(?:Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|Sept|September|Oct|October|Nov|November|Dec|December)\\.?\\s+\\d{1,2}(?:st|nd|rd|th)?,?\\s+\\d{4}(?![0-9A-Za-z])", | |
| "(?<![0-9A-Za-z])\\d{1,2}(?:st|nd|rd|th)?\\s+(?:Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|Sept|September|Oct|October|Nov|November|Dec|December)\\.?,?\\s+\\d{4}(?![0-9A-Za-z])", | |
| "(?<![0-9A-Za-z])(?:Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|Sept|September|Oct|October|Nov|November|Dec|December)\\.?,?\\s+\\d{4}(?![0-9A-Za-z])", | |
| "(?<![0-9A-Za-z])(?:FY)\\s?\\d{4}(?![0-9A-Za-z])", | |
| "\\d{4}\\s*年度", | |
| "(?<![0-9])\\d{4}\\s*年(?![0-9度])" | |
| ], | |
| "relative_date_pattern": "(?:昨年|一昨年|来年|再来年|今年|本年|先月|今月|来月|先週|今週|来週|昨日|本日|今日|明日|明後日|現在|最近|近年|直近|先般|過去\\d+年|今後\\d+年|\\byesterday\\b|\\btoday\\b|\\btomorrow\\b|\\blast\\s+(?:year|month|week|quarter)\\b|\\bnext\\s+(?:year|month|week|quarter)\\b|\\bthis\\s+(?:year|month|week|quarter)\\b|\\brecently\\b|\\bcurrently\\b|\\bnowadays\\b)", | |
| "era_offsets": { | |
| "令和": 2018, | |
| "reiwa": 2018, | |
| "平成": 1988, | |
| "heisei": 1988, | |
| "昭和": 1925, | |
| "showa": 1925, | |
| "大正": 1911, | |
| "taisho": 1911, | |
| "明治": 1867, | |
| "meiji": 1867 | |
| }, | |
| "month_names": { | |
| "jan": 1, | |
| "january": 1, | |
| "feb": 2, | |
| "february": 2, | |
| "mar": 3, | |
| "march": 3, | |
| "apr": 4, | |
| "april": 4, | |
| "may": 5, | |
| "jun": 6, | |
| "june": 6, | |
| "jul": 7, | |
| "july": 7, | |
| "aug": 8, | |
| "august": 8, | |
| "sep": 9, | |
| "sept": 9, | |
| "september": 9, | |
| "oct": 10, | |
| "october": 10, | |
| "nov": 11, | |
| "november": 11, | |
| "dec": 12, | |
| "december": 12 | |
| }, | |
| "notes": [ | |
| "Output granularity is preserved: YYYY, YYYY-MM or YYYY-MM-DD.", | |
| "Era year N maps to offset + N, so 令和1 == 2019.", | |
| "Relative expressions are counted but never become claims.", | |
| "Word boundaries are NOT \\\\b: in 契約は2024-01-05に both sides are word characters, so \\\\b never fires and the date was invisible.", | |
| "FY2024 and 2024年度 both normalise to 2024. Fiscal-year start months differ by country: a known false positive." | |
| ] | |
| } | |