Token Classification
Transformers
Safetensors
Arabic
bert
hadith
sanad
matn
hadith-separator
hadith_separator
islam
hadithBERT
Instructions to use SHK4K/hadith-segmentation-bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SHK4K/hadith-segmentation-bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="SHK4K/hadith-segmentation-bert")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("SHK4K/hadith-segmentation-bert") model = AutoModelForTokenClassification.from_pretrained("SHK4K/hadith-segmentation-bert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ismail ismail commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -55,7 +55,7 @@ model.eval()
|
|
| 55 |
id2label = {0: "O", 1: "B-SANAD", 2: "I-SANAD", 3: "B-MATN", 4: "I-MATN"}
|
| 56 |
|
| 57 |
# 2. Input your raw, unsegmented Hadith text
|
| 58 |
-
raw_hadith =
|
| 59 |
|
| 60 |
# Tokenize raw text string
|
| 61 |
inputs = tokenizer(raw_hadith, return_tensors="pt", truncation=True, max_length=512)
|
|
|
|
| 55 |
id2label = {0: "O", 1: "B-SANAD", 2: "I-SANAD", 3: "B-MATN", 4: "I-MATN"}
|
| 56 |
|
| 57 |
# 2. Input your raw, unsegmented Hadith text
|
| 58 |
+
raw_hadith = 'ุญุฏุซูุง ุงูุญู
ูุฏู ุนุจุฏ ุงููู ุจู ุงูุฒุจูุฑ ุ ูุงู : ุญุฏุซูุง ุณููุงู ุ ูุงู : ุญุฏุซูุง ูุญูู ุจู ุณุนูุฏ ุงูุฃูุตุงุฑู ุ ูุงู : ุฃุฎุจุฑูู ู
ุญู
ุฏ ุจู ุฅุจุฑุงููู
ุงูุชูู
ู ุ ุฃูู ุณู
ุน ุนููู
ุฉ ุจู ููุงุต ุงูููุซู ุ ูููู : ุณู
ุนุช ุนู
ุฑ ุจู ุงูุฎุทุงุจ ุฑุถู ุงููู ุนูู ุนูู ุงูู
ูุจุฑุ ูุงู : ุณู
ุนุช ุฑุณูู ุงููู ุตูู ุงููู ุนููู ูุณูู
ุ ูููู : " ุฅูู
ุง ุงูุฃุนู
ุงู ุจุงูููุงุชุ ูุฅูู
ุง ููู ุงู
ุฑุฆ ู
ุง ูููุ ูู
ู ูุงูุช ูุฌุฑุชู ุฅูู ุฏููุง ูุตูุจูุง ุฃู ุฅูู ุงู
ุฑุฃุฉ ูููุญูุงุ ููุฌุฑุชู ุฅูู ู
ุง ูุงุฌุฑ ุฅููู'
|
| 59 |
|
| 60 |
# Tokenize raw text string
|
| 61 |
inputs = tokenizer(raw_hadith, return_tensors="pt", truncation=True, max_length=512)
|